cz 1 год назад
Родитель
Сommit
477b6c841b

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

@@ -161,13 +161,13 @@
             </el-form-item>
           </el-col>
           <el-col :span="6" style="padding:0px 4px">
-            <el-form-item label="出货前付款比例(%)" prop="beforeShipmentRatio" class="margin-b-0 wid100">
+            <el-form-item label="出货前付款比例" prop="beforeShipmentRatio" class="margin-b-0 wid100">
               <el-input-number v-model="formData.data.beforeShipmentRatio" placeholder="请输入" style="width: 100%" :precision="2" :min="0" :max="100"
                                :controls="false" @change="(val)=>changeAdvanceRatio(val,false)" />
             </el-form-item>
           </el-col>
           <el-col :span="6" style="padding:0px 4px">
-            <el-form-item label="出货后付款比例(%)" prop="afterShipmentRatio" class="margin-b-0 wid100">
+            <el-form-item label="出货后付款比例" prop="afterShipmentRatio" class="margin-b-0 wid100">
               <el-input-number v-model="formData.data.afterShipmentRatio" placeholder=" " style="width: 100%" :precision="2" :min="0" :max="100"
                                :controls="false" disabled />
             </el-form-item>

+ 529 - 118
src/components/process/SF/ContractChange.vue

@@ -5,9 +5,10 @@
         <div>
           <el-button type="primary" v-if="
               [30].includes(route.query.processType) || !route.query.processType
-            " @click="clickCopy(1)">复制合同</el-button>
+            " @click="clickCopy(1)">复制订单</el-button>
         </div>
       </template>
+
       <template #ofCompanyId>
         <div style="width: 100%">
           <el-form-item label="业务公司" class="margin-b-0 wid100" required>
@@ -23,8 +24,8 @@
               <el-col :span="12">
                 <el-form-item prop="deptId" label="" label-width="0px" class="margin-b-0 wid100">
                   <el-tree-select v-model="formData.data.deptId" :data="deptData" style="width: 100%" placeholder="部门" default-expand-all
-                                  :props="{ value:  'deptId', label:  'deptName', children: 'children', disabled: 'disabled' }"
-                                  :disabled="useUserStore().currentCompany==useUserStore().user.ofCompanyId" />
+                                  :props="{ value:  'deptId', label:  'deptName', children: 'children', disabled: 'disabled' }" />
+                  <!-- :disabled="useUserStore().currentCompany==useUserStore().user.ofCompanyId" -->
                 </el-form-item>
               </el-col>
 
@@ -32,6 +33,7 @@
           </el-form-item>
         </div>
       </template>
+
       <template #seller>
         <div style="width: 100%">
           <el-form-item prop="sellCorporationId" label="卖方信息" class="wid100">
@@ -150,6 +152,29 @@
         </div>
       </template>
 
+      <template #advanceRatio>
+        <el-row style="width: 100%">
+          <el-col :span="6" style="padding-right:8px">
+            <el-form-item label="定金比例(%)" prop="advanceRatio" class="margin-b-0 wid100">
+              <el-input-number v-model="formData.data.advanceRatio" placeholder="请输入" style="width: 100%" :precision="2" :min="0" :max="100"
+                               :controls="false" @change="(val)=>changeAdvanceRatio(val,true)" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="6" style="padding:0px 4px">
+            <el-form-item label="出货前付款比例" prop="beforeShipmentRatio" class="margin-b-0 wid100">
+              <el-input-number v-model="formData.data.beforeShipmentRatio" placeholder="请输入" style="width: 100%" :precision="2" :min="0" :max="100"
+                               :controls="false" @change="(val)=>changeAdvanceRatio(val,false)" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="6" style="padding:0px 4px">
+            <el-form-item label="出货后付款比例" prop="afterShipmentRatio" class="margin-b-0 wid100">
+              <el-input-number v-model="formData.data.afterShipmentRatio" placeholder=" " style="width: 100%" :precision="2" :min="0" :max="100"
+                               :controls="false" disabled />
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </template>
+
       <template #commodity>
         <div style="width: 100%">
           <el-button type="primary" @click="openProductCompany = true" plain style="margin-bottom: 16px" v-if="!judgeStatus() && isEditList"
@@ -235,38 +260,102 @@
                 <div v-else></div>
               </template>
             </el-table-column>
-            <el-table-column prop="productCnName" label="商品名称" min-width="130" />
-            <el-table-column prop="productCode" label="商品编码" width="150" />
-            <el-table-column label="规格尺寸 (cm)" width="130">
+            <el-table-column prop="productName" label="商品信息" width="250">
               <template #default="{ row, $index }">
-                <div style="width: 100%">
-                  {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
+                <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>
+                  <!-- <el-row :gutter="5">
+                    <el-col :span="12">
+                      分类:{{row.productClassifyName}}
+                    </el-col>
+                    <el-col :span="12">
+                      编码名称:{{row.productCode}}({{row.productName}})
+                    </el-col>
+                  </el-row>
+                  <el-row :gutter="5">
+                    <el-col :span="12">
+                      规格尺寸 (cm): {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
+                    </el-col>
+                    <el-col :span="12">
+                      颜色:{{row.productColor}}
+                    </el-col>
+                  </el-row>
+                  <el-row :gutter="5">
+                    <el-col :span="12">
+                      纹路:{{dictKeyValue(row.productFrontalTexture,frontLinesData)}}
+                    </el-col>
+                    <el-col :span="6">
+                      净重: {{row.productNetWeight}}
+                    </el-col>
+                    <el-col :span="6">
+                      单位:{{row.productUnit}}
+                    </el-col>
+                  </el-row> -->
                 </div>
               </template>
             </el-table-column>
-            <el-table-column prop="productColor" label="颜色" width="140" />
-            <!-- <el-table-column label="设计图稿" width="80">
+
+            <!-- <el-table-column label="规格尺寸 (cm)" width="130">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
-                  <el-upload :action="uploadUrl" accept=".gif, .jpeg, .jpg, .png" :show-file-list="false" :data="uploadData"
-                             :before-upload="(file)=>handleBeforeUpload(file,$index)" :on-success="()=>handleSuccess($index)">
-                    <div v-loading="row.imgLoading">
-                      <img v-if="row.imageUrl" :src="row.imageUrl" class="pic" />
-                      <el-icon v-else class="avatar-uploader-icon">
-                        <Plus />
-                      </el-icon>
-                    </div>
-                  </el-upload>
+                  {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
                 </div>
               </template>
-            </el-table-column> -->
-            <el-table-column label="生产plt文件" width="210">
+            </el-table-column>
+            <el-table-column prop="productColor" label="颜色" width="140" />
+            <el-table-column prop="ww" label="纹路" width="140" />
+            <el-table-column prop="weight" label="净重" width="140" />
+            <el-table-column prop="unit" label="单位" width="140" /> -->
+            <el-table-column label="生产plt文件" width="180">
               <template #default="{ row, $index }">
                 <div style="width:100%">
-                  <div style="display:flex">
-                    <div style="writing-mode: vertical-rl;margin-right:10px;background:rgb(94 120 145);color:#fff;padding:5px 2px;border-radius:3px;line-height:21px;cursor:pointer"
+                  <!-- <div style="display:flex">
+                    <div style="writing-mode: vertical-rl;margin-right:10px;background:rgb(94 120 145);color:#fff;padding:5px 2px;border-radius:3px;line-height:21px;;cursor:pointer"
+                         @click="handleClickUploadOne($index)" v-if="!judgeStatus()">
+                      {{row.isShowProductFile?'上  传  p   l   t':'取  消  上  传'}}
+                    </div>
+                    <div>
+                      <div v-if="row.isShowProductFile &&row.fileListOne && row.fileListOne.length > 0">
+                        <span class="el-click" @click="onPicture(row.fileListOne[0].fileUrl)">{{row.fileListOne[0].fileName}}</span>
+                      </div>
+                      <div v-else>
+                        <el-upload :file-list="row.prodFileList" :action="uploadUrl" :data="uploadData" :limit="1" :list-type="'text'"
+                                   :before-upload="(file)=>handleBeforeUploadOne(file,$index)" :on-success="()=>handleSuccessOne($index)"
+                                   :on-remove="(file)=>handleRemoveFile(file,$index)" :on-preview="onPreviewFile"
+                                   :on-exceed="()=>msgTip(`上传文件数量不可大于1`, 2)">
+                          <el-button text type="primary">上传</el-button>
+                        </el-upload>
+                      </div>
+                    </div>
+                  </div> -->
+                  <div>
+                    <!-- writing-mode: vertical-rl; 文字垂直排 -->
+                    <div style="margin-right:10px;background:rgb(94 120 145);color:#fff;padding:5px 2px;border-radius:3px;line-height:21px;;cursor:pointer;width:60px;text-align:center"
                          @click="handleClickUploadOne($index)" v-if="!judgeStatus()">
-                      {{row.isShowProductFile?'上  传  文  件':'取  消  上  传'}}
+                      {{row.isShowProductFile?'上传plt':'取消上传'}}
                     </div>
                     <div>
                       <div v-if="row.isShowProductFile &&row.fileListOne && row.fileListOne.length > 0">
@@ -291,7 +380,7 @@
                   <el-form-item :prop="'contractProductList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true"
                                 class="margin-b-0 wid100">
                     <el-input-number onmousewheel="return false;" v-model="row.quantity" placeholder="请输入" style="width: 100%" :precision="0"
-                                     :controls="false" :min="0" @change="calculationAmount('quantity')" v-if="isEditList" />
+                                     :controls="false" :min="0" @change="calculationAmount()" v-if="isEditList" />
                     <div v-else> {{row.quantity}}</div>
                   </el-form-item>
                 </div>
@@ -355,6 +444,8 @@
                 </div>
               </template>
             </el-table-column>
+            <el-table-column label="出厂单价" prop="factoryPrice" width="100">
+            </el-table-column>
             <el-table-column prop="amount" label="小计" width="110">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
@@ -362,6 +453,13 @@
                 </div>
               </template>
             </el-table-column>
+            <el-table-column prop="amountTwo" label="出厂小计金额" width="110">
+              <template #default="{ row, $index }">
+                <div style="width: 100%">
+                  ¥ {{row.amountTwo}}
+                </div>
+              </template>
+            </el-table-column>
             <el-table-column label="备注" min-width="200">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
@@ -446,7 +544,7 @@
       </template>
     </el-dialog>
 
-    <!-- <el-dialog v-if="copyContract" v-model="copyContract" :title="copyType === 1 ? '合同选择' : '样品单选择'" width="90%" append-to-body>
+    <!-- <el-dialog v-if="copyContract" v-model="copyContract" :title="copyType === 1 ? '订单选择' : '样品单选择'" width="90%" append-to-body>
       <SelectContract @select="selectContract" v-if="copyType === 1"></SelectContract>
       <SelectSample @select="selectContract" v-if="copyType === 2"></SelectSample>
     </el-dialog> -->
@@ -481,6 +579,21 @@ const fundsPaymentMethod = computed(
 const shippingMethod = computed(
   () => proxy.useUserStore().allDict["shipping_method"]
 );
+const contractChannel = computed(
+  () => proxy.useUserStore().allDict["contract_channel"]
+);
+const taxTransportationWay = computed(
+  () => proxy.useUserStore().allDict["tax_transportation_way"]
+);
+const shopName = computed(() => proxy.useUserStore().allDict["shop_name"]);
+
+const taxPoints = computed(() => proxy.useUserStore().allDict["tax_points"]);
+const settlementWay = computed(
+  () => proxy.useUserStore().allDict["settlement_way"]
+);
+const frontLinesData = computed(
+  () => proxy.useUserStore().allDict["front_lines"]
+);
 const companyId = computed(() => proxy.useUserStore().user.companyId);
 const accountList = ref([]);
 const customerList = ref([]);
@@ -505,6 +618,8 @@ const formData = reactive({
     contractProductList: [],
     companyId: "",
     templateContent: "",
+    contractChannel: "",
+    paymentMethod: "",
   },
 });
 const uploadData = ref({});
@@ -550,7 +665,7 @@ const formConfig = computed(() => {
     {
       type: "input",
       prop: "code",
-      label: "合同号",
+      label: "订单号",
       disabled: true,
       isShow: formData.data.code ? true : false,
     },
@@ -613,8 +728,7 @@ const formConfig = computed(() => {
       propsTreeLabel: "deptName",
       propsTreeValue: "deptId",
       itemWidth: 50,
-      disabled:
-        !isEditList.value || route.query.flowKey == "contract_update_flow",
+      disabled: !isEditList.value,
       fn: () => {
         formData.data.contractProductList = [];
       },
@@ -637,6 +751,31 @@ const formConfig = computed(() => {
     },
     {
       type: "select",
+      prop: "contractChannel",
+      label: "订单渠道",
+      data: contractChannel.value,
+      itemWidth: 50,
+    },
+    {
+      type: "input",
+      prop: "channelCode",
+      label: "渠道订单编号",
+      itemWidth: 50,
+      isShow:
+        formData.data.contractChannel &&
+        formData.data.contractChannel.includes("阿里巴巴")
+          ? true
+          : false,
+    },
+    {
+      type: "select",
+      prop: "salesmanId",
+      label: "业务员",
+      data: userList.value,
+      itemWidth: 50,
+    },
+    {
+      type: "select",
       prop: "merchUserId",
       label: "跟单员",
       data: userList.value,
@@ -700,6 +839,14 @@ const formConfig = computed(() => {
     },
     {
       type: "select",
+      prop: "taxPoints",
+      label: "税点",
+      data: taxPoints.value,
+      itemWidth: 25,
+      isShow: formData.data.isTax && formData.data.isTax == "1" ? true : false,
+    },
+    {
+      type: "select",
       prop: "isFreight",
       label: "是否含运费",
       data: [
@@ -714,40 +861,179 @@ const formConfig = computed(() => {
       ],
       itemWidth: 25,
     },
+    // {
+    //   type: "select",
+    //   prop: "rr",
+    //   label: "结算方式",
+    //   data: settlementWay.value,
+    //   itemWidth: 25,
+    // },
     {
       type: "select",
       prop: "paymentMethod",
-      label: "付款方式",
+      label: "客户付款方式",
       data: fundsPaymentMethod.value,
       itemWidth: 25,
     },
+    // {
+    //   type: "select",
+    //   prop: "paymentMethod",
+    //   label: "付款方式",
+    //   data: fundsPaymentMethod.value,
+    //   itemWidth: 25,
+    // },
     {
-      type: "number",
-      prop: "advanceRatio",
-      label: "预付款比列(%)",
-      precision: 2,
-      min: 0,
-      controls: false,
+      type: "input",
+      prop: "alibabaCode",
+      label: "阿里巴巴订单编号",
+      itemType: "text",
       itemWidth: 25,
+      isShow:
+        formData.data.paymentMethod &&
+        formData.data.paymentMethod.includes("阿里巴巴")
+          ? true
+          : false,
     },
     {
-      type: "input",
-      prop: "remark",
-      label: "付款条件",
-      itemType: "textarea",
-      itemWidth: 50,
+      type: "select",
+      prop: "alibabaShopName",
+      label: "1688店铺名称",
+      data: shopName.value,
+      itemWidth: 25,
+      isShow:
+        formData.data.paymentMethod &&
+        formData.data.paymentMethod.includes("阿里巴巴")
+          ? true
+          : false,
     },
     {
       type: "select",
       prop: "shroffAccountId",
-      label: "收款账号",
+      label: "款账号",
       data: accountList.value,
-      itemWidth: 100,
+      itemWidth: 50,
       fn: (val) => {
         changeShroffAccount(val);
       },
+      isShow: formData.data.paymentMethod == "bank1",
+    },
+    {
+      type: "input",
+      prop: "accountName",
+      label: "户名",
+      placeholder: "请输入户名",
+      itemWidth: 50,
+      isShow:
+        formData.data.paymentMethod &&
+        formData.data.paymentMethod.includes("bank")
+          ? true
+          : false,
+    },
+    {
+      type: "input",
+      prop: "openingBank",
+      label: "开户行",
+      placeholder: "请输入开户行",
+      itemWidth: 50,
+      isShow:
+        formData.data.paymentMethod &&
+        formData.data.paymentMethod.includes("bank")
+          ? true
+          : false,
+    },
+    {
+      type: "input",
+      prop: "accountOpening",
+      label: "账号",
+      placeholder: "请输入账号",
+      itemWidth: 50,
+      isShow:
+        formData.data.paymentMethod &&
+        (formData.data.paymentMethod.includes("bank") ||
+          ["wxPay", "aliPay"].includes(formData.data.paymentMethod))
+          ? true
+          : false,
+    },
+    {
+      type: "input",
+      prop: "remark",
+      label: "其他收款方式备注说明",
+      itemType: "textarea",
+      itemWidth: 100,
+      isShow:
+        formData.data.paymentMethod &&
+        !["bank", "bank1", "阿里巴巴", "wxPay", "aliPay"].includes(
+          formData.data.paymentMethod
+        )
+          ? true
+          : false,
+    },
+    {
+      type: "slot",
+      slotName: "advanceRatio",
+      prop: "",
+      label: "",
     },
     // {
+    //   type: "number",
+    //   prop: "advanceRatio",
+    //   label: "定金比例",
+    //   precision: 2,
+    //   min: 0,
+    //   max: 100,
+    //   controls: false,
+    //   itemWidth: 25,
+    //   fn: (val) => {
+    //     if (val && formData.data.beforeShipmentRatio) {
+    //       let total = val + formData.data.beforeShipmentRatio;
+    //       if (total > 100) {
+    //         formData.data.advanceRatio = null;
+    //         formData.data.beforeShipmentRatio = null;
+    //       }
+    //       formData.data.afterShipmentRatio = 100 - total;
+    //     }
+    //   },
+    // },
+    // {
+    //   type: "number",
+    //   prop: "beforeShipmentRatio",
+    //   label: "出货前付款⽐例",
+    //   precision: 2,
+    //   min: 0,
+    //   max: 100,
+    //   controls: false,
+    //   itemWidth: 25,
+    //   fn: (val) => {
+    //     if (val && formData.data.advanceRatio) {
+    //       let total = val + formData.data.advanceRatio;
+    //       if (total > 100) {
+    //         formData.data.advanceRatio = null;
+    //         formData.data.beforeShipmentRatio = null;
+    //       }
+    //       formData.data.afterShipmentRatio = 100 - total;
+    //     }
+    //   },
+    // },
+    // {
+    //   type: "number",
+    //   prop: "afterShipmentRatio",
+    //   label: "出货后尾款⽐例",
+    //   precision: 2,
+    //   min: 0,
+    //   max: 100,
+    //   controls: false,
+    //   itemWidth: 25,
+    //   disabled: true,
+    // },
+    // {
+    //   type: "input",
+    //   prop: "remark",
+    //   label: "付款条件",
+    //   itemType: "textarea",
+    //   itemWidth: 100,
+    // },
+
+    // {
     //   type: "input",
     //   prop: "beneficiaryName",
     //   label: " ",
@@ -795,30 +1081,7 @@ const formConfig = computed(() => {
     //   itemWidth: 50,
     //   isShow: formData.data.contractType == "1",
     // },
-    {
-      type: "input",
-      prop: "accountName",
-      label: "户名",
-      placeholder: "请输入户名",
-      itemWidth: 50,
-      // isShow: formData.data.contractType == "2",
-    },
-    {
-      type: "input",
-      prop: "openingBank",
-      label: "开户行",
-      placeholder: "请输入开户行",
-      itemWidth: 50,
-      // isShow: formData.data.contractType == "2",
-    },
-    {
-      type: "input",
-      prop: "accountOpening",
-      label: "账号",
-      placeholder: "请输入账号",
-      itemWidth: 50,
-      // isShow: formData.data.contractType == "2",
-    },
+
     // {
     //   type: "slot",
     //   slotName: "payment",
@@ -831,6 +1094,14 @@ const formConfig = computed(() => {
     },
     {
       type: "date",
+      itemType: "date",
+      prop: "saleDate",
+      label: "销售日期",
+      itemWidth: 50,
+    },
+    {
+      type: "date",
+      itemType: "date",
       prop: "deliveryTime",
       label: "交货期限",
       itemWidth: 50,
@@ -843,6 +1114,13 @@ const formConfig = computed(() => {
       itemWidth: 50,
     },
     // {
+    //   type: "select",
+    //   prop: "taxTransportationWay",
+    //   label: "税运方式",
+    //   data: taxTransportationWay.value,
+    //   itemWidth: 50,
+    // },
+    // {
     //   type: "input",
     //   prop: "transportRemark",
     //   label: "运输说明",
@@ -875,25 +1153,39 @@ const formConfig = computed(() => {
     },
     {
       type: "title",
-      title: "合同总金额",
+      title: "订单总金额",
       haveLine: true,
     },
     {
       type: "input",
       prop: "amount",
-      label: "合同总金额",
+      label: "订单总⾦额",
+      itemWidth: 25,
+      disabled: true,
+    },
+    {
+      type: "input",
+      prop: "factoryAmount",
+      label: "出⼚总⾦额",
+      itemWidth: 25,
+      disabled: true,
+    },
+    {
+      type: "input",
+      prop: "grossProfit",
+      label: "合计⽑利",
       itemWidth: 25,
       disabled: true,
     },
     {
       type: "title",
-      title: "合同模板",
+      title: "订单模板",
       haveLine: true,
     },
     {
       type: "select",
       prop: "contractTemplateId",
-      label: "合同模板",
+      label: "订单模板",
       data: templateList.value,
       itemWidth: 50,
       fn: (val) => {
@@ -913,6 +1205,7 @@ const formConfig = computed(() => {
     },
   ];
 });
+
 const rules = ref({
   ofCompanyId: [
     { required: true, message: "请选择业务公司", trigger: "change" },
@@ -929,6 +1222,7 @@ const rules = ref({
     { required: true, message: "请选择订单归属", trigger: "change" },
   ],
   merchUserId: [{ required: true, message: "请选择跟单员", trigger: "change" }],
+  salesmanId: [{ required: true, message: "请选择业务员", trigger: "change" }],
   isTax: [{ required: true, message: "请选择是否含税", trigger: "change" }],
   isFreight: [
     { required: true, message: "请选择是否含运费", trigger: "change" },
@@ -963,7 +1257,9 @@ const rules = ref({
   transportMethod: [
     { required: true, message: "请选择运输方式", trigger: "change" },
   ],
-  // remark: [{ required: true, message: "请输入付款条件", trigger: "blur" }],
+  remark: [
+    { required: true, message: "请输入其他收款方式备注说明", trigger: "blur" },
+  ],
   rate: [{ required: true, message: "请输入汇率", trigger: "blur" }],
   shroffAccountId: [
     { required: true, message: "请选择收款账号", trigger: "change" },
@@ -974,6 +1270,29 @@ const rules = ref({
   templateContent: [
     { required: true, message: "请输入模板内容", trigger: "blur" },
   ],
+  contractChannel: [
+    { required: true, message: "请选择订单渠道", trigger: "change" },
+  ],
+  channelCode: [
+    { required: true, message: "请输入订单渠道编号", trigger: "blur" },
+  ],
+  saleDate: [{ required: true, message: "请选择销售日期", trigger: "change" }],
+  taxTransportationWay: [
+    { required: true, message: "请选择税运方式", trigger: "change" },
+  ],
+  beforeShipmentRatio: [
+    { required: true, message: "请输入出货前付款比例", trigger: "blur" },
+  ],
+  afterShipmentRatio: [
+    { required: true, message: "请输入出货后付款比例", trigger: "blur" },
+  ],
+  taxPoints: [{ required: true, message: "请选择税点", trigger: "change" }],
+  alibabaCode: [
+    { required: true, message: "请输入阿里巴巴编号", trigger: "blur" },
+  ],
+  alibabaShopName: [
+    { required: true, message: "请选择1688店铺名称", trigger: "change" },
+  ],
 });
 const getDict = () => {
   proxy
@@ -1176,6 +1495,35 @@ const changeCustomer = (val) => {
     formData.data.buyAddress = "";
   }
 };
+const changeAdvanceRatio = (val, flag) => {
+  if (flag) {
+    let total = Number(
+      parseFloat(val + Number(formData.data.beforeShipmentRatio)).toFixed(2)
+    );
+    if (total > 100) {
+      formData.data.advanceRatio = null;
+      formData.data.beforeShipmentRatio = null;
+      formData.data.afterShipmentRatio = null;
+    } else {
+      formData.data.afterShipmentRatio = Number(
+        parseFloat(100 - total).toFixed(2)
+      );
+    }
+  } else {
+    let total = Number(
+      parseFloat(val + Number(formData.data.advanceRatio)).toFixed(2)
+    );
+    if (total > 100) {
+      formData.data.advanceRatio = null;
+      formData.data.beforeShipmentRatio = null;
+      formData.data.afterShipmentRatio = null;
+    } else {
+      formData.data.afterShipmentRatio = Number(
+        parseFloat(100 - total).toFixed(2)
+      );
+    }
+  }
+};
 const createFilter = (queryString) => {
   return (restaurant) => {
     return (
@@ -1243,15 +1591,20 @@ const selectProduct = async (goods) => {
         formData.data.contractProductList.push({
           fileUrl: fileUrl,
           productId: goods.id,
-          productCnName: goods.name,
+          productClassifyName: goods.classifyName,
+          productName: goods.name,
           productCode: goods.customCode,
           productLength: goods["length"],
           productWidth: goods.width,
           productHeight: goods.height,
           productColor: goods.color,
+          productNetWeight: goods.netWeight,
+          productUnit: goods.unit,
+          productFrontalTexture: goods.frontalTexture,
           prodFilePath: goods.prodFilePath,
           quantity: null,
           price: goods.price || null,
+          factoryPrice: goods.factoryPrice || null,
           amount: "",
           remark: "",
           fileList: [],
@@ -1312,6 +1665,7 @@ const selectMaterial = (goods) => {
 };
 
 const changeProductPrice = () => {
+  return;
   let productIds = formData.data.contractProductList.map((x) => x.productId);
   if (productIds && productIds.length > 0) {
     proxy
@@ -1374,29 +1728,28 @@ const handleDeleteMaterial = (index, sonIndex) => {
   );
 };
 
-const calculationAmount = (att = "") => {
-  nextTick(() => {
-    if (
-      formData.data.contractProductList &&
-      formData.data.contractProductList.length > 0
-    ) {
-      for (let i = 0; i < formData.data.contractProductList.length; i++) {
-        let money = 0;
-        money = parseFloat(
-          Number(formData.data.contractProductList[i].quantity) *
-            Number(formData.data.contractProductList[i].price)
-        ).toFixed(2);
-        formData.data.contractProductList[i].amount = money;
-      }
+const calculationAmount = () => {
+  if (
+    formData.data.contractProductList &&
+    formData.data.contractProductList.length > 0
+  ) {
+    for (let i = 0; i < formData.data.contractProductList.length; i++) {
+      formData.data.contractProductList[i].amount = parseFloat(
+        Number(formData.data.contractProductList[i].quantity) *
+          Number(formData.data.contractProductList[i].price)
+      ).toFixed(2);
+      formData.data.contractProductList[i].amountTwo = parseFloat(
+        Number(formData.data.contractProductList[i].quantity) *
+          Number(formData.data.contractProductList[i].factoryPrice)
+      ).toFixed(2);
     }
-    nextTick(() => {
-      totalAmount();
-    });
-  });
+  }
+  totalAmount();
 };
 
 const totalAmount = () => {
   let money = 0;
+  let moneyTwo = 0;
   if (
     formData.data.contractProductList &&
     formData.data.contractProductList.length > 0
@@ -1407,6 +1760,12 @@ const totalAmount = () => {
           Number(money) + Number(formData.data.contractProductList[i].amount)
         ).toFixed(2);
       }
+      if (formData.data.contractProductList[i].amountTwo) {
+        moneyTwo = parseFloat(
+          Number(moneyTwo) +
+            Number(formData.data.contractProductList[i].amountTwo)
+        ).toFixed(2);
+      }
     }
   }
   if (
@@ -1422,6 +1781,10 @@ const totalAmount = () => {
     }
   }
   formData.data.amount = money;
+  formData.data.factoryAmount = moneyTwo;
+  formData.data.grossProfit = parseFloat(
+    Number(formData.data.amount) - Number(formData.data.factoryAmount)
+  ).toFixed(2);
 };
 const clickAdd = () => {
   if (
@@ -1547,7 +1910,10 @@ const remoteMethod = (keyword) => {
   return;
 };
 
-const handleSubmit = async () => {
+const handleSubmit = async (isStag = false) => {
+  if (isStag) {
+    return true;
+  }
   let flag = await formDom.value.handleSubmit(() => {});
   if (flag) {
     if (
@@ -1576,6 +1942,8 @@ const handleSubmit = async () => {
 };
 
 const getFormData = () => {
+  // 赋值类型
+  formData.data.type = route.query.flowKey == "sample_flow" ? "1" : "0";
   return proxy.deepClone(formData.data);
 };
 // 向父组件暴露
@@ -1772,6 +2140,7 @@ const getAllData = (businessId) => {
         });
       changeProductPrice();
     }
+    calculationAmount();
     if (formData.data.countryId) {
       getCityData(formData.data.countryId, "20");
     }
@@ -1809,12 +2178,18 @@ const getFileData = () => {
     });
 };
 const getPriceSheetData = (id) => {
-  proxy.post("/extQuotation/detail", { id }).then((res) => {
+  proxy.post("/extQuotation/detail", { id }).then(async (res) => {
+    if (formData.data.deptId) {
+      res.deptId = formData.data.deptId;
+    }
     formData.data = res;
     formData.data = {
+      contractType: route.query.contractType,
       templateContent: "",
       quotationId: res.id,
       companyId: res.companyId,
+      ofCompanyId: res.ofCompanyId,
+      deptId: res.deptId,
       buyCorporationId: res.buyCorporationId,
       buyAddress: res.buyAddress,
       buyPostalCode: res.buyPostalCode,
@@ -1822,20 +2197,20 @@ const getPriceSheetData = (id) => {
       buyContactNumber: res.buyContactNumber,
       amount: res.amount,
     };
-    if (res.type == 1) {
-      formData.data.contractType = "2";
-      if (currencyData.value && currencyData.value.length > 0) {
-        formData.data.currency = currencyData.value[0].dictKey;
-      }
-      formData.data.rate = 1;
-    } else {
-      formData.data.contractType = "1";
-    }
+    // if (res.type == 1) {
+    //   formData.data.contractType = "2";
+    //   if (currencyData.value && currencyData.value.length > 0) {
+    //     formData.data.currency = currencyData.value[0].dictKey;
+    //   }
+    //   formData.data.rate = 1;
+    // } else {
+    //   formData.data.contractType = "1";
+    // }
     formData.data.contractProductList = res.quotationProductList.map((x) => ({
       quotationProductId: x.id,
       fileUrl: "",
       productId: x.productId,
-      productCnName: x.productName,
+      productName: x.productName,
       productCode: x.productCode,
       productLength: x.productLength,
       productWidth: x.productWidth,
@@ -1853,7 +2228,39 @@ const getPriceSheetData = (id) => {
       rowId: uuidv4(),
     }));
     changeProductPrice();
+    totalAmount();
     getFileData();
+    let productIds = formData.data.contractProductList.map((x) => x.productId);
+    const productAllFile = await proxy.getFileData({
+      businessIdList: productIds,
+      getAll: true,
+    });
+    for (let i = 0; i < formData.data.contractProductList.length; i++) {
+      const ele = formData.data.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;
+          }
+          ele.fileListOne = productAllFile[ele.productId].filter(
+            (x) => x.businessType == "2"
+          );
+          if (ele.fileListOne && ele.fileListOne.length > 0) {
+            ele.isShowProductFile = true;
+          } else {
+            ele.isShowProductFile = false;
+          }
+          break;
+        }
+      }
+    }
     formData.data.countryId = res.buyCountryId;
     formData.data.provinceId = res.buyProvinceId;
     formData.data.cityId = res.buyCityId;
@@ -1869,12 +2276,16 @@ const getPriceSheetData = (id) => {
 const isEditList = ref(true);
 onMounted(() => {
   formData.data.ofCompanyId = proxy.useUserStore().user.companyId;
+  formData.data.salesmanId = proxy.useUserStore().user.userId;
   handleOfCompanyIdChange(formData.data.ofCompanyId);
   if (
     proxy.useUserStore().currentCompany == proxy.useUserStore().user.ofCompanyId
   ) {
     formData.data.deptId = proxy.useUserStore().user.deptId;
   }
+  if (currencyData.value && currencyData.value.length > 0) {
+    formData.data.currency = currencyData.value[0].dictKey;
+  }
   formOption.disabled = judgeStatus();
   // 报价转销售订单
   if (route.query && route.query.priceSheetId) {
@@ -1893,21 +2304,21 @@ onMounted(() => {
   }
 });
 
-// watch(
-//   () => props.queryData,
-//   (val) => {
-//     nextTick(() => {
-//       formOption.disabled = judgeStatus();
-//     });
-//     if (val.businessId && val.processType) {
-//       getAllData(val.businessId);
-//     }
-//   },
-//   {
-//     deep: true,
-//     immediate: true,
-//   }
-// );
+watch(
+  () => props.queryData,
+  (val) => {
+    nextTick(() => {
+      formOption.disabled = judgeStatus();
+    });
+    if (val.businessId && val.processType) {
+      getAllData(val.businessId);
+    }
+  },
+  {
+    deep: true,
+    immediate: true,
+  }
+);
 
 const showPriceInfo = () => {
   if (props.queryData.processType) {

+ 14 - 9
src/components/process/SF/DiscussPrice.vue

@@ -529,17 +529,22 @@ const getCityData = (id, type, isChange) => {
 const rawMaterialData = ref([]);
 const technologyData = ref([]);
 const getRawMaterialData = () => {
-  proxy.post("/productInfo/page", { productClassifyId: 100 }).then((res) => {
+  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,
+    // }));
     rawMaterialData.value = res.rows.map((x) => ({
       ...x,
-      label:
-        x.name +
-        "," +
-        x.customCode +
-        "," +
-        `${x["length"]}*${x.width}*${x.height}(cm)` +
-        "," +
-        x.color,
+      label: x.name + "," + x.customCode,
       value: x.id,
     }));
   });

+ 14 - 9
src/views/EHSD/productLibrary/companyProduct/index.vue

@@ -1270,17 +1270,22 @@ const getDtl = (row) => {
 };
 const rawMaterialData = ref([]);
 const getRawMaterialData = () => {
-  proxy.post("/productInfo/page", { productClassifyId: 100 }).then((res) => {
+  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,
+    // }));
     rawMaterialData.value = res.rows.map((x) => ({
       ...x,
-      label:
-        x.name +
-        "," +
-        x.customCode +
-        "," +
-        `${x["length"]}*${x.width}*${x.height}(cm)` +
-        "," +
-        x.color,
+      label: x.name + "," + x.customCode,
       value: x.id,
     }));
   });

+ 14 - 9
src/views/EHSD/productLibrary/waitCreateProduct/index.vue

@@ -1062,17 +1062,22 @@ const getDtl = (row) => {
 };
 const rawMaterialData = ref([]);
 const getRawMaterialData = () => {
-  proxy.post("/productInfo/page", { productClassifyId: 100 }).then((res) => {
+  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,
+    // }));
     rawMaterialData.value = res.rows.map((x) => ({
       ...x,
-      label:
-        x.name +
-        "," +
-        x.customCode +
-        "," +
-        `${x["length"]}*${x.width}*${x.height}(cm)` +
-        "," +
-        x.color,
+      label: x.name + "," + x.customCode,
       value: x.id,
     }));
   });

+ 14 - 9
src/views/EHSD/saleContract/PriceSheetDetail.vue

@@ -611,17 +611,22 @@ const getDict = () => {
 const rawMaterialData = ref([]);
 const technologyData = ref([]);
 const getRawMaterialData = () => {
-  proxy.post("/productInfo/page", { productClassifyId: 100 }).then((res) => {
+  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,
+    // }));
     rawMaterialData.value = res.rows.map((x) => ({
       ...x,
-      label:
-        x.name +
-        "," +
-        x.customCode +
-        "," +
-        `${x["length"]}*${x.width}*${x.height}(cm)` +
-        "," +
-        x.color,
+      label: x.name + "," + x.customCode,
       value: x.id,
     }));
   });

+ 106 - 4
src/views/EHSD/saleContract/contractEHSD/index.vue

@@ -276,6 +276,16 @@
       </template>
     </el-dialog>
 
+    <el-dialog :title="'终止生产'" v-model="terminationDialog" width="700px" destroy-on-close>
+      <byForm :formConfig="terminationFormConfig" :formOption="formOption" v-model="formData.terminationData" :rules="terminationRules"
+              ref="terminationFormDom" v-loading="formLoading">
+      </byForm>
+      <template #footer>
+        <el-button @click="terminationDialog =false" size="default" v-debounce>取 消</el-button>
+        <el-button @click="submitTermination" type="primary" size="default" v-debounce>提 交</el-button>
+      </template>
+    </el-dialog>
+
   </div>
 </template>
 
@@ -338,6 +348,10 @@ const produceStatusData = ref([
   },
   {
     label: "作废",
+    value: "88",
+  },
+  {
+    label: "终止",
     value: "99",
   },
 ]);
@@ -684,12 +698,38 @@ const config = computed(() => {
     },
     {
       attrs: {
-        label: "预付比例",
+        label: "定金比例",
         slot: "advanceRatio",
         width: 100,
         align: "right",
       },
     },
+    {
+      attrs: {
+        label: "出货前付款比例",
+        prop: "beforeShipmentRatio",
+        width: 130,
+        align: "right",
+      },
+      render(val) {
+        if (val) {
+          return proxy.moneyFormat(val, 2) + "%";
+        }
+      },
+    },
+    {
+      attrs: {
+        label: "出货后付款比例",
+        prop: "afterShipmentRatio",
+        width: 130,
+        align: "right",
+      },
+      render(val) {
+        if (val) {
+          return proxy.moneyFormat(val, 2) + "%";
+        }
+      },
+    },
 
     {
       attrs: {
@@ -702,7 +742,7 @@ const config = computed(() => {
     {
       attrs: {
         label: "已结算金额",
-        prop: "sumClaimMoney",
+        prop: "settledAmount",
         width: 100,
         align: "right",
       },
@@ -710,7 +750,7 @@ const config = computed(() => {
     {
       attrs: {
         label: "未结算金额",
-        prop: "sumClaimMoney",
+        prop: "unsettledAmount",
         width: 100,
         align: "right",
       },
@@ -782,7 +822,7 @@ const config = computed(() => {
             ? {
                 attrs: {
                   label: "生产",
-                  type: "danger",
+                  type: "primary",
                   text: true,
                 },
                 el: "button",
@@ -791,6 +831,19 @@ const config = computed(() => {
                 },
               }
             : {},
+          row.status == 30 && row.orderDistributeStatus == 1
+            ? {
+                attrs: {
+                  label: "终止生产",
+                  type: "danger",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  hanleTermination(row);
+                },
+              }
+            : {},
 
           route.query.pageType == "1"
             ? {
@@ -1751,6 +1804,55 @@ const trunContract = (row) => {
     },
   });
 };
+
+const hanleTermination = (row) => {
+  formData.terminationData = {
+    id: row.id,
+    amount: row.amount || null,
+    terminationRemark: "",
+  };
+  terminationDialog.value = true;
+};
+
+const terminationFormDom = ref(null);
+const terminationDialog = ref(false);
+const terminationFormConfig = computed(() => [
+  {
+    type: "number",
+    prop: "amount",
+    label: "合同总金额",
+    precision: 2,
+    min: 0,
+    controls: false,
+    // itemWidth: 25,
+  },
+  {
+    type: "input",
+    prop: "terminationRemark",
+    itemType: "textarea",
+    label: "终止备注",
+    itemWidth: 100,
+  },
+]);
+const terminationRules = ref({
+  amount: [{ required: true, message: "请输入合同总金额", trigger: "blur" }],
+  terminationRemark: [
+    { required: true, message: "请输入终止备注", trigger: "blur" },
+  ],
+});
+const submitTermination = () => {
+  terminationFormDom.value.handleSubmit(() => {
+    formLoading.value = true;
+    proxy
+      .post("/contract/productionTermination", formData.terminationData)
+      .then((res) => {
+        proxy.msgTip("操作成功");
+        formLoading.value = false;
+        terminationDialog.value = false;
+        getList();
+      });
+  });
+};
 </script>
 
 <style lang="scss" scoped>

+ 14 - 9
src/views/EHSD/saleContract/priceSheetEHSD/index.vue

@@ -1437,17 +1437,22 @@ getList();
 const rawMaterialData = ref([]);
 const technologyData = ref([]);
 const getRawMaterialData = () => {
-  proxy.post("/productInfo/page", { productClassifyId: 100 }).then((res) => {
+  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,
+    // }));
     rawMaterialData.value = res.rows.map((x) => ({
       ...x,
-      label:
-        x.name +
-        "," +
-        x.customCode +
-        "," +
-        `${x["length"]}*${x.width}*${x.height}(cm)` +
-        "," +
-        x.color,
+      label: x.name + "," + x.customCode,
       value: x.id,
     }));
   });

+ 1 - 1
src/views/EHSD/saleContract/priceSheetEstimate/index.vue

@@ -1120,7 +1120,7 @@ getList();
 const rawMaterialData = ref([]);
 const technologyData = ref([]);
 const getRawMaterialData = () => {
-  proxy.post("/productInfo/page", { productClassifyId: 100 }).then((res) => {
+  proxy.post("/productInfo/page", { productClassifyId: 110 }).then((res) => {
     rawMaterialData.value = res.rows.map((x) => ({
       ...x,
       label:

+ 73 - 3
src/views/MES/productionOrder/index.vue

@@ -148,7 +148,14 @@
       </template>
     </el-dialog>
 
-    <el-dialog :title="'订单详情'" v-model="dialogVisible" width="90%" destroy-on-close>
+    <el-dialog :title="'查看'" v-model="dialogVisible" width="90%" destroy-on-close>
+      <el-tabs v-model="activeName" type="card" class="demo-tabs" @tab-change="handleTabChange">
+        <el-tab-pane label="订单详情" name="1">
+        </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>
           <div style="width: 100%">
@@ -255,7 +262,6 @@
                       </div>
                     </div>
                   </div>
-
                 </template>
               </el-table-column>
               <el-table-column label="数量" width="100" prop="quantity" />
@@ -263,6 +269,34 @@
             </el-table>
           </div>
         </template>
+
+        <template #commodityOne>
+          <div style="width: 100%">
+            <el-table :data="formData.orderData.materialList" style="width: 100%; ">
+              <el-table-column label="物料图片" width="80">
+                <template #default="{ row }">
+                  <div v-if="row.fileUrl">
+                    <img :src="row.fileUrl" class="pic" @click="onPicture(row.fileUrl)" />
+                  </div>
+                  <div v-else></div>
+                </template>
+              </el-table-column>
+              <el-table-column prop="materialCode" label="物料编码" width="200" />
+              <el-table-column prop="materialName" label="物料名称" min-width="150" />
+              <el-table-column prop="quantity" label="应发数量" width="100" />
+              <el-table-column prop="unclaimedQuantity" label="未领数量" width="100" />
+              <el-table-column prop="receivedQuantity" label="已领数量" width="100" />
+              <el-table-column prop="workshopInventoryQuantity" label="车间结存" width="100">
+                <template #default="{ row, $index }">
+                  <div style="color:red">
+                    {{row.workshopInventoryQuantity}}
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column prop="purchaseTransitQuantity" label="采购在途" width="100" />
+            </el-table>
+          </div>
+        </template>
       </byForm>
       <template #footer>
         <el-button @click="dialogVisible = false" size="defualt">取 消</el-button>
@@ -287,6 +321,7 @@ const contractTag = computed(
 const companyData = ref([]);
 const loading = ref(false);
 const submitLoading = ref(false);
+const activeName = ref("1");
 const sourceList = ref({
   data: [],
   pagination: {
@@ -336,6 +371,10 @@ const statusData = ref([
   },
   {
     label: "作废",
+    value: "88",
+  },
+  {
+    label: "终止",
     value: "99",
   },
 ]);
@@ -606,23 +645,38 @@ const formConfig = computed(() => {
     {
       type: "title1",
       title: "基本信息",
+      isShow: activeName.value == "1",
     },
     {
       type: "text",
       prop: "code",
       label: "合同号:",
       disabled: true,
-      isShow: formData.orderData.code ? true : false,
+      isShow: formData.orderData.code && activeName.value == "1" ? true : false,
     },
     {
       type: "title1",
       title: "商品信息",
       haveLine: true,
+      isShow: activeName.value == "1",
     },
     {
       type: "slot",
       slotName: "commodity",
       label: "",
+      isShow: activeName.value == "1",
+    },
+    {
+      type: "title1",
+      title: "物料结存",
+      haveLine: false,
+      isShow: activeName.value == "2",
+    },
+    {
+      type: "slot",
+      slotName: "commodityOne",
+      label: "",
+      isShow: activeName.value == "2",
     },
   ];
 });
@@ -950,6 +1004,22 @@ const lookDetails = (item) => {
   proxy.post("/contract/detail", { id: item.contractId }).then(async (res) => {
     formData.orderData = res;
     dialogVisible.value = true;
+    proxy
+      .post("/produceOrder/materialBalanceList", { id: item.contractId })
+      .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

+ 78 - 18
src/views/MES/productionTask/index.vue

@@ -1,6 +1,7 @@
 <template>
   <div class="pageIndexClass  a">
-    <byTable :hideTable="true" :hidePagination="true" :config="[]" highlight-current-row :selectConfig="selectConfig" :action-list="[ {
+    <byTable :hideTable="true" :hidePagination="true" :config="[]" highlight-current-row :selectConfig="selectConfig"
+             :pagination="sourceList.pagination" :action-list="[ {
                 text: '打印任务单',
                 action: () => openModal('add'),
                 disabled: selectIds.length==0,
@@ -18,6 +19,13 @@
         <el-tab-pane label="车间工序结存" name="4">
         </el-tab-pane>
         <el-tab-pane v-for="item in processesData" :label="item.name" :name="item.id" :key="item.id">
+          <template #label>
+            <div>
+              <el-badge :value="Number(taskCountObj[item.id])||0" :max="99">
+                {{item.name}}
+              </el-badge>
+            </div>
+          </template>
         </el-tab-pane>
       </el-tabs>
     </div>
@@ -489,7 +497,7 @@
               <el-table-column label="未排程件数" prop="waitQuantity" width="110" />
               <el-table-column label="排程数量" width="110">
                 <template #default="{ row, $index }">
-                  <el-form-item :prop="'list.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true" class="margin-b-0">
+                  <el-form-item :prop="'list.' + $index + '.quantity'" :rules="rulesOne.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>
@@ -506,7 +514,6 @@
       </byForm>
       <template #footer>
         <el-button @click="schedulingDialog = false" size="defualt">取 消</el-button>
-        <el-button type="danger" @click="deleteRecordOne()" v-if="isShowDeteleBtn" size="defualt">删 除</el-button>
         <el-button type="primary" @click="submitFormOne()" size="defualt">提 交</el-button>
       </template>
     </el-dialog>
@@ -536,6 +543,16 @@ const contractTag = computed(
 const pageActiveName = ref("1");
 const handlePageTabChange = (val) => {
   selectIds.value = [];
+  if (val == "1") {
+    sourceList.value.pagination.isScheduling = "0";
+  } else {
+    sourceList.value.pagination.isScheduling = "";
+  }
+  if (val == "2") {
+    sourceList.value.pagination.produceStatus = "2,5,10";
+  } else {
+    sourceList.value.pagination.produceStatus = "";
+  }
   switch (val) {
     case "1":
       break;
@@ -569,6 +586,7 @@ const sourceList = ref({
     beginTime: "",
     endTime: "",
     isOverdue: "",
+    isScheduling: "0",
   },
 });
 const treeData = ref([]);
@@ -599,6 +617,10 @@ const statusData = ref([
   },
   {
     label: "作废",
+    value: "88",
+  },
+  {
+    label: "终止",
     value: "99",
   },
 ]);
@@ -1011,23 +1033,23 @@ const configOne = ref([
   {
     attrs: {
       label: "操作",
-      width: "120",
+      width: "80",
       align: "center",
       fixed: "right",
     },
     renderHTML(row) {
       return [
-        {
-          attrs: {
-            label: "修改",
-            type: "primary",
-            text: true,
-          },
-          el: "button",
-          click() {
-            addScheduling("edit", row);
-          },
-        },
+        // {
+        //   attrs: {
+        //     label: "修改",
+        //     type: "primary",
+        //     text: true,
+        //   },
+        //   el: "button",
+        //   click() {
+        //     addScheduling("edit", row);
+        //   },
+        // },
         {
           attrs: {
             label: "删除",
@@ -1036,8 +1058,19 @@ const configOne = ref([
           },
           el: "button",
           click() {
-            formData.data.id = row.id;
-            deleteRecordOne();
+            proxy
+              .msgConfirm()
+              .then((res) => {
+                proxy
+                  .post("/productionScheduling/delete", {
+                    id: row.id,
+                  })
+                  .then((res) => {
+                    proxy.msgTip("操作成功", 1);
+                    getTableList();
+                  });
+              })
+              .catch((err) => {});
           },
         },
       ];
@@ -1089,6 +1122,14 @@ const getTableList = (req) => {
     });
 };
 
+const taskCountObj = ref({});
+const getTaskCount = () => {
+  proxy.post("/produceOrderDetail/taskCount").then((res) => {
+    taskCountObj.value = res;
+  });
+};
+getTaskCount();
+
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
@@ -1583,7 +1624,7 @@ const selectTask = (row) => {
 };
 
 const clickDeteleOne = (index) => {
-  formData.data.list.splice(index, 1);
+  formDataOne.data.list.splice(index, 1);
 };
 
 const submitFormOne = () => {
@@ -1594,6 +1635,15 @@ const submitFormOne = () => {
       }
     }
     submitLoading.value = true;
+    if (modalType.value == "add") {
+      formDataOne.data.list = formDataOne.data.list.map((x) => ({
+        ...x,
+        taskId: x.taskId,
+        quantity: x.quantity,
+        schedulingDate: formDataOne.data.schedulingDate,
+        processesId: formDataOne.data.processesId,
+      }));
+    }
     proxy
       .post(
         "/productionScheduling/" + modalType.value,
@@ -1685,5 +1735,15 @@ const submitFormOne = () => {
     padding: 0px !important;
   }
 }
+.el-tabs__nav-wrap,
+.el-tabs__nav-scroll {
+  overflow: visible !important;
+}
+::v-deep(.el-tabs__nav-wrap) {
+  overflow: visible !important;
+}
+::v-deep(.el-tabs__nav-scroll) {
+  overflow: visible !important;
+}
 </style>
 

+ 1 - 1
src/views/MES/productionTask/selectProductionTask.vue

@@ -541,7 +541,7 @@ const config = ref([
     attrs: {
       label: "订单号",
       slot: "orderCode",
-      width: 130,
+      width: 150,
     },
   },
   {

+ 9 - 1
src/views/finance/fundManage/flow/index.vue

@@ -649,7 +649,7 @@ const formConfig = computed(() => {
     },
     {
       type: "title1",
-      title: "其他信息",
+      title: "其他",
     },
     {
       type: "input",
@@ -657,6 +657,13 @@ const formConfig = computed(() => {
       label: "摘要",
       itemType: "textarea",
     },
+    {
+      type: "upload",
+      listType: "text",
+      accept: "",
+      prop: "fileList",
+      label: "凭证上传",
+    },
   ];
 });
 const rules = ref({
@@ -681,6 +688,7 @@ const openModal = (val) => {
   modalType.value = val;
   formData.data = {
     transactionTime: moment().format("yyyy-MM-DD HH:mm:ss"),
+    fileList: [],
   };
   loadingDialog.value = false;
   dialogVisible.value = true;

+ 7 - 6
src/views/index.vue

@@ -40,14 +40,15 @@
             <svg-icon :icon-class="'chuku'" className="svg-class1" />
           </div>
         </li>
-        <li class="theme6" @click="toUrl(6)" v-if="useUserStore().user.companyId =='100'">
+        <!-- <li class="theme6" @click="toUrl(6)" v-if="useUserStore().user.companyId =='100'">
           <div class="num">{{ allData[4].total }}</div>
           <div class="label">待认领</div>
           <div class="icon-box">
             <svg-icon :icon-class="'renling'" className="svg-class1" />
           </div>
-        </li>
-        <li class="theme6" @click="toUrl(6)" v-else>
+        </li> -->
+
+        <li class="theme6" @click="toUrl(6)">
           <div class="num">{{ allData[5].total }}</div>
           <div class="label">库存预警</div>
           <div class="icon-box">
@@ -119,7 +120,7 @@
           </el-table>
 
         </el-card>
-        <el-card style="width:32%" v-if="useUserStore().user.companyId =='100'">
+        <!-- <el-card style="width:32%" v-if="useUserStore().user.companyId =='100'">
           <TitleInfo :content="'待认领'"></TitleInfo>
           <el-table :data="allData[4].rows" style="width: 100%" :height="tableHeight">
             <el-table-column prop="accountManagementName" label="账户名称" />
@@ -127,8 +128,8 @@
             <el-table-column prop="transactionTime" label="到账时间" width="150" />
           </el-table>
 
-        </el-card>
-        <el-card style="width:32%" v-else>
+        </el-card> -->
+        <el-card style="width:32%">
           <TitleInfo :content="'库存预警'"></TitleInfo>
           <el-table :data="allData[5].rows" style="width: 100%" :height="tableHeight">
             <el-table-column prop="productCode" label="产品编码" />

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

@@ -158,8 +158,8 @@
       </el-tabs>
     </div>
 
-    <el-dialog :title="dialogTitle" width="400" v-model="dialogVisible" v-if="dialogVisible" :show-close="false" :close-on-click-modal="false"
-               :close-on-press-escape="false">
+    <el-dialog :title="dialogTitle" width="400" v-model="dialogVisible" v-if="dialogVisible" :before-close="handleNextClose" :show-close="true"
+               :close-on-click-modal="false" :close-on-press-escape="false">
       <el-form :model="flowForm">
         <el-form-item label="处理人" v-if="nextHandleUser && nextHandleUser.length>0">
           <el-select v-model="flowForm.handleUserId" placeholder="请选择" filterable style="width: 100%">
@@ -314,6 +314,11 @@ const handleSuccess = (any, UploadFile) => {
 const onPreviewFile = (file) => {
   window.open(file.raw.fileUrl, "_blank");
 };
+
+const handleNextClose = () => {
+  btnLoading.value = false;
+  dialogVisible.value = false;
+};
 // 提交逻辑
 const handleSubmit = async (_type) => {
   handleType.value = _type ? _type : undefined;

+ 8 - 8
src/views/purchaseManage/supplier/supplyPrice/index.vue

@@ -350,14 +350,6 @@ const formConfig = computed(() => [
     itemWidth: 50,
   },
   {
-    type: "input",
-    prop: "unit",
-    label: "单位",
-    disabled: true,
-    isShow: modalType.value == "edit",
-    itemWidth: 50,
-  },
-  {
     type: "number",
     prop: "price",
     label: "单价(不含税)",
@@ -377,6 +369,14 @@ const formConfig = computed(() => [
     itemWidth: 50,
     isShow: modalType.value == "edit",
   },
+  {
+    type: "input",
+    prop: "unit",
+    label: "单位",
+    disabled: true,
+    isShow: modalType.value == "edit",
+    itemWidth: 50,
+  },
 ]);
 const getList = (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };

+ 18 - 5
src/views/purchaseSales/outAndInWarehouse/waitingForDelivery/index.vue

@@ -99,6 +99,7 @@ import { computed, ref } from "vue";
 import byTable from "@/components/byTable/index";
 import byForm from "@/components/byForm/index";
 import { ElMessage } from "element-plus";
+import moment from "moment";
 
 const { proxy } = getCurrentInstance();
 const warehouseList = ref([]);
@@ -424,7 +425,7 @@ const formConfig = computed(() => {
     },
     {
       type: "select",
-      prop: "aa",
+      prop: "contractType",
       label: "订单类型",
       disabled: true,
       data: [
@@ -446,35 +447,39 @@ const formConfig = computed(() => {
         },
       ],
       itemWidth: 25,
+      isShow: rowBusinessType.value == "2",
     },
     {
       type: "input",
-      prop: "ww",
+      prop: "customerName",
       label: "客户名称",
       itemType: "text",
       disabled: true,
       itemWidth: 25,
+      isShow: rowBusinessType.value == "2",
     },
 
     {
       type: "input",
-      prop: "ww",
+      prop: "merchUserName",
       label: "跟单员",
       itemType: "text",
       disabled: true,
       itemWidth: 25,
+      isShow: rowBusinessType.value == "2",
     },
     {
       type: "input",
-      prop: "ww",
+      prop: "salesmanName",
       label: "业务员",
       itemType: "text",
       disabled: true,
       itemWidth: 25,
+      isShow: rowBusinessType.value == "2",
     },
     {
       type: "date",
-      prop: "subcribeTime",
+      prop: "inOutTime",
       itemType: "date",
       label: "申请日期",
       itemWidth: 25,
@@ -525,6 +530,7 @@ const rules = ref({
   fileList: [
     { required: true, message: "请上传凭证", trigger: ["blur", "change"] },
   ],
+  inOutTime: [{ required: true, message: "请选择申请日期", trigger: "change" }],
 });
 const submitForm = () => {
   submit.value.handleSubmit(() => {
@@ -550,12 +556,18 @@ const submitForm = () => {
     );
   });
 };
+const rowBusinessType = ref("");
 const clickOperation = (row) => {
+  rowBusinessType.value = row.businessType;
   formData.data = {
     id: row.id,
     companyId: row.companyId,
     businessType: row.businessType + "",
     businessCode: row.businessCode,
+    contractType: row.contractType,
+    customerName: row.customerName,
+    merchUserName: row.merchUserName,
+    salesmanName: row.salesmanName,
     warehouseId: "",
     stockWaitDetailsList: row.stockWaitDetailsList.map((x) => ({
       ...x,
@@ -564,6 +576,7 @@ const clickOperation = (row) => {
       quantity: null,
     })),
     fileList: [],
+    inOutTime: moment().format("YYYY-MM-DD"),
   };
   loadingDialog.value = false;
   dialogVisible.value = true;

+ 17 - 11
src/views/purchaseSales/outAndInWarehouse/waitingForStorage/index.vue

@@ -409,15 +409,16 @@ const formConfig = computed(() => {
     },
     {
       type: "input",
-      prop: "businessCode",
+      prop: "purchaseUserName",
       label: "采购员",
       itemType: "text",
       disabled: true,
       itemWidth: 25,
+      isShow: rowBusinessType.value == "104",
     },
     {
       type: "date",
-      prop: "subcribeTime",
+      prop: "inOutTime",
       itemType: "date",
       label: "入库日期",
       itemWidth: 25,
@@ -444,7 +445,7 @@ const formConfig = computed(() => {
     },
     {
       type: "select",
-      prop: "userId",
+      prop: "inOutUserId",
       label: "入库员",
       required: true,
       filterable: true,
@@ -486,11 +487,9 @@ const rules = ref({
   fileList: [
     { required: true, message: "请上传凭证", trigger: ["blur", "change"] },
   ],
-  subcribeTime: [
-    { required: true, message: "请选择入库日期", trigger: "change" },
-  ],
+  inOutTime: [{ required: true, message: "请选择入库日期", trigger: "change" }],
   deptId: [{ required: true, message: "请选择业务部门", trigger: "change" }],
-  userId: [{ required: true, message: "请选择入库员", trigger: "change" }],
+  inOutUserId: [{ required: true, message: "请选择入库员", trigger: "change" }],
 });
 const submitForm = () => {
   submit.value.handleSubmit(() => {
@@ -564,8 +563,9 @@ const getDeptData = (val) => {
       }
     });
 };
-
+const rowBusinessType = ref("");
 const clickOperation = (row) => {
+  rowBusinessType.value = row.businessType;
   if (row.companyId) {
     getDeptData(row.companyId);
   }
@@ -574,16 +574,22 @@ const clickOperation = (row) => {
     companyId: row.companyId,
     businessType: row.businessType + "",
     businessCode: row.businessCode,
-    warehouseId: "",
+    purchaseUserName: row.purchaseUserName,
+    warehouseId: row.warehouseId || "",
     stockWaitDetailsList: row.stockWaitDetailsList.map((x) => ({
       ...x,
       needQuantity: x.quantity,
       quantity: null,
     })),
     fileList: [],
-    subcribeTime: moment().format("YYYY-MM-DD"),
-    userId: proxy.useUserStore().user.userId,
+    inOutTime: moment().format("YYYY-MM-DD"),
+    inOutUserId: row.inOutUserId || proxy.useUserStore().user.userId,
   };
+  if (
+    proxy.useUserStore().currentCompany == proxy.useUserStore().user.ofCompanyId
+  ) {
+    formData.data.deptId = proxy.useUserStore().user.deptId;
+  }
   loadingDialog.value = false;
   dialogVisible.value = true;
 };