Browse Source

快捷售后功能

cz 1 năm trước cách đây
mục cha
commit
450d0f3858

+ 46 - 0
src/components/process/EHSD/AfterSales.vue

@@ -385,6 +385,49 @@ const getDict = () => {
 };
 // getDict();
 
+const getContractData = (businessId) => {
+  proxy.post("/contract/detail", { id: businessId }).then((res) => {
+    formData.data.contractId = res.id;
+    formData.data.currency = res.currency;
+    if (res.contractProductList && res.contractProductList.length > 0) {
+      formData.data.afterSalesDetailList = res.contractProductList.map(
+        (row) => ({
+          contractProductId: row.id,
+          productId: row.productId,
+          contractCode: res.code,
+          productName: row.productName,
+          productCode: row.productCode,
+          productModel: row.productModel,
+          fileUrl: "",
+          contractQuantity: row.quantity,
+          price: row.price,
+          quantity: null,
+          remark: "",
+          amount: "",
+        })
+      );
+      let ids = formData.data.afterSalesDetailList.map((x) => x.productId);
+      proxy
+        .post("/fileInfo/getList", {
+          businessIdList: ids,
+        })
+        .then((fileObj) => {
+          for (let i = 0; i < formData.data.afterSalesDetailList.length; i++) {
+            const e = formData.data.afterSalesDetailList[i];
+            for (const key in fileObj) {
+              if (e.productId === key) {
+                e.fileList = fileObj[key] || [];
+                if (e.fileList && e.fileList.length > 0) {
+                  e.fileUrl = e.fileList[0].fileUrl;
+                }
+              }
+            }
+          }
+        });
+    }
+  });
+};
+
 const getAllData = (businessId) => {
   if (businessId) {
     proxy.post("/afterSales/detail", { id: businessId }).then((res) => {
@@ -425,6 +468,9 @@ const getAllData = (businessId) => {
 
 onMounted(() => {
   formOption.disabled = judgeStatus();
+  if (route.query.contractId) {
+    getContractData(route.query.contractId);
+  }
   if (route.query.businessId) {
     getAllData(route.query.businessId);
   }

+ 15 - 2
src/views/EHSD/saleContract/contractEHSD/index.vue

@@ -576,8 +576,9 @@ const config = computed(() => {
             },
             el: "button",
             click() {
-              openRecords.value = true;
-              getRecordsData(row);
+              // openRecords.value = true;
+              // getRecordsData(row);
+              afterSalesAdd(row);
             },
           },
         ];
@@ -1166,6 +1167,18 @@ const pushRoute = (row) => {
     },
   });
 };
+
+const afterSalesAdd = (row) => {
+  proxy.$router.replace({
+    path: "/platform_manage/process/processApproval",
+    query: {
+      flowKey: "after_sales_flow",
+      flowName: "售后流程",
+      random: proxy.random(),
+      contractId: row.id,
+    },
+  });
+};
 </script>
 
 <style lang="scss" scoped>

+ 11 - 4
src/views/systemTenant/tenant/userTenant/index.vue

@@ -6,6 +6,12 @@
           action: () => openModal(),
         },
       ]" @get-list="getList">
+
+      <template #status="{item}">
+        <div style="width:100%">
+          <span :style="{color:item.status==1?'red':''}">{{item.status==1?'停用':'启用'}}</span>
+        </div>
+      </template>
     </byTable>
 
     <el-dialog :title="modalType == 'add' ? '添加用户' : '编辑用户'" v-if="dialogVisible" v-model="dialogVisible" width="600" v-loading="loadingDialog">
@@ -106,6 +112,7 @@ const config = computed(() => {
       attrs: {
         label: "账号状态",
         prop: "status",
+        slot: "status",
       },
       render(status) {
         return status == 1 ? "停用" : "启用";
@@ -294,13 +301,13 @@ const formConfig = computed(() => {
       multiple: false,
       data: [
         {
-          label: "停用",
-          value: "1",
-        },
-        {
           label: "启用",
           value: "0",
         },
+        {
+          label: "停用",
+          value: "1",
+        },
       ],
     },
     {