Browse Source

部分新需求

cz 1 year ago
parent
commit
7f6d3af768

+ 1 - 1
src/assets/styles/index.scss

@@ -219,7 +219,7 @@ aside {
 
 // 20223/05/04增加
 .public_height_dialog {
-  height: calc(100vh - 270px);
+  height: calc(100vh - 276px);
   overflow: auto;
   padding-right: 10px;
 }

+ 153 - 33
src/components/contractCom/contractDetails.vue

@@ -1,15 +1,17 @@
 <template>
-  <div style="background: #fff; padding: 0 20px">
-    <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" @tab-change="handleChange" stretch>
+  <div style="background: #fff; padding:  10px;margin:10px">
+
+    <el-tabs v-model="activeName" type="card" class="demo-tabs" @tab-click="handleClick" @tab-change="handleChange">
       <el-tab-pane label="销售订单" name="first"></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="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="five" v-if="isShowSalesFinancemanArrange">
       </el-tab-pane>
       <el-tab-pane label="结算表" name="six" v-if="isShowSalesFinancemanArrange">
       </el-tab-pane>
-      <el-tab-pane label="单证" name="seven" v-if="isShowSalesFinancemanArrange"></el-tab-pane>
+      <el-tab-pane label="单证" name="seven" v-if="isShowSalesFinancemanArrange"></el-tab-pane> -->
     </el-tabs>
     <div class="content-box" v-if="['first', 'second'].includes(activeName)">
       <div class="left">
@@ -43,7 +45,28 @@
       </div>
     </div>
     <div v-if="activeName === 'third'">
-      <byTable :hidePagination="true" :hideSearch="true" :source="tableData" :config="config" highlight-current-row :action-list="[]">
+      <byTable :hidePagination="true" :hideSearch="true" :source="tableData" :otherHeight="33" :config="config" highlight-current-row
+               :action-list="[]">
+        <template #pic="{ item }">
+          <div v-if="item.fileUrl">
+            <img :src="item.fileUrl" class="pic" @click="openImg(item.fileUrl)" />
+          </div>
+          <div v-else></div>
+        </template>
+        <template #size="{ item }">
+          <div v-if="item.productLength && item.productWidth && item.productHeight">
+            <span>{{ item.productLength }}</span>*
+            <span>{{ item.productWidth }}</span>*
+            <span>{{ item.productHeight }}</span>
+          </div>
+          <div v-else></div>
+        </template>
+        <template #progress="{item}">
+          <div style="width: 100%">
+            <el-progress type="circle" :percentage="(Number(item.finishQuantity) / Number(item.quantity))*100" width="60"
+                         :status="(Number(item.finishQuantity) / Number(item.quantity))*100 == 100 ? 'success' : ''" />
+          </div>
+        </template>
         <template #amount="{ item }">
           <div>{{ item.currency }} {{ moneyFormat(item.amount, 2) }}</div>
         </template>
@@ -121,51 +144,125 @@ const transactionType = ref([
     value: "30",
   },
 ]);
+// const config = computed(() => {
+//   return [
+//     {
+//       attrs: {
+//         label: "交易时间",
+//         prop: "createTime",
+//         width: 155,
+//       },
+//     },
+//     {
+//       attrs: {
+//         label: "交易类型",
+//         prop: "type",
+//         width: 80,
+//       },
+//       render(type) {
+//         return proxy.dictValueLabel(type, transactionType.value);
+//       },
+//     },
+//     {
+//       attrs: {
+//         label: "交易金额",
+//         prop: "amount",
+//         slot: "amount",
+//         width: 130,
+//       },
+//     },
+//     {
+//       attrs: {
+//         label: "摘要",
+//         prop: "remarks",
+//       },
+//     },
+//     {
+//       attrs: {
+//         label: "资金账户",
+//         prop: "accountManagementName",
+//         slot: "accountManagementName",
+//       },
+//     },
+//     {
+//       attrs: {
+//         label: "对方账户",
+//         prop: "name",
+//         width: 120,
+//       },
+//     },
+//   ];
+// });
 const config = computed(() => {
   return [
     {
       attrs: {
-        label: "交易时间",
-        prop: "createTime",
-        width: 155,
+        label: "产品图片",
+        slot: "pic",
+        width: 80,
       },
     },
+    // {
+    //   attrs: {
+    //     label: "设计图",
+    //     slot: "picOne",
+    //     width: 80,
+    //   },
+    // },
     {
       attrs: {
-        label: "交易类型",
-        prop: "type",
-        width: 80,
+        label: "产品编码",
+        prop: "productCode",
+        width: 130,
       },
-      render(type) {
-        return proxy.dictValueLabel(type, transactionType.value);
+    },
+    {
+      attrs: {
+        label: "产品名称",
+        prop: "productName",
+        "min-width": 150,
       },
     },
     {
       attrs: {
-        label: "交易金额",
-        prop: "amount",
-        slot: "amount",
-        width: 130,
+        label: "规格尺寸(cm)",
+        slot: "size",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "产品颜色",
+        prop: "productColor",
+        width: 160,
       },
     },
     {
       attrs: {
-        label: "摘要",
-        prop: "remarks",
+        label: "生产件数",
+        prop: "quantity",
+        width: 100,
       },
     },
     {
       attrs: {
-        label: "资金账户",
-        prop: "accountManagementName",
-        slot: "accountManagementName",
+        label: "完成进度",
+        slot: "progress",
+        width: 90,
       },
     },
     {
       attrs: {
-        label: "对方账户",
-        prop: "name",
-        width: 120,
+        label: "已完成",
+        prop: "finishQuantity",
+        width: 100,
+      },
+    },
+    {
+      attrs: {
+        label: "未完成",
+        prop: "incomplete",
+        width: 100,
       },
     },
   ];
@@ -233,6 +330,7 @@ const pushProcessApproval = (row) => {
 //   });
 //   window.open(page.href, "_blank");
 // };
+let first = true;
 
 const handleChange = (val) => {
   if (["first", "second"].includes(val)) {
@@ -246,6 +344,28 @@ const handleChange = (val) => {
       handleItemClick(leftList.value[0]);
     }
   }
+  if (val === "third" && first) {
+    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",
+        });
+      });
+  }
 };
 const getDetailsData = (id) => {
   proxy.post("/contract/getVersionList", { id: id }).then((res) => {
@@ -261,13 +381,13 @@ const getDetailsData = (id) => {
       purchaseDataList.value = res;
     });
 
-  proxy
-    .post("/contract/getAccountRunningWaterByContractId", {
-      id: id,
-    })
-    .then((res) => {
-      tableData.value = res;
-    });
+  // proxy
+  //   .post("/contract/getAccountRunningWaterByContractId", {
+  //     id: id,
+  //   })
+  //   .then((res) => {
+  //     tableData.value = res;
+  //   });
 };
 if (props.contractId) {
   getDetailsData(props.contractId);

+ 24 - 19
src/components/process/SF/Contract.vue

@@ -826,7 +826,7 @@ const formConfig = computed(() => {
     },
     {
       type: "title",
-      title: "款信息",
+      title: "款信息",
       haveLine: true,
     },
     // {
@@ -889,7 +889,7 @@ const formConfig = computed(() => {
     },
     {
       type: "select",
-      prop: "rr",
+      prop: "settlementMethod",
       label: "客户结算方式",
       data: settlementWay.value,
       itemWidth: 25,
@@ -935,7 +935,7 @@ const formConfig = computed(() => {
     {
       type: "select",
       prop: "shroffAccountId",
-      label: "款账号",
+      label: "款账号",
       data: accountList.value,
       itemWidth: 50,
       fn: (val) => {
@@ -1167,16 +1167,16 @@ const formConfig = computed(() => {
       slotName: "commodity",
       label: "",
     },
-    {
-      type: "title",
-      title: "其他收费项目",
-      haveLine: true,
-    },
-    {
-      type: "slot",
-      slotName: "otherCharge",
-      label: "",
-    },
+    // {
+    //   type: "title",
+    //   title: "其他收费项目",
+    //   haveLine: true,
+    // },
+    // {
+    //   type: "slot",
+    //   slotName: "otherCharge",
+    //   label: "",
+    // },
     {
       type: "title",
       title: "订单总金额",
@@ -1292,6 +1292,9 @@ const rules = ref({
     { required: true, message: "请输入收费项目", trigger: ["change", "blur"] },
   ],
   currency: [{ required: true, message: "请选择币种", trigger: "change" }],
+  settlementMethod: [
+    { required: true, message: "请选择客户结算方式", trigger: "change" },
+  ],
   paymentMethod: [
     { required: true, message: "请选择付款方式", trigger: "change" },
   ],
@@ -1489,14 +1492,16 @@ const changeCustomer = (val) => {
     proxy.post("/customer/detail", { id: val }).then(
       (res) => {
         formData.data.buyCorporationName = res.name;
+        formData.data.settlementMethod = res.settlementMode;
         if (res.customerUserList && res.customerUserList.length > 0) {
           formData.data.buyContactName = res.customerUserList[0].name;
-          if (res.customerUserList[0].contactJson) {
-            let contactJson = JSON.parse(res.customerUserList[0].contactJson);
-            if (contactJson && contactJson.length > 0) {
-              formData.data.buyContactNumber = contactJson[0].contactNo;
-            }
-          }
+          formData.data.buyContactNumber = res.customerUserList[0].phone;
+          // if (res.customerUserList[0].contactJson) {
+          //   let contactJson = JSON.parse(res.customerUserList[0].contactJson);
+          //   if (contactJson && contactJson.length > 0) {
+          //     formData.data.buyContactNumber = contactJson[0].contactNo;
+          //   }
+          // }
           customerUserList.value = res.customerUserList.map((item) => {
             return {
               ...item,

+ 73 - 25
src/components/process/SF/ContractChange.vue

@@ -529,6 +529,15 @@
           <Editor :value="formData.data.templateContent" @updateValue="updateContent" :readOnly="judgeStatus()" ref="remarkEditor" />
         </div>
       </template>
+
+      <template #contractFileList>
+        <div style="width: 100%">
+          <div v-for="(file, index) in formData.data.contractFileList" :key="index">
+            <span class="el-click" @click="openImg(file.fileUrl)">{{ file.fileName }}</span>
+          </div>
+        </div>
+      </template>
+
     </byForm>
 
     <el-dialog v-if="openProductCompany" v-model="openProductCompany" title="产品库" width="90%" append-to-body>
@@ -817,7 +826,7 @@ const formConfig = computed(() => {
     },
     {
       type: "title",
-      title: "款信息",
+      title: "款信息",
       haveLine: true,
     },
     // {
@@ -878,13 +887,13 @@ const formConfig = computed(() => {
       ],
       itemWidth: 25,
     },
-    // {
-    //   type: "select",
-    //   prop: "rr",
-    //   label: "结算方式",
-    //   data: settlementWay.value,
-    //   itemWidth: 25,
-    // },
+    {
+      type: "select",
+      prop: "settlementMethod",
+      label: "客户结算方式",
+      data: settlementWay.value,
+      itemWidth: 25,
+    },
     {
       type: "select",
       prop: "paymentMethod",
@@ -926,7 +935,7 @@ const formConfig = computed(() => {
     {
       type: "select",
       prop: "shroffAccountId",
-      label: "款账号",
+      label: "款账号",
       data: accountList.value,
       itemWidth: 50,
       fn: (val) => {
@@ -1158,16 +1167,16 @@ const formConfig = computed(() => {
       slotName: "commodity",
       label: "",
     },
-    {
-      type: "title",
-      title: "其他收费项目",
-      haveLine: true,
-    },
-    {
-      type: "slot",
-      slotName: "otherCharge",
-      label: "",
-    },
+    // {
+    //   type: "title",
+    //   title: "其他收费项目",
+    //   haveLine: true,
+    // },
+    // {
+    //   type: "slot",
+    //   slotName: "otherCharge",
+    //   label: "",
+    // },
     {
       type: "title",
       title: "订单总金额",
@@ -1220,6 +1229,21 @@ const formConfig = computed(() => {
       itemWidth: 100,
       disabled: false,
     },
+    {
+      type: "title",
+      title: "合同上传",
+      haveLine: true,
+      isShow:
+        route.query.processType == 20 || props.queryData.processType == 20,
+    },
+    {
+      type: "slot",
+      slotName: "contractFileList",
+      prop: "contractFileList",
+      label: "合同上传",
+      isShow:
+        route.query.processType == 20 || props.queryData.processType == 20,
+    },
   ];
 });
 
@@ -1268,6 +1292,9 @@ const rules = ref({
     { required: true, message: "请输入收费项目", trigger: ["change", "blur"] },
   ],
   currency: [{ required: true, message: "请选择币种", trigger: "change" }],
+  settlementMethod: [
+    { required: true, message: "请选择客户结算方式", trigger: "change" },
+  ],
   paymentMethod: [
     { required: true, message: "请选择付款方式", trigger: "change" },
   ],
@@ -1465,14 +1492,16 @@ const changeCustomer = (val) => {
     proxy.post("/customer/detail", { id: val }).then(
       (res) => {
         formData.data.buyCorporationName = res.name;
+        formData.data.settlementMethod = res.settlementMode;
         if (res.customerUserList && res.customerUserList.length > 0) {
           formData.data.buyContactName = res.customerUserList[0].name;
-          if (res.customerUserList[0].contactJson) {
-            let contactJson = JSON.parse(res.customerUserList[0].contactJson);
-            if (contactJson && contactJson.length > 0) {
-              formData.data.buyContactNumber = contactJson[0].contactNo;
-            }
-          }
+          formData.data.buyContactNumber = res.customerUserList[0].phone;
+          // if (res.customerUserList[0].contactJson) {
+          //   let contactJson = JSON.parse(res.customerUserList[0].contactJson);
+          //   if (contactJson && contactJson.length > 0) {
+          //     formData.data.buyContactNumber = contactJson[0].contactNo;
+          //   }
+          // }
           customerUserList.value = res.customerUserList.map((item) => {
             return {
               ...item,
@@ -2058,6 +2087,25 @@ const getAllData = (businessId) => {
     formData.data.isFreight = formData.data.isFreight + "";
     formData.data.isTax = formData.data.isTax + "";
     remarkEditor.value.changeHtml(formData.data.templateContent);
+    // 外层附件回显
+    proxy
+      .post("/fileInfo/getList", { businessIdList: [businessId] })
+      .then((fileObj) => {
+        if (fileObj[businessId] && fileObj[businessId].length > 0) {
+          formData.data.contractFileList = fileObj[businessId]
+            .filter((x) => x.businessType == "10")
+            .map((item) => {
+              return {
+                ...item,
+                name: item.fileName,
+                url: item.fileUrl,
+              };
+            });
+        } else {
+          formData.data.contractFileList = [];
+        }
+      });
+
     if (
       formData.data.contractProductList &&
       formData.data.contractProductList.length > 0

+ 2 - 2
src/components/process/SF/SalesOutBound.vue

@@ -29,8 +29,8 @@
             <el-table-column prop="productUnit" label="单位" width="100" />
             <el-table-column label="订单数量" width="100" prop="orderQuantity" />
             <el-table-column label="单价" width="100" prop="price" />
-            <el-table-column label="已出库数量" width="100" prop="saleOutboundQuantity" fixed="right" />
-            <el-table-column prop="quantity" label="出库数量" width="140" fixed="right">
+            <el-table-column label="已发货数量" width="100" prop="saleOutboundQuantity" fixed="right" />
+            <el-table-column prop="quantity" label="发货数量" width="140" fixed="right">
               <template #default="{ row, $index }">
                 <el-form-item :prop="'outboundRecordList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true" class="margin-b-0">
                   <el-input-number onmousewheel="return false;" v-model="row.quantity" placeholder="请输入" style="width: 100%" :precision="0"

+ 92 - 73
src/views/EHSD/saleContract/collectionClaim/index.vue

@@ -6,15 +6,18 @@
               
         ]" @get-list="getList">
 
-        <template #name="{ item }">
-          <div>
-            <span class="el-click">{{ item.name }}</span>
+        <template #contract="{ item }">
+          <div style="width:100%">
+            <div v-for="row in item.claimContractList" :key="row.contractId">
+              {{row.contractCode}}
+              <span style="color:#409eff">({{moneyFormat(row.money,2)}})</span>
+            </div>
           </div>
         </template>
 
       </byTable>
     </div>
-    <el-dialog :title="modalType == 'add' ? '订单回款认' : '编辑客户联系人'" v-model="dialogVisible" width="50%" destroy-on-close>
+    <el-dialog :title="modalType == 'add' ? '订单回款认' : '编辑客户联系人'" v-model="dialogVisible" width="50%" destroy-on-close>
       <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="formDom" v-loading="submitLoading">
         <template #rawMaterialIdSlot>
           <div style="width:100%;display:flex">
@@ -69,11 +72,11 @@ const userList = ref([]);
 const deptData = ref([]);
 const claimStatus = ref([
   {
-    label: "未认",
+    label: "未认",
     value: "0",
   },
   {
-    label: "已认",
+    label: "已认",
     value: "1",
   },
 ]);
@@ -81,8 +84,8 @@ const dialogVisible = ref(false);
 const modalType = ref("add");
 const selectConfig = computed(() => [
   {
-    label: "出纳认领",
-    prop: "type",
+    label: "确认状态",
+    prop: "isClaim",
     data: claimStatus.value,
   },
   {
@@ -99,89 +102,121 @@ const config = computed(() => {
     {
       attrs: {
         label: "业务公司",
-        prop: "code",
+        prop: "companyName",
+        width: 100,
+        fixed: "left",
       },
     },
     {
       attrs: {
         label: "业务部门",
-        prop: "name",
+        prop: "deptName",
+        width: 100,
+        fixed: "left",
       },
     },
     {
       attrs: {
         label: "发起人",
-        prop: "deptName",
+        prop: "registerUserName",
+        width: 100,
+        fixed: "left",
+      },
+    },
+    {
+      attrs: {
+        label: "回款金额",
+        prop: "amount",
+        width: 100,
+        fixed: "left",
+      },
+      render(val) {
+        return proxy.moneyFormat(val, 2);
       },
     },
     {
       attrs: {
-        label: "交易金额",
-        prop: "ssa",
+        label: "关联合同",
+        slot: "contract",
+        width: 200,
+        fixed: "left",
       },
     },
     {
       attrs: {
         label: "交易日期",
-        prop: "deptName",
+        prop: "transactionTime",
+        width: 100,
       },
     },
     {
       attrs: {
         label: "交易流水号",
-        prop: "deptName",
+        prop: "serialNumber",
+        width: 150,
       },
     },
 
     {
       attrs: {
         label: "交易摘要",
-        prop: "deptName",
+        prop: "remarks",
+        "min-width": 200,
       },
     },
     {
       attrs: {
         label: "付款人",
-        prop: "deptName",
+        prop: "name",
+        width: 100,
       },
     },
     {
       attrs: {
         label: "付款账号",
-        prop: "deptName",
+        prop: "accountOpening",
+        width: 200,
       },
     },
     {
       attrs: {
         label: "付款开户行",
-        prop: "deptName",
+        prop: "openingBank",
+        width: 100,
       },
     },
     {
       attrs: {
         label: "收款人",
-        prop: "deptName",
+        prop: "myAccountName",
+        width: 100,
       },
     },
     {
       attrs: {
         label: "收款账号",
-        prop: "deptName",
+        prop: "myAccountOpening",
+        width: 200,
       },
     },
     {
       attrs: {
         label: "收款开户行",
-        prop: "deptName",
+        prop: "myOpeningBank",
+        width: 100,
       },
     },
     {
       attrs: {
-        label: "出纳认领",
-        prop: "deptName",
+        label: "确认状态",
+        prop: "isClaim",
+        width: 80,
+        fixed: "right",
+      },
+      render(val) {
+        return proxy.dictValueLabel(val, claimStatus.value);
       },
     },
-
     {
       attrs: {
         label: "操作",
@@ -191,45 +226,25 @@ const config = computed(() => {
       },
       renderHTML(row) {
         return [
-          {
-            attrs: {
-              label: "认领",
-              type: "primary",
-              text: true,
-            },
-            el: "button",
-            click() {
-              getDtl(row);
-            },
-          },
-          // {
-          //   attrs: {
-          //     label: "删除",
-          //     type: "danger",
-          //     text: true,
-          //   },
-          //   el: "button",
-          //   click() {
-          //     proxy
-          //       .msgConfirm()
-          //       .then((res) => {
-          //         proxy
-          //           .post("/shopInfo/delete", {
-          //             id: row.id,
-          //           })
-          //           .then((res) => {
-          //             proxy.msgTip("删除成功", 1);
-          //             getList();
-          //           });
-          //       })
-          //       .catch((err) => {});
-          //   },
-          // },
+          row.isClaim == "0"
+            ? {
+                attrs: {
+                  label: "确认",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  getDtl(row);
+                },
+              }
+            : {},
         ];
       },
     },
   ];
 });
+
 const formData = reactive({
   data: {},
 });
@@ -245,34 +260,37 @@ const formConfig = computed(() => {
       type: "upload",
       listType: "text",
       accept: "",
-      prop: "licenseFileList",
+      prop: "fileList",
       label: "凭证上传",
     },
     {
       type: "input",
       itemType: "textarea",
-      prop: "name",
+      prop: "confirmRemark",
       label: "备注",
       itemWidth: 100,
     },
   ];
 });
 const rules = ref({
-  deptId: [{ required: true, message: "请选择负责部门", trigger: "change" }],
-  name: [{ required: true, message: "请输入店铺名称", trigger: "blur" }],
-  code: [{ required: true, message: "请输入店铺编号", trigger: "blur" }],
+  fileList: [{ required: true, message: "请上传凭证", trigger: "blur" }],
+  confirmRemark: [
+    { required: true, message: "请输入关联金额", trigger: "blur" },
+  ],
 });
 
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
-  proxy.post("/shopInfo/page", sourceList.value.pagination).then((res) => {
-    sourceList.value.data = res.rows;
-    sourceList.value.pagination.total = res.total;
-    setTimeout(() => {
-      loading.value = false;
-    }, 200);
-  });
+  proxy
+    .post("/claim/claimInfoConfirmPage", sourceList.value.pagination)
+    .then((res) => {
+      sourceList.value.data = res.rows;
+      sourceList.value.pagination.total = res.total;
+      setTimeout(() => {
+        loading.value = false;
+      }, 200);
+    });
 };
 
 const openModal = () => {
@@ -321,7 +339,7 @@ const getDeptData = (val) => {
 const submitForm = () => {
   formDom.value.handleSubmit((valid) => {
     submitLoading.value = true;
-    proxy.post("/shopInfo/" + modalType.value, formData.data).then(
+    proxy.post("/claim/claimConfirm", formData.data).then(
       (res) => {
         proxy.msgTip("操作成功", 1);
         dialogVisible.value = false;
@@ -353,8 +371,9 @@ getDict();
 const getDtl = (row) => {
   modalType.value = "add";
   formData.data = {
+    id: row.id,
     fileList: [],
-    remake: "",
+    confirmRemark: "",
   };
   dialogVisible.value = true;
 };

+ 262 - 93
src/views/EHSD/saleContract/collectionRegistration/index.vue

@@ -10,9 +10,12 @@
               },
         ]" @get-list="getList">
 
-        <template #name="{ item }">
-          <div>
-            <span class="el-click">{{ item.name }}</span>
+        <template #contract="{ item }">
+          <div style="width:100%">
+            <div v-for="row in item.claimContractList" :key="row.contractId">
+              {{row.contractCode}}
+              <span style="color:#409eff">({{moneyFormat(row.money,2)}})</span>
+            </div>
           </div>
         </template>
 
@@ -30,6 +33,34 @@
             <el-button type="primary" style="width:88px;margin-left:15px" @click="openSelectCustomer = true" plain>选择</el-button>
           </div>
         </template>
+
+        <template #detail>
+          <div style="width: 100%;padding:0 20px">
+            <el-button type="primary" style="margin-bottom: 16px" @click="openSelectCustomer = true">选择合同</el-button>
+            <el-table :data="formData.data.claimContractList">
+              <el-table-column prop="contractCode" label="合同编码" />
+              <el-table-column label="合同金额">
+                <template #default="{ row, $index }">
+                  {{ row.currency }}{{ moneyFormat(row.contractTotal, 2) }}
+                </template>
+              </el-table-column>
+              <el-table-column prop="sumContractNotClaimMoney" label="未结清金额" />
+              <el-table-column prop="money" label="关联金额" width="150">
+                <template #default="{ row, $index }">
+                  <el-form-item :prop="'claimContractList.' + $index + '.money'" :rules="rules.money" :inline-message="true"
+                                class="margin-b-0 wid100">
+                    <el-input-number v-model="row.money" :precision="2" :controls="false" :min="0" onmousewheel="return false;" />
+                  </el-form-item>
+                </template>
+              </el-table-column>
+              <el-table-column prop="zip" label="操作" width="60" align="center">
+                <template #default="{ $index }">
+                  <el-button type="primary" link @click="handleRemove($index)">删除</el-button>
+                </template>
+              </el-table-column>
+            </el-table>
+          </div>
+        </template>
       </byForm>
       <template #footer>
         <el-button @click="dialogVisible = false" size="defualt" v-debounce>取 消</el-button>
@@ -39,13 +70,8 @@
       </template>
     </el-dialog>
 
-    <el-dialog v-model="openSelectCustomer" title="选择客户" width="80%" append-to-body>
-      <SelectCustomer @selectCustomer="selectCustomer" :isSelect="true"></SelectCustomer>
-      <template #footer>
-        <span class="dialog-footer">
-          <el-button @click="openSelectCustomer = false">取消</el-button>
-        </span>
-      </template>
+    <el-dialog title="合同选择" v-if="openSelectCustomer" v-model="openSelectCustomer" width="80%" v-loading="loading" destroy-on-close>
+      <ContractSelect @handleSelectContrct="handleSelectContrct"></ContractSelect>
     </el-dialog>
   </div>
 </template>
@@ -53,7 +79,7 @@
 <script setup>
 import byTable from "@/components/byTable/index";
 import byForm from "@/components/byForm/index";
-import SelectCustomer from "@/views/customer/file/index";
+import ContractSelect from "@/views/salesMange/saleContract/contractSelect/index";
 
 const { proxy } = getCurrentInstance();
 const loading = ref(false);
@@ -66,18 +92,22 @@ const sourceList = ref({
     pageNum: 1,
     pageSize: 10,
     keyword: "",
+    isClaim: "",
+    beginTime: "",
+    endTime: "",
   },
 });
 const treeData = ref([]);
+const accountList = ref([]);
 const userList = ref([]);
 const deptData = ref([]);
 const claimStatus = ref([
   {
-    label: "未认",
+    label: "未认",
     value: "0",
   },
   {
-    label: "已认",
+    label: "已认",
     value: "1",
   },
 ]);
@@ -85,8 +115,8 @@ const dialogVisible = ref(false);
 const modalType = ref("add");
 const selectConfig = computed(() => [
   {
-    label: "出纳认领",
-    prop: "type",
+    label: "确认状态",
+    prop: "isClaim",
     data: claimStatus.value,
   },
   {
@@ -103,89 +133,121 @@ const config = computed(() => {
     {
       attrs: {
         label: "业务公司",
-        prop: "code",
+        prop: "companyName",
+        width: 100,
+        fixed: "left",
       },
     },
     {
       attrs: {
         label: "业务部门",
-        prop: "name",
+        prop: "deptName",
+        width: 100,
+        fixed: "left",
       },
     },
     {
       attrs: {
         label: "发起人",
-        prop: "deptName",
+        prop: "registerUserName",
+        width: 100,
+        fixed: "left",
       },
     },
     {
       attrs: {
-        label: "交易金额",
-        prop: "ssa",
+        label: "回款金额",
+        prop: "amount",
+        width: 100,
+        fixed: "left",
+      },
+      render(val) {
+        return proxy.moneyFormat(val, 2);
+      },
+    },
+    {
+      attrs: {
+        label: "关联合同",
+        slot: "contract",
+        width: 200,
+        fixed: "left",
       },
     },
     {
       attrs: {
         label: "交易日期",
-        prop: "deptName",
+        prop: "transactionTime",
+        width: 100,
       },
     },
     {
       attrs: {
         label: "交易流水号",
-        prop: "deptName",
+        prop: "serialNumber",
+        width: 150,
       },
     },
 
     {
       attrs: {
         label: "交易摘要",
-        prop: "deptName",
+        prop: "remarks",
+        "min-width": 200,
       },
     },
     {
       attrs: {
         label: "付款人",
-        prop: "deptName",
+        prop: "name",
+        width: 100,
       },
     },
     {
       attrs: {
         label: "付款账号",
-        prop: "deptName",
+        prop: "accountOpening",
+        width: 200,
       },
     },
     {
       attrs: {
         label: "付款开户行",
-        prop: "deptName",
+        prop: "openingBank",
+        width: 100,
       },
     },
     {
       attrs: {
         label: "收款人",
-        prop: "deptName",
+        prop: "myAccountName",
+        width: 100,
       },
     },
     {
       attrs: {
         label: "收款账号",
-        prop: "deptName",
+        prop: "myAccountOpening",
+        width: 200,
       },
     },
     {
       attrs: {
         label: "收款开户行",
-        prop: "deptName",
+        prop: "myOpeningBank",
+        width: 100,
       },
     },
     {
       attrs: {
-        label: "出纳认领",
-        prop: "deptName",
+        label: "确认状态",
+        prop: "isClaim",
+        width: 80,
+        fixed: "right",
+      },
+      render(val) {
+        return proxy.dictValueLabel(val, claimStatus.value);
       },
     },
-
     {
       attrs: {
         label: "操作",
@@ -206,29 +268,31 @@ const config = computed(() => {
           //     getDtl(row);
           //   },
           // },
-          {
-            attrs: {
-              label: "删除",
-              type: "danger",
-              text: true,
-            },
-            el: "button",
-            click() {
-              proxy
-                .msgConfirm()
-                .then((res) => {
+          row.isClaim == "0"
+            ? {
+                attrs: {
+                  label: "删除",
+                  type: "danger",
+                  text: true,
+                },
+                el: "button",
+                click() {
                   proxy
-                    .post("/shopInfo/delete", {
-                      id: row.id,
-                    })
+                    .msgConfirm()
                     .then((res) => {
-                      proxy.msgTip("删除成功", 1);
-                      getList();
-                    });
-                })
-                .catch((err) => {});
-            },
-          },
+                      proxy
+                        .post("/accountRunningWater/delete", {
+                          id: row.id,
+                        })
+                        .then((res) => {
+                          proxy.msgTip("删除成功", 1);
+                          getList();
+                        });
+                    })
+                    .catch((err) => {});
+                },
+              }
+            : {},
         ];
       },
     },
@@ -274,7 +338,7 @@ const formConfig = computed(() => {
     },
     {
       type: "select",
-      prop: "devUserId",
+      prop: "registerUserId",
       label: "发起人",
       disabled: true,
       filterable: true,
@@ -283,35 +347,44 @@ const formConfig = computed(() => {
     },
     {
       type: "number",
-      prop: "netWeight",
-      label: "交易金额",
+      prop: "amount",
+      label: "回款金额",
       precision: 2,
-      min: 0,
+      min: 0.01,
       controls: false,
       itemWidth: 33.33,
     },
     {
       type: "date",
       itemType: "date",
-      prop: "name",
+      prop: "transactionTime",
       label: "交易日期",
       itemWidth: 33.33,
     },
     {
       type: "input",
-      prop: "name",
+      prop: "serialNumber",
       label: "交易流水号",
       itemWidth: 33.33,
     },
     {
       type: "input",
       itemType: "textarea",
-      prop: "name",
+      prop: "remarks",
       label: "交易摘要",
       itemWidth: 100,
     },
     {
       type: "title1",
+      title: "关联合同",
+    },
+    {
+      type: "slot",
+      slotName: "detail",
+      label: "",
+    },
+    {
+      type: "title1",
       title: "付款信息",
     },
     {
@@ -322,13 +395,13 @@ const formConfig = computed(() => {
     },
     {
       type: "input",
-      prop: "name",
+      prop: "accountOpening",
       label: "付款账号",
       itemWidth: 33.33,
     },
     {
       type: "input",
-      prop: "name",
+      prop: "openingBank",
       label: "付款开户行",
       itemWidth: 33.33,
     },
@@ -337,20 +410,30 @@ const formConfig = computed(() => {
       title: "收款信息",
     },
     {
+      type: "select",
+      prop: "accountManagementId",
+      label: "收款账号",
+      data: accountList.value,
+      itemWidth: 100,
+      fn: (val) => {
+        changeShroffAccount(val);
+      },
+    },
+    {
       type: "input",
-      prop: "name",
+      prop: "myAccountName",
       label: "收款人",
       itemWidth: 33.33,
     },
     {
       type: "input",
-      prop: "name",
+      prop: "myAccountOpening",
       label: "收款账号",
       itemWidth: 33.33,
     },
     {
       type: "input",
-      prop: "name",
+      prop: "myOpeningBank",
       label: "收款开户行",
       itemWidth: 33.33,
     },
@@ -362,27 +445,54 @@ const formConfig = computed(() => {
       type: "upload",
       listType: "text",
       accept: "",
-      prop: "licenseFileList",
+      prop: "fileList",
       label: "凭证上传",
     },
   ];
 });
 const rules = ref({
-  deptId: [{ required: true, message: "请选择负责部门", trigger: "change" }],
-  name: [{ required: true, message: "请输入店铺名称", trigger: "blur" }],
-  code: [{ required: true, message: "请输入店铺编号", trigger: "blur" }],
+  // deptId: [{ required: true, message: "请选择负责部门", trigger: "change" }],
+  amount: [{ required: true, message: "请输入回款金额", trigger: "blur" }],
+  transactionTime: [
+    { required: true, message: "请选择交易日期", trigger: "change" },
+  ],
+  serialNumber: [
+    { required: true, message: "请输入交易流水号", trigger: "blur" },
+  ],
+  remarks: [{ required: true, message: "请输入交易摘要", trigger: "blur" }],
+  name: [{ required: true, message: "请输入付款人", trigger: "blur" }],
+  accountOpening: [
+    { required: true, message: "请输入付款账号", trigger: "blur" },
+  ],
+  openingBank: [
+    { required: true, message: "请输入付款开户行", trigger: "blur" },
+  ],
+  accountManagementId: [
+    { required: true, message: "请选择收款账号", trigger: "change" },
+  ],
+  myAccountName: [{ required: true, message: "请输入收款人", trigger: "blur" }],
+  myAccountOpening: [
+    { required: true, message: "请输入收款账号", trigger: "blur" },
+  ],
+  myOpeningBank: [
+    { required: true, message: "请输入收款开户行", trigger: "blur" },
+  ],
+  fileList: [{ required: true, message: "请上传凭证", trigger: "blur" }],
+  money: [{ required: true, message: "请输入关联金额", trigger: "blur" }],
 });
 
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
-  proxy.post("/shopInfo/page", sourceList.value.pagination).then((res) => {
-    sourceList.value.data = res.rows;
-    sourceList.value.pagination.total = res.total;
-    setTimeout(() => {
-      loading.value = false;
-    }, 200);
-  });
+  proxy
+    .post("/claim/claimInfoConfirmPage", sourceList.value.pagination)
+    .then((res) => {
+      sourceList.value.data = res.rows;
+      sourceList.value.pagination.total = res.total;
+      setTimeout(() => {
+        loading.value = false;
+      }, 200);
+    });
 };
 
 const openModal = () => {
@@ -391,8 +501,9 @@ const openModal = () => {
   formData.data = {
     companyId: proxy.useUserStore().user.companyId,
     deptId: proxy.useUserStore().user.dept.deptId,
-    devUserId: proxy.useUserStore().user.userId,
+    registerUserId: proxy.useUserStore().user.userId,
     fileList: [],
+    claimContractList: [],
   };
   getDeptData(formData.data.companyId);
 };
@@ -428,20 +539,53 @@ const getDeptData = (val) => {
     });
 };
 
+const changeShroffAccount = (val) => {
+  if (val) {
+    let data = accountList.value.find((item) => item.value == val);
+    if (data) {
+      formData.data.myAccountName = data.name;
+      formData.data.myOpeningBank = data.openingBank;
+      formData.data.myAccountOpening = data.accountOpening;
+    }
+  }
+};
+
 const submitForm = () => {
   formDom.value.handleSubmit((valid) => {
-    submitLoading.value = true;
-    proxy.post("/shopInfo/" + modalType.value, formData.data).then(
-      (res) => {
-        proxy.msgTip("操作成功", 1);
-        dialogVisible.value = false;
-        submitLoading.value = false;
-        getList();
-      },
-      (err) => {
-        submitLoading.value = false;
+    if (
+      formData.data.claimContractList &&
+      formData.data.claimContractList.length > 0
+    ) {
+      for (let i = 0; i < formData.data.claimContractList.length; i++) {
+        const ele = formData.data.claimContractList[i];
+        if (!(ele.money > 0)) {
+          return proxy.msgTip("关联金额不能为0", 2);
+        }
+      }
+      const total = formData.data.claimContractList.reduce(
+        (total, x) => (total += Number(x.money)),
+        0
+      );
+      if (
+        Number(parseFloat(total).toFixed(2)) != Number(formData.data.amount)
+      ) {
+        return proxy.msgTip("关联金额总合必须等于回款金额", 2);
       }
-    );
+      submitLoading.value = true;
+      proxy.post("/claim/addClaimInfo", formData.data).then(
+        (res) => {
+          proxy.msgTip("操作成功", 1);
+          dialogVisible.value = false;
+          submitLoading.value = false;
+          getList();
+        },
+        (err) => {
+          submitLoading.value = false;
+        }
+      );
+    } else {
+      return proxy.msgTip("请关联合同");
+    }
   });
 };
 
@@ -457,6 +601,18 @@ const getDict = () => {
     .then((res) => {
       treeData.value = proxy.handleTree(res.data, "deptId");
     });
+
+  proxy
+    .post("/accountManagement/page", { pageNum: 1, pageSize: 999 })
+    .then((res) => {
+      accountList.value = res.rows.map((item) => {
+        return {
+          ...item,
+          label: item.alias,
+          value: item.id,
+        };
+      });
+    });
 };
 getDict();
 
@@ -470,11 +626,24 @@ const getDtl = (row) => {
 
 getList();
 
-const selectCustomer = (row) => {
-  formData.data.customerId = row.id;
-  formData.data.customerIdLabel = row.name;
-  openSelectCustomer.value = false;
-  proxy.msgTip("选择成功");
+const handleSelectContrct = (row) => {
+  const flag = formData.data.claimContractList.some(
+    (x) => x.contractId === row.id
+  );
+  if (flag) return proxy.msgTip("该合同已选择", 2);
+  formData.data.claimContractList.push({
+    contractId: row.id,
+    contractCode: row.code,
+    money: null,
+    contractTotal: row.amount,
+    sumContractNotClaimMoney: row.unsettledAmount,
+  });
+  return proxy.msgTip("选择成功", 1);
+};
+
+const handleRemove = (index) => {
+  formData.data.claimContractList.splice(index, 1);
+  return proxy.msgTip("删除成功", 1);
 };
 </script>
 

+ 86 - 28
src/views/EHSD/saleContract/contractEHSD/index.vue

@@ -69,14 +69,16 @@
                   <div>产品尺寸:{{i.productLength}}cm*{{i.productWidth}}cm*{{i.productHeight}}cm</div>
                   <div>产品颜色:{{i.productColor}}</div>
                   <div>产品数量:{{i.quantity}}</div>
+                  <div>生产完成数量:{{i.finishQuantity}}</div>
                 </div>
               </div>
               <template #reference>
-                <div style="display:flex;height:65px;position:relative;top:15px">
+                <div style="display:flex;height:70px;position:relative;top:20px">
                   <div v-for="(product,index) in item.contractProductList" :key="product.id" style="margin-right:10px;position:relative;">
-                    <el-badge :value="product.quantity" :min="0" :max="999999" v-if="index<3">
-                      <img :src="product.productImgUrl" class="pic" @click="handleClickFile(product.productImgUrl)">
-                    </el-badge>
+                    <!-- <el-badge :value="product.quantity" :min="0" :max="999999" v-if="index<3"> -->
+                    <div class="badge">{{product.quantity}}/{{product.finishQuantity||0}}</div>
+                    <img :src="product.productImgUrl" class="pic" @click="handleClickFile(product.productImgUrl)">
+                    <!-- </el-badge> -->
                     <div v-if="index==3" class="more">
                       共{{item.contractProductList.length}}款
                     </div>
@@ -313,9 +315,9 @@
       </template>
     </el-dialog>
 
-    <el-dialog :title="'销售出库'" v-model="salesOutBoundDialog" width="80%" destroy-on-close>
+    <el-dialog :title="'发货申请'" v-model="salesOutBoundDialog" width="80%" destroy-on-close>
       <el-tabs v-model="activeName" type="card" class="demo-tabs">
-        <el-tab-pane label="销售出库" name="1">
+        <el-tab-pane label="发货申请" name="1">
         </el-tab-pane>
         <el-tab-pane label="出库记录" name="2">
         </el-tab-pane>
@@ -381,8 +383,8 @@
               <el-table-column prop="productUnit" label="单位" width="100" />
               <el-table-column label="订单数量" width="100" prop="orderQuantity" />
               <el-table-column label="单价" width="100" prop="price" />
-              <el-table-column label="已出库数量" width="100" prop="saleOutboundQuantity" fixed="right" />
-              <el-table-column prop="quantity" label="出库数量" width="140" fixed="right">
+              <el-table-column label="已发货数量" width="100" prop="saleOutboundQuantity" fixed="right" />
+              <el-table-column prop="quantity" label="发货数量" width="140" fixed="right">
                 <template #default="{ row, $index }">
                   <el-form-item :prop="'outboundRecordList.' + $index + '.quantity'" :rules="salesOutBoundRules.quantity" :inline-message="true"
                                 class="margin-b-0">
@@ -423,7 +425,7 @@
                                :formatter="(row) => dictKeyValue(row.productFrontalTexture, frontLinesData)" />
               <el-table-column prop="productNetWeight" label="净重" width="100" />
               <el-table-column prop="productUnit" label="单位" width="100" />
-              <el-table-column label="出库数量" width="100" prop="quantity" fixed="right" />
+              <el-table-column label="发货数量" width="100" prop="quantity" fixed="right" />
               <el-table-column label="备注" min-width="200" prop="remark" />
             </el-table>
           </div>
@@ -534,6 +536,10 @@ const status = ref([
     value: 70,
   },
   {
+    label: "已发货",
+    value: 75,
+  },
+  {
     label: "作废",
     value: 88,
   },
@@ -562,6 +568,17 @@ const contractType = ref([
   },
 ]);
 
+const processingMethod = ref([
+  {
+    dictKey: 10,
+    dictValue: "业务自采",
+  },
+  {
+    dictKey: 20,
+    dictValue: "生产处理",
+  },
+]);
+
 const belongTypeData = ref([
   {
     dictKey: "1",
@@ -718,6 +735,16 @@ const config = computed(() => {
     },
     {
       attrs: {
+        label: "订单处理方式",
+        prop: "processingMethod",
+        width: 110,
+      },
+      render(val) {
+        return proxy.dictKeyValue(val, processingMethod.value);
+      },
+    },
+    {
+      attrs: {
         label: "合同号",
         slot: "code",
         width: 140,
@@ -835,17 +862,31 @@ const config = computed(() => {
     //     width: 180,
     //   },
     // },
+    // {
+    //   attrs: {
+    //     label: "已出库数量",
+    //     slot: "receiptStockQuantity",
+    //     width: 100,
+    //   },
+    // },
+    // {
+    //   attrs: {
+    //     label: "待出库数量",
+    //     prop: "waitStockQuantity",
+    //     width: 100,
+    //   },
+    // },
     {
       attrs: {
-        label: "已出库数量",
-        slot: "receiptStockQuantity",
+        label: "已发货数量",
+        prop: "deliverQuantity",
         width: 100,
       },
     },
     {
       attrs: {
-        label: "待出库数量",
-        prop: "waitStockQuantity",
+        label: "未出货数量",
+        prop: "notDeliverQuantity",
         width: 100,
       },
     },
@@ -992,17 +1033,19 @@ const config = computed(() => {
               }
             : {},
           // row.produceStatus == 1
-          {
-            attrs: {
-              label: "终止生产",
-              type: "danger",
-              text: true,
-            },
-            el: "button",
-            click() {
-              hanleTermination(row);
-            },
-          },
+          row.status == 30
+            ? {
+                attrs: {
+                  label: "终止生产",
+                  type: "danger",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  hanleTermination(row);
+                },
+              }
+            : {},
           route.query.pageType == "1"
             ? {
                 attrs: {
@@ -1020,7 +1063,7 @@ const config = computed(() => {
           row.status == 30
             ? {
                 attrs: {
-                  label: "销售出库",
+                  label: "发货申请",
                   type: "primary",
                   text: true,
                 },
@@ -1082,7 +1125,7 @@ const config = computed(() => {
               }
             : {},
 
-          row.status == 30
+          [30, 70, 75, 99].includes(row.status)
             ? {
                 attrs: {
                   label: "打印",
@@ -1125,7 +1168,7 @@ const config = computed(() => {
                 },
               }
             : {},
-          row.status == 30 && row.isSettled == "0"
+          [30, 70, 75, 99].includes(row.status) && row.isSettled == "0"
             ? {
                 attrs: {
                   label: "结清",
@@ -1179,7 +1222,7 @@ const config = computed(() => {
                 },
               }
             : {},
-          row.status == 30 || row.status == 60 || row.status == 70
+          [30, 70, 75, 99].includes(row.status)
             ? {
                 attrs: {
                   label: "合同上传",
@@ -2379,4 +2422,19 @@ const objectSpanMethod = ({ rowIndex, columnIndex }) => {
   padding: 4px;
   color: #fff;
 }
+.badge {
+  padding: 6px;
+  font-size: 12px;
+  font-weight: 700;
+  color: #fff;
+  background: #f56c6c;
+  border-radius: 10px;
+  height: 18px;
+  line-height: 8px;
+  // margin-left: 2px;
+  // margin-top: -2px;
+  position: absolute;
+  top: -19px;
+  right: 0;
+}
 </style>

+ 332 - 0
src/views/EHSD/saleContract/shipmentRegistration/index.vue

@@ -0,0 +1,332 @@
+<template>
+  <div class="pageIndexClass">
+    <div>
+      <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" highlight-current-row
+               :selectConfig="selectConfig" :action-list="[
+            
+        ]" @get-list="getList">
+        <!-- {
+        text: '添加',
+        action: () => openModal('add'),
+        disabled: false,
+        }, -->
+        <template #name="{ item }">
+          <div>
+            <span class="el-click">{{ item.name }}</span>
+          </div>
+        </template>
+
+      </byTable>
+    </div>
+    <el-dialog :title="modalType == 'add' ? '添加客户联系人' : '装车登记'" v-model="dialogVisible" width="50%" destroy-on-close>
+      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="formDom" v-loading="submitLoading">
+
+      </byForm>
+      <template #footer>
+        <el-button @click="dialogVisible = false" size="defualt" v-debounce>取 消</el-button>
+        <el-button type="primary" @click="submitForm()" size="defualt" v-debounce :loading="submitLoading">
+          确 定
+        </el-button>
+      </template>
+    </el-dialog>
+
+    <el-dialog v-model="openSelectCustomer" title="选择客户" width="80%" append-to-body>
+      <SelectCustomer @selectCustomer="selectCustomer" :isSelect="true"></SelectCustomer>
+      <template #footer>
+        <span class="dialog-footer">
+          <el-button @click="openSelectCustomer = false">取消</el-button>
+        </span>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup>
+import byTable from "@/components/byTable/index";
+import byForm from "@/components/byForm/index";
+// import SelectCustomer from "@/views/customer/file/index";
+
+const { proxy } = getCurrentInstance();
+const loading = ref(false);
+const submitLoading = ref(false);
+const openSelectCustomer = ref(false);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 3,
+    pageNum: 1,
+    pageSize: 10,
+    keyword: "",
+  },
+});
+const userList = ref([]);
+const isKpData = ref([
+  {
+    label: "是",
+    value: "1",
+  },
+  {
+    label: "否",
+    value: "0",
+  },
+]);
+const dialogVisible = ref(false);
+const modalType = ref("add");
+const selectConfig = computed(() => []);
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "订单号",
+        prop: "contractCode",
+        // width: 200,
+      },
+    },
+    {
+      attrs: {
+        label: "申请时间",
+        prop: "createTime",
+        // width: 100,
+      },
+    },
+    {
+      attrs: {
+        label: "申请款数",
+        prop: "modCount",
+        // width: 100,
+      },
+    },
+    {
+      attrs: {
+        label: "申请件数",
+        prop: "sumQuantity",
+        // width: 110,
+      },
+    },
+    {
+      attrs: {
+        label: "出货开单员",
+        prop: "billUserName",
+        // width: 110,
+      },
+    },
+    {
+      attrs: {
+        label: "出货装车日期",
+        prop: "truckDate",
+        // width: 110,
+      },
+    },
+    {
+      attrs: {
+        label: "备注",
+        prop: "truckRemark",
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: "100",
+        align: "center",
+        fixed: "right",
+      },
+      renderHTML(row) {
+        return [
+          row.truckDate == null
+            ? {
+                attrs: {
+                  label: "装车登记",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  getDtl(row);
+                },
+              }
+            : {},
+          // {
+          //   attrs: {
+          //     label: "删除",
+          //     type: "danger",
+          //     text: true,
+          //   },
+          //   el: "button",
+          //   click() {
+          //     proxy
+          //       .msgConfirm()
+          //       .then((res) => {
+          //         proxy
+          //           .post("/customerUser/delete", {
+          //             id: row.id,
+          //           })
+          //           .then((res) => {
+          //             proxy.msgTip("删除成功", 1);
+          //             getList();
+          //           });
+          //       })
+          //       .catch((err) => {});
+          //   },
+          // },
+        ];
+      },
+    },
+  ];
+});
+const formData = reactive({
+  data: {},
+});
+const formOption = reactive({
+  inline: true,
+  labelWidth: 110,
+  itemWidth: 100,
+});
+const formDom = ref(null);
+const formConfig = computed(() => {
+  return [
+    {
+      type: "select",
+      label: "出货开单员",
+      prop: "billUserId",
+      itemWidth: 100,
+      data: userList.value,
+      clearable: false,
+    },
+    {
+      type: "date",
+      itemType: "date",
+      prop: "truckDate",
+      label: "出货装车日期",
+      itemWidth: 100,
+    },
+    {
+      type: "upload",
+      listType: "picture-card",
+      accept: "",
+      prop: "fileList",
+      label: "出货单图片",
+      itemWidth: 100,
+    },
+    {
+      type: "upload",
+      listType: "picture-card",
+      accept: "",
+      prop: "truckFileList",
+      label: "出货装车图片",
+      itemWidth: 100,
+    },
+    {
+      type: "input",
+      prop: "truckRemark",
+      label: "备注",
+      required: true,
+      itemWidth: 100,
+      itemType: "textarea",
+    },
+  ];
+});
+
+const rules = ref({
+  billUserId: [
+    { required: true, message: "请选择出货开单员", trigger: "change" },
+  ],
+  truckDate: [
+    { required: true, message: "请选择出货装车日期", trigger: "change" },
+  ],
+  fileList: [{ required: true, message: "请上传出货单图片", trigger: "blur" }],
+  truckFileList: [
+    { required: true, message: "请上传出货装车图片", trigger: "blur" },
+  ],
+  truckRemark: [{ required: true, message: "请输入备注", trigger: "blur" }],
+});
+
+const getDict = () => {
+  proxy
+    .get("/tenantUser/list", {
+      pageNum: 1,
+      pageSize: 10000,
+      tenantId: proxy.useUserStore().user.tenantId,
+    })
+    .then((res) => {
+      userList.value = res.rows.map((item) => {
+        return {
+          label: item.nickName,
+          value: item.userId,
+        };
+      });
+    });
+};
+getDict();
+
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy
+    .post("/contractOutboundInfo/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 = {};
+};
+
+const submitForm = () => {
+  formDom.value.handleSubmit((valid) => {
+    submitLoading.value = true;
+    proxy.post("/contractOutboundInfo/loadTruck", formData.data).then(
+      (res) => {
+        proxy.msgTip("操作成功", 1);
+        dialogVisible.value = false;
+        submitLoading.value = false;
+        getList();
+      },
+      (err) => {
+        submitLoading.value = false;
+      }
+    );
+  });
+};
+
+const getDtl = (row) => {
+  modalType.value = "edit";
+  formData.data = {
+    id: row.id,
+    billUserId: "",
+    truckDate: "",
+    truckRemark: "",
+    fileList: [],
+    truckFileList: [],
+  };
+  dialogVisible.value = true;
+  // proxy.post("/customerUser/detail", { id: row.id }).then((res) => {
+  //   res.isKp = res.isKp + "";
+  //   formData.data = res;
+  //   dialogVisible.value = true;
+  // });
+};
+
+getList();
+
+const selectCustomer = (row) => {
+  formData.data.customerId = row.id;
+  formData.data.customerName = row.name;
+  formData.data.customerCode = row.customerCode;
+  // formData.data.customerMinorPart = row.minorPart;
+  openSelectCustomer.value = false;
+  proxy.msgTip("选择成功");
+};
+</script>
+
+<style lang="scss" scoped>
+.content {
+  padding: 20px;
+}
+</style>

+ 113 - 107
src/views/MES/productionOrder/index.vue

@@ -596,7 +596,7 @@ const config = computed(() => {
           // row.produceStatus == 2
           //   ? {
           //       attrs: {
-          //         label: "销售出库",
+          //         label: "发货申请",
           //         type: "primary",
           //         text: true,
           //       },
@@ -1005,124 +1005,130 @@ const getFileData = () => {
 
 const lookDetails = (item) => {
   activeName.value = "1";
-  proxy.post("/contract/detail", { id: item.contractId }).then(async (res) => {
-    formData.orderData = res;
-    dialogVisible.value = true;
-    proxy
-      .post("/produceOrder/materialBalanceList", { id: item.id })
-      .then((sonRes) => {
-        formData.orderData.materialList = sonRes;
-        if (sonRes && sonRes.length > 0) {
-          let ids = sonRes.map((x) => x.materialId);
-          proxy.getFileData({
-            businessIdList: ids,
-            data: formData.orderData.materialList,
-            att: "materialId",
-            businessType: "0",
-            fileAtt: "fileList",
-            filePathAtt: "fileUrl",
-          });
-        }
-      });
-    if (
-      formData.orderData.contractProductList &&
-      formData.orderData.contractProductList.length > 0
-    ) {
-      getFileData();
-      let ids = formData.orderData.contractProductList.map((x) => x.id);
-      let productIds = formData.orderData.contractProductList.map(
-        (x) => x.productId
-      );
+  proxy
+    .post("/produceOrder/contractInfo", { id: item.id })
+    .then(async (res) => {
+      formData.orderData = res;
+      dialogVisible.value = true;
+      proxy
+        .post("/produceOrder/materialBalanceList", { id: item.id })
+        .then((sonRes) => {
+          formData.orderData.materialList = sonRes;
+          if (sonRes && sonRes.length > 0) {
+            let ids = sonRes.map((x) => x.materialId);
+            proxy.getFileData({
+              businessIdList: ids,
+              data: formData.orderData.materialList,
+              att: "materialId",
+              businessType: "0",
+              fileAtt: "fileList",
+              filePathAtt: "fileUrl",
+            });
+          }
+        });
+      if (
+        formData.orderData.contractProductList &&
+        formData.orderData.contractProductList.length > 0
+      ) {
+        getFileData();
+        let ids = formData.orderData.contractProductList.map((x) => x.id);
+        let productIds = formData.orderData.contractProductList.map(
+          (x) => x.productId
+        );
 
-      const productAllFile = await proxy.getFileData({
-        businessIdList: productIds,
-        getAll: true,
-      });
-      for (let i = 0; i < formData.orderData.contractProductList.length; i++) {
-        const ele = formData.orderData.contractProductList[i];
-        for (const key in productAllFile) {
-          if (
-            ele.productId == key &&
-            productAllFile[ele.productId] &&
-            productAllFile[ele.productId].length > 0
-          ) {
-            ele.productFile = productAllFile[ele.productId].filter(
-              (x) => x.businessType == "0"
-            );
-            if (ele.productFile && ele.productFile.length > 0) {
-              ele.fileUrl = ele.productFile[0].fileUrl;
+        const productAllFile = await proxy.getFileData({
+          businessIdList: productIds,
+          getAll: true,
+        });
+        for (
+          let i = 0;
+          i < formData.orderData.contractProductList.length;
+          i++
+        ) {
+          const ele = formData.orderData.contractProductList[i];
+          for (const key in productAllFile) {
+            if (
+              ele.productId == key &&
+              productAllFile[ele.productId] &&
+              productAllFile[ele.productId].length > 0
+            ) {
+              ele.productFile = productAllFile[ele.productId].filter(
+                (x) => x.businessType == "0"
+              );
+              if (ele.productFile && ele.productFile.length > 0) {
+                ele.fileUrl = ele.productFile[0].fileUrl;
+              }
+              break;
             }
-            break;
           }
         }
-      }
 
-      proxy
-        .getFileData({
-          businessIdList: ids,
-          getAll: true,
-        })
-        .then((fileObj) => {
-          if (fileObj && Object.keys(fileObj).length > 0) {
-            for (
-              let i = 0;
-              i < formData.orderData.contractProductList.length;
-              i++
-            ) {
-              const ele = formData.orderData.contractProductList[i];
-              for (const key in fileObj) {
-                if (
-                  ele.id == key &&
-                  fileObj[ele.id] &&
-                  fileObj[ele.id].length > 0
-                ) {
-                  let imageUrlList = fileObj[ele.id].filter(
-                    (x) => x.businessType == "0"
-                  );
-                  if (imageUrlList && imageUrlList.length > 0) {
-                    ele.imageUrl = imageUrlList[0].fileUrl;
-                  }
-                  ele.prodFileList = fileObj[ele.id]
-                    .filter((x) => x.businessType == "1")
-                    .map((x) => ({ ...x, name: x.fileName, url: x.fileUrl }));
-                  if (ele.prodFileList && ele.prodFileList.length > 0) {
-                    ele.isShowProductFile = false;
-                  } else {
-                    ele.isShowProductFile = true;
-                    if (productAllFile[ele.productId]) {
-                      ele.fileListOne = productAllFile[ele.productId].filter(
-                        (x) => x.businessType == "2"
-                      );
+        proxy
+          .getFileData({
+            businessIdList: ids,
+            getAll: true,
+          })
+          .then((fileObj) => {
+            if (fileObj && Object.keys(fileObj).length > 0) {
+              for (
+                let i = 0;
+                i < formData.orderData.contractProductList.length;
+                i++
+              ) {
+                const ele = formData.orderData.contractProductList[i];
+                for (const key in fileObj) {
+                  if (
+                    ele.id == key &&
+                    fileObj[ele.id] &&
+                    fileObj[ele.id].length > 0
+                  ) {
+                    let imageUrlList = fileObj[ele.id].filter(
+                      (x) => x.businessType == "0"
+                    );
+                    if (imageUrlList && imageUrlList.length > 0) {
+                      ele.imageUrl = imageUrlList[0].fileUrl;
+                    }
+                    ele.prodFileList = fileObj[ele.id]
+                      .filter((x) => x.businessType == "1")
+                      .map((x) => ({ ...x, name: x.fileName, url: x.fileUrl }));
+                    if (ele.prodFileList && ele.prodFileList.length > 0) {
+                      ele.isShowProductFile = false;
+                    } else {
+                      ele.isShowProductFile = true;
+                      if (productAllFile[ele.productId]) {
+                        ele.fileListOne = productAllFile[ele.productId].filter(
+                          (x) => x.businessType == "2"
+                        );
+                      }
                     }
                   }
                 }
               }
-            }
-          } else {
-            for (
-              let i = 0;
-              i < formData.orderData.contractProductList.length;
-              i++
-            ) {
-              const ele = formData.orderData.contractProductList[i];
-              ele.isShowProductFile = true;
-              for (const key in productAllFile) {
-                if (
-                  ele.productId == key &&
-                  productAllFile[ele.productId] &&
-                  productAllFile[ele.productId].length > 0
-                ) {
-                  ele.fileListOne = productAllFile[ele.productId].filter(
-                    (x) => x.businessType == "2"
-                  );
-                  break;
+            } else {
+              for (
+                let i = 0;
+                i < formData.orderData.contractProductList.length;
+                i++
+              ) {
+                const ele = formData.orderData.contractProductList[i];
+                ele.isShowProductFile = true;
+                for (const key in productAllFile) {
+                  if (
+                    ele.productId == key &&
+                    productAllFile[ele.productId] &&
+                    productAllFile[ele.productId].length > 0
+                  ) {
+                    ele.fileListOne = productAllFile[ele.productId].filter(
+                      (x) => x.businessType == "2"
+                    );
+                    break;
+                  }
                 }
               }
             }
-          }
-        });
-    }
-  });
+          });
+      }
+    });
 };
 
 const handleClickUpload = async (att, flag, index) => {

+ 197 - 5
src/views/MES/productionTask/index.vue

@@ -83,7 +83,8 @@
               </template>
             </el-popover>
             <!-- <el-button type="primary" text @click="openRemark(item)" v-if="!item.remark">进度说明</el-button> -->
-            <el-button type="primary" text>{{item.remark?'锁定':'解锁'}}报工</el-button>
+            <el-button type="primary" text @click="handleChangeStatus(item)"><span
+                    :style="{color:item.reportLock==1?'red':''}">{{item.reportLock==1?'已':'未'}}锁定</span></el-button>
           </div>
         </template>
 
@@ -158,8 +159,8 @@
         <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"
-                    :class="showCotentQuantity(slotItem,item)">
+              <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">
@@ -554,6 +555,45 @@
       </template>
     </el-dialog>
 
+    <el-dialog :title="'排程'" v-model="newSchedulingDialog" width="50%" destroy-on-close>
+      <byForm :formConfig="schedulingFormConfig" :formOption="formOption" v-model="schedulingFormData.data" :rules="schedulingRules"
+              ref="schedulingFormDom" v-loading="submitLoading">
+        <template #addList>
+          <div style="width:100%">
+            <el-button type="primary" @click="clickAdd()" plain style="margin-bottom: 16px">添加</el-button>
+            <el-table :data="schedulingFormData.data.list" border>
+              <el-table-column label="排程日期">
+                <template #default="{ row, $index }">
+                  <el-form-item :prop="'list.' + $index + '.schedulingDate'" :rules="schedulingRules.schedulingDate" :inline-message="true"
+                                class="margin-b-0">
+                    <el-date-picker v-model="row.schedulingDate" type="date" placeholder="请选择" :value-format="'YYYY-MM-DD'"
+                                    :disabled-date="disabledFn" />
+                  </el-form-item>
+                </template>
+              </el-table-column>
+              <el-table-column label="数量" width="150">
+                <template #default="{ row, $index }">
+                  <el-form-item :prop="'list.' + $index + '.quantity'" :rules="schedulingRules.quantity" :inline-message="true" class="margin-b-0">
+                    <el-input-number onmousewheel="return false;" v-model="row.quantity" placeholder="请输入" style="width: 100%" :precision="0"
+                                     :controls="false" :min="1" />
+                  </el-form-item>
+                </template>
+              </el-table-column>
+              <el-table-column label="操作" width="60" align="center" fixed="right">
+                <template #default="{ row,$index }">
+                  <el-button type="primary" link @click="clickDetele($index)">删除</el-button>
+                </template>
+              </el-table-column>
+            </el-table>
+          </div>
+        </template>
+      </byForm>
+      <template #footer>
+        <el-button @click="newSchedulingDialog = false" size="defualt">取 消</el-button>
+        <el-button type="primary" @click="submitSchedulingForm()" size="defualt">提 交</el-button>
+      </template>
+    </el-dialog>
+
     <el-dialog :title="'选择生产任务'" v-model="openSelectTask" width="90%" destroy-on-close>
       <SelectProductionTask @selectTask="selectTask" :processesId="pageActiveName"></SelectProductionTask>
       <template #footer>
@@ -570,7 +610,8 @@ import byForm from "@/components/byForm/index";
 import QRCode from "qrcodejs2-fix";
 import moment from "moment";
 import SelectProductionTask from "@/views/MES/productionTask/selectProductionTask.vue";
-import { nextTick } from "vue";
+import "@imengyu/vue3-context-menu/lib/vue3-context-menu.css";
+import ContextMenu from "@imengyu/vue3-context-menu";
 
 const { proxy } = getCurrentInstance();
 const contractTag = computed(
@@ -756,7 +797,7 @@ const config = ref([
   {
     attrs: {
       label: "操作",
-      width: "220",
+      width: "200",
       slot: "btn",
       align: "left",
       // fixed: "right",
@@ -1768,6 +1809,157 @@ const submitFormOne = () => {
       );
   });
 };
+
+const handleChangeStatus = (item) => {
+  proxy
+    .post("/produceOrderDetail/reportLockOrUnlock", {
+      id: item.id,
+    })
+    .then(
+      (res) => {
+        proxy.msgTip("操作成功", 1);
+        // getList();
+        item.reportLock = item.reportLock == "1" ? "0" : "1";
+      },
+      (err) => {}
+    );
+};
+
+const schedulingFormDom = ref(null);
+const schedulingFormData = reactive({
+  data: {},
+});
+const schedulingFormConfig = computed(() => {
+  return [
+    {
+      type: "input",
+      prop: "processesName",
+      label: "工序名称",
+      itemWidth: 100,
+      disabled: true,
+    },
+    {
+      type: "input",
+      prop: "allQuantity",
+      label: "总生产件数",
+      itemWidth: 100,
+      disabled: true,
+    },
+    {
+      type: "input",
+      prop: "waitQuantity",
+      label: "未排程件数",
+      itemWidth: 100,
+      disabled: true,
+    },
+    {
+      type: "slot",
+      slotName: "addList",
+      label: "排程明细",
+    },
+  ];
+});
+
+const schedulingRules = ref({
+  schedulingDate: [
+    { required: true, message: "请选择排程日期", trigger: "change" },
+  ],
+  quantity: [{ required: true, message: "请输入数量", trigger: "blur" }],
+});
+const newSchedulingDialog = ref(false);
+const processesRowData = ref({});
+const rowData = ref({});
+const handleAddScheduling = (sonItem, item) => {
+  processesRowData.value = sonItem;
+  rowData.value = item;
+  let schedulingCount = 0;
+  let current = item.productionTaskProgressList.find(
+    (x) => x.processesId == sonItem.id
+  );
+  if (current) {
+    schedulingCount = current.schedulingCount;
+  }
+  schedulingFormData.data = {
+    taskId: item.id,
+    allQuantity: item.quantity,
+    waitQuantity: parseFloat(item.quantity - schedulingCount) + "",
+    processesId: sonItem.id,
+    processesName: sonItem.name,
+    schedulingDate: "",
+    quantity: null,
+    list: [],
+  };
+  newSchedulingDialog.value = true;
+};
+
+const handleContextmenu = (sonItem, item, e) => {
+  e.preventDefault();
+  ContextMenu.showContextMenu({
+    x: e.x,
+    y: e.y,
+    items: [
+      {
+        label: "排程",
+        onClick: () => {
+          handleAddScheduling(sonItem, item);
+        },
+      },
+    ],
+  });
+  // nextTick(() => {
+  //   let items = document.querySelectorAll(".mx-context-menu-item");
+  //   items.forEach((x, index) => {
+  //     if (index == 0) {
+  //       x.style["border-top"] = "1px solid #eee";
+  //     }
+  //     x.style["border-bottom"] = "1px solid #eee";
+  //   });
+  // });
+};
+const clickAdd = () => {
+  schedulingFormData.data.list.push({
+    taskId: rowData.value.id,
+    processesId: processesRowData.value.id,
+    schedulingDate: "",
+    quantity: null,
+  });
+};
+
+const clickDetele = (index) => {
+  schedulingFormData.data.list.splice(index, 1);
+};
+
+const submitSchedulingForm = () => {
+  schedulingFormDom.value.handleSubmit((valid) => {
+    if (
+      !(schedulingFormData.data.list && schedulingFormData.data.list.length > 0)
+    ) {
+      return proxy.msgTip("请添加排程明细", 2);
+    }
+    submitLoading.value = true;
+    proxy.post("/productionScheduling/add", schedulingFormData.data.list).then(
+      (res) => {
+        proxy.msgTip("操作成功", 1);
+        newSchedulingDialog.value = false;
+        submitLoading.value = false;
+        handleSearch({});
+      },
+      (err) => {
+        submitLoading.value = false;
+      }
+    );
+  });
+};
+
+const disabledFn = (date) => {
+  // 当前日期
+  let current = moment(date).format("yyyy-MM-DD");
+  // 禁用已选日期和比当前日期小的
+  return (
+    moment(current).add(1, "day").isBefore(moment()) ||
+    currentDate.value.includes(current)
+  );
+};
 </script>
 
 <style lang="scss" scoped>

+ 414 - 117
src/views/customer/addCustomer.vue

@@ -42,9 +42,9 @@
       </template>
       <template #person>
         <div style="width: 100%">
-          <el-button type="primary" @click="clickAddPerson">添 加</el-button>
-          <el-table :data="formData.data.customerUserList" style="width: 100%; margin-top: 16px">
-            <el-table-column label="姓名" width="160">
+          <el-button type="primary" @click="clickAddPerson" v-if="!formOption.disabled">添 加</el-button>
+          <el-table :data="formData.data.customerUserList" style="width: 100%; ">
+            <el-table-column label="姓名" width="150" fixed="left">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
                   <el-form-item :prop="'customerUserList.' + $index + '.name'" class="margin-b-0 wid100" :rules="rules.name2" :inline-message="true">
@@ -53,75 +53,84 @@
                 </div>
               </template>
             </el-table-column>
-            <el-table-column label="性别" width="100">
+            <el-table-column label="性别" width="100" fixed="left">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
-                  <el-form-item :prop="'customerUserList.' + $index + '.name'" class="margin-b-0 wid100" :rules="rules.name2" :inline-message="true">
-                    <el-input v-model="row.name" placeholder="请输入" />
+                  <el-form-item :prop="'customerUserList.' + $index + '.sex'" class="margin-b-0 wid100" :rules="rules.sex" :inline-message="true">
+                    <el-select v-model="row.sex" placeholder="请选择" style="width: 100%">
+                      <el-option :label="'男'" :value="'1'" />
+                      <el-option :label="'女'" :value="'2'" />
+                    </el-select>
                   </el-form-item>
                 </div>
               </template>
             </el-table-column>
-            <el-table-column label="职位" width="150">
+            <el-table-column label="职位" width="150" fixed="left">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
-                  <el-form-item :prop="'customerUserList.' + $index + '.name'" class="margin-b-0 wid100" :rules="rules.name2" :inline-message="true">
-                    <el-input v-model="row.name" placeholder="请输入" />
+                  <el-form-item :prop="'customerUserList.' + $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="是否企业关键KP" width="150">
+            <el-table-column label="是否企业关键KP" width="150" fixed="left">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
-                  <el-form-item :prop="'customerUserList.' + $index + '.name'" class="margin-b-0 wid100" :rules="rules.name2" :inline-message="true">
-                    <el-input v-model="row.name" placeholder="请输入" />
+                  <el-form-item :prop="'customerUserList.' + $index + '.isKp'" class="margin-b-0 wid100" :rules="rules.isKp" :inline-message="true">
+                    <el-select v-model="row.isKp" placeholder="请选择" style="width: 100%">
+                      <el-option :label="'是'" :value="1" />
+                      <el-option :label="'否'" :value="0" />
+                    </el-select>
                   </el-form-item>
                 </div>
               </template>
             </el-table-column>
-            <el-table-column label="微信" width="150">
+            <el-table-column label="手机号" width="150" fixed="left">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
-                  <el-form-item :prop="'customerUserList.' + $index + '.name'" class="margin-b-0 wid100" :rules="rules.name2" :inline-message="true">
-                    <el-input v-model="row.name" placeholder="请输入" />
+                  <el-form-item :prop="'customerUserList.' + $index + '.phone'" class="margin-b-0 wid100" :rules="rules.phone" :inline-message="true">
+                    <el-input v-model="row.phone" placeholder="请输入" />
                   </el-form-item>
                 </div>
               </template>
             </el-table-column>
-            <el-table-column label="旺旺" width="150">
+            <el-table-column label="微信" width="150">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
-                  <el-form-item :prop="'customerUserList.' + $index + '.name'" class="margin-b-0 wid100" :rules="rules.name2" :inline-message="true">
-                    <el-input v-model="row.name" placeholder="请输入" />
+                  <el-form-item :prop="'customerUserList.' + $index + '.weChat'" class="margin-b-0 wid100" :rules="rules.weChat"
+                                :inline-message="true">
+                    <el-input v-model="row.weChat" placeholder="请输入" />
                   </el-form-item>
                 </div>
               </template>
             </el-table-column>
-            <el-table-column label="联系电话" width="150">
+            <el-table-column label="旺旺" width="150">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
-                  <el-form-item :prop="'customerUserList.' + $index + '.email'" class="margin-b-0 wid100" :rules="rules.email" :inline-message="true">
-                    <el-input v-model="row.email" placeholder="请输入" />
+                  <el-form-item :prop="'customerUserList.' + $index + '.wangWang'" class="margin-b-0 wid100" :rules="rules.wangWang"
+                                :inline-message="true">
+                    <el-input v-model="row.wangWang" placeholder="请输入" />
                   </el-form-item>
                 </div>
               </template>
             </el-table-column>
-            <el-table-column label="手机号" width="150">
+            <el-table-column label="联系电话" width="150">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
-                  <el-form-item :prop="'customerUserList.' + $index + '.name'" class="margin-b-0 wid100" :rules="rules.name2" :inline-message="true">
-                    <el-input v-model="row.name" placeholder="请输入" />
+                  <el-form-item :prop="'customerUserList.' + $index + '.tel'" class="margin-b-0 wid100" :rules="rules.tel" :inline-message="true">
+                    <el-input v-model="row.tel" placeholder="请输入" />
                   </el-form-item>
                 </div>
               </template>
             </el-table-column>
-
             <el-table-column label="WhatsApp" width="150">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
-                  <el-form-item :prop="'customerUserList.' + $index + '.name'" class="margin-b-0 wid100" :rules="rules.name2" :inline-message="true">
-                    <el-input v-model="row.name" placeholder="请输入" />
+                  <el-form-item :prop="'customerUserList.' + $index + '.whatsApp'" class="margin-b-0 wid100" :rules="rules.whatsApp"
+                                :inline-message="true">
+                    <el-input v-model="row.whatsApp" placeholder="请输入" />
                   </el-form-item>
                 </div>
               </template>
@@ -130,8 +139,8 @@
             <el-table-column label="QQ" width="150">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
-                  <el-form-item :prop="'customerUserList.' + $index + '.name'" class="margin-b-0 wid100" :rules="rules.name2" :inline-message="true">
-                    <el-input v-model="row.name" placeholder="请输入" />
+                  <el-form-item :prop="'customerUserList.' + $index + '.qq'" class="margin-b-0 wid100" :rules="rules.qq" :inline-message="true">
+                    <el-input v-model="row.qq" placeholder="请输入" />
                   </el-form-item>
                 </div>
               </template>
@@ -139,8 +148,8 @@
             <el-table-column label="Skype" width="150">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
-                  <el-form-item :prop="'customerUserList.' + $index + '.name'" class="margin-b-0 wid100" :rules="rules.name2" :inline-message="true">
-                    <el-input v-model="row.name" placeholder="请输入" />
+                  <el-form-item :prop="'customerUserList.' + $index + '.skype'" class="margin-b-0 wid100" :rules="rules.skype" :inline-message="true">
+                    <el-input v-model="row.skype" placeholder="请输入" />
                   </el-form-item>
                 </div>
               </template>
@@ -148,8 +157,9 @@
             <el-table-column label="LinkedIn" width="150">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
-                  <el-form-item :prop="'customerUserList.' + $index + '.name'" class="margin-b-0 wid100" :rules="rules.name2" :inline-message="true">
-                    <el-input v-model="row.name" placeholder="请输入" />
+                  <el-form-item :prop="'customerUserList.' + $index + '.linkedIn'" class="margin-b-0 wid100" :rules="rules.linkedIn"
+                                :inline-message="true">
+                    <el-input v-model="row.linkedIn" placeholder="请输入" />
                   </el-form-item>
                 </div>
               </template>
@@ -157,8 +167,9 @@
             <el-table-column label="Facebook" width="150">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
-                  <el-form-item :prop="'customerUserList.' + $index + '.name'" class="margin-b-0 wid100" :rules="rules.name2" :inline-message="true">
-                    <el-input v-model="row.name" placeholder="请输入" />
+                  <el-form-item :prop="'customerUserList.' + $index + '.facebook'" class="margin-b-0 wid100" :rules="rules.facebook"
+                                :inline-message="true">
+                    <el-input v-model="row.facebook" placeholder="请输入" />
                   </el-form-item>
                 </div>
               </template>
@@ -166,8 +177,9 @@
             <el-table-column label="Dirrect Line" width="150">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
-                  <el-form-item :prop="'customerUserList.' + $index + '.email'" class="margin-b-0 wid100" :rules="rules.email" :inline-message="true">
-                    <el-input v-model="row.email" placeholder="请输入" />
+                  <el-form-item :prop="'customerUserList.' + $index + '.directLine'" class="margin-b-0 wid100" :rules="rules.directLine"
+                                :inline-message="true">
+                    <el-input v-model="row.directLine" placeholder="请输入" />
                   </el-form-item>
                 </div>
               </template>
@@ -181,7 +193,7 @@
                 </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" v-if="!formOption.disabled">
               <template #default="{ row, $index }">
                 <!-- <el-button type="primary" link @click="clickInformationMore(row, $index)">更多</el-button> -->
                 <el-button type="primary" link @click="clickDelete($index)">删除</el-button>
@@ -298,6 +310,12 @@ const customerState = computed(
 const newoldCustomer = computed(
   () => proxy.useUserStore().allDict["newold_customer"]
 );
+const invoiceType = computed(
+  () => proxy.useUserStore().allDict["invoice_type"]
+);
+const cooperationStatus = computed(
+  () => proxy.useUserStore().allDict["cooperation_status"]
+);
 
 const submit = ref(null);
 const formData = reactive({
@@ -360,6 +378,13 @@ const getCityData = (id, type, isChange = false) => {
   });
 };
 getCityData("0");
+const formOption = reactive({
+  disabled: false,
+  inline: true,
+  labelWidth: 120,
+  itemWidth: 100,
+  rules: [],
+});
 const getDtl = () => {
   loading.value = true;
   proxy.post("/customer/detail", { id: customerId.value }).then((res) => {
@@ -373,6 +398,40 @@ const getDtl = () => {
     if (formData.data.provinceId) {
       getCityData(formData.data.provinceId, "30");
     }
+    proxy
+      .post("/fileInfo/getList", { businessIdList: [customerId.value] })
+      .then((fileObj) => {
+        if (fileObj[customerId.value] && fileObj[customerId.value].length > 0) {
+          formData.data.fileList = fileObj[customerId.value]
+            .filter((x) => x.businessType == "10")
+            .map((item) => {
+              return {
+                ...item,
+                name: item.fileName,
+                url: item.fileUrl,
+              };
+            });
+
+          formData.data.imgFileList = fileObj[customerId.value]
+            .filter((x) => x.businessType == "20")
+            .map((item) => {
+              return {
+                ...item,
+                name: item.fileName,
+                url: item.fileUrl,
+              };
+            });
+          if (
+            formData.data.imgFileList &&
+            formData.data.imgFileList.length > 0
+          ) {
+            formData.data.imageUrl = formData.data.imgFileList[0].fileUrl;
+          }
+        } else {
+          formData.data.fileList = [];
+          formData.data.imgFileList = [];
+        }
+      });
     loading.value = false;
   });
 };
@@ -382,6 +441,8 @@ if (props && props.modalType) {
     formData.data = {
       countryId: "44",
       tags: [],
+      fileList: [],
+      imgFileList: [],
       customerUserList: [
         {
           name: "",
@@ -393,18 +454,19 @@ if (props && props.modalType) {
       formData.data.customerUserList[0].email = props.customerMail;
     }
     getCityData(formData.data.countryId, "20");
-  } else if (modalType.value == "edit" && props.customerId) {
+  } else if (
+    (modalType.value == "edit" || modalType.value == "detail") &&
+    props.customerId
+  ) {
     customerId.value = props.customerId;
     getDtl();
+    // 详情禁用
+    if (modalType.value == "detail") {
+      formOption.disabled = true;
+    }
   }
 }
 
-const formOption = reactive({
-  inline: true,
-  labelWidth: 190,
-  itemWidth: 100,
-  rules: [],
-});
 const formConfig = computed(() => {
   return [
     // {
@@ -423,32 +485,39 @@ const formConfig = computed(() => {
       type: "slot",
       slotName: "name",
       prop: "name",
-      label: "客户名称",
-    },
-    {
-      type: "slot",
-      slotName: "allAddress",
-      label: "详细地址",
+      label: "公司/客户主体",
     },
     {
       type: "input",
-      prop: "fax",
-      label: "公司/客户主体",
-      itemWidth: 50,
+      prop: "customerCode",
+      label: "客户编号",
+      itemWidth: 100,
       itemType: "text",
     },
     {
-      type: "input",
-      prop: "fax",
-      label: "公司/客户客体",
-      itemWidth: 50,
-      itemType: "text",
+      type: "slot",
+      slotName: "allAddress",
+      label: "详细地址",
     },
+    // {
+    //   type: "input",
+    //   prop: "mainPart",
+    //   label: "公司/客户主体",
+    //   itemWidth: 50,
+    //   itemType: "text",
+    // },
+    // {
+    //   type: "input",
+    //   prop: "minorPart",
+    //   label: "公司/客户客体",
+    //   itemWidth: 50,
+    //   itemType: "text",
+    // },
     {
       type: "select",
       label: "业务员",
       prop: "userId",
-      itemWidth: 50,
+      itemWidth: 25,
       data: userList.value,
       clearable: true,
       disabled: isHighseas.value,
@@ -460,106 +529,105 @@ const formConfig = computed(() => {
       data: deptData.value,
       propsTreeLabel: "deptName",
       propsTreeValue: "deptId",
-      itemWidth: 50,
+      itemWidth: 25,
     },
     {
       type: "input",
-      prop: "fax",
+      prop: "mainCategories",
       label: "主营品类",
-      itemWidth: 50,
+      itemWidth: 25,
       itemType: "text",
     },
     {
       type: "select",
       label: "公司规模",
-      prop: "wwaa",
-      itemWidth: 50,
+      prop: "companySize",
+      itemWidth: 25,
       data: customerScale.value,
     },
     {
       type: "select",
       label: "客户结算方式",
-      prop: "wwaa",
-      itemWidth: 50,
+      prop: "settlementMode",
+      itemWidth: 25,
       data: settlementWay.value,
     },
     {
       type: "select",
       label: "客户类型",
       prop: "status",
-      itemWidth: 50,
+      itemWidth: 25,
       data: customerStatus.value,
     },
     {
       type: "select",
       label: "客户分级",
-      prop: "wwaa",
-      itemWidth: 50,
+      prop: "level",
+      itemWidth: 25,
       data: customerSlevel.value,
     },
     {
       type: "input",
-      prop: "fax",
+      prop: "maintainLevel",
       label: "维系级别",
-      itemWidth: 50,
+      itemWidth: 25,
       itemType: "text",
     },
     {
       type: "select",
       label: "新老客户",
-      prop: "wwaa",
-      itemWidth: 50,
+      prop: "newOld",
+      itemWidth: 25,
       data: newoldCustomer.value,
     },
     {
       type: "input",
-      prop: "fax",
+      prop: "annualQuantity",
       label: "要求年订单量",
-      itemWidth: 50,
+      itemWidth: 25,
       itemType: "text",
     },
     {
       type: "input",
-      prop: "fax",
+      prop: "followUpAsk",
       label: "回访要求",
-      itemWidth: 50,
+      itemWidth: 25,
       itemType: "text",
     },
     {
       type: "input",
-      prop: "fax",
+      prop: "remind",
       label: "提醒设定",
-      itemWidth: 50,
+      itemWidth: 25,
       itemType: "text",
     },
     {
       type: "date",
       itemType: "date",
-      prop: "fax",
+      prop: "createGroupTime",
       label: "建群时间",
-      itemWidth: 50,
+      itemWidth: 25,
     },
     {
       type: "select",
       label: "客户状态",
-      prop: "source",
-      itemWidth: 50,
+      prop: "state",
+      itemWidth: 25,
       data: customerState.value,
     },
     {
       type: "select",
       label: "客户来源",
       prop: "source",
-      itemWidth: 50,
+      itemWidth: 25,
       data: customerSource.value,
     },
-
     {
       type: "input",
       prop: "fax",
       label: "传真",
       required: true,
-      itemWidth: 50,
+      itemWidth: 25,
       itemType: "text",
     },
     {
@@ -573,73 +641,276 @@ const formConfig = computed(() => {
         width: "100%",
       },
     },
+    // {
+    //   type: "input",
+    //   prop: "beneficiaryName",
+    //   label: "Beneficiary Name",
+    //   required: true,
+    //   itemWidth: 50,
+    //   itemType: "text",
+    // },
+    // {
+    //   type: "input",
+    //   prop: "beneficiaryAccountNumber",
+    //   label: "Beneficiary Account Number",
+    //   required: true,
+    //   itemWidth: 50,
+    //   itemType: "text",
+    // },
+    // {
+    //   type: "input",
+    //   prop: "beneficiaryBank",
+    //   label: "Beneficiary Bank",
+    //   required: true,
+    //   itemWidth: 50,
+    //   itemType: "text",
+    // },
+    // {
+    //   type: "input",
+    //   prop: "swiftCode",
+    //   label: "Swift Code",
+    //   required: true,
+    //   itemWidth: 50,
+    //   itemType: "text",
+    // },
+    // {
+    //   type: "input",
+    //   prop: "beneficiaryBankAddress",
+    //   label: "Beneficiary Bank Address",
+    //   required: true,
+    //   itemWidth: 50,
+    //   itemType: "text",
+    // },
+    // {
+    //   type: "input",
+    //   prop: "beneficiaryAddress",
+    //   label: "Beneficiary Address",
+    //   required: true,
+    //   itemWidth: 50,
+    //   itemType: "text",
+    // },
+    {
+      type: "title1",
+      title: "联系人",
+    },
+    {
+      type: "slot",
+      slotName: "person",
+      label: "客户联系人",
+    },
+    {
+      type: "title1",
+      title: "客户对公财务信息",
+    },
+    {
+      type: "select",
+      label: "发票信息",
+      prop: "invoiceType",
+      itemWidth: 25,
+      data: invoiceType.value,
+    },
+    {
+      type: "select",
+      label: "合作状态",
+      prop: "cooperateStatus",
+      itemWidth: 25,
+      data: cooperationStatus.value,
+    },
     {
       type: "input",
-      prop: "beneficiaryName",
-      label: "Beneficiary Name",
-      required: true,
-      itemWidth: 50,
+      prop: "accountName",
+      label: "公司名称",
+      itemWidth: 25,
       itemType: "text",
     },
     {
       type: "input",
-      prop: "beneficiaryAccountNumber",
-      label: "Beneficiary Account Number",
-      required: true,
-      itemWidth: 50,
+      prop: "dutyParagraph",
+      label: "税号",
+      itemWidth: 25,
       itemType: "text",
     },
     {
       type: "input",
-      prop: "beneficiaryBank",
-      label: "Beneficiary Bank",
-      required: true,
-      itemWidth: 50,
+      prop: "accountAddress",
+      label: "地址",
+      itemWidth: 25,
       itemType: "text",
     },
     {
       type: "input",
-      prop: "swiftCode",
-      label: "Swift Code",
-      required: true,
-      itemWidth: 50,
+      prop: "accountTel",
+      label: "电话",
+      itemWidth: 25,
       itemType: "text",
     },
     {
       type: "input",
-      prop: "beneficiaryBankAddress",
-      label: "Beneficiary Bank Address",
-      required: true,
-      itemWidth: 50,
+      prop: "accountBank",
+      label: "开户行(对公)",
+      itemWidth: 25,
       itemType: "text",
     },
     {
       type: "input",
-      prop: "beneficiaryAddress",
-      label: "Beneficiary Address",
-      required: true,
-      itemWidth: 50,
+      prop: "accountNumber",
+      label: "开户账号(对公)",
+      itemWidth: 25,
       itemType: "text",
     },
     {
       type: "title1",
-      title: "联系人",
+      title: "客户对私财务信息",
     },
     {
-      type: "slot",
-      slotName: "person",
-      label: "客户联系人",
+      type: "input",
+      prop: "privAccountName",
+      label: "账户名称",
+      itemWidth: 25,
+      itemType: "text",
+    },
+    {
+      type: "input",
+      prop: "privAccountBank",
+      label: "开户行(对私)",
+      itemWidth: 25,
+      itemType: "text",
+    },
+    {
+      type: "input",
+      prop: "privAccountNumber",
+      label: "开户账号(对私)",
+      itemWidth: 25,
+      itemType: "text",
+    },
+    {
+      type: "upload",
+      listType: "text",
+      accept: "",
+      prop: "fileList",
+      label: "客户附件信息",
+      itemWidth: 100,
+    },
+    {
+      type: "uploadImg",
+      // listType: "picture-card",
+      // limit: 1,
+      // accept: ".gif, .jpeg, .jpg, .png",
+      prop: "imgFileList",
+      imgProp: "imageUrl",
+      label: "客户图片信息",
+      itemWidth: 100,
+    },
+    {
+      type: "title1",
+      title: "跟进下单数据",
+      isShow: modalType.value == "detail",
+    },
+    {
+      type: "date",
+      itemType: "date",
+      prop: "lastFollowTime",
+      label: "客情时间",
+      itemWidth: 25,
+      disabled: true,
+      isShow: modalType.value == "detail",
+    },
+    {
+      type: "input",
+      prop: "followCount",
+      label: "跟进次数",
+      itemWidth: 25,
+      itemType: "text",
+      disabled: true,
+      isShow: modalType.value == "detail",
+    },
+    {
+      type: "date",
+      itemType: "date",
+      prop: "lastSaleDate",
+      label: "最近下单时间",
+      itemWidth: 25,
+      disabled: true,
+      isShow: modalType.value == "detail",
+    },
+    {
+      type: "input",
+      prop: "lastSaleDay",
+      label: "下单距离天数",
+      itemWidth: 25,
+      itemType: "text",
+      disabled: true,
+      isShow: modalType.value == "detail",
+    },
+    {
+      type: "input",
+      prop: "orderCount",
+      label: "下单次数",
+      itemWidth: 25,
+      itemType: "text",
+      disabled: true,
+      isShow: modalType.value == "detail",
+    },
+    // {
+    //   type: "number",
+    //   prop: "flatPrice",
+    //   label: "每年成交金额",
+    //   precision: 2,
+    //   min: 0,
+    //   controls: false,
+    //   itemWidth: 25,
+    //   disabled: false,
+    // },
+    {
+      type: "number",
+      prop: "orderAmountSum",
+      label: "成交总金额",
+      precision: 2,
+      min: 0,
+      controls: false,
+      itemWidth: 25,
+      disabled: true,
+      isShow: modalType.value == "detail",
     },
   ];
 });
 
 const rules = ref({
-  name: [{ required: true, message: "请输入客户名称", trigger: "blur" }],
+  name: [{ required: true, message: "请输入公司/客户主体", trigger: "blur" }],
+  customerCode: [
+    { required: true, message: "请输入客户编号", trigger: "blur" },
+  ],
   name2: [{ required: true, message: "请输入", trigger: "blur" }],
-  email: [{ required: true, message: "请输入电子邮箱", trigger: "blur" }],
+  // email: [{ required: true, message: "请输入电子邮箱", trigger: "blur" }],
+  sex: [{ required: true, message: "请选择性别", trigger: "change" }],
+  position: [{ required: true, message: "请输入职位", trigger: "blur" }],
+  phone: [{ required: true, message: "请输入手机", trigger: "blur" }],
+
   countryId: [{ required: true, message: "请选择国家", trigger: "change" }],
   source: [{ required: true, message: "请选择客户来源", trigger: "change" }],
   status: [{ required: true, message: "请选择类型", trigger: "change" }],
+
+  mainPart: [
+    { required: true, message: "请选择公司/客户主体", trigger: "change" },
+  ],
+  minorPart: [
+    { required: true, message: "请选择公司/客户客体", trigger: "change" },
+  ],
+  // userId: [{ required: true, message: "请选择业务员", trigger: "change" }],
+  deptId: [{ required: true, message: "请选择业务部门", trigger: "change" }],
+  level: [{ required: true, message: "请选择客户分级", trigger: "change" }],
+  maintainLevel: [
+    { required: true, message: "请输入维系级别", trigger: "blur" },
+  ],
+  newOld: [{ required: true, message: "请选择新老客户", trigger: "change" }],
+  annualQuantity: [
+    { required: true, message: "请输入要求年订单量", trigger: "blur" },
+  ],
+  followUpAsk: [{ required: true, message: "请输入回访要求", trigger: "blur" }],
+  remind: [{ required: true, message: "请输入提醒设定", trigger: "blur" }],
+  createGroupTime: [
+    { required: true, message: "请选择建群时间", trigger: "change" },
+  ],
 });
 if (props.isPrivate) {
   rules.value.userId = [
@@ -654,12 +925,38 @@ const clickAddPerson = () => {
     formData.data.customerUserList.push({
       name: "",
       email: "",
+      sex: "",
+      position: "",
+      tel: "",
+      phone: "",
+      qq: "",
+      skype: "",
+      facebook: "",
+      isKp: "",
+      weChat: "",
+      wangWang: "",
+      whatsApp: "",
+      linkedIn: "",
+      directLine: "",
     });
   } else {
     formData.data.customerUserList = [
       {
         name: "",
         email: "",
+        sex: "",
+        position: "",
+        tel: "",
+        phone: "",
+        qq: "",
+        skype: "",
+        facebook: "",
+        isKp: "",
+        weChat: "",
+        wangWang: "",
+        whatsApp: "",
+        linkedIn: "",
+        directLine: "",
       },
     ];
   }

+ 135 - 89
src/views/customer/contacts/index.vue

@@ -20,11 +20,11 @@
     </div>
     <el-dialog :title="modalType == 'add' ? '添加客户联系人' : '编辑客户联系人'" v-model="dialogVisible" width="70%" destroy-on-close>
       <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="formDom" v-loading="submitLoading">
-        <template #rawMaterialIdSlot>
+        <template #customerId>
           <div style="width:100%;display:flex">
             <div style="width:calc(100% - 105px)">
-              <el-form-item label="客户" prop="customerId" class="margin-b-0">
-                <el-input disabled v-model="formData.data.customerIdLabel" placeholder="请选择"></el-input>
+              <el-form-item label="公司/客户主体" prop="customerName" class="margin-b-0">
+                <el-input disabled v-model="formData.data.customerName" placeholder="请选择"></el-input>
               </el-form-item>
             </div>
             <el-button type="primary" style="width:88px;margin-left:15px" @click="openSelectCustomer = true" plain>选择</el-button>
@@ -69,6 +69,16 @@ const sourceList = ref({
   },
 });
 const treeData = ref([]);
+const isKpData = ref([
+  {
+    label: "是",
+    value: "1",
+  },
+  {
+    label: "否",
+    value: "0",
+  },
+]);
 const dialogVisible = ref(false);
 const modalType = ref("add");
 const selectConfig = computed(() => []);
@@ -76,111 +86,128 @@ const config = computed(() => {
   return [
     {
       attrs: {
-        label: "公司名称",
-        prop: "code",
+        label: "公司/客户主体",
+        prop: "customerName",
+        width: 200,
+        fixed: "left",
       },
     },
     {
       attrs: {
-        label: "客户编号",
+        label: "姓名",
         prop: "name",
-      },
-    },
-    {
-      attrs: {
-        label: "客户名称",
-        prop: "deptName",
-      },
-    },
-    {
-      attrs: {
-        label: "联系人姓名",
-        prop: "ssa",
+        width: 100,
+        fixed: "left",
       },
     },
     {
       attrs: {
         label: "性别",
-        prop: "deptName",
+        prop: "sex",
+        width: 60,
+        fixed: "left",
+      },
+      render(val) {
+        if (val) {
+          return val == "1" ? "男" : "女";
+        }
       },
     },
     {
       attrs: {
         label: "职位",
-        prop: "deptName",
+        prop: "position",
+        width: 100,
+        fixed: "left",
       },
     },
 
     {
       attrs: {
         label: "是否企业关键KP",
-        prop: "deptName",
+        prop: "isKp",
+        width: 130,
+      },
+      render(val) {
+        return proxy.dictValueLabel(val, isKpData.value);
       },
     },
     {
       attrs: {
-        label: "微信",
-        prop: "deptName",
+        label: "手机号",
+        prop: "phone",
+        width: 110,
       },
     },
     {
       attrs: {
-        label: "旺旺",
-        prop: "deptName",
+        label: "微信",
+        prop: "weChat",
+        width: 110,
       },
     },
     {
       attrs: {
-        label: "联系电话",
-        prop: "deptName",
+        label: "旺旺",
+        prop: "wangWang",
+        width: 110,
       },
     },
     {
       attrs: {
-        label: "手机号",
-        prop: "deptName",
+        label: "联系电话",
+        prop: "tel",
+        width: 110,
       },
     },
+
     {
       attrs: {
         label: "WhatsApp",
-        prop: "deptName",
+        prop: "whatsApp",
+        width: 110,
       },
     },
     {
       attrs: {
         label: "QQ",
-        prop: "deptName",
+        prop: "qq",
+        width: 110,
       },
     },
     {
       attrs: {
         label: "Skype",
-        prop: "deptName",
+        prop: "skype",
+        width: 110,
       },
     },
     {
       attrs: {
         label: "LinkedIn",
-        prop: "deptName",
+        prop: "linkedIn",
+        width: 110,
       },
     },
     {
       attrs: {
         label: "Facebook",
-        prop: "deptName",
+        prop: "facebook",
+        width: 110,
       },
     },
     {
       attrs: {
         label: "Dirrect Line",
-        prop: "deptName",
+        prop: "directLine",
+        width: 110,
       },
     },
     {
       attrs: {
         label: "邮箱",
-        prop: "deptName",
+        prop: "email",
+        width: 180,
       },
     },
     {
@@ -215,7 +242,7 @@ const config = computed(() => {
                 .msgConfirm()
                 .then((res) => {
                   proxy
-                    .post("/shopInfo/delete", {
+                    .post("/customerUser/delete", {
                       id: row.id,
                     })
                     .then((res) => {
@@ -236,7 +263,7 @@ const formData = reactive({
 });
 const formOption = reactive({
   inline: true,
-  labelWidth: 100,
+  labelWidth: 110,
   itemWidth: 100,
 });
 const formDom = ref(null);
@@ -244,128 +271,143 @@ const formConfig = computed(() => {
   return [
     {
       type: "slot",
-      slotName: "rawMaterialIdSlot",
+      slotName: "customerId",
       label: "",
       itemWidth: 50,
       disabled: true,
     },
     {
       type: "input",
-      prop: "name",
+      prop: "customerCode",
       label: "客户编号",
       itemWidth: 50,
       disabled: true,
     },
+    // {
+    //   type: "input",
+    //   prop: "customerMainPart",
+    //   label: "客户主体",
+    //   itemWidth: 50,
+    //   disabled: true,
+    // },
+    // {
+    //   type: "input",
+    //   prop: "customerMinorPart",
+    //   label: "客户客体",
+    //   itemWidth: 50,
+    //   disabled: true,
+    // },
     {
       type: "input",
       prop: "name",
-      label: "客户主体",
-      itemWidth: 50,
-      disabled: true,
-    },
-    {
-      type: "input",
-      prop: "name",
-      label: "客户客体",
-      itemWidth: 50,
-      disabled: true,
-    },
-    {
-      type: "input",
-      prop: "name",
-      label: "联系人姓名",
+      label: "姓名",
       itemWidth: 25,
     },
     {
-      type: "input",
-      prop: "name",
+      type: "select",
+      prop: "sex",
       label: "性别",
+      data: [
+        {
+          label: "男",
+          value: "1",
+        },
+        {
+          label: "女",
+          value: "2",
+        },
+      ],
       itemWidth: 25,
     },
     {
       type: "input",
-      prop: "name",
+      prop: "position",
       label: "职位",
       itemWidth: 25,
     },
     {
-      type: "input",
-      prop: "name",
+      type: "select",
+      prop: "isKp",
       label: "是否企业关键KP",
+      data: isKpData.value,
       itemWidth: 25,
     },
     {
       type: "input",
-      prop: "name",
-      label: "微信",
+      prop: "phone",
+      label: "手机号",
       itemWidth: 25,
     },
     {
       type: "input",
-      prop: "name",
-      label: "旺旺",
+      prop: "weChat",
+      label: "微信",
       itemWidth: 25,
     },
     {
       type: "input",
-      prop: "name",
-      label: "联系电话",
+      prop: "wangWang",
+      label: "旺旺",
       itemWidth: 25,
     },
     {
       type: "input",
-      prop: "name",
-      label: "手机号",
+      prop: "tel",
+      label: "联系电话",
       itemWidth: 25,
     },
+
     {
       type: "input",
-      prop: "name",
+      prop: "whatsApp",
       label: "WhatsApp",
       itemWidth: 25,
     },
     {
       type: "input",
-      prop: "name",
+      prop: "qq",
       label: "QQ",
       itemWidth: 25,
     },
     {
       type: "input",
-      prop: "name",
+      prop: "skype",
       label: "Skype",
       itemWidth: 25,
     },
     {
       type: "input",
-      prop: "name",
+      prop: "linkedIn",
       label: "LinkedIn",
       itemWidth: 25,
     },
     {
       type: "input",
-      prop: "name",
+      prop: "facebook",
       label: "Facebook",
       itemWidth: 25,
     },
     {
       type: "input",
-      prop: "name",
+      prop: "directLine",
       label: "Dirrect Line",
       itemWidth: 25,
     },
     {
       type: "input",
-      prop: "name",
+      prop: "email",
       label: "邮箱",
       itemWidth: 25,
     },
   ];
 });
+
 const rules = ref({
-  deptId: [{ required: true, message: "请选择负责部门", trigger: "change" }],
-  name: [{ required: true, message: "请输入店铺名称", trigger: "blur" }],
-  code: [{ required: true, message: "请输入店铺编号", trigger: "blur" }],
+  customerName: [{ required: true, message: "请选择客户", trigger: "change" }],
+  name: [{ required: true, message: "请输入姓名", trigger: "blur" }],
+  sex: [{ required: true, message: "请选择性别", trigger: "change" }],
+  position: [{ required: true, message: "请输入职位", trigger: "blur" }],
+  phone: [{ required: true, message: "请输入手机号", trigger: "blur" }],
 });
 
 const getDeptData = () => {
@@ -385,7 +427,7 @@ getDeptData();
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
-  proxy.post("/shopInfo/page", sourceList.value.pagination).then((res) => {
+  proxy.post("/customerUser/page", sourceList.value.pagination).then((res) => {
     sourceList.value.data = res.rows;
     sourceList.value.pagination.total = res.total;
     setTimeout(() => {
@@ -397,16 +439,13 @@ const getList = async (req) => {
 const openModal = () => {
   dialogVisible.value = true;
   modalType.value = "add";
-  formData.data = {
-    definition: "2",
-    fileList: [],
-  };
+  formData.data = {};
 };
 
 const submitForm = () => {
   formDom.value.handleSubmit((valid) => {
     submitLoading.value = true;
-    proxy.post("/shopInfo/" + modalType.value, formData.data).then(
+    proxy.post("/customerUser/" + modalType.value, formData.data).then(
       (res) => {
         proxy.msgTip("操作成功", 1);
         dialogVisible.value = false;
@@ -422,17 +461,24 @@ const submitForm = () => {
 
 const getDtl = (row) => {
   modalType.value = "edit";
-  proxy.post("/shopInfo/detail", { id: row.id }).then((res) => {
-    formData.data = res;
-    dialogVisible.value = true;
-  });
+
+  formData.data = row;
+  formData.data.isKp = row.isKp + "";
+  dialogVisible.value = true;
+  // proxy.post("/customerUser/detail", { id: row.id }).then((res) => {
+  //   res.isKp = res.isKp + "";
+  //   formData.data = res;
+  //   dialogVisible.value = true;
+  // });
 };
 
 getList();
 
 const selectCustomer = (row) => {
   formData.data.customerId = row.id;
-  formData.data.customerIdLabel = row.name;
+  formData.data.customerName = row.name;
+  formData.data.customerCode = row.customerCode;
+  // formData.data.customerMinorPart = row.minorPart;
   openSelectCustomer.value = false;
   proxy.msgTip("选择成功");
 };

+ 17 - 11
src/views/customer/file/index.vue

@@ -110,7 +110,7 @@
             <span v-if="item.cityName"> ,{{ item.cityName }}</span>
           </template>
           <template #name="{ item }">
-            <div style="cursor: pointer; color: #409eff; word-break: break-all" @click="handleClickName(item)">
+            <div class="el-click" @click="handleClickName(item)">
               {{ item.name }}
             </div>
           </template>
@@ -210,8 +210,11 @@
     </div>
 
     <el-dialog :title="modalType == 'add' ? '新增' : '编辑'" v-if="dialogVisible" v-model="dialogVisible" width="80%">
-      <AddCustomer ref="AddCustomerDom" :modalType="modalType" :customerId="customerId" @refreshList="refreshList"></AddCustomer>
-      <template #footer>
+      <div class="public_height_dialog">
+        <AddCustomer ref="AddCustomerDom" :modalType="modalType" :customerId="customerId" @refreshList="refreshList"></AddCustomer>
+      </div>
+
+      <template #footer v-if="modalType!='detail'">
         <el-button @click="dialogVisible = false" size="default">取 消</el-button>
         <el-button type="primary" @click="submitForm()" size="default">确 定</el-button>
       </template>
@@ -517,7 +520,7 @@ const config = computed(() => {
     },
     {
       attrs: {
-        label: "客户名称",
+        label: "公司/客户主体",
         slot: "name",
         fixed: "left",
         width: 160,
@@ -851,12 +854,15 @@ const getDict = () => {
 getDict();
 getList();
 const handleClickName = (row) => {
-  proxy.$router.push({
-    name: "Portrait",
-    query: {
-      id: row.id,
-    },
-  });
+  customerId.value = row.id;
+  modalType.value = "detail";
+  dialogVisible.value = true;
+  // proxy.$router.push({
+  //   name: "Portrait",
+  //   query: {
+  //     id: row.id,
+  //   },
+  // });
 };
 const deleteFollow = (data) => {
   ElMessageBox.confirm("是否确认删除该跟进?", "提示", {
@@ -1211,7 +1217,7 @@ const formSearchConfig = computed(() => {
     {
       type: "input",
       prop: "name",
-      label: "客户名称",
+      label: "公司/客户主体",
       itemType: "text",
     },
     {

+ 17 - 12
src/views/customer/highseas/index.vue

@@ -110,7 +110,7 @@
             <span v-if="item.cityName"> ,{{ item.cityName }}</span>
           </template>
           <template #name="{ item }">
-            <div style="cursor: pointer; color: #409eff; word-break: break-all" @click="handleClickName(item)">
+            <div class="el-click" @click="handleClickName(item)">
               {{ item.name }}
             </div>
           </template>
@@ -206,8 +206,10 @@
     </div>
 
     <el-dialog :title="modalType == 'add' ? '新增' : '编辑'" v-if="dialogVisible" v-model="dialogVisible" width="80%" v-loading="loadingOperation">
-      <AddCustomer ref="AddCustomerDom" :modalType="modalType" :customerId="customerId" :isHighseas="true" @refreshList="refreshList"></AddCustomer>
-      <template #footer>
+      <div class="public_height_dialog">
+        <AddCustomer ref="AddCustomerDom" :modalType="modalType" :customerId="customerId" :isHighseas="true" @refreshList="refreshList"></AddCustomer>
+      </div>
+      <template #footer v-if="modalType!='detail'">
         <el-button @click="dialogVisible = false" size="default">取 消</el-button>
         <el-button type="primary" @click="submitForm()" size="default" :loading="submitLoading">确 定</el-button>
       </template>
@@ -459,7 +461,7 @@ const config = computed(() => {
     },
     {
       attrs: {
-        label: "客户名称",
+        label: "公司/客户主体",
         slot: "name",
         fixed: "left",
         width: 160,
@@ -611,7 +613,7 @@ const formConfig = computed(() => {
     {
       type: "input",
       prop: "name",
-      label: "客户名称",
+      label: "公司/客户主体",
       required: true,
       itemWidth: 100,
       itemType: "text",
@@ -860,12 +862,15 @@ const getDict = () => {
 getDict();
 getList();
 const handleClickName = (row) => {
-  proxy.$router.push({
-    path: "Portrait",
-    query: {
-      id: row.id,
-    },
-  });
+  customerId.value = row.id;
+  modalType.value = "detail";
+  dialogVisible.value = true;
+  // proxy.$router.push({
+  //   path: "Portrait",
+  //   query: {
+  //     id: row.id,
+  //   },
+  // });
 };
 const deleteFollow = (data) => {
   ElMessageBox.confirm("是否确认删除该跟进?", "提示", {
@@ -1215,7 +1220,7 @@ const formSearchConfig = computed(() => {
     {
       type: "input",
       prop: "name",
-      label: "客户名称",
+      label: "公司/客户主体",
       itemType: "text",
     },
     {

+ 17 - 12
src/views/customer/privatesea/index.vue

@@ -109,7 +109,7 @@
             <span v-if="item.cityName"> ,{{ item.cityName }}</span>
           </template>
           <template #name="{ item }">
-            <div style="cursor: pointer; color: #409eff; word-break: break-all" @click="handleClickName(item)">
+            <div class="el-click" @click="handleClickName(item)">
               {{ item.name }}
             </div>
           </template>
@@ -205,8 +205,10 @@
     </div>
 
     <el-dialog :title="modalType == 'add' ? '新增' : '编辑'" v-if="dialogVisible" v-model="dialogVisible" width="80%" v-loading="loadingOperation">
-      <AddCustomer ref="AddCustomerDom" :modalType="modalType" :customerId="customerId" :isPrivate="true" @refreshList="refreshList"></AddCustomer>
-      <template #footer>
+      <div class="public_height_dialog">
+        <AddCustomer ref="AddCustomerDom" :modalType="modalType" :customerId="customerId" :isPrivate="true" @refreshList="refreshList"></AddCustomer>
+      </div>
+      <template #footer v-if="modalType!='detail'">
         <el-button @click="dialogVisible = false" size="default">取 消</el-button>
         <el-button type="primary" @click="submitForm()" size="default" :loading="submitLoading">确 定</el-button>
       </template>
@@ -459,7 +461,7 @@ const config = computed(() => {
     },
     {
       attrs: {
-        label: "客户名称",
+        label: "公司/客户主体",
         slot: "name",
         fixed: "left",
         width: 160,
@@ -611,7 +613,7 @@ const formConfig = computed(() => {
     {
       type: "input",
       prop: "name",
-      label: "客户名称",
+      label: "公司/客户主体",
       required: true,
       itemWidth: 100,
       itemType: "text",
@@ -860,12 +862,15 @@ const getDict = () => {
 getDict();
 getList();
 const handleClickName = (row) => {
-  proxy.$router.push({
-    path: "Portrait",
-    query: {
-      id: row.id,
-    },
-  });
+  customerId.value = row.id;
+  modalType.value = "detail";
+  dialogVisible.value = true;
+  // proxy.$router.push({
+  //   path: "Portrait",
+  //   query: {
+  //     id: row.id,
+  //   },
+  // });
 };
 const deleteFollow = (data) => {
   ElMessageBox.confirm("是否确认删除该跟进?", "提示", {
@@ -1215,7 +1220,7 @@ const formSearchConfig = computed(() => {
     {
       type: "input",
       prop: "name",
-      label: "客户名称",
+      label: "公司/客户主体",
       itemType: "text",
     },
     {

+ 112 - 106
src/views/index.vue

@@ -704,124 +704,130 @@ const getFileData = () => {
 const activeName = ref("1");
 const lookDetails = (item) => {
   activeName.value = "1";
-  proxy.post("/contract/detail", { id: item.contractId }).then(async (res) => {
-    formData.orderData = res;
-    dialogVisible.value = true;
-    proxy
-      .post("/produceOrder/materialBalanceList", { id: item.id })
-      .then((sonRes) => {
-        formData.orderData.materialList = sonRes;
-        if (sonRes && sonRes.length > 0) {
-          let ids = sonRes.map((x) => x.materialId);
-          proxy.getFileData({
-            businessIdList: ids,
-            data: formData.orderData.materialList,
-            att: "materialId",
-            businessType: "0",
-            fileAtt: "fileList",
-            filePathAtt: "fileUrl",
-          });
-        }
-      });
-    if (
-      formData.orderData.contractProductList &&
-      formData.orderData.contractProductList.length > 0
-    ) {
-      getFileData();
-      let ids = formData.orderData.contractProductList.map((x) => x.id);
-      let productIds = formData.orderData.contractProductList.map(
-        (x) => x.productId
-      );
+  proxy
+    .post("/produceOrder/contractInfo", { id: item.id })
+    .then(async (res) => {
+      formData.orderData = res;
+      dialogVisible.value = true;
+      proxy
+        .post("/produceOrder/materialBalanceList", { id: item.id })
+        .then((sonRes) => {
+          formData.orderData.materialList = sonRes;
+          if (sonRes && sonRes.length > 0) {
+            let ids = sonRes.map((x) => x.materialId);
+            proxy.getFileData({
+              businessIdList: ids,
+              data: formData.orderData.materialList,
+              att: "materialId",
+              businessType: "0",
+              fileAtt: "fileList",
+              filePathAtt: "fileUrl",
+            });
+          }
+        });
+      if (
+        formData.orderData.contractProductList &&
+        formData.orderData.contractProductList.length > 0
+      ) {
+        getFileData();
+        let ids = formData.orderData.contractProductList.map((x) => x.id);
+        let productIds = formData.orderData.contractProductList.map(
+          (x) => x.productId
+        );
 
-      const productAllFile = await proxy.getFileData({
-        businessIdList: productIds,
-        getAll: true,
-      });
-      for (let i = 0; i < formData.orderData.contractProductList.length; i++) {
-        const ele = formData.orderData.contractProductList[i];
-        for (const key in productAllFile) {
-          if (
-            ele.productId == key &&
-            productAllFile[ele.productId] &&
-            productAllFile[ele.productId].length > 0
-          ) {
-            ele.productFile = productAllFile[ele.productId].filter(
-              (x) => x.businessType == "0"
-            );
-            if (ele.productFile && ele.productFile.length > 0) {
-              ele.fileUrl = ele.productFile[0].fileUrl;
+        const productAllFile = await proxy.getFileData({
+          businessIdList: productIds,
+          getAll: true,
+        });
+        for (
+          let i = 0;
+          i < formData.orderData.contractProductList.length;
+          i++
+        ) {
+          const ele = formData.orderData.contractProductList[i];
+          for (const key in productAllFile) {
+            if (
+              ele.productId == key &&
+              productAllFile[ele.productId] &&
+              productAllFile[ele.productId].length > 0
+            ) {
+              ele.productFile = productAllFile[ele.productId].filter(
+                (x) => x.businessType == "0"
+              );
+              if (ele.productFile && ele.productFile.length > 0) {
+                ele.fileUrl = ele.productFile[0].fileUrl;
+              }
+              break;
             }
-            break;
           }
         }
-      }
 
-      proxy
-        .getFileData({
-          businessIdList: ids,
-          getAll: true,
-        })
-        .then((fileObj) => {
-          if (fileObj && Object.keys(fileObj).length > 0) {
-            for (
-              let i = 0;
-              i < formData.orderData.contractProductList.length;
-              i++
-            ) {
-              const ele = formData.orderData.contractProductList[i];
-              for (const key in fileObj) {
-                if (
-                  ele.id == key &&
-                  fileObj[ele.id] &&
-                  fileObj[ele.id].length > 0
-                ) {
-                  let imageUrlList = fileObj[ele.id].filter(
-                    (x) => x.businessType == "0"
-                  );
-                  if (imageUrlList && imageUrlList.length > 0) {
-                    ele.imageUrl = imageUrlList[0].fileUrl;
-                  }
-                  ele.prodFileList = fileObj[ele.id]
-                    .filter((x) => x.businessType == "1")
-                    .map((x) => ({ ...x, name: x.fileName, url: x.fileUrl }));
-                  if (ele.prodFileList && ele.prodFileList.length > 0) {
-                    ele.isShowProductFile = false;
-                  } else {
-                    ele.isShowProductFile = true;
-                    if (productAllFile[ele.productId]) {
-                      ele.fileListOne = productAllFile[ele.productId].filter(
-                        (x) => x.businessType == "2"
-                      );
+        proxy
+          .getFileData({
+            businessIdList: ids,
+            getAll: true,
+          })
+          .then((fileObj) => {
+            if (fileObj && Object.keys(fileObj).length > 0) {
+              for (
+                let i = 0;
+                i < formData.orderData.contractProductList.length;
+                i++
+              ) {
+                const ele = formData.orderData.contractProductList[i];
+                for (const key in fileObj) {
+                  if (
+                    ele.id == key &&
+                    fileObj[ele.id] &&
+                    fileObj[ele.id].length > 0
+                  ) {
+                    let imageUrlList = fileObj[ele.id].filter(
+                      (x) => x.businessType == "0"
+                    );
+                    if (imageUrlList && imageUrlList.length > 0) {
+                      ele.imageUrl = imageUrlList[0].fileUrl;
+                    }
+                    ele.prodFileList = fileObj[ele.id]
+                      .filter((x) => x.businessType == "1")
+                      .map((x) => ({ ...x, name: x.fileName, url: x.fileUrl }));
+                    if (ele.prodFileList && ele.prodFileList.length > 0) {
+                      ele.isShowProductFile = false;
+                    } else {
+                      ele.isShowProductFile = true;
+                      if (productAllFile[ele.productId]) {
+                        ele.fileListOne = productAllFile[ele.productId].filter(
+                          (x) => x.businessType == "2"
+                        );
+                      }
                     }
                   }
                 }
               }
-            }
-          } else {
-            for (
-              let i = 0;
-              i < formData.orderData.contractProductList.length;
-              i++
-            ) {
-              const ele = formData.orderData.contractProductList[i];
-              ele.isShowProductFile = true;
-              for (const key in productAllFile) {
-                if (
-                  ele.productId == key &&
-                  productAllFile[ele.productId] &&
-                  productAllFile[ele.productId].length > 0
-                ) {
-                  ele.fileListOne = productAllFile[ele.productId].filter(
-                    (x) => x.businessType == "2"
-                  );
-                  break;
+            } else {
+              for (
+                let i = 0;
+                i < formData.orderData.contractProductList.length;
+                i++
+              ) {
+                const ele = formData.orderData.contractProductList[i];
+                ele.isShowProductFile = true;
+                for (const key in productAllFile) {
+                  if (
+                    ele.productId == key &&
+                    productAllFile[ele.productId] &&
+                    productAllFile[ele.productId].length > 0
+                  ) {
+                    ele.fileListOne = productAllFile[ele.productId].filter(
+                      (x) => x.businessType == "2"
+                    );
+                    break;
+                  }
                 }
               }
             }
-          }
-        });
-    }
-  });
+          });
+      }
+    });
 };
 </script>
 <style scoped lang="scss">

+ 2 - 2
src/views/process/processApproval/index.vue

@@ -670,8 +670,8 @@ const processApprovalDom = ref(null);
 const flowChartDom = ref(null);
 const getTableHeight = () => {
   if (route.query.currentContractId) {
-    processApprovalDom.value.style.height = window.innerHeight - 160 + "px";
-    flowChartDom.value.style.height = window.innerHeight - 250 + "px";
+    processApprovalDom.value.style.height = window.innerHeight - 195 + "px";
+    flowChartDom.value.style.height = window.innerHeight - 285 + "px";
   } else {
     processApprovalDom.value.style.height = window.innerHeight - 100 + "px";
     flowChartDom.value.style.height = window.innerHeight - 210 + "px";

+ 1 - 1
src/views/purchaseSales/outAndInWarehouse/manualDelivery/index.vue

@@ -97,7 +97,7 @@ const outBoundReason = ref([
     value: "1",
   },
   {
-    label: "销售出库",
+    label: "发货申请",
     value: "2",
   },
   {

+ 1 - 1
src/views/purchaseSales/outAndInWarehouse/record/index.vue

@@ -108,7 +108,7 @@ const typeList = ref([
     value: "1",
   },
   {
-    label: "销售出库",
+    label: "发货申请",
     value: "2",
   },
   {

+ 1 - 1
src/views/purchaseSales/outAndInWarehouse/waitingForDelivery/index.vue

@@ -134,7 +134,7 @@ const businessType = ref([
     value: "1",
   },
   {
-    label: "销售出库",
+    label: "发货申请",
     value: "2",
   },
   {

+ 265 - 119
src/views/salesMange/saleContract/contractSelect/index.vue

@@ -3,27 +3,59 @@
     <div class="content">
       <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" :selectConfig="selectConfig"
                highlight-current-row :action-list="[]" @get-list="getList">
+        <template #contractType="{ item }">
+          <div style="width: 100%">
+            <span>
+              {{ dictKeyValue(item.contractType, contractType) }}
+            </span>
+          </div>
+        </template>
+
+        <template #produceStatus="{ item }">
+          <div style="width: 100%">
+            <span v-if="item.produceStatus==0 || item.produceStatus" :class="item.produceStatus==10?'tag-active':'tag-active-1'">
+              {{ dictValueLabel(item.produceStatus, produceStatusData) }}</span>
+          </div>
+        </template>
+        <template #statusSlot="{ item }">
+          <div style="width: 100%">
+            <span :class="(item.status==88 || item.status==99)?'red':''">
+              {{ dictValueLabel(item.status, status) }}</span>
+          </div>
+        </template>
+
         <template #amount="{ item }">
           <div>
             <span style="padding-right: 4px">{{ item.currency }}</span>
             <span>{{ moneyFormat(item.amount, 2) }}</span>
           </div>
         </template>
-        <template #refundMoney="{ item }">
-          <div>
-            <span style="padding-right: 4px">{{ item.currency }}</span>
-            <span>{{ moneyFormat(item.sumContractClaimMoney, 2) }}</span>
+        <template #buyCorporationName="{ item }">
+          <div style="width: 100%">
+            <!-- style="color: #409eff; cursor: pointer" @click="clickCorporationName(item)" -->
+            <a>{{ item.buyCorporationName }}</a>
           </div>
         </template>
-        <template #sumContractNotClaimMoney="{ item }">
-          <div>
-            <span style="padding-right: 4px">{{ item.currency }}</span>
-            <span>{{ moneyFormat(item.sumContractNotClaimMoney, 2) }}</span>
+        <template #deliveryTime="{ item }">
+          <div style="width: 100%;display:flex;align-items:center">
+            <!-- <el-icon v-if="item.orderDistributeStatus==1 && item.deliveryTime" :size="16" style="cursor:pointer;margin-right: 8px;" color="#409EFF"
+                     @click="clickDistributeProduction(item)">
+              <Edit />
+            </el-icon> -->
+            <div v-if="item.deliveryTime">
+              {{item.deliveryTime.slice(0,10)}}
+            </div>
           </div>
         </template>
-        <template #advanceRatio="{ item }">
-          <div>
-            <span>{{ item.advanceRatio }}%</span>
+        <template #prodDeliveryPeriod="{ item }">
+          <div style="width: 100%;display:flex;align-items:center">
+            <!-- <el-icon v-if="item.orderDistributeStatus==1 && item.prodDeliveryPeriod" :size="16" style="cursor:pointer;margin-right: 8px;"
+                     color="#409EFF" @click="clickDistributeProduction(item)">
+              <Edit />
+            </el-icon> -->
+            <div v-if="item.prodDeliveryPeriod">
+              {{item.prodDeliveryPeriod.slice(0,10)}}
+            </div>
           </div>
         </template>
       </byTable>
@@ -38,8 +70,7 @@ import useUserStore from "@/store/modules/user";
 import { ElMessage, ElMessageBox } from "element-plus";
 
 const { proxy } = getCurrentInstance();
-const contractType = ref([]);
-const corporationList = ref([]);
+const userList = ref([]);
 const status = ref([
   {
     label: "草稿",
@@ -50,7 +81,7 @@ const status = ref([
     value: 10,
   },
   {
-    label: "驳回",
+    label: "审批驳回",
     value: 20,
   },
   {
@@ -58,6 +89,22 @@ const status = ref([
     value: 30,
   },
   {
+    label: "变更中",
+    value: 60,
+  },
+  {
+    label: "已变更",
+    value: 70,
+  },
+  {
+    label: "已发货",
+    value: 75,
+  },
+  {
+    label: "作废",
+    value: 88,
+  },
+  {
     label: "终止",
     value: 99,
   },
@@ -72,6 +119,45 @@ const refundStatus = ref([
     value: 10,
   },
 ]);
+const belongTypeData = ref([
+  {
+    dictKey: "1",
+    dictValue: "归属工厂",
+  },
+  {
+    dictKey: "2",
+    dictValue: "归属业务",
+  },
+]);
+const contractType = ref([
+  {
+    dictKey: "3",
+    dictValue: "打样订单",
+  },
+  {
+    dictKey: "2",
+    dictValue: "内销订单",
+  },
+  {
+    dictKey: "1",
+    dictValue: "外贸订单(退税)",
+  },
+  {
+    dictKey: "4",
+    dictValue: "外贸订单(不退税)",
+  },
+]);
+
+const processingMethod = ref([
+  {
+    dictKey: 10,
+    dictValue: "业务自采",
+  },
+  {
+    dictKey: 20,
+    dictValue: "生产处理",
+  },
+]);
 const sourceList = ref({
   data: [],
   pagination: {
@@ -79,16 +165,72 @@ const sourceList = ref({
     pageNum: 1,
     pageSize: 10,
     keyword: "",
-    sellCorporationId: "",
+    status: "",
+    companyId: "",
+    userId: "",
+    isSettled: "",
+    beginTime: "",
+    endTime: "",
+    deliveryTimeSta: "",
+    deliveryTimeEnd: "",
+    type: "",
+    produceStatus: "",
   },
 });
 const loading = ref(false);
+
 const selectConfig = computed(() => {
   return [
     {
-      label: "到款状态",
-      prop: "refundStatusNew",
-      data: refundStatus.value,
+      label: "业务公司",
+      prop: "ofCompanyId",
+      data: proxy.useUserStore().allDict["list_company_data"],
+    },
+    {
+      label: "订单类型",
+      prop: "contractType",
+      data: contractType.value,
+    },
+    {
+      label: "订单状态",
+      prop: "status",
+      data: status.value,
+    },
+    // {
+    //   label: "工厂",
+    //   prop: "companyId",
+    //   data: companyData.value,
+    // },
+    // {
+    //   label: "生产状态",
+    //   prop: "produceStatus",
+    //   data: produceStatusData.value,
+    // },
+    {
+      label: "业务员",
+      prop: "userId",
+      data: userList.value,
+    },
+    // {
+    //   label: "是否已结清",
+    //   prop: "isSettled",
+    //   data: isSettled.value,
+    // },
+    {
+      type: "time",
+      label: "创建时间",
+      placeholder: "开始日期",
+      prop: "beginTime",
+      placeholderOne: "结束日期",
+      propOne: "endTime",
+    },
+    {
+      type: "time",
+      label: "交期",
+      placeholder: "开始日期",
+      prop: "deliveryTimeSta",
+      placeholderOne: "结束日期",
+      propOne: "deliveryTimeEnd",
     },
   ];
 });
@@ -97,126 +239,143 @@ const config = computed(() => {
     {
       attrs: {
         label: "业务公司",
-        prop: "sellCorporationId",
-        "min-width": 220,
-      },
-      render(type) {
-        let text = "";
-        if (corporationList.value && corporationList.value.length > 0) {
-          let data = corporationList.value.filter((item) => item.value == type);
-          if (data && data.length > 0) {
-            text = data[0].label;
-          }
-        }
-        return text;
+        prop: "ofCompanyName",
+        width: 110,
       },
     },
     {
       attrs: {
-        label: "订单类型",
-        prop: "contractType",
-        width: 120,
-      },
-      render(type) {
-        let text = "";
-        if (contractType.value && contractType.value.length > 0) {
-          let data = contractType.value.filter((item) => item.value == type);
-          if (data && data.length > 0) {
-            text = data[0].label;
-          }
-        }
-        return text;
+        label: "业务部门",
+        prop: "deptName",
+        width: 110,
       },
     },
     {
       attrs: {
-        label: "合同编码",
-        prop: "code",
-        width: 180,
+        label: "订单类型",
+        slot: "contractType",
+        width: 110,
       },
     },
     {
       attrs: {
-        label: "客户",
-        prop: "buyCorporationName",
-        "min-width": 220,
+        label: "订单处理方式",
+        prop: "processingMethod",
+        width: 110,
+      },
+      render(val) {
+        return proxy.dictKeyValue(val, processingMethod.value);
       },
     },
-    // {
-    //   attrs: {
-    //     label: "版本号",
-    //     prop: "version",
-    //     width: 120,
-    //   },
-    // },
     {
       attrs: {
-        label: "合同金额",
-        slot: "amount",
+        label: "合同号",
+        prop: "code",
         width: 140,
       },
     },
 
-    // {
-    //   attrs: {
-    //     label: "已到账金额",
-    //     slot: "refundMoney",
-    //     width: 140,
-    //   },
-    // },
     {
       attrs: {
-        label: "未结清金额",
-        slot: "sumContractNotClaimMoney",
-        width: 140,
+        label: "订单归属",
+        prop: "belongType",
+        width: 80,
+      },
+      render(val) {
+        return proxy.dictKeyValue(val, belongTypeData.value);
+      },
+    },
+    {
+      attrs: {
+        label: "订单状态",
+        slot: "statusSlot",
+        width: 100,
+      },
+      render(type) {
+        return proxy.dictValueLabel(type, status.value);
       },
     },
     {
       attrs: {
         label: "业务员",
-        prop: "userName",
-        width: 140,
+        prop: "salesmanName",
+        width: 100,
       },
+      // render(type) {
+      //   return proxy.dictValueLabel(type, userList.value);
+      // },
     },
     {
       attrs: {
-        label: "创建时间",
+        label: "下单时间",
         prop: "createTime",
         width: 160,
       },
     },
     {
       attrs: {
-        label: "到款状态",
-        prop: "refundStatusNew",
-        width: 80,
+        label: "合同交期",
+        slot: "deliveryTime",
+        width: 100,
       },
-      render(refundStatusNew) {
-        return proxy.dictValueLabel(refundStatusNew, refundStatus.value);
+    },
+    {
+      attrs: {
+        label: "生产交期",
+        slot: "prodDeliveryPeriod",
+        width: 100,
       },
     },
-
     {
       attrs: {
-        label: "审批状态",
-        prop: "status",
+        label: "下发生产时间",
+        prop: "orderDistributeTime",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "客户名称",
+        slot: "buyCorporationName",
+        "min-width": 180,
+      },
+    },
+    {
+      attrs: {
+        label: "合同金额",
+        slot: "amount",
         width: 140,
+        align: "right",
       },
-      render(type) {
-        let text = "";
-        if (status.value && status.value.length > 0) {
-          let data = status.value.filter((item) => item.value == type);
-          if (data && data.length > 0) {
-            text = data[0].label;
-          }
-        }
-        return text;
+    },
+    {
+      attrs: {
+        label: "累计收款金额",
+        prop: "sumClaimMoney",
+        width: 110,
+        align: "right",
+      },
+    },
+    {
+      attrs: {
+        label: "已结算金额",
+        prop: "settledAmount",
+        width: 100,
+        align: "right",
+      },
+    },
+    {
+      attrs: {
+        label: "未结算金额",
+        prop: "unsettledAmount",
+        width: 100,
+        align: "right",
       },
     },
     {
       attrs: {
         label: "操作",
-        width: "120",
+        width: "80",
         align: "center",
         fixed: "right",
       },
@@ -240,44 +399,31 @@ const config = computed(() => {
 });
 const getDict = () => {
   proxy
-    .post("/dictTenantData/page", {
+    .get("/tenantUser/list", {
       pageNum: 1,
-      pageSize: 999,
-      dictCode: "contract_type",
-      tenantId: useUserStore().user.tenantId,
+      pageSize: 10000,
+      tenantId: proxy.useUserStore().user.tenantId,
+      // companyId: proxy.useUserStore().user.companyId,
     })
     .then((res) => {
-      if (res.rows && res.rows.length > 0) {
-        contractType.value = res.rows.map((item) => {
-          return {
-            label: item.dictValue,
-            value: item.dictKey,
-          };
-        });
-      }
-    });
-  proxy.post("/corporation/page", { pageNum: 1, pageSize: 999 }).then((res) => {
-    corporationList.value = res.rows.map((item) => {
-      return {
-        ...item,
-        label: item.name,
-        value: item.id,
-      };
+      userList.value = res.rows.map((item) => {
+        return {
+          label: item.nickName,
+          value: item.userId,
+        };
+      });
     });
-  });
 };
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
-  proxy
-    .post("/contract/contractAndSamplePage", sourceList.value.pagination)
-    .then((res) => {
-      sourceList.value.data = res.rows;
-      sourceList.value.pagination.total = res.total;
-      setTimeout(() => {
-        loading.value = false;
-      }, 200);
-    });
+  proxy.post("/contract/page", sourceList.value.pagination).then((res) => {
+    sourceList.value.data = res.rows;
+    sourceList.value.pagination.total = res.total;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
 };
 getDict();
 getList();