cz 1 tahun lalu
induk
melakukan
006349a85d
1 mengubah file dengan 31 tambahan dan 59 penghapusan
  1. 31 59
      src/views/JXSK/mes/task/add.vue

+ 31 - 59
src/views/JXSK/mes/task/add.vue

@@ -1,73 +1,25 @@
 <template>
   <div class="form" style="padding-bottom: 60px">
-    <van-nav-bar
-      :title="$t('task.name')"
-      :left-text="$t('common.back')"
-      left-arrow
-      @click-left="onClickLeft"
-    >
+    <van-nav-bar :title="$t('task.name')" :left-text="$t('common.back')" left-arrow @click-left="onClickLeft">
     </van-nav-bar>
-    <testForm
-      v-model="formData.data"
-      :formOption="formOption"
-      :formConfig="formConfig"
-      :rules="rules"
-      @onSubmit="onSubmit"
-      ref="formDom"
-    >
-      <template
-        v-for="(cur, index) in productionProcessesList"
-        :key="cur.id"
-        v-slot:[cur.id]="{ item }"
-      >
+    <testForm v-model="formData.data" :formOption="formOption" :formConfig="formConfig" :rules="rules" @onSubmit="onSubmit" ref="formDom">
+      <template v-for="(cur, index) in productionProcessesList" :key="cur.id" v-slot:[cur.id]="{ item }">
         <div style="width: 100%; display: flex">
           <div style="width: calc(100vw - 100px)">{{ cur.currentUser }}</div>
           <div style="width: 100px; float: right; margin-top: -20px">
-            <van-button
-              plain
-              type="primary"
-              @click="cur.showPicker = true"
-              style="border: none"
-              >选择</van-button
-            >
+            <van-button plain type="primary" @click="cur.showPicker = true" style="border: none">选择</van-button>
           </div>
         </div>
-        <van-popup
-          v-model:show="cur.showPicker"
-          round
-          position="bottom"
-          :style="{ height: '60%' }"
-        >
+        <van-popup v-model:show="cur.showPicker" round position="bottom" :style="{ height: '60%' }">
           <div style="padding: 10px; height: calc(100% - 40px)">
             <div style="display: flex; justify-content: space-between">
-              <van-button
-                plain
-                type="primary"
-                @click="cur.showPicker = false"
-                style="border: none"
-                >关闭</van-button
-              >
-              <van-button
-                plain
-                type="primary"
-                style="border: none"
-                @click="cur.showPicker = false"
-                >确定</van-button
-              >
+              <van-button plain type="primary" @click="cur.showPicker = false" style="border: none">关闭</van-button>
+              <van-button plain type="primary" style="border: none" @click="cur.showPicker = false">确定</van-button>
             </div>
             <div style="height: calc(100% - 30px); overflow: auto">
-              <van-checkbox-group
-                v-model="productionObj[cur.id]"
-                @change="(val) => handleSelectPeople(val, index)"
-              >
-                <van-checkbox
-                  :name="item.value"
-                  v-for="(item, index) in userList"
-                  :key="item.value"
-                  style="margin-top: 5px"
-                >
-                  {{ item.label }}</van-checkbox
-                >
+              <van-checkbox-group v-model="productionObj[cur.id]" @change="(val) => handleSelectPeople(val, index)">
+                <van-checkbox :name="item.value" v-for="(item, index) in userList" :key="item.value" style="margin-top: 5px">
+                  {{ item.label }}</van-checkbox>
               </van-checkbox-group>
             </div>
           </div>
@@ -130,7 +82,7 @@ const formOption = reactive({
         type: "input",
         itemType: "text",
         label: proxy.t("task.currentProcess"),
-        prop: "productionProcessesName",
+        prop: "name",
         readonly: true,
       },
       {
@@ -307,6 +259,26 @@ const onSubmit = () => {
 const getDetails = () => {
   proxy.post("/productionTask/detailByJxst", { id: route.query.id }).then(
     (res) => {
+      for (let i = 0; i < res.data.productionTaskDetailList.length; i++) {
+        const iele = res.data.productionTaskDetailList[i];
+        let name = "";
+        if (iele.taskProgressList && iele.taskProgressList.length > 0) {
+          for (let j = 0; j < iele.taskProgressList.length; j++) {
+            const jele = iele.taskProgressList[j];
+            let status =
+              jele.status == 0
+                ? "未开始"
+                : jele.status == 1
+                ? "进行中"
+                : "完成";
+            name += `${jele.processesName}(${status})${
+              j + 1 < iele.taskProgressList.length ? "," : ""
+            }`;
+          }
+        }
+
+        iele.name = name;
+      }
       res.data.waitQuantity = res.data.remainingQuantity;
       formData.data = res.data;
     },