Эх сурвалжийг харах

部分功能更改,增加部分新需求

cz 1 жил өмнө
parent
commit
0023e2df50

+ 711 - 35
src/components/contractCom/contractDetails.vue

@@ -5,6 +5,8 @@
       <el-tab-pane label="销售订单" name="first"></el-tab-pane>
       <el-tab-pane label="销售订单" name="first"></el-tab-pane>
       <!-- <el-tab-pane label="采购订单" name="second"></el-tab-pane> -->
       <!-- <el-tab-pane label="采购订单" name="second"></el-tab-pane> -->
       <el-tab-pane label="生产进度" name="third"></el-tab-pane>
       <el-tab-pane label="生产进度" name="third"></el-tab-pane>
+      <el-tab-pane label="待采购" name="four"></el-tab-pane>
+
       <!-- <el-tab-pane label="交易明细" name="third"></el-tab-pane>
       <!-- <el-tab-pane label="交易明细" name="third"></el-tab-pane>
       <el-tab-pane label="外销跟单" name="four"> </el-tab-pane>
       <el-tab-pane label="外销跟单" name="four"> </el-tab-pane>
       <el-tab-pane label="预算表" name="five" v-if="isShowSalesFinancemanArrange">
       <el-tab-pane label="预算表" name="five" v-if="isShowSalesFinancemanArrange">
@@ -46,41 +48,169 @@
     </div>
     </div>
     <div v-if="activeName === 'third'">
     <div v-if="activeName === 'third'">
       <byTable :hidePagination="true" :hideSearch="true" :source="tableData" :otherHeight="33" :config="config" highlight-current-row
       <byTable :hidePagination="true" :hideSearch="true" :source="tableData" :otherHeight="33" :config="config" highlight-current-row
-               :action-list="[]">
+               :action-list="[]" :row-class-name="getRowClass">
+        <template #orderCode="{ item }">
+          <!-- class="el-click" @click="lookDetails(item)" -->
+          <div style="width: 100%">
+            {{item.orderCode}}
+          </div>
+        </template>
+
         <template #pic="{ item }">
         <template #pic="{ item }">
-          <div v-if="item.fileUrl">
-            <img :src="item.fileUrl" class="pic" @click="openImg(item.fileUrl)" />
+          <div v-if="item.fileList &&item.fileList.length > 0">
+            <img :src="item.fileList[0].fileUrl" class="pic" @click="handleClickFile(item.fileList[0])" />
+          </div>
+          <div v-else></div>
+        </template>
+
+        <template #picOne="{ item }">
+          <div v-if="item.fileListOne &&item.fileListOne.length > 0">
+            <img :src="item.fileListOne[0].fileUrl" class="pic" @click="handleClickFile(item.fileListOne[0])" />
           </div>
           </div>
           <div v-else></div>
           <div v-else></div>
         </template>
         </template>
+
         <template #size="{ item }">
         <template #size="{ item }">
           <div>
           <div>
             <span>{{ item.productLength }}</span>*
             <span>{{ item.productLength }}</span>*
             <span>{{ item.productWidth }}</span>*
             <span>{{ item.productWidth }}</span>*
             <span>{{ item.productHeight }}</span>
             <span>{{ item.productHeight }}</span>
           </div>
           </div>
+
+        </template>
+
+        <template #isOverdue="{item}">
+          <div style="width: 100%">
+            <span v-if="item.isOverdue=='1'" class="red"> 逾期 </span>
+            <span v-else> 未逾期 </span>
+          </div>
+        </template>
+
+        <template #produceStatus="{item}">
+          <div style="width: 100%">
+            <span :class="{
+              'red':item.produceStatus=='88' || item.produceStatus=='99'
+            }"> {{dictValueLabel(item.produceStatus, statusData)}} </span>
+          </div>
         </template>
         </template>
+
         <template #progress="{item}">
         <template #progress="{item}">
           <div style="width: 100%">
           <div style="width: 100%">
-            <el-progress type="circle" :percentage="(Number(item.finishQuantity) / Number(item.quantity))*100" width="60"
+            <el-progress type="circle" :percentage="item.percentage" width="60"
                          :status="(Number(item.finishQuantity) / Number(item.quantity))*100 == 100 ? 'success' : ''" />
                          :status="(Number(item.finishQuantity) / Number(item.quantity))*100 == 100 ? 'success' : ''" />
           </div>
           </div>
         </template>
         </template>
-        <template #amount="{ item }">
-          <div>{{ item.currency }} {{ moneyFormat(item.amount, 2) }}</div>
+
+        <template #prodTag="{ item }">
+          <div style="width: 100%">
+            <el-popover placement="top-start" :width="300" trigger="hover">
+              <div>
+                备注:{{item.prodRemark}}
+              </div>
+              <template #reference>
+                <div style="width:100%;display:inline-block">
+                  <el-tag style="margin-right: 8px" type="success" v-for="(tag, index) in item.prodTags" :key="index">
+                    {{ dictKeyValue(tag, contractTag) }}
+                  </el-tag>
+                </div>
+              </template>
+            </el-popover>
+          </div>
         </template>
         </template>
-        <template #accountManagementName="{ item }">
-          <div>
-            {{ item.accountManagementName }} ({{
-              item.accountManagementOpening
-            }})
+
+        <template #logo="{item}">
+          <div style="width: 100%">
+            {{item.productLogoLength }} * {{item.productLogoWidth }}
+          </div>
+        </template>
+
+        <template #shortageMaterials="{item}">
+          <div style="width: 100%">
+            <!-- @click="lookDetail(item)" -->
+            <span v-if="item.lackStatus=='1'" class="red" style="cursor:pointer">
+              欠料</span>
+            <span v-else>未欠料</span>
+          </div>
+        </template>
+
+        <template v-for="(slotItem, index) in processesData" v-slot:[slotItem.id]="{ item }" :key="slotItem.id">
+          <div style="width:100%">
+            <div v-if="pageActiveName !='4'">
+              <span v-if="isShowCotent(slotItem,item)" style="font-weight:700;min-width:50px;line-height:18px;display:inline-block;cursor:pointer"
+                    :class="showCotentQuantity(slotItem,item)">
+                <!-- @contextmenu="(e)=>handleContextmenu(slotItem,item,e)" -->
+                {{showCotent(slotItem,item,'finishQuantity')}}
+              </span>
+              <div v-else class="no-bk">
+                -
+              </div>
+            </div>
+            <!-- style="border-top:1px solid #ebeef5;margin-top:3px" -->
+            <div v-else>
+              <div v-if="isShowCotent(slotItem,item)">
+                {{showCotentOne(slotItem,item,'balanceQuantity') || `&nbsp`}}
+              </div>
+              <div v-else class="no-bk">
+                -
+              </div>
+            </div>
+
           </div>
           </div>
         </template>
         </template>
       </byTable>
       </byTable>
     </div>
     </div>
     <div v-if="activeName === 'four'">
     <div v-if="activeName === 'four'">
-      <ExportTracking> </ExportTracking>
+      <byTable :hidePagination="true" :hideSearch="true" :source="tableDataOne" :otherHeight="33" :config="configOne" highlight-current-row
+               :action-list="[]">
+        <template #pic="{ item }">
+          <div v-if="item.fileList &&item.fileList.length > 0">
+            <img :src="item.fileList[0].fileUrl" class="pic" @click="handleClickFile(item.fileList[0])" />
+          </div>
+          <div v-else></div>
+        </template>
+        <template #size="{ item }">
+          <div>
+            <span>{{ item.productLength }}</span>*
+            <span>{{ item.productWidth }}</span>*
+            <span>{{ item.productHeight }}</span>
+          </div>
+
+        </template>
+
+        <template #purchaseCount="{item}">
+          <div style="width:100%;font-weight:700;color:#409EFF">
+            {{item.purchaseCount}}
+          </div>
+        </template>
+
+        <template #count="{item}">
+          <div style="width:100%;font-weight:700;color:#409EFF">
+            {{item.count}}
+          </div>
+        </template>
+
+        <template #prodTag="{ item }">
+          <div style="width: 100%">
+            <el-popover placement="top-start" :width="300" trigger="hover">
+              <div>
+                备注:{{item.prodRemark}}
+              </div>
+              <template #reference>
+                <div style="width:100%;display:inline-block">
+                  <el-tag style="margin-right: 8px" type="success" v-for="(tag, index) in item.prodTags" :key="index"
+                          :closable="useUserStore().user.companyId=='100'" @close="prodTagClose(index, item)">
+                    {{ dictKeyValue(tag, contractTag) }}
+                  </el-tag>
+                </div>
+              </template>
+            </el-popover>
+          </div>
+        </template>
+      </byTable>
     </div>
     </div>
+    <!-- <div v-if="activeName === 'four'">
+      <ExportTracking> </ExportTracking>
+    </div> -->
     <div v-if="activeName === 'five'">
     <div v-if="activeName === 'five'">
       <ProfitBudgetEHSD> </ProfitBudgetEHSD>
       <ProfitBudgetEHSD> </ProfitBudgetEHSD>
     </div>
     </div>
@@ -116,10 +246,23 @@ import useUserStore from "@/store/modules/user";
 const userInfo = useUserStore();
 const userInfo = useUserStore();
 const { proxy } = getCurrentInstance();
 const { proxy } = getCurrentInstance();
 import { useRoute } from "vue-router";
 import { useRoute } from "vue-router";
+import { computed } from "vue";
 const route = useRoute();
 const route = useRoute();
 const props = defineProps({
 const props = defineProps({
   contractId: String,
   contractId: String,
 });
 });
+const contractTag = computed(
+  () => proxy.useUserStore().allDict["contract_prod_tag"]
+);
+const backLinesData = computed(
+  () => proxy.useUserStore().allDict["back_lines"]
+);
+const frontLinesData = computed(
+  () => proxy.useUserStore().allDict["front_lines"]
+);
+const materialUnit = computed(
+  () => proxy.useUserStore().allDict["material_unit"]
+);
 const activeName = ref("first");
 const activeName = ref("first");
 const currentItem = ref({});
 const currentItem = ref({});
 const approvalData = ref({});
 const approvalData = ref({});
@@ -129,6 +272,7 @@ const leftList = ref([]);
 const contractDataList = ref([]);
 const contractDataList = ref([]);
 const purchaseDataList = ref([]);
 const purchaseDataList = ref([]);
 const tableData = ref([]);
 const tableData = ref([]);
+const tableDataOne = ref([]);
 const transactionType = ref([
 const transactionType = ref([
   {
   {
     label: "请款",
     label: "请款",
@@ -196,11 +340,111 @@ const config = computed(() => {
   return [
   return [
     {
     {
       attrs: {
       attrs: {
+        label: "客户名称",
+        prop: "customerName",
+        width: 150,
+        // fixed: "left",
+      },
+    },
+    {
+      attrs: {
+        label: "业务员",
+        prop: "saleUserName",
+        width: 100,
+        // align: "center",
+      },
+    },
+    {
+      attrs: {
+        label: "订单号",
+        slot: "orderCode",
+        width: 150,
+        fixed: "left",
+      },
+    },
+    {
+      attrs: {
+        label: "产品名称",
+        prop: "productName",
+        "min-width": 200,
+        fixed: "left",
+      },
+    },
+    {
+      attrs: {
+        label: "业务公司",
+        prop: "contractCompanyName",
+        width: 110,
+      },
+    },
+    {
+      attrs: {
+        label: "业务部门",
+        prop: "contractDeptName",
+        width: 100,
+      },
+    },
+    {
+      attrs: {
+        label: "是否逾期",
+        slot: "isOverdue",
+        width: 80,
+        // fixed: "left",
+      },
+    },
+
+    {
+      attrs: {
+        label: "生产状态",
+        // prop: "produceStatus",
+        slot: "produceStatus",
+        width: 100,
+      },
+      render(val) {
+        return proxy.dictValueLabel(val, statusData.value);
+      },
+    },
+    {
+      attrs: {
+        label: "订单类型",
+        prop: "contractType",
+        width: 110,
+      },
+      render(val) {
+        return proxy.dictKeyValue(val, contractTypeData.value);
+      },
+    },
+    {
+      attrs: {
+        label: "工厂",
+        prop: "companyName",
+        width: 100,
+        // align: "center",
+      },
+    },
+    {
+      attrs: {
+        label: "欠料状态",
+        prop: "produceStatus",
+        slot: "shortageMaterials",
+        width: 100,
+      },
+    },
+
+    {
+      attrs: {
         label: "产品图片",
         label: "产品图片",
         slot: "pic",
         slot: "pic",
         width: 80,
         width: 80,
       },
       },
     },
     },
+    {
+      attrs: {
+        label: "产品分类名称",
+        prop: "productClassifyNames",
+        width: 150,
+      },
+    },
     // {
     // {
     //   attrs: {
     //   attrs: {
     //     label: "设计图",
     //     label: "设计图",
@@ -217,13 +461,6 @@ const config = computed(() => {
     },
     },
     {
     {
       attrs: {
       attrs: {
-        label: "产品名称",
-        prop: "productName",
-        "min-width": 150,
-      },
-    },
-    {
-      attrs: {
         label: "规格尺寸(cm)",
         label: "规格尺寸(cm)",
         slot: "size",
         slot: "size",
         width: 160,
         width: 160,
@@ -238,6 +475,33 @@ const config = computed(() => {
     },
     },
     {
     {
       attrs: {
       attrs: {
+        label: "正面纹路",
+        prop: "productFrontalTexture",
+        width: 100,
+      },
+      render(val) {
+        return proxy.dictKeyValue(val, frontLinesData.value);
+      },
+    },
+    {
+      attrs: {
+        label: "背面纹路",
+        prop: "productReverseTexture",
+        width: 100,
+      },
+      render(val) {
+        return proxy.dictKeyValue(val, backLinesData.value);
+      },
+    },
+    {
+      attrs: {
+        label: "LOGO尺寸(cm)",
+        slot: "logo",
+        width: 130,
+      },
+    },
+    {
+      attrs: {
         label: "生产件数",
         label: "生产件数",
         prop: "quantity",
         prop: "quantity",
         width: 100,
         width: 100,
@@ -264,8 +528,165 @@ const config = computed(() => {
         width: 100,
         width: 100,
       },
       },
     },
     },
+
+    {
+      attrs: {
+        label: "生产指示",
+        slot: "prodTag",
+        "min-width": 220,
+      },
+    },
+    {
+      attrs: {
+        label: "下单时间",
+        prop: "orderCreateTime",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "交期",
+        prop: "deliveryPeriod",
+        width: 100,
+      },
+      render(val) {
+        if (val) {
+          return val.slice(0, 10);
+        }
+        return "";
+      },
+    },
+    // {
+    //   attrs: {
+    //     label: "投产时间",
+    //     prop: "produceTime",
+    //     width: 160,
+    //   },
+    // },
+    {
+      attrs: {
+        label: "完成时间",
+        prop: "finishTime",
+        width: 160,
+      },
+    },
+
+    {
+      attrs: {
+        label: "生产用时",
+        prop: "usageTime",
+        width: 100,
+      },
+    },
   ];
   ];
 });
 });
+const configOne = computed(() => [
+  {
+    attrs: {
+      label: "业务公司",
+      prop: "companyName",
+      width: 130,
+    },
+  },
+  {
+    attrs: {
+      label: "单号",
+      prop: "subscribeCode",
+      width: 150,
+    },
+  },
+  {
+    attrs: {
+      label: "物料图片",
+      slot: "pic",
+      align: "center",
+      width: 80,
+    },
+  },
+  {
+    attrs: {
+      label: "物料编码",
+      prop: "productCode",
+      width: 130,
+    },
+  },
+  {
+    attrs: {
+      label: "物料名称",
+      prop: "productName",
+      "min-width": 150,
+    },
+  },
+  {
+    attrs: {
+      label: "规格尺寸 (cm)",
+      slot: "size",
+      width: 140,
+    },
+  },
+  {
+    attrs: {
+      label: "单位",
+      prop: "productUnit",
+      width: 80,
+    },
+    render(unit) {
+      return proxy.dictKeyValue(unit, materialUnit.value);
+    },
+  },
+  {
+    attrs: {
+      label: "需求量",
+      prop: "prodNeedCount",
+      width: 100,
+    },
+  },
+  {
+    attrs: {
+      label: "需采购量",
+      slot: "count",
+      width: 100,
+    },
+  },
+  {
+    attrs: {
+      label: "已采购量",
+      slot: "purchaseCount",
+      width: 100,
+    },
+  },
+  {
+    attrs: {
+      label: "采购状态",
+      prop: "status",
+      width: 100,
+    },
+    render(status) {
+      return status == 15 ? "待采购" : "部分采购";
+    },
+  },
+  {
+    attrs: {
+      label: "生产指示",
+      slot: "prodTag",
+      "min-width": 220,
+    },
+  },
+  {
+    attrs: {
+      label: "申购人",
+      prop: "subcribeName",
+      width: 100,
+    },
+  },
+  {
+    attrs: {
+      label: "申购时间",
+      prop: "subcribeTime",
+      width: 160,
+    },
+  },
+]);
 const handleClick = () => {};
 const handleClick = () => {};
 
 
 const handleItemClick = (item) => {
 const handleItemClick = (item) => {
@@ -280,7 +701,6 @@ const handleItemClick = (item) => {
       processType: 20,
       processType: 20,
       random: proxy.random(),
       random: proxy.random(),
       flowName: "销售订单详情",
       flowName: "销售订单详情",
-
       businessId: currentItem.value.id,
       businessId: currentItem.value.id,
     };
     };
   } else if (activeName.value === "second") {
   } else if (activeName.value === "second") {
@@ -312,6 +732,54 @@ const pushProcessApproval = (row) => {
   });
   });
   return;
   return;
 };
 };
+const contractTypeData = ref([
+  {
+    dictKey: "3",
+    dictValue: "打样订单",
+  },
+  {
+    dictKey: "2",
+    dictValue: "内销订单",
+  },
+  {
+    dictKey: "1",
+    dictValue: "外贸订单(退税)",
+  },
+  {
+    dictKey: "4",
+    dictValue: "外贸订单(不退税)",
+  },
+]);
+const statusData = ref([
+  {
+    label: "未开始",
+    value: "0",
+  },
+  {
+    label: "生产中",
+    value: "1",
+  },
+  {
+    label: "生产完成",
+    value: "2",
+  },
+  {
+    label: "出库中",
+    value: "5",
+  },
+  {
+    label: "已出库",
+    value: "10",
+  },
+  {
+    label: "作废",
+    value: "88",
+  },
+  {
+    label: "终止",
+    value: "99",
+  },
+]);
 
 
 // const pushProcessApproval = (row) => {
 // const pushProcessApproval = (row) => {
 //   // 新页面打开方式
 //   // 新页面打开方式
@@ -330,7 +798,7 @@ const pushProcessApproval = (row) => {
 //   window.open(page.href, "_blank");
 //   window.open(page.href, "_blank");
 // };
 // };
 let first = true;
 let first = true;
-
+let firstOne = true;
 const handleChange = (val) => {
 const handleChange = (val) => {
   if (["first", "second"].includes(val)) {
   if (["first", "second"].includes(val)) {
     if (val === "first") {
     if (val === "first") {
@@ -345,24 +813,131 @@ const handleChange = (val) => {
   }
   }
   if (val === "third" && first) {
   if (val === "third" && first) {
     first = false;
     first = false;
+    // proxy
+    //   .post("/contract/detail", {
+    //     id: route.query.currentContractId,
+    //   })
+    //   .then((res) => {
+    //     tableData.value = res.contractProductList.map((x) => ({
+    //       ...x,
+    //       incomplete: x.quantity - x.finishQuantity,
+    //     }));
+    //     let productIds = tableData.value.map((x) => x.productId);
+    //     proxy.getFileData({
+    //       businessIdList: productIds,
+    //       data: tableData.value,
+    //       att: "productId",
+    //       businessType: "0",
+    //       fileAtt: "fileList",
+    //       filePathAtt: "fileUrl",
+    //     });
+    //   });
+
+    proxy
+      .post("/produceOrderDetail/page", {
+        pageNum: 1,
+        pageSize: 999,
+        contractId: route.query.currentContractId,
+      })
+      .then((res) => {
+        res.rows.forEach((x) => {
+          if (x.prodTag) {
+            x.prodTags = x.prodTag.split(",");
+          } else {
+            x.prodTags = [];
+          }
+          x.incomplete = x.quantity - x.finishQuantity;
+          x.percentage = parseFloat(
+            (x.finishQuantity / x.quantity) * 100
+          ).toFixed(2);
+        });
+        tableData.value = res.rows.map((x) => ({ ...x, isCheck: true }));
+        //   tableData.value.pagination.total = res.total;
+        // setTimeout(() => {
+        //   loading.value = false;
+        // }, 200);
+        // nextTick(() => {
+        //   let doms = document.querySelectorAll(".redClass");
+        //   for (let i = 0; i < doms.length; i++) {
+        //     doms[i].style.backgroundColor = "red";
+        //   }
+        // });
+        const productIdList = res.rows.map((x) => x.productId);
+        // 请求文件数据并回显
+        if (productIdList.length > 0) {
+          // proxy.getFile(productIdList,     tableData.value, "productId");
+          proxy
+            .post("/fileInfo/getList", { businessIdList: productIdList })
+            .then((fileObj) => {
+              for (let i = 0; i < tableData.value.length; i++) {
+                const ele = tableData.value[i];
+                for (const key in fileObj) {
+                  if (
+                    ele.productId == key &&
+                    fileObj[ele.productId] &&
+                    fileObj[ele.productId].length > 0
+                  ) {
+                    ele.fileList = fileObj[ele.productId].filter(
+                      (x) => x.businessType == "0"
+                    );
+                  }
+                }
+              }
+            });
+        }
+
+        const productIdListOne = res.rows.map((x) => x.contractDetailId);
+        // 请求文件数据并回显
+        if (productIdListOne.length > 0) {
+          proxy
+            .post("/fileInfo/getList", { businessIdList: productIdListOne })
+            .then((fileObj) => {
+              for (let i = 0; i < tableData.value.length; i++) {
+                const ele = tableData.value[i];
+                for (const key in fileObj) {
+                  if (
+                    ele.contractDetailId == key &&
+                    fileObj[ele.contractDetailId] &&
+                    fileObj[ele.contractDetailId].length > 0
+                  ) {
+                    ele.fileListOne = fileObj[ele.contractDetailId].filter(
+                      (x) => x.businessType == "0"
+                    );
+                  }
+                }
+              }
+            });
+          // proxy.getFile(
+          //   productIdListOne,
+          //       tableData.value,
+          //   "contractDetailId",
+          //   "fileListOne"
+          // );
+        }
+      });
+  }
+
+  if (val === "four" && firstOne) {
+    firstOne = false;
     proxy
     proxy
-      .post("/contract/detail", {
-        id: route.query.currentContractId,
+      .post("/subscribeDetail/page", {
+        pageNum: 1,
+        pageSize: 999,
+        contractId: route.query.currentContractId,
       })
       })
       .then((res) => {
       .then((res) => {
-        tableData.value = res.contractProductList.map((x) => ({
+        tableDataOne.value = res.rows.map((x) => ({
           ...x,
           ...x,
-          incomplete: x.quantity - x.finishQuantity,
+          isCheck: true,
+          prodTags: x.prodTag ? x.prodTag.split(",") : [],
         }));
         }));
-        let productIds = tableData.value.map((x) => x.productId);
-        proxy.getFileData({
-          businessIdList: productIds,
-          data: tableData.value,
-          att: "productId",
-          businessType: "0",
-          fileAtt: "fileList",
-          filePathAtt: "fileUrl",
-        });
+        // sourceList.value.pagination.total = res.total;
+
+        let productIdList = res.rows.map((x) => x.productId);
+        // 请求文件数据并回显
+        if (productIdList.length > 0) {
+          proxy.getFile(productIdList, tableDataOne.value, "productId");
+        }
       });
       });
   }
   }
 };
 };
@@ -388,6 +963,30 @@ const getDetailsData = (id) => {
   //     tableData.value = res;
   //     tableData.value = res;
   //   });
   //   });
 };
 };
+const processesData = ref([]);
+const getProcesses = () => {
+  proxy
+    .post("/productionProcesses/page", { pageNum: 1, pageSize: 9999 })
+    .then((res) => {
+      for (let i = 0; i < res.rows.length; i++) {
+        const ele = res.rows[i];
+        let attrs = {
+          label: `[ ${ele.name} ]`,
+          slot: ele.id,
+          isNeedHeaderSlot: false,
+          width: 110,
+          align: "center",
+          // fixed: "right",
+        };
+        config.value.push({
+          attrs,
+        });
+      }
+
+      processesData.value = res.rows;
+    });
+};
+getProcesses();
 if (props.contractId) {
 if (props.contractId) {
   getDetailsData(props.contractId);
   getDetailsData(props.contractId);
 }
 }
@@ -405,7 +1004,68 @@ const checkShow = () => {
     isShowSalesFinancemanArrange.value = true;
     isShowSalesFinancemanArrange.value = true;
   }
   }
 };
 };
-checkShow();
+// checkShow();
+
+const getRowClass = ({ row }) => {
+  if (row.isOverdue == "1") {
+    return "redClass";
+  }
+  return "";
+};
+
+const isShowCotent = (slot, item) => {
+  if (item && item.productionTaskProgressList) {
+    return item.productionTaskProgressList.some(
+      (x) => x.processesId == slot.id
+    );
+  } else {
+    return false;
+  }
+};
+const showCotent = (slot, item, att) => {
+  if (item && item.productionTaskProgressList) {
+    const current = item.productionTaskProgressList.find(
+      (x) => x.processesId == slot.id
+    );
+    if (current) {
+      return current["schedulingCount"] + " / " + current["finishQuantity"];
+    }
+  } else {
+    return false;
+  }
+};
+
+const showCotentOne = (slot, item, att) => {
+  if (item && item.productionTaskProgressList) {
+    const current = item.productionTaskProgressList.find(
+      (x) => x.processesId == slot.id
+    );
+    if (current) {
+      return current["schedulingCount"] + " / " + current["balanceQuantity"];
+    }
+  } else {
+    return false;
+  }
+};
+
+const showCotentQuantity = (slot, item) => {
+  if (item && item.productionTaskProgressList) {
+    const current = item.productionTaskProgressList.find(
+      (x) => x.processesId == slot.id
+    );
+    if (current && Number(current.finishQuantity) > 0) {
+      if (Number(current.finishQuantity) >= item.quantity) {
+        return "tag-active";
+      } else if (Number(current.finishQuantity) < item.quantity) {
+        return "tag-active-1";
+      }
+    }
+  }
+};
+
+const handleClickFile = (file) => {
+  window.open(file.fileUrl, "_blank");
+};
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
@@ -444,4 +1104,20 @@ checkShow();
   line-height: 24px;
   line-height: 24px;
   padding-left: 4px;
   padding-left: 4px;
 }
 }
+
+::v-deep(.redClass) {
+  // color: #fff !important;
+  background-color: #fbdbdb !important;
+  .el-table-fixed-column--left,
+  .el-table-fixed-column--right {
+    background-color: #fbdbdb;
+  }
+}
+
+.red {
+  background: red;
+  border-radius: 2px;
+  padding: 4px;
+  color: #fff;
+}
 </style>
 </style>

+ 21 - 0
src/components/process/SF/Contract.vue

@@ -678,6 +678,7 @@ const qualityLevel = computed(
 const accountList = ref([]);
 const accountList = ref([]);
 const customerList = ref([]);
 const customerList = ref([]);
 const templateList = ref([]);
 const templateList = ref([]);
+const sampleData = ref([]);
 const sealUseData = ref([]);
 const sealUseData = ref([]);
 const userList = ref([]);
 const userList = ref([]);
 const corporationList = ref([]);
 const corporationList = ref([]);
@@ -904,6 +905,13 @@ const formConfig = computed(() => {
       itemWidth: 50,
       itemWidth: 50,
     },
     },
     {
     {
+      type: "select",
+      prop: "sampleId",
+      label: "关联样品单",
+      data: sampleData.value,
+      itemWidth: 50,
+    },
+    {
       type: "title",
       type: "title",
       title: "贸易信息",
       title: "贸易信息",
       haveLine: true,
       haveLine: true,
@@ -1493,6 +1501,19 @@ const getDict = () => {
     });
     });
 
 
   proxy
   proxy
+    .post("/contract/page", {
+      pageNum: 1,
+      pageSize: 9999,
+      notLinkSample: "1",
+    })
+    .then((res) => {
+      sampleData.value = res.rows.map((x) => ({
+        label: x.code,
+        value: x.id,
+      }));
+    });
+
+  proxy
     .post("/sealUse/page", {
     .post("/sealUse/page", {
       pageNum: 1,
       pageNum: 1,
       pageSize: 999,
       pageSize: 999,

+ 23 - 2
src/components/process/SF/ContractChange.vue

@@ -497,7 +497,7 @@
                 </div>
                 </div>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
-            <el-table-column label="业务供货价" prop="businessCostPrice" width="100">
+            <el-table-column label="业务供货价" prop="factoryPrice" width="100">
             </el-table-column>
             </el-table-column>
             <el-table-column prop="amount" label="小计" width="110">
             <el-table-column prop="amount" label="小计" width="110">
               <template #default="{ row, $index }">
               <template #default="{ row, $index }">
@@ -678,6 +678,7 @@ const qualityLevel = computed(
 const accountList = ref([]);
 const accountList = ref([]);
 const customerList = ref([]);
 const customerList = ref([]);
 const templateList = ref([]);
 const templateList = ref([]);
+const sampleData = ref([]);
 const sealUseData = ref([]);
 const sealUseData = ref([]);
 const userList = ref([]);
 const userList = ref([]);
 const corporationList = ref([]);
 const corporationList = ref([]);
@@ -904,6 +905,13 @@ const formConfig = computed(() => {
       itemWidth: 50,
       itemWidth: 50,
     },
     },
     {
     {
+      type: "select",
+      prop: "sampleId",
+      label: "关联样品单",
+      data: sampleData.value,
+      itemWidth: 50,
+    },
+    {
       type: "title",
       type: "title",
       title: "贸易信息",
       title: "贸易信息",
       haveLine: true,
       haveLine: true,
@@ -1493,6 +1501,19 @@ const getDict = () => {
     });
     });
 
 
   proxy
   proxy
+    .post("/contract/page", {
+      pageNum: 1,
+      pageSize: 9999,
+      notLinkSample: "1",
+    })
+    .then((res) => {
+      sampleData.value = res.rows.map((x) => ({
+        label: x.code,
+        value: x.id,
+      }));
+    });
+
+  proxy
     .post("/sealUse/page", {
     .post("/sealUse/page", {
       pageNum: 1,
       pageNum: 1,
       pageSize: 999,
       pageSize: 999,
@@ -1978,7 +1999,7 @@ const calculationAmount = (flag = false) => {
       ).toFixed(2);
       ).toFixed(2);
       formData.data.contractProductList[i].amountTwo = parseFloat(
       formData.data.contractProductList[i].amountTwo = parseFloat(
         Number(formData.data.contractProductList[i].quantity) *
         Number(formData.data.contractProductList[i].quantity) *
-          Number(formData.data.contractProductList[i].businessCostPrice)
+          Number(formData.data.contractProductList[i].factoryPrice)
       ).toFixed(2);
       ).toFixed(2);
       let row = formData.data.contractProductList[i];
       let row = formData.data.contractProductList[i];
       if (flag && row.quantity) {
       if (flag && row.quantity) {

+ 12 - 5
src/components/product/SelectProduct.vue

@@ -24,9 +24,9 @@
         </template>
         </template>
         <template #size="{ item }">
         <template #size="{ item }">
           <div>
           <div>
-            <span>{{ item['length'] }}cm</span>*
-            <span>{{ item.width }}cm</span>*
-            <span>{{ item.height }}cm</span>
+            <span>{{ item['length'] }}</span>*
+            <span>{{ item.width }}</span>*
+            <span>{{ item.height }}</span>
           </div>
           </div>
 
 
         </template>
         </template>
@@ -250,9 +250,16 @@ const config = computed(() => {
     // },
     // },
     {
     {
       attrs: {
       attrs: {
-        label: "尺寸",
+        label: "规格尺寸 (cm)",
         slot: "size",
         slot: "size",
-        width: 180,
+        width: 130,
+      },
+    },
+    {
+      attrs: {
+        label: "颜色",
+        prop: "color",
+        width: 100,
       },
       },
     },
     },
     {
     {

+ 104 - 22
src/views/EHSD/saleContract/contractEHSD/index.vue

@@ -12,7 +12,7 @@
             text: '新建',
             text: '新建',
             action: () => newContract(),
             action: () => newContract(),
           },
           },
-        ]" @get-list="getList" ref="tableDom">
+        ]" @get-list="getList" :row-class-name="getRowClass" ref="tableDom">
         <template #code="{ item }">
         <template #code="{ item }">
           <div style="width: 100%">
           <div style="width: 100%">
             <a style="color: #409eff; cursor: pointer; word-break: break-all" @click="openDetails(item)">{{ item.code }}</a>
             <a style="color: #409eff; cursor: pointer; word-break: break-all" @click="openDetails(item)">{{ item.code }}</a>
@@ -21,10 +21,16 @@
 
 
         <template #isSettled="{ item }">
         <template #isSettled="{ item }">
           <div>
           <div>
-            <span style="padding: 4px" :class="[item.isSettled == 1 ? 'active' : '']">
-              {{
-                proxy.dictValueLabel(item.isSettled, isSettled)
-              }}</span>
+            <span style="padding: 4px" :class="[item.isSettled == 1 ? 'active' : '']" v-if="!item.settledRemark">
+              {{proxy.dictValueLabel(item.isSettled, isSettled)}}
+            </span>
+            <el-popover v-else placement="top-start" title="" :width="400" trigger="hover" :content="item.settledRemark">
+              <template #reference>
+                <span style="padding: 4px" :class="[item.isSettled == 1 ? 'active' : '']">
+                  {{proxy.dictValueLabel(item.isSettled, isSettled)}}
+                </span>
+              </template>
+            </el-popover>
           </div>
           </div>
         </template>
         </template>
 
 
@@ -456,6 +462,16 @@
       <SalesOutboundPDF :rowData="outboundRowData"></SalesOutboundPDF>
       <SalesOutboundPDF :rowData="outboundRowData"></SalesOutboundPDF>
     </el-dialog>
     </el-dialog>
 
 
+    <el-dialog :title="'结清'" v-model="confirmDialog" width="50%" destroy-on-close>
+      <byForm :formConfig="confirmFormConfig" :formOption="confirmFormOption" v-model="confirmFormData.data" :rules="confirmRules"
+              ref="confirmFormDom" v-loading="formLoading">
+      </byForm>
+      <template #footer>
+        <el-button @click="confirmDialog =false" size="default" v-debounce>取 消</el-button>
+        <el-button @click="submitConfirm()" type="primary" size="default" v-debounce>提 交</el-button>
+      </template>
+    </el-dialog>
+
   </div>
   </div>
 </template>
 </template>
 
 
@@ -778,6 +794,13 @@ const config = computed(() => {
     },
     },
     {
     {
       attrs: {
       attrs: {
+        label: "样品单号",
+        prop: "sampleCode",
+        width: 140,
+      },
+    },
+    {
+      attrs: {
         label: "订单处理方式",
         label: "订单处理方式",
         prop: "processingMethod",
         prop: "processingMethod",
         width: 110,
         width: 110,
@@ -1010,6 +1033,14 @@ const config = computed(() => {
     },
     },
     {
     {
       attrs: {
       attrs: {
+        label: "已出货金额",
+        prop: "outboundAmount",
+        width: 110,
+        align: "right",
+      },
+    },
+    {
+      attrs: {
         label: "已结算金额",
         label: "已结算金额",
         prop: "settledAmount",
         prop: "settledAmount",
         width: 100,
         width: 100,
@@ -1237,23 +1268,7 @@ const config = computed(() => {
                 },
                 },
                 el: "button",
                 el: "button",
                 click() {
                 click() {
-                  ElMessageBox.confirm("是否确认结清?", "提示", {
-                    confirmButtonText: "确定",
-                    cancelButtonText: "取消",
-                    type: "warning",
-                  }).then(() => {
-                    proxy
-                      .post("/contract/settle", {
-                        id: row.id,
-                      })
-                      .then(() => {
-                        ElMessage({
-                          message: "操作成功",
-                          type: "success",
-                        });
-                        getList();
-                      });
-                  });
+                  handleSetIsSettle(row);
                 },
                 },
               }
               }
             : {},
             : {},
@@ -2467,6 +2482,64 @@ const handlePrint = (row) => {
   };
   };
   openPrintOutbound.value = true;
   openPrintOutbound.value = true;
 };
 };
+
+const getRowClass = ({ row }) => {
+  if (row.isSpecialOutbound == 1) {
+    return "redClass";
+  }
+  return "";
+};
+
+const confirmFormDom = ref(null);
+const confirmDialog = ref(false);
+const confirmFormOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  disabled: false,
+});
+const confirmFormData = reactive({
+  data: {},
+});
+const confirmFormConfig = computed(() => [
+  {
+    type: "input",
+    itemType: "textarea",
+    label: "备注",
+    prop: "settledRemark",
+    itemWidth: 100,
+  },
+]);
+const confirmRules = ref({
+  settledRemark: [{ required: true, message: "请输入备注", trigger: "blur" }],
+});
+const handleSetIsSettle = (row) => {
+  confirmFormData.data = {
+    id: row.id,
+    settledRemark: "",
+  };
+  if (Number(row.sumClaimMoney) < Number(row.amount)) {
+    confirmDialog.value = true;
+  } else {
+    proxy.msgConfirm().then((res) => {
+      proxy.post("/contract/settle", confirmFormData.data).then(() => {
+        proxy.msgTip("操作成功");
+        getList();
+      });
+    });
+  }
+};
+
+const submitConfirm = (type) => {
+  confirmFormDom.value.handleSubmit(() => {
+    formLoading.value = true;
+    proxy.post("/contract/settle", confirmFormData.data).then((res) => {
+      formLoading.value = false;
+      confirmDialog.value = false;
+      getList();
+    });
+  });
+};
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
@@ -2530,4 +2603,13 @@ const handlePrint = (row) => {
   // width: calc(100% - 10px);
   // width: calc(100% - 10px);
   width: 100%;
   width: 100%;
 }
 }
+
+::v-deep(.redClass) {
+  // color: #fff !important;
+  background-color: #fbdbdb !important;
+  .el-table-fixed-column--left,
+  .el-table-fixed-column--right {
+    background-color: #fbdbdb;
+  }
+}
 </style>
 </style>

+ 227 - 3
src/views/MES/productionTask/index.vue

@@ -156,6 +156,20 @@
           </div>
           </div>
         </template>
         </template>
 
 
+        <template #logo="{item}">
+          <div style="width: 100%">
+            {{item.productLogoLength }} * {{item.productLogoWidth }}
+          </div>
+        </template>
+
+        <template #shortageMaterials="{item}">
+          <div style="width: 100%">
+            <span v-if="item.lackStatus=='1'" class="red" style="cursor:pointer" @click="lookDetail(item)">
+              欠料</span>
+            <span v-else>未欠料</span>
+          </div>
+        </template>
+
         <template v-for="(slotItem, index) in processesData" v-slot:[slotItem.id]="{ item }" :key="slotItem.id">
         <template v-for="(slotItem, index) in processesData" v-slot:[slotItem.id]="{ item }" :key="slotItem.id">
           <div style="width:100%">
           <div style="width:100%">
             <div v-if="pageActiveName !='4'">
             <div v-if="pageActiveName !='4'">
@@ -600,6 +614,88 @@
         <el-button @click="openSelectTask = false" size="defualt" v-debounce>取 消</el-button>
         <el-button @click="openSelectTask = false" size="defualt" v-debounce>取 消</el-button>
       </template>
       </template>
     </el-dialog>
     </el-dialog>
+
+    <el-dialog :title="'欠料明细'" v-model="shortageMaterialDialog" width="80%" destroy-on-close>
+      <el-tabs v-model="shortageMaterialTab" type="card" class="demo-tabs">
+        <el-tab-pane label="待采购" name="1">
+        </el-tab-pane>
+        <el-tab-pane label="未到货" name="2">
+        </el-tab-pane>
+        <el-tab-pane label="待入库" name="3">
+        </el-tab-pane>
+      </el-tabs>
+      <div style="width: 100%" v-show="shortageMaterialTab=='1'">
+        <el-table :data="shortageMaterialData.data.waitPurchase" style="width: 100%;">
+          <el-table-column prop="subscribeCode" label="单号" />
+          <el-table-column label="图片" width="80">
+            <template #default="{ row }">
+              <div v-if="row.fileUrl">
+                <img :src="row.fileUrl" class="pic" @click="onPicture(row.fileUrl)" />
+              </div>
+              <div v-else></div>
+            </template>
+          </el-table-column>
+          <!-- <el-table-column prop="productCategory" label="分类名称" /> -->
+          <el-table-column prop="productCustomCode" label="编码" width="200" />
+          <el-table-column prop="productName" label="名称" min-width="150" />
+          <el-table-column label="规格尺寸 (cm)" width="150">
+            <template #default="{ row, $index }">
+              <div style="width: 100%">
+                {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column prop="productColor" label="颜色" width="170" />
+          <el-table-column prop="productUnit" label="单位" width="100" />
+          <el-table-column prop="count" label="需采购量" width="100" />
+          <el-table-column prop="purchaseCount" label="已采购量" width="100" />
+        </el-table>
+      </div>
+
+      <div style="width: 100%" v-show="shortageMaterialTab=='2'">
+        <el-table :data="shortageMaterialData.data.undeliveredGoods" style="width: 100%;">
+          <el-table-column prop="code" label="采购单号" />
+          <el-table-column prop="sellCorporationName" label="供应商" />
+          <el-table-column prop="deliveryTime" label="交付日期" />
+          <el-table-column prop="status" label="采购状态" :formatter="(row)=>dictValueLabel(row.status,purchaseStatus)" />
+          <el-table-column prop="userName" label="采购人" />
+          <el-table-column prop="createTime" label="采购时间" />
+          <el-table-column prop="arrivalStatus" label="到货状态" :formatter="(row)=>dictValueLabel(row.arrivalStatus,arrivalStatusData)" />
+        </el-table>
+      </div>
+
+      <div style="width: 100%" v-show="shortageMaterialTab=='3'">
+        <el-table :data="shortageMaterialData.data.waitInbound" style="width: 100%;">
+          <el-table-column prop="businessCode" label="单号" />
+          <el-table-column label="图片" width="80">
+            <template #default="{ row }">
+              <div v-if="row.fileUrl">
+                <img :src="row.fileUrl" class="pic" @click="onPicture(row.fileUrl)" />
+              </div>
+              <div v-else></div>
+            </template>
+          </el-table-column>
+          <!-- <el-table-column prop="productCategory" label="分类名称" /> -->
+          <el-table-column prop="productCustomCode" label="编码" width="200" />
+          <el-table-column prop="productName" label="名称" min-width="150" />
+          <el-table-column label="规格尺寸 (cm)" width="150">
+            <template #default="{ row, $index }">
+              <div style="width: 100%">
+                {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column prop="productColor" label="颜色" width="170" />
+          <el-table-column prop="productUnit" label="单位" width="100" />
+          <el-table-column prop="quantity" label="需入库数量" width="100" />
+          <el-table-column prop="receiptQuantity" label="已入库数量" width="100" />
+          <el-table-column prop="waitQuantity" label="待入库数量" width="100" />
+        </el-table>
+      </div>
+      <template #footer>
+        <el-button @click="shortageMaterialDialog = false" size="defualt">关 闭</el-button>
+      </template>
+    </el-dialog>
   </div>
   </div>
 
 
 </template>
 </template>
@@ -617,6 +713,12 @@ const { proxy } = getCurrentInstance();
 const contractTag = computed(
 const contractTag = computed(
   () => proxy.useUserStore().allDict["contract_prod_tag"]
   () => proxy.useUserStore().allDict["contract_prod_tag"]
 );
 );
+const backLinesData = computed(
+  () => proxy.useUserStore().allDict["back_lines"]
+);
+const frontLinesData = computed(
+  () => proxy.useUserStore().allDict["front_lines"]
+);
 const pageActiveName = ref("1");
 const pageActiveName = ref("1");
 const lastPageActiveName = ref("");
 const lastPageActiveName = ref("");
 const handlePageTabChange = (val) => {
 const handlePageTabChange = (val) => {
@@ -831,6 +933,22 @@ const config = ref([
   },
   },
   {
   {
     attrs: {
     attrs: {
+      label: "客户名称",
+      prop: "customerName",
+      width: 150,
+      // fixed: "left",
+    },
+  },
+  {
+    attrs: {
+      label: "业务员",
+      prop: "saleUserName",
+      width: 100,
+      // align: "center",
+    },
+  },
+  {
+    attrs: {
       label: "订单号",
       label: "订单号",
       slot: "orderCode",
       slot: "orderCode",
       width: 150,
       width: 150,
@@ -854,12 +972,20 @@ const config = ref([
   },
   },
   {
   {
     attrs: {
     attrs: {
+      label: "业务部门",
+      prop: "contractDeptName",
+      width: 100,
+    },
+  },
+  {
+    attrs: {
       label: "是否逾期",
       label: "是否逾期",
       slot: "isOverdue",
       slot: "isOverdue",
       width: 80,
       width: 80,
       // fixed: "left",
       // fixed: "left",
     },
     },
   },
   },
+
   {
   {
     attrs: {
     attrs: {
       label: "生产状态",
       label: "生产状态",
@@ -891,12 +1017,13 @@ const config = ref([
   },
   },
   {
   {
     attrs: {
     attrs: {
-      label: "业务员",
-      prop: "saleUserName",
+      label: "欠料状态",
+      prop: "produceStatus",
+      slot: "shortageMaterials",
       width: 100,
       width: 100,
-      // align: "center",
     },
     },
   },
   },
+
   {
   {
     attrs: {
     attrs: {
       label: "产品图片",
       label: "产品图片",
@@ -904,6 +1031,13 @@ const config = ref([
       width: 80,
       width: 80,
     },
     },
   },
   },
+  {
+    attrs: {
+      label: "产品分类名称",
+      prop: "productClassifyNames",
+      width: 150,
+    },
+  },
   // {
   // {
   //   attrs: {
   //   attrs: {
   //     label: "设计图",
   //     label: "设计图",
@@ -934,6 +1068,33 @@ const config = ref([
   },
   },
   {
   {
     attrs: {
     attrs: {
+      label: "正面纹路",
+      prop: "productFrontalTexture",
+      width: 100,
+    },
+    render(val) {
+      return proxy.dictKeyValue(val, frontLinesData.value);
+    },
+  },
+  {
+    attrs: {
+      label: "背面纹路",
+      prop: "productReverseTexture",
+      width: 100,
+    },
+    render(val) {
+      return proxy.dictKeyValue(val, backLinesData.value);
+    },
+  },
+  {
+    attrs: {
+      label: "LOGO尺寸(cm)",
+      slot: "logo",
+      width: 130,
+    },
+  },
+  {
+    attrs: {
       label: "生产件数",
       label: "生产件数",
       prop: "quantity",
       prop: "quantity",
       width: 100,
       width: 100,
@@ -1977,6 +2138,69 @@ const disabledFn = (date) => {
     currentDate.value.includes(current)
     currentDate.value.includes(current)
   );
   );
 };
 };
+
+const shortageMaterialDialog = ref(false);
+const shortageMaterialTab = ref("1");
+const shortageMaterialData = reactive({
+  data: {
+    waitInbound: [],
+    waitPurchase: [],
+    undeliveredGoods: [],
+  },
+});
+const lookDetail = (row) => {
+  let contractId = row.contractId;
+  proxy
+    .post("/subscribeDetail/page", { contractId, status: "15,30" })
+    .then((res) => {
+      shortageMaterialData.data.waitPurchase = res.rows;
+      let productIds = res.rows.map((x) => x.productId);
+      proxy.getFileData({
+        businessIdList: productIds,
+        data: shortageMaterialData.data.waitPurchase,
+        att: "productId",
+        businessType: "0",
+        fileAtt: "fileList",
+        filePathAtt: "fileUrl",
+      });
+    });
+
+  proxy
+    .post("/ehsdPurchase/page", {
+      dataResourceId: contractId,
+      arrivalStatus: "0,1",
+    })
+    .then((res) => {
+      shortageMaterialData.data.undeliveredGoods = res.rows;
+    });
+
+  proxy.post("/stockWait/page", { contractId }).then((res) => {
+    let arr = [];
+    for (let i = 0; i < res.rows.length; i++) {
+      const ele = res.rows[i];
+      for (let j = 0; j < ele.stockWaitDetailsList.length; j++) {
+        const jele = ele.stockWaitDetailsList[j];
+        jele.businessCode = ele.businessCode;
+        jele.waitQuantity =
+          Number(jele.quantity) - Number(jele.receiptQuantity);
+        arr.push(jele);
+      }
+    }
+    shortageMaterialData.data.waitInbound = arr;
+    let productIds = arr.map((x) => x.productId);
+    proxy.getFileData({
+      businessIdList: productIds,
+      data: shortageMaterialData.data.waitInbound,
+      att: "productId",
+      businessType: "0",
+      fileAtt: "fileList",
+      filePathAtt: "fileUrl",
+    });
+  });
+
+  shortageMaterialTab.value = "1";
+  shortageMaterialDialog.value = true;
+};
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>

+ 6 - 2
src/views/purchaseManage/supplier/supplier/index.vue

@@ -776,8 +776,12 @@ const submitForm = () => {
 const getDtl = (row) => {
 const getDtl = (row) => {
   modalType.value = "edit";
   modalType.value = "edit";
   proxy.post("/supplierInfo/detail", { id: row.id }).then((res) => {
   proxy.post("/supplierInfo/detail", { id: row.id }).then((res) => {
-    getCityData(res.countryId, "20");
-    getCityData(res.provinceId, "30");
+    if (res.countryId) {
+      getCityData(res.countryId, "20");
+    }
+    if (res.provinceId) {
+      getCityData(res.provinceId, "30");
+    }
     getDeptData(res.companyId);
     getDeptData(res.companyId);
     res.type = res.type + "";
     res.type = res.type + "";
     formData.data = res;
     formData.data = res;

+ 882 - 0
src/views/purchaseManage/supplier/supplier/indexTwo.vue

@@ -0,0 +1,882 @@
+<template>
+  <div class="pageIndexClass">
+    <div class="content">
+      <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" highlight-current-row
+               :selectConfig="selectConfig" :table-events="{
+          select: select,
+        }" :action-list="[
+           {
+                text: '导出Excel',
+                action: () => exportExcel(),
+                disabled: false,
+              },
+          {
+            text: '添加供应商',
+            action: () => openModal('add'),
+          },
+        ]" @get-list="getList">
+        <template #address="{ item }">
+          <div>
+            {{ item.countryName }}, {{ item.provinceName }} ,
+            {{ item.cityName }}, {{ item.areaDetail }}
+          </div>
+        </template>
+      </byTable>
+    </div>
+    <el-dialog :title="modalType == 'add' ? '添加供应商' : '编辑供应商'" v-model="dialogVisible" width="60%" v-loading="loading" destroy-on-close>
+      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="byform">
+        <template #address>
+          <div style="width:100%">
+            <el-row style="width:100%">
+              <el-col :span="8">
+                <el-form-item label="" prop="countryId" style="width:100%">
+                  <el-select v-model="formData.data.countryId" placeholder="国家" filterable @change="(val) => getCityData(val, '20', true)"
+                             style="width:100%">
+                    <el-option v-for="item in countryData" :label="item.name" :value="item.id">
+                    </el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="" prop="provinceName" style="width:100%">
+                  <selectCity placeholder="省/洲" @change="(val) => getCityData(val, '30', true)" addressId="provinceId" addressName="provinceName"
+                              v-model="formData.data" :data="provinceData" style="width:100%">
+                  </selectCity>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="" prop="cityName" style="width:100%">
+                  <selectCity placeholder="城市" addressId="cityId" addressName="cityName" v-model="formData.data" :data="cityData" style="width:100%">
+                  </selectCity>
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-form-item label="" label-width="0px" prop="areaDetail" class="margin-b-0 wid100">
+              <el-input v-model="formData.data.areaDetail" type="textarea" placeholder="详细地址">
+              </el-input>
+            </el-form-item>
+          </div>
+        </template>
+
+        <template #contact>
+          <el-form-item label="联系信息" required class="margin-b-0 wid100">
+            <el-row style="width: 100%">
+              <el-col :span="8">
+                <el-form-item label="" label-width="0px" prop="contactPerson" class="margin-b-0 wid100">
+                  <el-input v-model="formData.data.contactPerson" placeholder="联系人">
+                  </el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="16">
+                <el-form-item label="" label-width="0px" prop="contactNumber" class="margin-b-0 wid100">
+                  <el-input v-model="formData.data.contactNumber" placeholder="联系电话" :formatter="(val) => val.replace(/[^\d\-]/g, '')"
+                            :parser="(val) => val.replace(/[^\d\-]/g, '')">
+                  </el-input>
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form-item>
+        </template>
+        <template #paymentDays>
+          <el-row style="width: 100%">
+            <el-col :span="8">
+              <el-form-item label="" label-width="0px" prop="accountPeriod" class="margin-b-0 wid100">
+                <el-input-number v-model="formData.data.accountPeriod" placeholder="请输入账期 (天)" style="width: 100%" :precision="0" :controls="false"
+                                 :min="0" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="16">
+              <el-form-item label="" label-width="0px" prop="accountPeriodRemark" class="margin-b-0 wid100">
+                <el-input v-model="formData.data.accountPeriodRemark" placeholder="请输入账期说明" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </template>
+
+        <template #otherContacts>
+          <div style="width: 100%;padding-left:20px">
+            <el-button type="primary" @click="clickAddPerson">添 加</el-button>
+            <el-table :data="formData.data.contactList" style="width: 100%; margin-top: 16px">
+              <el-table-column label="姓名" width="150">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    <el-form-item :prop="'contactList.' + $index + '.name'" class="margin-b-0 wid100" :rules="rules.name2" :inline-message="true">
+                      <el-input v-model="row.name" placeholder="请输入姓名" />
+                    </el-form-item>
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column label="职位" width="150">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    <el-form-item :prop="'contactList.' + $index + '.position'" class="margin-b-0 wid100" :rules="rules.position"
+                                  :inline-message="true">
+                      <el-input v-model="row.position" placeholder="请输入职位" />
+                    </el-form-item>
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column label="电话" width="200">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    <el-form-item :prop="'contactList.' + $index + '.phoneNum'" class="margin-b-0 wid100" :rules="rules.phoneNum"
+                                  :inline-message="true">
+                      <el-input v-model="row.phoneNum" placeholder="请输入电话" />
+                    </el-form-item>
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column label="邮箱" width="200">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    <el-form-item :prop="'contactList.' + $index + '.email'" class="margin-b-0 wid100" :rules="rules.email" :inline-message="true">
+                      <el-input v-model="row.email" placeholder="请输入邮箱" />
+                    </el-form-item>
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column label="备注" min-width="200">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    <el-form-item :prop="'contactList.' + $index + '.remark'" class="margin-b-0 wid100" :rules="rules.remark" :inline-message="true">
+                      <el-input v-model="row.remark" placeholder="请输入备注" />
+                    </el-form-item>
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column align="center" label="操作" width="80" fixed="right">
+                <template #default="{ row, $index }">
+                  <el-button type="primary" link @click="clickDelete($index)">删除</el-button>
+                </template>
+              </el-table-column>
+            </el-table>
+          </div>
+        </template>
+
+      </byForm>
+      <template #footer>
+        <el-button @click="dialogVisible = false" size="default">取 消</el-button>
+        <el-button type="primary" @click="submitForm()" size="default" :loading="submitLoading">
+          确 定
+        </el-button>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup>
+/* eslint-disable vue/no-unused-components */
+import { ElMessage, ElMessageBox } from "element-plus";
+import byTable from "@/components/byTable/index";
+import byForm from "@/components/byForm/index";
+import { computed, ref } from "vue";
+import selectCity from "@/components/selectCity/index.vue";
+
+const { proxy } = getCurrentInstance();
+const supplierType = computed(
+  () => proxy.useUserStore().allDict["supplier_type"]
+);
+const supplierGrade = computed(
+  () => proxy.useUserStore().allDict["supplier_grade"]
+);
+const supplierStatus = computed(
+  () => proxy.useUserStore().allDict["supplier_status"]
+);
+const invoiceType = computed(
+  () => proxy.useUserStore().allDict["invoice_type"]
+);
+const supplierShippingMethod = computed(
+  () => proxy.useUserStore().allDict["supplier_shipping_method"]
+);
+const supplierPaymentMethod = computed(
+  () => proxy.useUserStore().allDict["supplier_payment_method"]
+);
+
+const loading = ref(false);
+const submitLoading = ref(false);
+const treeData = ref([]);
+const companyData = ref([]);
+const userList = ref([]);
+const deptData = ref([]);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 3,
+    pageNum: 1,
+    pageSize: 10,
+    type: "",
+    keyword: "",
+  },
+});
+let dialogVisible = ref(false);
+let modalType = ref("add");
+const uploadData = ref({});
+let rules = ref({
+  companyId: [{ required: true, message: "请选择生产公司", trigger: "change" }],
+  devUserId: [{ required: true, message: "请选择开发人员", trigger: "change" }],
+  deptId: [{ required: true, message: "请选择业务部门", trigger: "change" }],
+  name: [{ required: true, message: "请输入供应商名称", trigger: "blur" }],
+  type: [{ required: true, message: "请选择供应商类型", trigger: "change" }],
+  grade: [{ required: true, message: "请选择供应商等级", trigger: "change" }],
+  status: [{ required: true, message: "请选择供应商状态", trigger: "change" }],
+  countryId: [{ required: true, message: "请选择国家", trigger: "change" }],
+  // provinceId: [{ required: true, message: "请选择省/洲", trigger: "change" }],
+  // cityId: [{ required: true, message: "请选择城市", trigger: "change" }],
+  areaDetail: [{ required: true, message: "请输入详细地址", trigger: "blur" }],
+  contactPerson: [{ required: true, message: "请输入联系人", trigger: "blur" }],
+  contactNumber: [
+    { required: true, message: "请输入联系电话", trigger: "blur" },
+  ],
+  name2: [{ required: true, message: "请输入姓名", trigger: "blur" }],
+  position: [{ required: true, message: "请输入职位", trigger: "blur" }],
+  phoneNum: [{ required: true, message: "请输入电话", trigger: "blur" }],
+  accountPeriod: [{ required: true, message: "请输入账期", trigger: "blur" }],
+  accountPeriodRemark: [
+    { required: true, message: "请输入账期说明", trigger: "blur" },
+  ],
+  fax: [{ required: true, message: "请输入传真", trigger: "blur" }],
+  privIncludingTax: [
+    { required: true, message: "请选择报价是否含税", trigger: "change" },
+  ],
+  privTaxPoints: [
+    { required: true, message: "请输入供应商税点", trigger: "blur" },
+  ],
+  licenseFileList: [
+    { required: true, message: "请上传营业执照", trigger: "change" },
+  ],
+});
+const selectConfig = computed(() => [
+  {
+    label: "供应商类型",
+    prop: "type",
+    data: supplierType.value,
+  },
+  {
+    label: "生产公司",
+    prop: "companyId",
+    data: companyData.value,
+  },
+]);
+const config = computed(() => {
+  return [
+    // {
+    //   attrs: {
+    //     label: "生产公司",
+    //     prop: "companyName",
+    //     width: 130,
+    //   },
+    // },
+    {
+      attrs: {
+        label: "类型",
+        prop: "type",
+        width: 120,
+      },
+      render(val) {
+        return proxy.dictKeyValue(val, supplierType.value);
+      },
+    },
+    {
+      attrs: {
+        label: "等级",
+        prop: "grade",
+        width: 100,
+      },
+      render(val) {
+        return proxy.dictKeyValue(val, supplierGrade.value);
+      },
+    },
+    {
+      attrs: {
+        label: "状态",
+        prop: "status",
+        width: 100,
+      },
+      render(val) {
+        return proxy.dictKeyValue(val, supplierStatus.value);
+      },
+    },
+    {
+      attrs: {
+        label: "供应商名称",
+        prop: "name",
+      },
+    },
+    {
+      attrs: {
+        label: "所在城市",
+        prop: "remarks",
+        slot: "address",
+      },
+    },
+    {
+      attrs: {
+        label: "联系人",
+        prop: "contactPerson",
+        width: 120,
+      },
+    },
+    {
+      attrs: {
+        label: "联系人电话",
+        prop: "contactNumber",
+        width: 150,
+      },
+    },
+    {
+      attrs: {
+        label: "备注",
+        prop: "remark",
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: "120",
+        align: "center",
+        fixed: "right",
+      },
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "修改",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              getDtl(row);
+            },
+          },
+          {
+            attrs: {
+              label: "删除",
+              type: "danger",
+              text: true,
+            },
+            el: "button",
+            click() {
+              ElMessageBox.confirm(
+                "此操作将永久删除该数据, 是否继续?",
+                "提示",
+                {
+                  confirmButtonText: "确定",
+                  cancelButtonText: "取消",
+                  type: "warning",
+                }
+              ).then(() => {
+                proxy
+                  .post("/supplierInfo/delete", {
+                    id: row.id,
+                  })
+                  .then((res) => {
+                    ElMessage({
+                      message: "删除成功",
+                      type: "success",
+                    });
+                    getList();
+                  });
+              });
+            },
+          },
+        ];
+      },
+    },
+  ];
+});
+let formData = reactive({
+  data: {
+    type: "",
+    contactList: [],
+  },
+});
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const byform = ref(null);
+const formConfig = computed(() => {
+  return [
+    {
+      type: "title1",
+      title: "基本信息",
+    },
+    // {
+    //   type: "treeSelect",
+    //   prop: "companyId",
+    //   label: "生产公司",
+    //   data: treeData.value,
+    //   propsTreeLabel: "deptName",
+    //   propsTreeValue: "deptId",
+    //   itemWidth: 50,
+    //   fn: (val) => {
+    //     getDeptData(val);
+    //   },
+    // },
+    {
+      type: "select",
+      prop: "devUserId",
+      label: "开发⼈员",
+      required: true,
+      filterable: true,
+      data: userList.value,
+      itemWidth: 50,
+    },
+    {
+      type: "treeSelect",
+      prop: "deptId",
+      label: "业务部门",
+      data: deptData.value,
+      propsTreeLabel: "deptName",
+      propsTreeValue: "deptId",
+      itemWidth: 50,
+    },
+    {
+      type: "select",
+      prop: "type",
+      label: "供应商类型",
+      required: true,
+      filterable: true,
+      data: supplierType.value,
+      itemWidth: 50,
+    },
+    {
+      type: "select",
+      prop: "grade",
+      label: "供应商等级",
+      required: true,
+      filterable: true,
+      data: supplierGrade.value,
+      itemWidth: 50,
+    },
+    {
+      type: "select",
+      prop: "status",
+      label: "供应商状态",
+      required: true,
+      filterable: true,
+      data: supplierStatus.value,
+      itemWidth: 50,
+    },
+    {
+      type: "input",
+      prop: "name",
+      label: "供应商名称",
+      required: true,
+    },
+    {
+      type: "slot",
+      slotName: "address",
+      label: "地址",
+    },
+    {
+      type: "input",
+      label: "邮编",
+      prop: "postalCode",
+      itemType: "text",
+    },
+    {
+      type: "slot",
+      slotName: "contact",
+      prop: "",
+      label: "",
+    },
+    {
+      type: "slot",
+      slotName: "paymentDays",
+      label: "账期信息",
+    },
+    {
+      type: "select",
+      prop: "deliverMethod",
+      label: "发货方式",
+      required: true,
+      filterable: true,
+      data: supplierShippingMethod.value,
+      itemWidth: 50,
+    },
+    {
+      type: "select",
+      prop: "paymentMethod",
+      label: "付款方式",
+      required: true,
+      filterable: true,
+      data: supplierPaymentMethod.value,
+      itemWidth: 50,
+    },
+    {
+      type: "input",
+      label: "传真",
+      prop: "fax",
+      itemType: "text",
+    },
+    // {
+    //   type: "upload",
+    //   listType: "text",
+    //   accept: "",
+    //   prop: "fileList",
+    //   label: "上传附件",
+    // },
+    {
+      type: "select",
+      prop: "privIncludingTax",
+      label: "报价是否含税",
+      required: true,
+      filterable: true,
+      data: [
+        {
+          label: "是",
+          value: "1",
+        },
+        {
+          label: "否",
+          value: "0",
+        },
+      ],
+      itemWidth: 50,
+    },
+    {
+      type: "input",
+      prop: "privTaxPoints",
+      label: "供应商税点",
+      itemType: "text",
+      itemWidth: 50,
+    },
+    {
+      type: "upload",
+      listType: "text",
+      accept: "",
+      prop: "licenseFileList",
+      label: "营业执照",
+    },
+    {
+      type: "input",
+      label: "备注",
+      prop: "remark",
+      itemType: "textarea",
+    },
+    {
+      type: "input",
+      prop: "jdSubjectCode",
+      label: "金蝶科目代码",
+      itemWidth: 50,
+    },
+    {
+      type: "input",
+      prop: "jdSubjectName",
+      label: "金蝶科目名称",
+      itemWidth: 50,
+    },
+    {
+      type: "title1",
+      title: "其他联系人",
+    },
+    {
+      type: "slot",
+      slotName: "otherContacts",
+      label: "",
+    },
+    {
+      type: "title1",
+      title: "对公开票信息",
+    },
+    {
+      type: "input",
+      prop: "openingName",
+      label: "单位名称",
+      itemType: "text",
+      itemWidth: 50,
+    },
+    {
+      type: "input",
+      prop: "taxpayerCode",
+      label: "纳税⼈识别号",
+      itemType: "text",
+      itemWidth: 50,
+    },
+
+    {
+      type: "input",
+      prop: "openingBank",
+      label: "开户银行",
+      itemType: "text",
+      itemWidth: 50,
+    },
+    {
+      type: "input",
+      prop: "accountOpening",
+      label: "银行账号",
+      itemType: "text",
+      itemWidth: 50,
+    },
+    // {
+    //   type: "input",
+    //   prop: "interbankNumber",
+    //   label: "联行号",
+    //   itemType: "text",
+    // },
+    {
+      type: "input",
+      prop: "invoiceAddress",
+      label: "地址",
+      itemType: "text",
+      itemWidth: 50,
+    },
+    {
+      type: "input",
+      prop: "invoiceContactInfo",
+      label: "联系⽅式",
+      itemType: "text",
+      itemWidth: 50,
+    },
+    {
+      type: "select",
+      prop: "invoiceType",
+      label: "发票类型",
+      required: true,
+      filterable: true,
+      data: invoiceType.value,
+      itemWidth: 50,
+    },
+    {
+      type: "input",
+      prop: "invoiceName",
+      label: "开票名称",
+      itemType: "text",
+      itemWidth: 50,
+    },
+    {
+      type: "title1",
+      title: "对私汇款账号",
+    },
+    {
+      type: "input",
+      prop: "privOpeningName",
+      label: "账户名",
+      itemType: "text",
+      itemWidth: 50,
+    },
+    {
+      type: "input",
+      prop: "privOpeningBank",
+      label: "开户⾏",
+      itemType: "text",
+      itemWidth: 50,
+    },
+
+    {
+      type: "input",
+      prop: "privAccountOpening",
+      label: "账号",
+      itemType: "text",
+      itemWidth: 50,
+    },
+  ];
+});
+
+const getDeptData = (val) => {
+  proxy
+    .get("/tenantUser/list", {
+      pageNum: 1,
+      pageSize: 10000,
+      tenantId: proxy.useUserStore().user.tenantId,
+      companyId: val,
+    })
+    .then((res) => {
+      userList.value = res.rows.map((item) => {
+        return {
+          label: item.nickName,
+          value: item.userId,
+        };
+      });
+    });
+
+  proxy
+    .get("/tenantDept/list", {
+      pageNum: 1,
+      pageSize: 9999,
+      keyword: "",
+      ancestors: val,
+      tenantId: proxy.useUserStore().user.tenantId,
+      // type: 2,
+    })
+    .then((res) => {
+      deptData.value = proxy.handleTree(res.data, "deptId");
+    });
+};
+
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy.post("/supplierInfo/page", sourceList.value.pagination).then((res) => {
+    sourceList.value.data = res.rows;
+    sourceList.value.pagination.total = res.total;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
+};
+const openModal = () => {
+  dialogVisible.value = true;
+  modalType.value = "add";
+  formData.data = {
+    type: "",
+    countryId: "44",
+    fileList: [],
+    contactList: [],
+    licenseFileList: [],
+  };
+  getCityData(formData.data.countryId, "20");
+  getDeptData(proxy.useUserStore().user.companyId);
+};
+
+const clickAddPerson = () => {
+  formData.data.contactList.push({
+    name: "",
+    remark: "",
+  });
+};
+
+const clickDelete = (index) => {
+  formData.data.contactList.splice(index, 1);
+};
+const uploadFile = async (file) => {
+  const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
+  uploadData.value = res.uploadBody;
+  file.id = res.id;
+  file.fileName = res.fileName;
+  file.fileUrl = res.fileUrl;
+  return true;
+};
+const onPreviewFile = (file) => {
+  window.open(file.raw.fileUrl, "_blank");
+};
+const submitForm = () => {
+  byform.value.handleSubmit(() => {
+    submitLoading.value = true;
+    proxy.post("/supplierInfo/" + modalType.value, formData.data).then(
+      () => {
+        ElMessage({
+          message: modalType.value == "add" ? "添加成功" : "编辑成功",
+          type: "success",
+        });
+        dialogVisible.value = false;
+        submitLoading.value = false;
+        getList();
+      },
+      (err) => {
+        console.log(err);
+        submitLoading.value = false;
+      }
+    );
+  });
+};
+const getDtl = (row) => {
+  modalType.value = "edit";
+  proxy.post("/supplierInfo/detail", { id: row.id }).then((res) => {
+    if (res.countryId) {
+      getCityData(res.countryId, "20");
+    }
+    if (res.provinceId) {
+      getCityData(res.provinceId, "30");
+    }
+    // getDeptData(res.companyId);
+    res.type = res.type + "";
+    formData.data = res;
+    dialogVisible.value = true;
+    proxy
+      .post("/fileInfo/getList", { businessIdList: [row.id] })
+      .then((fileObj) => {
+        if (fileObj[row.id] && fileObj[row.id].length > 0) {
+          formData.data.fileList = fileObj[row.id]
+            .filter((x) => x.businessType == "0")
+            .map((item) => {
+              return {
+                ...item,
+                name: item.fileName,
+                url: item.fileUrl,
+              };
+            });
+          formData.data.licenseFileList = fileObj[row.id]
+            .filter((x) => x.businessType == "10")
+            .map((item) => {
+              return {
+                ...item,
+                name: item.fileName,
+                url: item.fileUrl,
+              };
+            });
+        } else {
+          formData.data.fileList = [];
+          formData.data.licenseFileList = [];
+        }
+      });
+  });
+};
+const countryData = ref([]);
+const provinceData = ref([]);
+const cityData = ref([]);
+const getCityData = (id, type, flag) => {
+  proxy.post("/customizeArea/list", { parentId: id }).then((res) => {
+    if (type === "20") {
+      provinceData.value = res;
+      if (flag) {
+        formData.data.provinceId = "";
+        formData.data.provinceName = "";
+        formData.data.cityId = "";
+        formData.data.cityName = "";
+      }
+    } else if (type === "30") {
+      cityData.value = res;
+      if (flag) {
+        formData.data.cityId = "";
+        formData.data.cityName = "";
+      }
+    } else {
+      countryData.value = res;
+    }
+  });
+};
+const getDict = () => {
+  proxy
+    .get("/tenantDept/list", {
+      pageNum: 1,
+      pageSize: 9999,
+      keyword: "",
+      tenantId: proxy.useUserStore().user.tenantId,
+      type: 0,
+    })
+    .then((res) => {
+      companyData.value = res.data.map((x) => ({
+        ...x,
+        label: x.deptName,
+        value: x.deptId,
+      }));
+      treeData.value = proxy.handleTree(res.data, "deptId");
+    });
+};
+getDict();
+getCityData("0");
+getList();
+
+const exportExcel = () => {
+  proxy.msgTip("正在导出,请稍后", 2);
+  proxy
+    .postTwo("/supplierInfo/excelExport", sourceList.value.pagination)
+    .then((res) => {
+      proxy.downloadFile(res, "供应商数据.xlsx");
+    });
+};
+</script>
+
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+::v-deep(.el-input-number .el-input__inner) {
+  text-align: left;
+}
+</style>

+ 21 - 1
src/views/systemTenant/tenant/deptTenant/index.vue

@@ -41,7 +41,8 @@
         <template #parentId>
         <template #parentId>
           <div style="width: 100%">
           <div style="width: 100%">
             <el-tree-select v-model="formData.data.parentId" :data="sourceList.data" :disabled="modalType=='edit'" check-strictly
             <el-tree-select v-model="formData.data.parentId" :data="sourceList.data" :disabled="modalType=='edit'" check-strictly
-                            :render-after-expand="false" node-key="deptId" :props="defaultProps" style="width:100%" />
+                            :render-after-expand="false" node-key="deptId" :props="defaultProps" style="width:100%"
+                            @change="(val)=>changeParentId(val)" />
           </div>
           </div>
         </template>
         </template>
         <template #orderNum>
         <template #orderNum>
@@ -79,6 +80,7 @@ const { proxy } = getCurrentInstance();
 const defaultProps = {
 const defaultProps = {
   children: "children",
   children: "children",
   label: "deptName",
   label: "deptName",
+  disabled: "disabled",
 };
 };
 const defaultPropsOne = {
 const defaultPropsOne = {
   children: "children",
   children: "children",
@@ -141,6 +143,13 @@ const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
   loading.value = true;
   proxy.get("/tenantDept/list", sourceList.value.pagination).then((res) => {
   proxy.get("/tenantDept/list", sourceList.value.pagination).then((res) => {
+    res.data.forEach((x) => {
+      if (x.type == 3) {
+        x.disabled = true;
+      } else {
+        x.disabled = false;
+      }
+    });
     deptAllData.value = res.data;
     deptAllData.value = res.data;
     sourceList.value.data = proxy.handleTree(res.data, "deptId");
     sourceList.value.data = proxy.handleTree(res.data, "deptId");
     console.log(sourceList.value.data);
     console.log(sourceList.value.data);
@@ -387,6 +396,17 @@ const submitTree = () => {
       roomDialogVisible.value = false;
       roomDialogVisible.value = false;
     });
     });
 };
 };
+
+const changeParentId = (val) => {
+  const current = deptAllData.value.find((x) => x.deptId == val);
+  if (current.type == 2) {
+    disabledType.value = true;
+    formData.data.type = 3;
+  } else {
+    disabledType.value = false;
+    formData.data.type = "";
+  }
+};
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>