Ver código fonte

交接单:改为限制仅允许勾选同一销售合同的数据进行采购

lxf 1 ano atrás
pai
commit
061cc23091

+ 59 - 203
src/views/purchaseManage/purchaseManage/handoverSlip/index.vue

@@ -22,8 +22,7 @@
           action: () => start(),
         },
       ]"
-      @get-list="getList"
-    >
+      @get-list="getList">
       <template #claimTime="{ item }">
         <div>
           <span v-if="item.claimTime">{{ item.claimTime }}</span>
@@ -32,118 +31,40 @@
       </template>
       <template #details="{ item }">
         <div>
-          <el-button
-            type="primary"
-            link
-            v-if="item.expendQuantity >= 0"
-            @click="handleClickDetails(item)"
-            >查看</el-button
-          >
-          <el-button
-            type="primary"
-            link
-            style="color: #f54a45"
-            v-else
-            @click="handleClickDetails(item)"
-            >查看</el-button
-          >
+          <el-button type="primary" link v-if="item.expendQuantity >= 0" @click="handleClickDetails(item)">查看</el-button>
+          <el-button type="primary" link style="color: #f54a45" v-else @click="handleClickDetails(item)">查看</el-button>
         </div>
       </template>
       <template #btn="{ item }">
         <div v-if="item.expendQuantity > 0">
-          <el-button type="primary" link @click="start(10, item)"
-            >采购</el-button
-          >
-          <el-button type="primary" link @click="transferToProduction(item)"
-            >转生产</el-button
-          >
+          <el-button type="primary" link @click="start(10, item)">采购</el-button>
+          <el-button type="primary" link @click="transferToProduction(item)">转生产</el-button>
         </div>
         <div v-else-if="item.expendQuantity == 0">
-          <el-button type="primary" link @click="handleFollow(item)"
-            >跟进</el-button
-          >
-          <el-button type="primary" link @click="lookRecords(item)"
-            >跟进记录</el-button
-          >
+          <el-button type="primary" link @click="handleFollow(item)">跟进</el-button>
+          <el-button type="primary" link @click="lookRecords(item)">跟进记录</el-button>
         </div>
         <div v-else>
-          <el-button
-            type="primary"
-            link
-            style="color: #f54a45"
-            @click="handleFollow(item)"
-            >跟进</el-button
-          >
-          <el-button
-            type="primary"
-            link
-            style="color: #f54a45"
-            @click="lookRecords(item)"
-            >跟进记录</el-button
-          >
+          <el-button type="primary" link style="color: #f54a45" @click="handleFollow(item)">跟进</el-button>
+          <el-button type="primary" link style="color: #f54a45" @click="lookRecords(item)">跟进记录</el-button>
         </div>
       </template>
     </byTable>
 
-    <el-dialog
-      title="转生产"
-      v-if="dialogVisible"
-      v-model="dialogVisible"
-      width="1200"
-      v-loading="loadingDialog"
-    >
-      <byForm
-        :formConfig="formConfig"
-        :formOption="formOption"
-        v-model="formData.data"
-        :rules="rules"
-        ref="submit"
-      >
+    <el-dialog title="转生产" v-if="dialogVisible" v-model="dialogVisible" width="1200" v-loading="loadingDialog">
+      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit">
         <template #details>
           <div style="width: 100%">
-            <el-table
-              :data="formData.data.list"
-              style="width: 100%; margin-top: 16px"
-            >
-              <el-table-column
-                prop="productCode"
-                label="物品编码"
-                width="140"
-              />
-              <el-table-column
-                prop="productName"
-                label="物品名称"
-                min-width="220"
-              />
-              <el-table-column
-                prop="productUnit"
-                label="单位"
-                width="100"
-                :formatter="
-                  (row) => dictValueLabel(row.productUnit, productUnit)
-                "
-              />
-              <el-table-column
-                prop="expendQuantity"
-                label="待处理数量"
-                width="120"
-              />
+            <el-table :data="formData.data.list" style="width: 100%; margin-top: 16px">
+              <el-table-column prop="productCode" label="物品编码" width="140" />
+              <el-table-column prop="productName" label="物品名称" min-width="220" />
+              <el-table-column prop="productUnit" label="单位" width="100" :formatter="(row) => dictValueLabel(row.productUnit, productUnit)" />
+              <el-table-column prop="expendQuantity" label="待处理数量" width="120" />
               <el-table-column label="转生产数量" width="160">
                 <template #default="{ row, $index }">
                   <div style="width: 100%">
-                    <el-form-item
-                      :prop="'list.' + $index + '.quantity'"
-                      :rules="rules.quantity"
-                      :inline-message="true"
-                    >
-                      <el-input-number
-                        v-model="row.quantity"
-                        placeholder="请输入数量"
-                        style="width: 100%"
-                        :precision="0"
-                        :controls="false"
-                        :min="0"
-                      />
+                    <el-form-item :prop="'list.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true">
+                      <el-input-number v-model="row.quantity" placeholder="请输入数量" style="width: 100%" :precision="0" :controls="false" :min="0" />
                     </el-form-item>
                   </div>
                 </template>
@@ -151,31 +72,15 @@
               <el-table-column label="完工期限" width="180">
                 <template #default="{ row, $index }">
                   <div style="width: 100%">
-                    <el-form-item
-                      :prop="'list.' + $index + '.time'"
-                      :rules="rules.time"
-                      :inline-message="true"
-                    >
-                      <el-date-picker
-                        v-model="row.time"
-                        type="date"
-                        placeholder="请选择"
-                        value-format="YYYY-MM-DD"
-                      />
+                    <el-form-item :prop="'list.' + $index + '.time'" :rules="rules.time" :inline-message="true">
+                      <el-date-picker v-model="row.time" type="date" placeholder="请选择" value-format="YYYY-MM-DD" />
                     </el-form-item>
                   </div>
                 </template>
               </el-table-column>
-              <el-table-column
-                align="center"
-                label="操作"
-                width="80"
-                fixed="right"
-              >
+              <el-table-column align="center" label="操作" width="80" fixed="right">
                 <template #default="{ row, $index }">
-                  <el-button type="primary" link @click="handleDelete($index)"
-                    >删除</el-button
-                  >
+                  <el-button type="primary" link @click="handleDelete($index)">删除</el-button>
                 </template>
               </el-table-column>
             </el-table>
@@ -184,45 +89,21 @@
       </byForm>
       <template #footer>
         <el-button @click="dialogVisible = false" size="large">取 消</el-button>
-        <el-button type="primary" @click="submitForm()" size="large"
-          >确 定</el-button
-        >
+        <el-button type="primary" @click="submitForm()" size="large">确 定</el-button>
       </template>
     </el-dialog>
-    <el-dialog
-      title="填写跟进"
-      v-if="dialogVisibleOne"
-      v-model="dialogVisibleOne"
-      width="500"
-      v-loading="loadingDialog"
-    >
-      <byForm
-        :formConfig="formConfigOne"
-        :formOption="formOption"
-        v-model="formData.dataOne"
-        :rules="rulesOne"
-        ref="submitOne"
-      >
-      </byForm>
+    <el-dialog title="填写跟进" v-if="dialogVisibleOne" v-model="dialogVisibleOne" width="500" v-loading="loadingDialog">
+      <byForm :formConfig="formConfigOne" :formOption="formOption" v-model="formData.dataOne" :rules="rulesOne" ref="submitOne"> </byForm>
       <template #footer>
-        <el-button @click="dialogVisibleOne = false" size="large"
-          >取 消</el-button
-        >
-        <el-button type="primary" @click="submitFormOne()" size="large"
-          >确 定</el-button
-        >
+        <el-button @click="dialogVisibleOne = false" size="large">取 消</el-button>
+        <el-button type="primary" @click="submitFormOne()" size="large">确 定</el-button>
       </template>
     </el-dialog>
 
     <el-dialog title="跟进记录" v-model="dialogVisibleTwo" width="500">
       <div style="width: 100%">
         <el-timeline :reverse="false">
-          <el-timeline-item
-            placement="top"
-            v-for="(activity, index) in activities"
-            :key="index"
-            :timestamp="activity.followUpTime"
-          >
+          <el-timeline-item placement="top" v-for="(activity, index) in activities" :key="index" :timestamp="activity.followUpTime">
             <div>
               跟进结果:
               <span>{{ activity.resultType ? "已处理" : "处理中" }}</span>
@@ -233,24 +114,11 @@
       </div>
     </el-dialog>
 
-    <el-dialog
-      title="交接单"
-      v-if="openHandover"
-      v-model="openHandover"
-      width="800"
-    >
-      <byForm
-        :formConfig="formHandoverConfig"
-        :formOption="formOption"
-        v-model="productRow.data"
-      >
+    <el-dialog title="交接单" v-if="openHandover" v-model="openHandover" width="800">
+      <byForm :formConfig="formHandoverConfig" :formOption="formOption" v-model="productRow.data">
         <template #remark>
           <div style="width: 100%">
-            <Editor
-              ref="remarkEditor"
-              :readOnly="true"
-              :value="productRow.data.remark"
-            />
+            <Editor ref="remarkEditor" :readOnly="true" :value="productRow.data.remark" />
           </div>
         </template>
         <template #file>
@@ -259,8 +127,7 @@
               v-model:fileList="productRow.data.fileList"
               action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
               multiple
-              :on-preview="onPreviewFile"
-            >
+              :on-preview="onPreviewFile">
             </el-upload>
           </div>
         </template>
@@ -278,7 +145,6 @@ import byForm from "@/components/byForm/index";
 import { computed, nextTick, ref } from "vue";
 import { ElMessage } from "element-plus";
 import Editor from "@/components/Editor/index.vue";
-import { async } from "@antv/x6/lib/registry/marker/async";
 
 const { proxy } = getCurrentInstance();
 const loading = ref(false);
@@ -386,18 +252,16 @@ const config = computed(() => {
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
-  proxy
-    .post("/contractProduct/page", sourceList.value.pagination)
-    .then((message) => {
-      sourceList.value.data = message.rows.map((x) => ({
-        ...x,
-        isCheck: true,
-      }));
-      sourceList.value.pagination.total = message.total;
-      setTimeout(() => {
-        loading.value = false;
-      }, 200);
-    });
+  proxy.post("/contractProduct/page", sourceList.value.pagination).then((message) => {
+    sourceList.value.data = message.rows.map((x) => ({
+      ...x,
+      isCheck: true,
+    }));
+    sourceList.value.pagination.total = message.total;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
 };
 getList();
 const productUnit = ref([]);
@@ -516,12 +380,8 @@ const formConfigOne = computed(() => {
 });
 
 const rulesOne = ref({
-  resultType: [
-    { required: true, message: "请选择跟进结果", trigger: "change" },
-  ],
-  followUpTime: [
-    { required: true, message: "请选择跟进时间", trigger: "change" },
-  ],
+  resultType: [{ required: true, message: "请选择跟进结果", trigger: "change" }],
+  followUpTime: [{ required: true, message: "请选择跟进时间", trigger: "change" }],
   remark: [{ required: true, message: "请输入跟进记录", trigger: "blur" }],
 });
 
@@ -612,7 +472,7 @@ watch(selectData, (newVal) => {
   } else if (newVal.length == 1) {
     const current = newVal[0];
     sourceList.value.data.forEach((x) => {
-      if (x.corporationId !== current.corporationId) {
+      if (x.contractId !== current.contractId) {
         x.isCheck = false;
       }
     });
@@ -695,23 +555,19 @@ const formHandoverConfig = computed(() => {
 });
 const remarkEditor = ref(null);
 const handleClickDetails = (row) => {
-  proxy
-    .post("/flowProcess/getStartData", { flowId: row.flowId })
-    .then(async (res) => {
-      const current = res.contractProductList.find(
-        (x) => x.productId === row.productId
-      );
-      productRow.data = current || {};
-      productRow.data.fileList =
-        current.fileList.map((x) => ({
-          raw: x,
-          name: x.fileName,
-          url: x.fileUrl,
-        })) || [];
-      openHandover.value = true;
-      await nextTick();
-      remarkEditor.value.changeHtml(productRow.data.remark);
-    });
+  proxy.post("/flowProcess/getStartData", { flowId: row.flowId }).then(async (res) => {
+    const current = res.contractProductList.find((x) => x.productId === row.productId);
+    productRow.data = current || {};
+    productRow.data.fileList =
+      current.fileList.map((x) => ({
+        raw: x,
+        name: x.fileName,
+        url: x.fileUrl,
+      })) || [];
+    openHandover.value = true;
+    await nextTick();
+    remarkEditor.value.changeHtml(productRow.data.remark);
+  });
 };
 const onPreviewFile = (file) => {
   window.open(file.raw.fileUrl, "_blank");
@@ -729,7 +585,7 @@ const onPreviewFile = (file) => {
   display: none;
 }
 </style>
-<style >
+<style>
 .redClass {
   color: #f54a45 !important;
 }