guoyujia 1 år sedan
förälder
incheckning
b52317f55a
2 ändrade filer med 39 tillägg och 30 borttagningar
  1. 33 20
      src/views/business/daywork/form.vue
  2. 6 10
      src/views/business/deptEquipment/index.vue

+ 33 - 20
src/views/business/daywork/form.vue

@@ -69,12 +69,22 @@
                 style="width: 220px"
                 @change="handleChangeStatus"
               >
-                <el-option
-                  v-for="dict in daywork_status"
-                  :key="dict.value"
-                  :label="dict.label"
-                  :value="dict.value"
-                ></el-option>
+                <template v-if="form.status < 4">
+                  <el-option
+                    v-for="dict in daywork_status_first"
+                    :key="dict.value"
+                    :label="dict.label"
+                    :value="dict.value"
+                  ></el-option>
+                </template>
+                <template v-else>
+                  <el-option
+                    v-for="dict in daywork_status_second"
+                    :key="dict.value"
+                    :label="dict.label"
+                    :value="dict.value"
+                  ></el-option>
+                </template>
               </el-select>
             </el-form-item>
           </el-col>
@@ -91,7 +101,7 @@
                 type="datetime"
                 value-format="YYYY-MM-DD HH:mm:ss "
                 :editable="false"
-                :clearable = "false"
+                :clearable="false"
                 placeholder="请选择结束时间"
                 @change="handleTotalTime"
               />
@@ -235,6 +245,8 @@ const { proxy } = getCurrentInstance();
 const emit = defineEmits(["handleSaveSuccess"]);
 /** 字典 */
 const { daywork_status } = proxy.useDict("daywork_status");
+const { daywork_status_first } = proxy.useDict("daywork_status_first");
+const { daywork_status_second } = proxy.useDict("daywork_status_second");
 const { waste_causes } = proxy.useDict("waste_causes");
 const queryParams = ref({
   pageNum: 1,
@@ -246,7 +258,7 @@ const processList = ref([]);
 const visible = ref(false);
 const editStatus = ref(true);
 const rejectAmount = ref(0);
-const workingHoursTime =ref('')
+const workingHoursTime = ref("");
 const detailsRow = {
   id: null,
   rejectNum: "",
@@ -312,9 +324,7 @@ const data = reactive({
       { required: true, message: "开始日期不能为空", trigger: "blur" },
     ],
     endTime: [{ validator: validateEndTime, trigger: "blur" }],
-    workingHoursTime: [
-      { validator: validateWorkingHours, trigger: "change" },
-    ],
+    workingHoursTime: [{ validator: validateWorkingHours, trigger: "change" }],
     qualifiedNum: [
       { required: true, message: "合格数量不能为空", trigger: "blur" },
       { validator: validateQualifiedNum, trigger: "blur" },
@@ -330,7 +340,7 @@ const open = (row) => {
   reset();
   loading.value = true;
   if (row.id) {
-    console.log(row)
+    console.log(row);
     editStatus.value = true;
     detailInfo.value = proxy.deepClone(row);
     form.value.id = row.id;
@@ -340,7 +350,7 @@ const open = (row) => {
     form.value.nickName = row.nickName;
     form.value.status = row.status;
     form.value.qualifiedNum = row.qualifiedNum;
-    form.value.workHoursTimestamp = 0
+    form.value.workHoursTimestamp = 0;
     form.value.prodNum = row.prodNum;
     getProcessList({ technologicalProcessId: row.technologicalProcessId }).then(
       (res) => {
@@ -352,7 +362,7 @@ const open = (row) => {
         }
       }
     );
-    getDayworkItemRejectList({dayworkItemId: detailInfo.value.id }).then(
+    getDayworkItemRejectList({ dayworkItemId: detailInfo.value.id }).then(
       (response) => {
         if (response.code == 200) {
           for (let i = 0; i < response.data.length; i++) {
@@ -408,11 +418,14 @@ const handleSave = () => {
       var flag = true;
       //判断工序是否是尾序
       var lastProcess = false;
-      if(form.value.processId == processList.value[processList.value.length - 1].value){
+      if (
+        form.value.processId ==
+        processList.value[processList.value.length - 1].value
+      ) {
         lastProcess = true;
       }
-      if(lastProcess) {
-        if(form.value.status > 3) {
+      if (lastProcess) {
+        if (form.value.status > 3) {
           flag = false;
           proxy.$modal.msgError("尾序不能选择该状态");
         }
@@ -461,16 +474,16 @@ const handleSave = () => {
           if (parseInt(form.value.prodNum) - rejectAmount.value < 0) {
             proxy.$modal.msgError("废品总数加合格数不能超过投产数");
             form.value.qualifiedNum = 0;
-          } 
+          }
         }
       }
       //workinghours
       if (form.value.status == 0 || form.value.status == 1) {
         form.value.workHoursTimestamp = 0;
       }
-      form.value.workingHours = form.value.workHoursTimestamp
+      form.value.workingHours = form.value.workHoursTimestamp;
       if (flag) {
-        console.log(form.value)
+        console.log(form.value);
         updateDayworkItemInfo(form.value).then((res) => {
           if (res.code == 200) {
             proxy.$modal.msgSuccess("保存成功!");

+ 6 - 10
src/views/business/deptEquipment/index.vue

@@ -101,11 +101,11 @@
                     <dict-tag :options="resource_group_detail" :value="scope.row.commonType" />
                   </template>
                 </el-table-column>
-                <el-table-column label="是否临时" prop="protemDayworkId" width="70" align="center">
+                <!-- <el-table-column label="是否临时" prop="protemDayworkId" width="70" align="center">
                   <template #default="scope">
                     <dict-tag :options="temporary_status" :value="scope.row.protemDayworkId" />
                   </template>
-                </el-table-column>
+                </el-table-column> -->
                 <!-- <el-table-column label="操作" width="150" align="center">
                   <template #default="scope">
                     <el-button icon="delete" link type="danger" @click="handledelGroupDetail(scope.row)" v-hasPermi="['business:deptEquipment:remove']">删除
@@ -292,12 +292,7 @@ function getResourceGroupDetail() {
   queryResourceGroupDetailParams.value.productionResourceGroupId = currentGroup.value.id
   listGroupDetail(queryResourceGroupDetailParams.value).then((res) => {
     if (res.code == 200) {
-      for(var i = 0; i < res.rows.length; i++) {
-        if(res.rows[i].protemDayworkId!=0 ) {
-            res.rows[i].protemDayworkId = 1
-        }
-      }
-      groupDetailList.value = res.rows
+      groupDetailList.value = res.rows.filter(obj => obj.protemDayworkId == 0);
       console.log(groupDetailList.value)
     }
   })
@@ -334,15 +329,16 @@ function handleShowProcessFormDialog() {
 
 /**工序多选带回 */
 function handleProcessMultipleSelected(selection) {
+  var addDeptProcessList = []
   for (var i = 0; i < selection.length; i++) {
     var deptProcessAdd = {}
     deptProcessAdd.deptId = currentWorkSection.value.id
     deptProcessAdd.processId = selection[i].id
     deptProcessAdd.processCode = selection[i].processCode
     deptProcessAdd.processAlias = selection[i].processAlias
-    deptProcessList.value.push(deptProcessAdd)
+    addDeptProcessList.push(deptProcessAdd)
   }
-  addDeptProcess(deptProcessList.value).then((res) => {
+  addDeptProcess(addDeptProcessList).then((res) => {
     if (res.code == 200) {
       proxy.$modal.msgSuccess('保存成功')
       handleWorkSectionChange(currentWorkSection.value)