Browse Source

SAI开项管理 - 可修改状态为验收后的所有数据的级别和类别

wangggziwen 1 năm trước cách đây
mục cha
commit
455f77dbbd
1 tập tin đã thay đổi với 94 bổ sung1 xóa
  1. 94 1
      ui/src/views/production/apply/all/index.vue

+ 94 - 1
ui/src/views/production/apply/all/index.vue

@@ -271,6 +271,19 @@
               v-hasPermi="['production:apply:remove']"
             >删除</el-button>
           </span>
+          <span v-if="(scope.row.applyStatus == 1
+                      || scope.row.applyStatus == 2
+                      || scope.row.applyStatus == 3
+                      || scope.row.applyStatus == 4)
+                      && (loginStaffInfo.isMonitor || loginStaffInfo.userId == '20276')">
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-edit"
+              @click="handleUpdate2(scope.row)"
+              v-hasPermi="['production:apply:edit']"
+            >修改</el-button>
+          </span>
         </template>
       </el-table-column>
     </el-table>
@@ -490,6 +503,42 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
+    <el-dialog  :close-on-click-modal="false" :title="title" :visible.sync="open2" width="60%" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="0px">
+        <el-descriptions title="" :column="3" border>
+          <el-descriptions-item label="SAI级别" :span="1">
+            <el-form-item prop="saiLevel">
+              <el-select v-model="form.saiLevel" placeholder="请选择SAI级别" @change="handleSaiLevelChange">
+                <el-option key="1" label="1" value="1"></el-option>
+                <el-option key="2" label="2" value="2"></el-option>
+                <el-option key="3" label="3" value="3"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item label="SAI类别" :span="1">
+            <el-form-item prop="category">
+              <el-select
+                @change="handleSaiCategoryChange"
+                filterable
+                clearable
+                v-model="form.category"
+                placeholder="请选择SAI类别">
+                <el-option
+                  v-for="dict in saiCategoryOptions2"
+                  :key="dict.dictValue"
+                  :label="dict.dictLabel"
+                  :value="dict.dictValue"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-descriptions-item>
+        </el-descriptions>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="submitForm">保 存</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
     <!-- 延期对话框 -->
     <el-dialog  :close-on-click-modal="false" :title="title" :visible.sync="delayOpen" width="25%" append-to-body>
       <el-form ref="delayForm" :model="delayForm" :rules="delayRules" label-width="136px">
@@ -765,7 +814,10 @@ export default {
       // 是否禁用开项编号输入框
       recordNoDisabled: true,
       // 当前登录员工
-      loginStaffInfo: {},
+      loginStaffInfo: {
+        userId: null,
+        isMonitor: false
+      },
       //图片集合   打开关闭按钮 等等
       imgs:[],
       jpgList:[],
@@ -828,6 +880,7 @@ export default {
       clientHeight:300,
       // 是否显示弹出层
       open: false,
+      open2: false,
       // 是否显示延期弹出层
       delayOpen: false,
         // 用户导入参数
@@ -1270,6 +1323,9 @@ export default {
         let staff = response.data;
         if (staff != null) {
           this.loginStaffInfo = response.data;
+          if (this.loginStaffInfo.actualpost == '12' || this.loginStaffInfo.actualpost == '34') {
+            this.loginStaffInfo.isMonitor = true;
+          }
           this.form.applicantDept = staff.unit;
           if (staff.unit == '10') {
             this.form.applicantTeam = staff.team;
@@ -1417,6 +1473,7 @@ export default {
       this.delayOpen = false;
       this.saiOpen = false;
       this.open = false;
+      this.open2 = false;
       this.reset();
     },
     // 表单重置
@@ -1536,6 +1593,40 @@ export default {
         this.title = "修改SAI开项申请";
       });
     },
+    handleUpdate2(row) {
+      this.reset();
+      const saiApplyId = row.saiApplyId || this.ids
+      listFile({
+        approveId: saiApplyId
+      }).then(response => {
+        this.doc.commonfileListApply = response;
+      });
+      getApply(saiApplyId).then(response => {
+        this.form = response.data;
+        if (this.form.unsafeStatus != null && this.form.unsafeStatus != "") {
+          this.form.unsafeStatus = this.form.unsafeStatus.toString();
+        }
+        if (this.form.unsafeAction != null && this.form.unsafeAction != "") {
+          this.form.unsafeAction = this.form.unsafeAction.toString();
+        }
+        if (this.form.category != null && this.form.category != "") {
+          this.form.category = Number(this.form.category);
+        }
+        this.fileList = [];
+        if (this.form.files.length > 0) {
+          console.log(this.form.files);
+          for (let i = 0; i < this.form.files.length; i++) {
+            let obj = {}
+            obj.name = this.form.files[i].fileName
+            obj.response = {};
+            obj.response.msg = this.form.files[i].fileUrl
+            this.fileList.push(obj)
+          }
+        }
+        this.open2 = true;
+        this.title = "修改SAI开项申请";
+      });
+    },
     /** 新增/修改保存按钮 */
     submitForm() {
       this.form.files = []
@@ -1553,12 +1644,14 @@ export default {
             updateApply(this.form).then(response => {
               this.msgSuccess("修改成功");
               this.open = false;
+              this.open2 = false;
               this.getList();
             });
           } else {
             addApply(this.form).then(response => {
               this.msgSuccess("新增成功");
               this.open = false;
+              this.open2 = false;
               this.getList();
             });
           }