瀏覽代碼

销售出库流程

cz 1 年之前
父節點
當前提交
e98d4e25eb

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

@@ -177,8 +177,9 @@
 
       <template #commodity>
         <div style="width: 100%">
-          <el-button type="primary" @click="openProductCompany = true" plain style="margin-bottom: 16px" v-if="!judgeStatus() && isEditList"
-                     :disabled="!formData.data.companyId">产品库</el-button>
+          <el-button type="primary" @click="openProductCompany = true" plain style="margin-bottom: 16px"
+                     v-if="!judgeStatus() && isEditList">产品库</el-button>
+          <!-- :disabled="!formData.data.companyId" -->
           <!-- default-expand-all -->
           <el-table :data="formData.data.contractProductList" style="width: 100%;" row-key="rowId">
             <el-table-column type="expand" width="50" align="center">
@@ -528,10 +529,20 @@
           <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>
-      <SelectProduct @selectProduct="selectProduct" :companyId="formData.data.companyId" :isRawMaterial="'1'" :disablePerm="'1'"></SelectProduct>
+      <SelectProduct @selectProduct="selectProduct" :isRawMaterial="'1'" :disablePerm="'1'"></SelectProduct>
+      <!-- :companyId="formData.data.companyId" -->
       <template #footer>
         <el-button @click="openProductCompany = false" size="defualt" v-debounce>关 闭</el-button>
       </template>
@@ -594,7 +605,6 @@ const settlementWay = computed(
 const frontLinesData = computed(
   () => proxy.useUserStore().allDict["front_lines"]
 );
-const companyId = computed(() => proxy.useUserStore().user.companyId);
 const accountList = ref([]);
 const customerList = ref([]);
 const templateList = ref([]);
@@ -726,29 +736,29 @@ const formConfig = computed(() => {
       label: "订单处理方式",
       data: [
         {
-          dictKey: "10",
+          dictKey: 10,
           dictValue: "业务自采",
         },
         {
-          dictKey: "20",
+          dictKey: 20,
           dictValue: "生产处理",
         },
       ],
-      itemWidth: 25,
-    },
-    {
-      type: "treeSelect",
-      prop: "companyId",
-      label: "工厂",
-      data: treeData.value,
-      propsTreeLabel: "deptName",
-      propsTreeValue: "deptId",
       itemWidth: 50,
-      disabled: !isEditList.value,
-      fn: () => {
-        formData.data.contractProductList = [];
-      },
     },
+    // {
+    //   type: "treeSelect",
+    //   prop: "companyId",
+    //   label: "工厂",
+    //   data: treeData.value,
+    //   propsTreeLabel: "deptName",
+    //   propsTreeValue: "deptId",
+    //   itemWidth: 50,
+    //   disabled: !isEditList.value,
+    //   fn: () => {
+    //     formData.data.contractProductList = [];
+    //   },
+    // },
     {
       type: "select",
       prop: "belongType",
@@ -1219,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,
+    },
   ];
 });
 
@@ -1379,7 +1404,6 @@ const getDict = () => {
       pageNum: 1,
       pageSize: 10000,
       tenantId: proxy.useUserStore().user.tenantId,
-      // companyId: proxy.useUserStore().user.companyId,
     })
     .then((res) => {
       userList.value = res.rows.map((item) => {
@@ -2058,6 +2082,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
@@ -2206,7 +2249,7 @@ const getPriceSheetData = (id) => {
       contractType: route.query.contractType,
       templateContent: "",
       quotationId: res.id,
-      companyId: res.companyId,
+      // companyId: res.companyId,
       ofCompanyId: res.ofCompanyId,
       deptId: res.deptId,
       buyCorporationId: res.buyCorporationId,

+ 35 - 16
src/components/process/SF/ContractChange.vue

@@ -177,8 +177,9 @@
 
       <template #commodity>
         <div style="width: 100%">
-          <el-button type="primary" @click="openProductCompany = true" plain style="margin-bottom: 16px" v-if="!judgeStatus() && isEditList"
-                     :disabled="!formData.data.companyId">产品库</el-button>
+          <el-button type="primary" @click="openProductCompany = true" plain style="margin-bottom: 16px"
+                     v-if="!judgeStatus() && isEditList">产品库</el-button>
+          <!-- :disabled="!formData.data.companyId" -->
           <!-- default-expand-all -->
           <el-table :data="formData.data.contractProductList" style="width: 100%;" row-key="rowId">
             <el-table-column type="expand" width="50" align="center">
@@ -531,7 +532,8 @@
     </byForm>
 
     <el-dialog v-if="openProductCompany" v-model="openProductCompany" title="产品库" width="90%" append-to-body>
-      <SelectProduct @selectProduct="selectProduct" :companyId="formData.data.companyId" :isRawMaterial="'1'" :disablePerm="'1'"></SelectProduct>
+      <SelectProduct @selectProduct="selectProduct" :isRawMaterial="'1'" :disablePerm="'1'"></SelectProduct>
+      <!-- :companyId="formData.data.companyId" -->
       <template #footer>
         <el-button @click="openProductCompany = false" size="defualt" v-debounce>关 闭</el-button>
       </template>
@@ -594,7 +596,6 @@ const settlementWay = computed(
 const frontLinesData = computed(
   () => proxy.useUserStore().allDict["front_lines"]
 );
-const companyId = computed(() => proxy.useUserStore().user.companyId);
 const accountList = ref([]);
 const customerList = ref([]);
 const templateList = ref([]);
@@ -721,18 +722,34 @@ const formConfig = computed(() => {
       },
     },
     {
-      type: "treeSelect",
-      prop: "companyId",
-      label: "工厂",
-      data: treeData.value,
-      propsTreeLabel: "deptName",
-      propsTreeValue: "deptId",
+      type: "select",
+      prop: "processingMethod",
+      label: "订单处理方式",
+      data: [
+        {
+          dictKey: 10,
+          dictValue: "业务自采",
+        },
+        {
+          dictKey: 20,
+          dictValue: "生产处理",
+        },
+      ],
       itemWidth: 50,
-      disabled: !isEditList.value,
-      fn: () => {
-        formData.data.contractProductList = [];
-      },
     },
+    // {
+    //   type: "treeSelect",
+    //   prop: "companyId",
+    //   label: "工厂",
+    //   data: treeData.value,
+    //   propsTreeLabel: "deptName",
+    //   propsTreeValue: "deptId",
+    //   itemWidth: 50,
+    //   disabled: !isEditList.value,
+    //   fn: () => {
+    //     formData.data.contractProductList = [];
+    //   },
+    // },
     {
       type: "select",
       prop: "belongType",
@@ -1215,6 +1232,9 @@ const rules = ref({
   contractType: [
     { required: true, message: "请选择订单类型", trigger: "change" },
   ],
+  processingMethod: [
+    { required: true, message: "请选择订单处理方式", trigger: "change" },
+  ],
   deliveryTime: [
     { required: true, message: "请选择交货日期", trigger: "change" },
   ],
@@ -1360,7 +1380,6 @@ const getDict = () => {
       pageNum: 1,
       pageSize: 10000,
       tenantId: proxy.useUserStore().user.tenantId,
-      // companyId: proxy.useUserStore().user.companyId,
     })
     .then((res) => {
       userList.value = res.rows.map((item) => {
@@ -2187,7 +2206,7 @@ const getPriceSheetData = (id) => {
       contractType: route.query.contractType,
       templateContent: "",
       quotationId: res.id,
-      companyId: res.companyId,
+      // companyId: res.companyId,
       ofCompanyId: res.ofCompanyId,
       deptId: res.deptId,
       buyCorporationId: res.buyCorporationId,

+ 265 - 0
src/components/process/SF/SalesOutBound.vue

@@ -0,0 +1,265 @@
+<template>
+  <div style="width: 100%; padding: 0px 15px">
+    <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="formDom">
+      <template #commodity>
+        <div style="width: 100%">
+          <el-table :data="formData.data.outboundRecordList" style="width: 100%; ">
+
+            <el-table-column label="商品图片" width="80">
+              <template #default="{ row }">
+                <div v-if="row.fileUrl">
+                  <img :src="row.fileUrl" class="pic" @click="openImg(row.fileUrl)" />
+                </div>
+                <div v-else></div>
+              </template>
+            </el-table-column>
+            <el-table-column prop="productName" label="商品名称" min-width="150" />
+            <el-table-column prop="productCode" label="商品编码" width="200" />
+            <el-table-column label="规格尺寸 (cm)" width="130">
+              <template #default="{ row, $index }">
+                <div style="width: 100%">
+                  {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column prop="productColor" label="颜色" width="150" />
+            <el-table-column prop="productFrontalTexture" label="纹路" width="130"
+                             :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="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">
+              <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"
+                                   :controls="false" :min="0" @change="totalAmount()" />
+                </el-form-item>
+              </template>
+            </el-table-column>
+            <el-table-column label="小计" width="100" prop="amount" fixed="right" />
+            <el-table-column label="备注" min-width="200" prop="remark" />
+          </el-table>
+        </div>
+      </template>
+    </byForm>
+  </div>
+</template>
+
+<script setup>
+import byForm from "@/components/byForm/index";
+const route = useRoute();
+// 接收父组件的传值
+const props = defineProps({
+  queryData: Object,
+});
+const { proxy } = getCurrentInstance();
+const frontLinesData = computed(
+  () => proxy.useUserStore().allDict["front_lines"]
+);
+const formData = reactive({
+  data: {},
+});
+const formDom = ref(null);
+const judgeStatus = () => {
+  if (route.query.processType == 20 || route.query.processType == 10) {
+    return true;
+  }
+  if (props.queryData.recordList && props.queryData.recordList.length > 0) {
+    let data = props.queryData.recordList.filter(
+      (item) => item.status === 2 && item.nodeType !== 1
+    );
+    if (data && data.length > 0) {
+      return true;
+    }
+  }
+  return false;
+};
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  disabled: false,
+});
+const formConfig = computed(() => {
+  return [
+    {
+      type: "title1",
+      title: "商品信息",
+      haveLine: true,
+    },
+    {
+      type: "slot",
+      slotName: "commodity",
+      label: "",
+    },
+    {
+      type: "title1",
+      title: "出库总金额",
+      haveLine: true,
+    },
+    {
+      type: "input",
+      label: "出库总金额",
+      prop: "amount",
+      itemWidth: 25,
+      disabled: true,
+    },
+  ];
+});
+const rules = ref({
+  quantity: [{ required: true, message: "请输入数量", trigger: "blur" }],
+});
+
+const totalAmount = () => {
+  let money = 0;
+  if (
+    formData.data.outboundRecordList &&
+    formData.data.outboundRecordList.length > 0
+  ) {
+    for (let i = 0; i < formData.data.outboundRecordList.length; i++) {
+      formData.data.outboundRecordList[i].amount = parseFloat(
+        Number(formData.data.outboundRecordList[i].quantity) *
+          Number(formData.data.outboundRecordList[i].price)
+      ).toFixed(2);
+      money = parseFloat(
+        Number(money) + Number(formData.data.outboundRecordList[i].amount)
+      ).toFixed(2);
+    }
+  }
+  formData.data.amount = money;
+};
+
+const handleSubmit = async () => {
+  let flag = await formDom.value.handleSubmit(() => {});
+  if (flag) {
+    if (
+      formData.data.outboundRecordList &&
+      formData.data.outboundRecordList.length > 0
+    ) {
+      let total = 0;
+      for (let i = 0; i < formData.data.outboundRecordList.length; i++) {
+        const ele = formData.data.outboundRecordList[i];
+        total += Number(ele.quantity);
+        if (
+          Number(ele.quantity) + Number(ele.saleOutboundQuantity) >
+          Number(ele.orderQuantity)
+        ) {
+          proxy.msgTip("出库数量加已出库数量不能大于订单数量", 2);
+          return false;
+        }
+      }
+      if (!(total > 0)) {
+        proxy.msgTip("出库数量不能为0", 2);
+        return false;
+      }
+    }
+    return true;
+  } else {
+    setTimeout(() => {
+      const errorDiv = document.getElementsByClassName("is-error");
+      errorDiv[0].scrollIntoView();
+    }, 0);
+  }
+  return flag;
+};
+
+const getFormData = () => {
+  return proxy.deepClone(formData.data);
+};
+// 向父组件暴露
+defineExpose({
+  getFormData,
+  handleSubmit,
+});
+
+const getAllData = (businessId) => {
+  proxy.post("/contract/detail", { id: businessId }).then((res) => {
+    formData.data = {
+      contractId: businessId,
+      outboundRecordList: res.contractProductList.map((x) => ({
+        ...x,
+        contractProductId: x.id,
+        orderQuantity: x.quantity,
+        quantity: null,
+        amount: "",
+      })),
+      amount: "",
+    };
+    if (
+      formData.data.outboundRecordList &&
+      formData.data.outboundRecordList.length > 0
+    ) {
+      let productIds = formData.data.outboundRecordList.map((x) => x.productId);
+      proxy.getFileData({
+        businessIdList: productIds,
+        data: formData.data.outboundRecordList,
+        att: "productId",
+        businessType: "0",
+        fileAtt: "fileList",
+        filePathAtt: "fileUrl",
+      });
+    }
+  });
+};
+
+onMounted(() => {
+  formOption.disabled = judgeStatus();
+  if (route.query && route.query.businessId && !route.query.processType) {
+    let businessId = route.query.businessId;
+    getAllData(businessId);
+  } else if (route.query && route.query.businessId && route.query.processType) {
+    proxy
+      .post("/contractOutboundInfo/detail", { id: route.query.businessId })
+      .then((res) => {
+        formData.data = res;
+        totalAmount();
+        if (
+          formData.data.outboundRecordList &&
+          formData.data.outboundRecordList.length > 0
+        ) {
+          let productIds = formData.data.outboundRecordList.map(
+            (x) => x.productId
+          );
+          proxy.getFileData({
+            businessIdList: productIds,
+            data: formData.data.outboundRecordList,
+            att: "productId",
+            businessType: "0",
+            fileAtt: "fileList",
+            filePathAtt: "fileUrl",
+          });
+        }
+      });
+  }
+});
+</script>
+
+<style lang="scss" scoped>
+.table {
+  border-collapse: collapse;
+  border-spacing: 0;
+
+  td {
+    text-align: center;
+    padding: 2px 4px;
+    // padding: 5px 10px;
+  }
+}
+.small-title {
+  padding-left: 15px;
+  margin-bottom: 10px;
+  color: #3366ff;
+  font-size: 14px;
+}
+:deep(.el-checkbox) {
+  margin-right: 0px;
+}
+// :deep(.el-collapse-item) {
+//   margin-bottom: 10px;
+// }
+:deep(.el-collapse-item__header) {
+  background-color: #eee;
+}
+</style>

+ 24 - 6
src/components/product/SelectMaterial.vue

@@ -1,8 +1,8 @@
 <template>
   <div class="user">
     <div class="tree">
-      <treeList title="物料分类" submitType="2" :data="treeListData" v-model="sourceList.pagination.productClassifyId" @change="treeChange"
-                @changeTreeList="getTreeList">
+      <treeList title="物料分类" submitType="2" :hiddenBtn="true" :data="treeListData" v-model="sourceList.pagination.productClassifyId"
+                @change="treeChange" @changeTreeList="getTreeList">
       </treeList>
     </div>
     <div class="content">
@@ -185,6 +185,18 @@ import byTable from "@/components/byTable/index";
 import byForm from "@/components/byForm/index";
 import treeList from "@/components/product/treeList";
 const { proxy } = getCurrentInstance();
+// 接收父组件的传值
+const props = defineProps({
+  // 过滤是否是原料的数据
+  isNeRawMaterial: {
+    type: String,
+    default: "0",
+  },
+  ancestors: {
+    type: Number,
+    default: "",
+  },
+});
 const currencyData = computed(
   () => proxy.useUserStore().allDict["account_currency"]
 );
@@ -217,9 +229,10 @@ const sourceList = ref({
     pageNum: 1,
     pageSize: 10,
     type: "",
-    productClassifyId: "",
+    productClassifyId: props.ancestors,
     keyword: "",
     definition: "2",
+    isNeRawMaterial: props.isNeRawMaterial,
   },
 });
 const dialogVisible = ref(false);
@@ -678,10 +691,9 @@ const getList = async (req) => {
 };
 const isShowNoAttributes = ref(false);
 const treeChange = (e) => {
-  console.log(e, "asa");
   if (e.id != undefined) {
     sourceList.value.pagination.productClassifyId = e.id;
-    getList({ productClassifyId: e.id });
+    getList({ productClassifyId: e.id || props.ancestors });
     if (e.id == "110") {
       isShowNoAttributes.value = true;
     } else {
@@ -731,7 +743,13 @@ const submitForm = () => {
 
 const getTreeList = () => {
   proxy
-    .post("/productClassify/tree", { parentId: "", name: "", definition: "2" })
+    .post("/productClassify/tree", {
+      ancestors: props.ancestors,
+      parentId: "",
+      name: "",
+      definition: "2",
+      isNeRawMaterial: props.isNeRawMaterial,
+    })
     .then((message) => {
       message = message.map((x) => ({ ...x, id: x.id + "" }));
       treeListData.value = [

+ 65 - 32
src/views/EHSD/productLibrary/companyProduct/index.vue

@@ -68,6 +68,17 @@
             </div>
           </template>
 
+          <template #rawMaterialIdSlot>
+            <div style="width:100%;display:flex">
+              <div style="width:calc(100% - 105px)">
+                <el-form-item label="原材料" prop="rawMaterialId" class="margin-b-0">
+                  <el-input disabled v-model="formData.data.rawMaterialIdLabel" placeholder="请选择"></el-input>
+                </el-form-item>
+              </div>
+              <el-button type="primary" style="width:88px;margin-left:15px" @click="openSelectRawMaterial = true" plain>选择</el-button>
+            </div>
+          </template>
+
           <template #color>
             <div style="width: 100%">
               <el-form-item label="颜色" class="margin-b-0 wid100">
@@ -389,7 +400,14 @@
     <el-dialog :title="'物料选择'" v-model="openSelectMaterial" width="90%" destroy-on-close>
       <SelectMaterial :isNeRawMaterial="'1'" @selectMaterial="selectMaterial"></SelectMaterial>
       <template #footer>
-        <el-button @click="bomDialog = false" size="defualt" v-debounce>取 消</el-button>
+        <el-button @click="openSelectMaterial = false" size="defualt" v-debounce>取 消</el-button>
+      </template>
+    </el-dialog>
+
+    <el-dialog :title="'原材料选择'" v-model="openSelectRawMaterial" width="90%" destroy-on-close>
+      <SelectMaterial :ancestors="100" @selectMaterial="selectRawMaterial"></SelectMaterial>
+      <template #footer>
+        <el-button @click="openSelectRawMaterial = false" size="defualt" v-debounce>取 消</el-button>
       </template>
     </el-dialog>
 
@@ -870,25 +888,32 @@ const formConfig = computed(() => {
       type: "title1",
       title: "主材",
     },
+    // {
+    //   type: "select",
+    //   prop: "rawMaterialId",
+    //   label: "原材料",
+    //   itemWidth: 50,
+    //   data: rawMaterialData.value,
+    //   filterable: true,
+    //   disabled: false,
+    //   fn: (val) => {
+    //     // let current = rawMaterialData.value.find((x) => x.value == val);
+    //     // if (current) {
+    //     //   formData.data.price = Number(
+    //     //     parseFloat(
+    //     //       current["length"] * current.width * current.price
+    //     //     ).toFixed(2)
+    //     //   );
+    //     // }
+    //     // getPriceData();
+    //   },
+    // },
     {
-      type: "select",
-      prop: "rawMaterialId",
-      label: "原材料",
+      type: "slot",
+      slotName: "rawMaterialIdSlot",
+      label: "",
       itemWidth: 50,
-      data: rawMaterialData.value,
-      filterable: true,
-      disabled: false,
-      fn: (val) => {
-        // let current = rawMaterialData.value.find((x) => x.value == val);
-        // if (current) {
-        //   formData.data.price = Number(
-        //     parseFloat(
-        //       current["length"] * current.width * current.price
-        //     ).toFixed(2)
-        //   );
-        // }
-        // getPriceData();
-      },
+      disabled: true,
     },
 
     // {
@@ -1191,6 +1216,8 @@ const getDtl = (row) => {
   modalType.value = "edit";
   proxy.post("/productInfo/detail", { id: row.id }).then((res) => {
     formData.data = res;
+    formData.data.rawMaterialIdLabel =
+      res.rawMaterialName + "," + res.rawMaterialCode;
     formData.data.productBomDetailList =
       formData.data.productBomDetailList.filter((x) => x.type == 2);
 
@@ -1270,23 +1297,22 @@ const getDtl = (row) => {
 };
 const rawMaterialData = ref([]);
 const getRawMaterialData = () => {
-  proxy.post("/productInfo/page", { productClassifyId: 110 }).then((res) => {
-    // rawMaterialData.value = res.rows.map((x) => ({
-    //   ...x,
-    //   label:
-    //     x.name +
-    //     "," +
-    //     x.customCode +
-    //     "," +
-    //     `${x["length"]}*${x.width}*${x.height}(cm)` +
-    //     "," +
-    //     x.color,
-    //   value: x.id,
-    // }));
+  proxy.post("/productInfo/page", { productClassifyId: 100 }).then((res) => {
     rawMaterialData.value = res.rows.map((x) => ({
-      label: x.name + "," + x.customCode,
+      label:
+        x.name +
+        "," +
+        x.customCode +
+        "," +
+        `${x["length"]}*${x.width}*${x.height}(cm)` +
+        "," +
+        x.color,
       value: x.id,
     }));
+    // rawMaterialData.value = res.rows.map((x) => ({
+    //   label: x.name + "," + x.customCode,
+    //   value: x.id,
+    // }));
   });
 };
 getRawMaterialData();
@@ -1568,6 +1594,13 @@ const handleChangeIsCustomized = (val) => {
     ];
   }
 };
+
+const openSelectRawMaterial = ref(false);
+const selectRawMaterial = (row) => {
+  formData.data.rawMaterialId = row.id;
+  formData.data.rawMaterialIdLabel = row.name + "," + row.customCode;
+  openSelectRawMaterial.value = false;
+};
 </script>
 
 <style lang="scss" scoped>

+ 515 - 62
src/views/EHSD/saleContract/contractEHSD/index.vue

@@ -303,6 +303,137 @@
       </template>
     </el-dialog>
 
+    <el-dialog :title="'合同上传'" v-model="uploadDialog" width="700px" destroy-on-close>
+      <byForm :formConfig="uploadFormConfig" :formOption="formOption" v-model="uploadFormData.data" :rules="uploadRules" ref="uploadFormDom"
+              v-loading="formLoading">
+      </byForm>
+      <template #footer>
+        <el-button @click="uploadDialog =false" size="default" v-debounce>取 消</el-button>
+        <el-button @click="submitUpload" type="primary" size="default" v-debounce>提 交</el-button>
+      </template>
+    </el-dialog>
+
+    <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>
+        <el-tab-pane label="出库记录" name="2">
+        </el-tab-pane>
+      </el-tabs>
+      <byForm :formConfig="salesOutBoundFormConfig" :formOption="formOption" v-model="salesOutBoundFormData.data" :rules="salesOutBoundRules"
+              ref="salesOutBoundFormDom" v-loading="formLoading">
+        <template #commodity>
+          <div style="width: 100%">
+            <el-button @click="submitSalesOutBoundOne(true)" type="primary" size="default" plain v-debounce>申请特批</el-button>
+            <el-table :data="salesOutBoundFormData.data.outboundRecordList" style="width: 100%; ">
+              <el-table-column label="商品图片" width="80">
+                <template #default="{ row }">
+                  <div v-if="row.fileUrl">
+                    <img :src="row.fileUrl" class="pic" @click="openImg(row.fileUrl)" />
+                  </div>
+                  <div v-else></div>
+                </template>
+              </el-table-column>
+              <!-- <el-table-column prop="productName" label="商品信息" min-width="250">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%;line-height:22px">
+                    <div>
+                      分类:{{row.productClassifyName}}
+                    </div>
+                    <div>
+                      编码:{{row.productCode}}
+                    </div>
+                    <div>
+                      名称:{{row.productName}}
+                    </div>
+                    <div>
+                      规格尺寸 (cm): {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
+                    </div>
+                    <div>
+                      颜色:{{row.productColor}}
+                    </div>
+                    <div>
+                      纹路:{{dictKeyValue(row.productFrontalTexture,frontLinesData)}}
+                    </div>
+                    <div>
+                      净重: {{row.productNetWeight}}
+                    </div>
+                    <div>
+                      单位:{{row.productUnit}}
+                    </div>
+                  </div>
+                </template>
+              </el-table-column> -->
+              <el-table-column prop="productName" label="商品名称" min-width="150" />
+              <el-table-column prop="productCode" label="商品编码" width="200" />
+              <el-table-column label="规格尺寸 (cm)" width="130">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column prop="productColor" label="颜色" width="150" />
+              <el-table-column prop="productFrontalTexture" label="纹路" width="130"
+                               :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="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">
+                <template #default="{ row, $index }">
+                  <el-form-item :prop="'outboundRecordList.' + $index + '.quantity'" :rules="salesOutBoundRules.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="0" @change="totalAmount()" />
+                  </el-form-item>
+                </template>
+              </el-table-column>
+              <el-table-column label="小计" width="100" prop="amount" fixed="right" />
+              <el-table-column label="备注" min-width="200" prop="remark" />
+            </el-table>
+          </div>
+        </template>
+
+        <template #commodityOne>
+          <div style="width: 100%">
+            <el-table :data="salesOutBoundFormData.data.recordList" style="width: 100%; " :span-method="objectSpanMethod">
+              <el-table-column label="出库时间" width="160" prop="createTime" fixed="left" />
+              <el-table-column label="商品图片" width="80">
+                <template #default="{ row }">
+                  <div v-if="row.fileUrl">
+                    <img :src="row.fileUrl" class="pic" @click="openImg(row.fileUrl)" />
+                  </div>
+                  <div v-else></div>
+                </template>
+              </el-table-column>
+              <el-table-column prop="productName" label="商品名称" min-width="150" />
+              <el-table-column prop="productCode" label="商品编码" width="200" />
+              <el-table-column label="规格尺寸 (cm)" width="130">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column prop="productColor" label="颜色" width="150" />
+              <el-table-column prop="productFrontalTexture" label="纹路" width="130"
+                               :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="备注" min-width="200" prop="remark" />
+            </el-table>
+          </div>
+        </template>
+      </byForm>
+      <template #footer v-if="activeName=='1'">
+        <el-button @click="salesOutBoundDialog =false" size="default" v-debounce>取 消</el-button>
+        <el-button @click="submitSalesOutBound(false)" type="primary" size="default" v-debounce>提 交</el-button>
+      </template>
+    </el-dialog>
+
   </div>
 </template>
 
@@ -317,11 +448,15 @@ import ContractPDFOne from "@/components/PDF/contractPDFOne.vue";
 import ContractPDFOneNew from "@/components/PDF/contractPDFOneNew.vue";
 import $bus from "@/bus/index.js";
 import moment from "moment";
+import { reactiveComputed } from "@vueuse/core";
 const route = useRoute();
+const { proxy } = getCurrentInstance();
+const frontLinesData = computed(
+  () => proxy.useUserStore().allDict["front_lines"]
+);
 const contractTag = computed(
   () => proxy.useUserStore().allDict["contract_prod_tag"]
 );
-const { proxy } = getCurrentInstance();
 const accountCurrency = ref([]);
 const tradeMethods = ref([]);
 const corporationList = ref([]);
@@ -473,17 +608,17 @@ const selectConfig = computed(() => {
       prop: "status",
       data: status.value,
     },
-    {
-      label: "工厂",
-      prop: "companyId",
-      data: companyData.value,
-    },
     // {
-    //   label: "生产状态",
-    //   prop: "produceStatus",
-    //   data: produceStatusData.value,
+    //   label: "工厂",
+    //   prop: "companyId",
+    //   data: companyData.value,
     // },
     {
+      label: "生产状态",
+      prop: "produceStatus",
+      data: produceStatusData.value,
+    },
+    {
       label: "业务员",
       prop: "userId",
       data: userList.value,
@@ -587,13 +722,13 @@ const config = computed(() => {
         width: 140,
       },
     },
-    {
-      attrs: {
-        label: "工厂",
-        prop: "companyName",
-        width: 120,
-      },
-    },
+    // {
+    //   attrs: {
+    //     label: "工厂",
+    //     prop: "companyName",
+    //     width: 120,
+    //   },
+    // },
     {
       attrs: {
         label: "订单归属",
@@ -881,33 +1016,20 @@ const config = computed(() => {
                 },
               }
             : {},
-          // row.status == 30 &&
-          // row.outboundStatus == 0 &&
-          // row.produceStatus == 2
-          //   ? {
-          //       attrs: {
-          //         label: "销售出库",
-          //         type: "primary",
-          //         text: true,
-          //       },
-          //       el: "button",
-          //       click() {
-          //         proxy
-          //           .msgConfirm()
-          //           .then((res) => {
-          //             proxy
-          //               .post("/contract/saleOutbound", {
-          //                 id: row.id,
-          //               })
-          //               .then((res) => {
-          //                 proxy.msgTip("操作成功", 1);
-          //                 getList();
-          //               });
-          //           })
-          //           .catch((err) => {});
-          //       },
-          //     }
-          //   : {},
+          // && row.outboundStatus == 0 && row.produceStatus == 2
+          row.status == 30 && 10 > row.produceStatus && row.produceStatus >= 2
+            ? {
+                attrs: {
+                  label: "销售出库",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  handleSalesOutBound(row);
+                },
+              }
+            : {},
           row.status == 0
             ? {
                 attrs: {
@@ -1058,6 +1180,20 @@ const config = computed(() => {
                 },
               }
             : {},
+
+          row.status == 30
+            ? {
+                attrs: {
+                  label: "合同上传",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  clickUpload(row);
+                },
+              }
+            : {},
         ];
       },
     },
@@ -1618,14 +1754,14 @@ const formSearchConfig = computed(() => {
       data: status.value,
       clearable: true,
     },
-    {
-      type: "select",
-      label: "工厂",
-      prop: "companyId",
-      itemWidth: 50,
-      data: companyData.value,
-      clearable: true,
-    },
+    // {
+    //   type: "select",
+    //   label: "工厂",
+    //   prop: "companyId",
+    //   itemWidth: 50,
+    //   data: companyData.value,
+    //   clearable: true,
+    // },
     {
       type: "select",
       label: "业务员",
@@ -1677,16 +1813,16 @@ const moreSearchReset = () => {
 const productionFormDom = ref(null);
 const productionDialog = ref(false);
 const productionFormConfig = computed(() => [
-  {
-    type: "treeSelect",
-    prop: "produceCompanyId",
-    label: "工厂",
-    data: companyData.value,
-    propsTreeLabel: "deptName",
-    propsTreeValue: "deptId",
-    itemWidth: 100,
-    disabled: true,
-  },
+  // {
+  //   type: "treeSelect",
+  //   prop: "produceCompanyId",
+  //   label: "工厂",
+  //   data: companyData.value,
+  //   propsTreeLabel: "deptName",
+  //   propsTreeValue: "deptId",
+  //   itemWidth: 100,
+  //   disabled: true,
+  // },
   {
     type: "input",
     itemType: "textarea",
@@ -1722,7 +1858,7 @@ const clickDistributeProduction = (row) => {
   formData.data = {
     contractId: row.id,
     deliveryPeriod: "",
-    produceCompanyId: row.companyId,
+    // produceCompanyId: row.companyId,
     rejectRemark: row.rejectRemark,
     orderDistributeStatus: row.orderDistributeStatus,
   };
@@ -1879,6 +2015,323 @@ const submitTermination = () => {
       });
   });
 };
+
+const uploadFormData = reactive({
+  data: {},
+});
+const clickUpload = (row) => {
+  let businessId = row.id;
+  uploadFormData.data = {
+    id: row.id,
+    contractFileList: [],
+  };
+  proxy
+    .post("/fileInfo/getList", { businessIdList: [businessId] })
+    .then((fileObj) => {
+      if (fileObj[businessId] && fileObj[businessId].length > 0) {
+        uploadFormData.data.contractFileList = fileObj[businessId]
+          .filter((x) => x.businessType == "10")
+          .map((item) => {
+            return {
+              ...item,
+              name: item.fileName,
+              url: item.fileUrl,
+            };
+          });
+      } else {
+        uploadFormData.data.contractFileList = [];
+      }
+    });
+  uploadDialog.value = true;
+};
+const uploadFormDom = ref(null);
+const uploadDialog = ref(false);
+const uploadFormConfig = computed(() => [
+  {
+    type: "upload",
+    listType: "text",
+    accept: "",
+    prop: "contractFileList",
+    label: "合同上传",
+  },
+]);
+const uploadRules = ref({
+  contractFileList: [
+    { required: true, message: "请上传附件", trigger: "blur" },
+  ],
+});
+const submitUpload = () => {
+  uploadFormDom.value.handleSubmit(() => {
+    // if (
+    //   !(uploadFormData.data.contractFileList && uploadFormData.data.contractFileList.length > 0)
+    // ) {
+    //   return proxy.msgTip("请上传附件", 2);
+    // }
+    formLoading.value = true;
+    proxy.post("/contract/contractAttach", uploadFormData.data).then((res) => {
+      proxy.msgTip("操作成功");
+      formLoading.value = false;
+      uploadDialog.value = false;
+    });
+  });
+};
+
+const activeName = ref("1");
+const salesOutBoundFormData = reactive({
+  data: {},
+});
+const salesOutBoundFormDom = ref(null);
+const salesOutBoundDialog = ref(false);
+const salesOutBoundFormConfig = computed(() => [
+  {
+    type: "title1",
+    title: "商品信息",
+    haveLine: true,
+    isShow: activeName.value == "1",
+  },
+  {
+    type: "slot",
+    slotName: "commodity",
+    label: "",
+    isShow: activeName.value == "1",
+  },
+  {
+    type: "title1",
+    title: "出库总金额",
+    haveLine: true,
+    isShow: activeName.value == "1",
+  },
+  {
+    type: "input",
+    label: "出库总金额",
+    prop: "amount",
+    itemWidth: 25,
+    disabled: true,
+    isShow: activeName.value == "1",
+  },
+  {
+    type: "title1",
+    title: "出库记录",
+    haveLine: false,
+    isShow: activeName.value == "2",
+  },
+  {
+    type: "slot",
+    slotName: "commodityOne",
+    label: "",
+    isShow: activeName.value == "2",
+  },
+]);
+const salesOutBoundRules = ref({
+  fileList: [{ required: true, message: "请上传附件", trigger: "blur" }],
+});
+const handleSalesOutBound = (row) => {
+  activeName.value = "1";
+  proxy.post("/contract/detail", { id: row.id }).then((res) => {
+    salesOutBoundDialog.value = true;
+    salesOutBoundFormData.data = {
+      contractId: row.id,
+      outboundRecordList: res.contractProductList.map((x) => ({
+        ...x,
+        contractProductId: x.id,
+        orderQuantity: x.quantity,
+        quantity: null,
+        amount: "",
+      })),
+      amount: "",
+    };
+    let productIds;
+    if (
+      salesOutBoundFormData.data.outboundRecordList &&
+      salesOutBoundFormData.data.outboundRecordList.length > 0
+    ) {
+      productIds = salesOutBoundFormData.data.outboundRecordList.map(
+        (x) => x.productId
+      );
+      proxy.getFileData({
+        businessIdList: productIds,
+        data: salesOutBoundFormData.data.outboundRecordList,
+        att: "productId",
+        businessType: "0",
+        fileAtt: "fileList",
+        filePathAtt: "fileUrl",
+      });
+    }
+
+    proxy
+      .post("/contractOutboundRecords/page", {
+        contractId: row.id,
+        pageNum: 1,
+        pageSize: 999,
+      })
+      .then((sonRes) => {
+        salesOutBoundFormData.data.recordList = sonRes.rows;
+        setTimeout(() => {
+          if (
+            salesOutBoundFormData.data.recordList &&
+            salesOutBoundFormData.data.recordList.length > 0
+          ) {
+            proxy.getFileData({
+              businessIdList: productIds,
+              data: salesOutBoundFormData.data.recordList,
+              att: "productId",
+              businessType: "0",
+              fileAtt: "fileList",
+              filePathAtt: "fileUrl",
+            });
+          }
+        }, 1000);
+      });
+  });
+};
+
+const totalAmount = () => {
+  let money = 0;
+  if (
+    salesOutBoundFormData.data.outboundRecordList &&
+    salesOutBoundFormData.data.outboundRecordList.length > 0
+  ) {
+    for (
+      let i = 0;
+      i < salesOutBoundFormData.data.outboundRecordList.length;
+      i++
+    ) {
+      salesOutBoundFormData.data.outboundRecordList[i].amount = parseFloat(
+        Number(salesOutBoundFormData.data.outboundRecordList[i].quantity) *
+          Number(salesOutBoundFormData.data.outboundRecordList[i].price)
+      ).toFixed(2);
+      money = parseFloat(
+        Number(money) +
+          Number(salesOutBoundFormData.data.outboundRecordList[i].amount)
+      ).toFixed(2);
+    }
+  }
+  salesOutBoundFormData.data.amount = money;
+};
+
+const submitSalesOutBound = (flag) => {
+  salesOutBoundFormDom.value.handleSubmit(() => {
+    if (
+      salesOutBoundFormData.data.outboundRecordList &&
+      salesOutBoundFormData.data.outboundRecordList.length > 0
+    ) {
+      let total = 0;
+      for (
+        let i = 0;
+        i < salesOutBoundFormData.data.outboundRecordList.length;
+        i++
+      ) {
+        const ele = salesOutBoundFormData.data.outboundRecordList[i];
+        total += Number(ele.quantity);
+        if (
+          Number(ele.quantity) + Number(ele.saleOutboundQuantity) >
+          Number(ele.orderQuantity)
+        ) {
+          return proxy.msgTip("出库数量加已出库数量不能大于订单数量", 2);
+        }
+      }
+      if (!(total > 0)) {
+        return proxy.msgTip("出库数量不能为0", 2);
+      }
+    }
+    const data = {
+      contractId: salesOutBoundFormData.data.contractId,
+      outboundRecordList: salesOutBoundFormData.data.outboundRecordList.map(
+        (x) => ({
+          contractProductId: x.contractProductId,
+          quantity: x.quantity,
+        })
+      ),
+    };
+    formLoading.value = true;
+    if (flag) {
+      proxy
+        .msgConfirm()
+        .then((res) => {
+          proxy
+            .post("/flowProcess/initiate", {
+              flowKey: "sales_outbound_approved_flow",
+              data,
+              skipSetData: true,
+            })
+            .then(
+              (res) => {
+                proxy.msgTip("操作成功");
+                formLoading.value = false;
+                salesOutBoundDialog.value = false;
+                getList();
+              },
+              (err) => {
+                formLoading.value = false;
+              }
+            );
+        })
+        .catch((err) => {
+          formLoading.value = false;
+        });
+    } else {
+      proxy.post("/contract/saleOutbound", data).then(
+        (res) => {
+          proxy.msgTip("操作成功");
+          formLoading.value = false;
+          salesOutBoundDialog.value = false;
+          getList();
+        },
+        (err) => {
+          formLoading.value = false;
+        }
+      );
+    }
+  });
+};
+
+const submitSalesOutBoundOne = (row) => {
+  proxy.$router.replace({
+    path: "/platform_manage/process/processApproval",
+    query: {
+      flowKey: "sales_outbound_approved_flow",
+      flowName: "销售出库特批申请",
+      businessId: salesOutBoundFormData.data.contractId,
+      random: proxy.random(),
+    },
+  });
+};
+
+const flitterData = (arr) => {
+  let spanOneArr = [];
+  let concatOne = 0;
+  arr.forEach((item, index) => {
+    if (index === 0) {
+      spanOneArr.push(1);
+    } else {
+      //注意这里的quarterly是表格绑定的字段,根据自己的需求来改
+      if (item.recordId === arr[index - 1].recordId) {
+        //第一列需合并相同内容的判断条件
+        spanOneArr[concatOne] += 1;
+        spanOneArr.push(0);
+      } else {
+        spanOneArr.push(1);
+        concatOne = index;
+      }
+    }
+  });
+  return {
+    one: spanOneArr,
+  };
+};
+
+const objectSpanMethod = ({ rowIndex, columnIndex }) => {
+  if (columnIndex === 0) {
+    const _row = flitterData(salesOutBoundFormData.data.recordList).one[
+      rowIndex
+    ];
+    const _col = _row > 0 ? 1 : 0;
+    return {
+      rowspan: _row,
+      colspan: _col,
+    };
+  }
+};
 </script>
 
 <style lang="scss" scoped>

+ 28 - 28
src/views/MES/productionOrder/index.vue

@@ -117,7 +117,8 @@
         </el-calendar>
       </div>
     </div> -->
-    <el-dialog :title="modalType == 'add' ? '添加店铺' : '编辑店铺'" v-model="dialogVisible" width="500px" destroy-on-close>
+
+    <!-- <el-dialog :title="modalType == 'add' ? '添加店铺' : '编辑店铺'" v-model="dialogVisible" width="500px" destroy-on-close>
       <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="formDom" v-loading="submitLoading">
       </byForm>
       <template #footer>
@@ -126,7 +127,7 @@
           确 定
         </el-button>
       </template>
-    </el-dialog>
+    </el-dialog> -->
 
     <el-dialog :title="'投产'" v-model="productionDialog" width="500px" destroy-on-close>
       <byForm :formConfig="productionFormConfig" :formOption="formOption" v-model="formData.data" :rules="productionRules" ref="productionFormDom"
@@ -154,7 +155,6 @@
         </el-tab-pane>
         <el-tab-pane label="物料结存" name="2">
         </el-tab-pane>
-
       </el-tabs>
       <byForm :formConfig="formConfig" :formOption="formOptionOne" v-model="formData.orderData" ref="formDom">
         <template #commodity>
@@ -593,31 +593,31 @@ const config = computed(() => {
                 },
               }
             : {},
-          row.produceStatus == 2
-            ? {
-                attrs: {
-                  label: "销售出库",
-                  type: "primary",
-                  text: true,
-                },
-                el: "button",
-                click() {
-                  proxy
-                    .msgConfirm()
-                    .then((res) => {
-                      proxy
-                        .post("/contract/saleOutbound", {
-                          id: row.contractId,
-                        })
-                        .then((res) => {
-                          proxy.msgTip("操作成功", 1);
-                          getList();
-                        });
-                    })
-                    .catch((err) => {});
-                },
-              }
-            : {},
+          // row.produceStatus == 2
+          //   ? {
+          //       attrs: {
+          //         label: "销售出库",
+          //         type: "primary",
+          //         text: true,
+          //       },
+          //       el: "button",
+          //       click() {
+          //         proxy
+          //           .msgConfirm()
+          //           .then((res) => {
+          //             proxy
+          //               .post("/contract/saleOutbound", {
+          //                 id: row.contractId,
+          //               })
+          //               .then((res) => {
+          //                 proxy.msgTip("操作成功", 1);
+          //                 getList();
+          //               });
+          //           })
+          //           .catch((err) => {});
+          //       },
+          //     }
+          //   : {},
         ];
       },
     },

+ 210 - 47
src/views/customer/addCustomer.vue

@@ -44,27 +44,72 @@
         <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-table-column label="姓名" width="160">
               <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-input v-model="row.name" placeholder="请输入" />
                   </el-form-item>
                 </div>
               </template>
             </el-table-column>
-            <el-table-column label="电子邮箱">
+            <el-table-column label="性别" width="100">
+              <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>
+                </div>
+              </template>
+            </el-table-column>
+            <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>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column label="是否企业关键KP" 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>
+                </div>
+              </template>
+            </el-table-column>
+            <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>
+                </div>
+              </template>
+            </el-table-column>
+            <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>
+                </div>
+              </template>
+            </el-table-column>
+            <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-input v-model="row.email" placeholder="请输入" />
                   </el-form-item>
                 </div>
               </template>
             </el-table-column>
-            <el-table-column align="center" label="操作" width="120" fixed="right">
+            <el-table-column align="center" label="操作" width="80" fixed="right">
               <template #default="{ row, $index }">
-                <el-button type="primary" link @click="clickInformationMore(row, $index)">更多</el-button>
+                <!-- <el-button type="primary" link @click="clickInformationMore(row, $index)">更多</el-button> -->
                 <el-button type="primary" link @click="clickDelete($index)">删除</el-button>
               </template>
             </el-table-column>
@@ -150,11 +195,32 @@ isHighseas.value = props.isHighseas;
 const customerId = ref("");
 const { proxy } = getCurrentInstance();
 const loading = ref(false);
-const customerTag = ref([]);
-const customerSource = ref([]);
-const customerStatus = ref([]);
-const contactType = ref([]);
 const userList = ref([]);
+const deptData = ref([]);
+const customerTag = computed(
+  () => proxy.useUserStore().allDict["customer_tag"]
+);
+const customerSource = computed(
+  () => proxy.useUserStore().allDict["customer_source"]
+);
+const customerStatus = computed(
+  () => proxy.useUserStore().allDict["customer_status"]
+);
+const contactType = computed(
+  () => proxy.useUserStore().allDict["contact_type"]
+);
+const settlementWay = computed(
+  () => proxy.useUserStore().allDict["settlement_way"]
+);
+const customerSlevel = computed(
+  () => proxy.useUserStore().allDict["customer_slevel"]
+);
+const customerScale = computed(
+  () => proxy.useUserStore().allDict["customer_scale"]
+);
+const customerState = computed(
+  () => proxy.useUserStore().allDict["customer_state"]
+);
 const submit = ref(null);
 const formData = reactive({
   data: {
@@ -163,36 +229,10 @@ const formData = reactive({
 });
 const getDict = () => {
   proxy
-    .getDictOne([
-      "customer_tag",
-      "customer_source",
-      "customer_status",
-      "contact_type",
-    ])
-    .then((res) => {
-      customerTag.value = res["customer_tag"].map((x) => ({
-        label: x.dictValue,
-        value: x.dictKey,
-      }));
-      customerSource.value = res["customer_source"].map((x) => ({
-        label: x.dictValue,
-        value: x.dictKey,
-      }));
-      console.log(res, "ss");
-      customerStatus.value = res["customer_status"].map((x) => ({
-        label: x.dictValue,
-        value: x.dictKey,
-      }));
-      contactType.value = res["contact_type"].map((x) => ({
-        label: x.dictValue,
-        value: x.dictKey,
-      }));
-    });
-  proxy
     .get("/tenantUser/list", {
       pageNum: 1,
       pageSize: 10000,
-      tenantId: useUserStore().user.tenantId,
+      tenantId: proxy.useUserStore().user.tenantId,
     })
     .then((res) => {
       userList.value = res.rows.map((item) => {
@@ -202,6 +242,19 @@ const getDict = () => {
         };
       });
     });
+
+  proxy
+    .get("/tenantDept/list", {
+      pageNum: 1,
+      pageSize: 9999,
+      keyword: "",
+      ancestors: proxy.useUserStore().user.companyId,
+      tenantId: proxy.useUserStore().user.tenantId,
+      // type: 2,
+    })
+    .then((res) => {
+      deptData.value = proxy.handleTree(res.data, "deptId");
+    });
 };
 getDict();
 const countryData = ref([]);
@@ -300,18 +353,18 @@ const formConfig = computed(() => {
       label: "详细地址",
     },
     {
-      type: "select",
-      label: "客户来源",
-      prop: "source",
+      type: "input",
+      prop: "fax",
+      label: "公司/客户主体",
       itemWidth: 50,
-      data: customerSource.value,
+      itemType: "text",
     },
     {
-      type: "select",
-      label: "客户类型",
-      prop: "status",
+      type: "input",
+      prop: "fax",
+      label: "公司/客户客体",
       itemWidth: 50,
-      data: customerStatus.value,
+      itemType: "text",
     },
     {
       type: "select",
@@ -323,6 +376,116 @@ const formConfig = computed(() => {
       disabled: isHighseas.value,
     },
     {
+      type: "treeSelect",
+      prop: "deptId",
+      label: "业务部门",
+      data: deptData.value,
+      propsTreeLabel: "deptName",
+      propsTreeValue: "deptId",
+      itemWidth: 50,
+    },
+    {
+      type: "input",
+      prop: "fax",
+      label: "主营品类",
+      itemWidth: 50,
+      itemType: "text",
+    },
+    {
+      type: "select",
+      label: "公司规模",
+      prop: "wwaa",
+      itemWidth: 50,
+      data: customerScale.value,
+    },
+    {
+      type: "select",
+      label: "客户结算方式",
+      prop: "wwaa",
+      itemWidth: 50,
+      data: settlementWay.value,
+    },
+    {
+      type: "select",
+      label: "客户类型",
+      prop: "status",
+      itemWidth: 50,
+      data: customerStatus.value,
+    },
+    {
+      type: "select",
+      label: "客户分级",
+      prop: "wwaa",
+      itemWidth: 50,
+      data: customerSlevel.value,
+    },
+    {
+      type: "input",
+      prop: "fax",
+      label: "维系级别",
+      itemWidth: 50,
+      itemType: "text",
+    },
+    {
+      type: "select",
+      label: "新老客户",
+      prop: "wwaa",
+      itemWidth: 50,
+      data: [
+        {
+          dictKey: 10,
+          dictValue: "新客户",
+        },
+        {
+          dictKey: 20,
+          dictValue: "老客户",
+        },
+      ],
+    },
+    {
+      type: "input",
+      prop: "fax",
+      label: "要求年订单量",
+      itemWidth: 50,
+      itemType: "text",
+    },
+    {
+      type: "input",
+      prop: "fax",
+      label: "回访要求",
+      itemWidth: 50,
+      itemType: "text",
+    },
+    {
+      type: "input",
+      prop: "fax",
+      label: "提醒设定",
+      itemWidth: 50,
+      itemType: "text",
+    },
+    {
+      type: "date",
+      itemType: "date",
+      prop: "fax",
+      label: "建群时间",
+      itemWidth: 50,
+    },
+    {
+      type: "select",
+      label: "客户状态",
+      prop: "source",
+      itemWidth: 50,
+      data: customerState.value,
+    },
+    {
+      type: "select",
+      label: "客户来源",
+      prop: "source",
+      itemWidth: 50,
+      data: customerSource.value,
+    },
+
+    {
       type: "input",
       prop: "fax",
       label: "传真",
@@ -403,7 +566,7 @@ const formConfig = computed(() => {
 
 const rules = ref({
   name: [{ required: true, message: "请输入客户名称", trigger: "blur" }],
-  name2: [{ required: true, message: "请输入联系人", trigger: "blur" }],
+  name2: [{ required: true, message: "请输入", trigger: "blur" }],
   email: [{ required: true, message: "请输入电子邮箱", trigger: "blur" }],
   countryId: [{ required: true, message: "请选择国家", trigger: "change" }],
   source: [{ required: true, message: "请选择客户来源", trigger: "change" }],
@@ -436,7 +599,7 @@ const formPerson = reactive({
   data: {},
 });
 const rulesPerson = ref({
-  name: [{ required: true, message: "请输入联系人", trigger: "blur" }],
+  name: [{ required: true, message: "请输入", trigger: "blur" }],
   email: [{ required: true, message: "请输入电子邮箱", trigger: "blur" }],
   type: [{ required: true, message: "请选择类型", trigger: "change" }],
   contactNo: [{ required: true, message: "请输入联系号码", trigger: "blur" }],

+ 1 - 1
src/views/customer/file/index.vue

@@ -209,7 +209,7 @@
       </div>
     </div>
 
-    <el-dialog :title="modalType == 'add' ? '新增' : '编辑'" v-if="dialogVisible" v-model="dialogVisible" width="60%">
+    <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>
         <el-button @click="dialogVisible = false" size="default">取 消</el-button>

+ 1 - 1
src/views/customer/highseas/index.vue

@@ -205,7 +205,7 @@
       </div>
     </div>
 
-    <el-dialog :title="modalType == 'add' ? '新增' : '编辑'" v-if="dialogVisible" v-model="dialogVisible" width="60%" v-loading="loadingOperation">
+    <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>
         <el-button @click="dialogVisible = false" size="default">取 消</el-button>

+ 1 - 1
src/views/customer/privatesea/index.vue

@@ -204,7 +204,7 @@
       </div>
     </div>
 
-    <el-dialog :title="modalType == 'add' ? '新增' : '编辑'" v-if="dialogVisible" v-model="dialogVisible" width="60%" v-loading="loadingOperation">
+    <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>
         <el-button @click="dialogVisible = false" size="default">取 消</el-button>

+ 7 - 0
src/views/process/processApproval/index.vue

@@ -16,6 +16,10 @@
           <DiscussPrice ref="makeDom" :queryData="queryData.data"></DiscussPrice>
         </template>
 
+        <template v-if="flowForm.flowKey == 'sales_outbound_approved_flow'">
+          <SalesOutBound ref="makeDom" :queryData="queryData.data"></SalesOutBound>
+        </template>
+
         <!-- 销售订单 -->
         <Contract ref="makeDom" :queryData="queryData.data" v-else-if="flowForm.flowKey == 'contract_flow' || flowForm.flowKey == 'sample_flow'">
         </Contract>
@@ -189,6 +193,8 @@ import { useRouter, useRoute } from "vue-router";
 
 import PriceSheet from "@/components/process/SF/PriceSheet";
 import DiscussPrice from "@/components/process/SF/DiscussPrice";
+import SalesOutBound from "@/components/process/SF/SalesOutBound";
+
 import Contract from "@/components/process/SF/Contract";
 import ContractChange from "@/components/process/SF/ContractChange";
 
@@ -444,6 +450,7 @@ const skipPage = () => {
     purchase_back_flow: "ReturnGood",
     discuss_price_flow: "PriceSheetEHSD",
     after_sales_flow: "AfterSales",
+    sales_outbound_approved_flow: "Contract",
   };
   const useTagsStore = useTagsViewStore();
   useTagsStore.delVisitedView(router.currentRoute.value);