Forráskód Böngészése

Merge remote-tracking branch 'origin/master'

hmc 1 éve
szülő
commit
58c1cb9ede

+ 2 - 0
zkqy-custom-business/src/main/resources/mapper/business/ProductCodeListMapper.xml

@@ -127,6 +127,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <insert id="insertProductCodeList" parameterType="com.zkqy.business.domain.ProductCodeList" useGeneratedKeys="true" keyProperty="id">
         insert into {DBNAME}.product_code_list
         <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
             <if test="qrCode != null">qr_code,</if>
             <if test="lotNum != null">lot_num,</if>
             <if test="productId != null">product_id,</if>
@@ -160,6 +161,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             del_flag
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
             <if test="qrCode != null">#{qrCode},</if>
             <if test="lotNum != null">#{lotNum},</if>
             <if test="productId != null">#{productId},</if>

+ 2 - 2
zkqy-custom-business/src/main/resources/mapper/business/SaleProductsMapper.xml

@@ -437,7 +437,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     r.levels
             ) AS a
                 LEFT JOIN {DBNAME}.sale_products sp ON sp.sale_order_no = a.sale_order_no
-                AND sp.product_no = a.productCode
+                AND sp.product_no = a.productCode and sp.del_flag = '0'
 
     </select>
 
@@ -476,7 +476,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     r.levels
             ) AS a
                 LEFT JOIN {DBNAME}.sale_products sp ON sp.sale_order_no = a.sale_order_no
-            AND sp.product_no = a.productCode
+            AND sp.product_no = a.productCode and sp.del_flag = '0'
 
     </select>
 

+ 25 - 1
zkqy-ui/src/api/tablelist/commonTable.js

@@ -379,4 +379,28 @@ export function queryMaterielList(data) {
     method: 'get',
     //baseURL: process.env.VUE_APP_BASE_API1
   })
-}
+}
+
+// 订单管理  新的获取产品数据
+
+export function getSaleOrderProductionListDistinct(data) {
+  return request({
+    url: '/system/production/getSaleOrderProductionListDistinct',
+    method: 'get',
+    //baseURL: process.env.VUE_APP_BASE_API1
+  })
+}
+
+
+// 订单管理  获取规格数据
+
+export function getProductSpecificationsByProductName(data) {
+  return request({
+    url: '/system/production/getProductSpecificationsByProductName',
+    method: 'get',
+    //baseURL: process.env.VUE_APP_BASE_API1
+    params: data
+  })
+}
+
+// d

+ 1 - 3
zkqy-ui/src/views/orderMange/components/dialogForm/RetailProvide.vue

@@ -391,9 +391,7 @@ export default {
         this.tableData.forEach((item) => {
           // item.saleOrderNo = saleOrderSaleNo;
           let { boxNum, actualWeight, unitPrice } = item;
-          item.saleAmount = (Number(actualWeight) * Number(unitPrice)).toFixed(
-            2
-          );
+          item.saleAmount = (Number(boxNum) * Number(unitPrice)).toFixed(2);
         });
         // 表单字段循环赋值
         // for (const key of Object.keys(this.form)) {

+ 220 - 130
zkqy-ui/src/views/orderMange/index.vue

@@ -42,7 +42,7 @@
               :underline="false"
               style="font-size: 12px; vertical-align: baseline"
               @click="importTemplate"
-            >下载模板
+              >下载模板
             </el-link>
           </div>
         </el-upload>
@@ -67,7 +67,7 @@
             icon="el-icon-plus"
             size="mini"
             @click="addHandler"
-          >新增
+            >新增
           </el-button>
         </el-col>
         <!-- <el-col :span="1.5" v-if="false">
@@ -89,7 +89,7 @@
             size="mini"
             :disabled="multiple"
             @click="myDeleteHandler"
-          >删除
+            >删除
           </el-button>
         </el-col>
         <!-- <el-col :span="1.5">
@@ -171,7 +171,7 @@
                     :style="`color:${
                       scope.row.styleFieldObj[item.key].fontColor
                     }`"
-                  >{{ scope.row[item.key] }}</span
+                    >{{ scope.row[item.key] }}</span
                   >
                 </template>
                 <!-- 标签字体样式 -->
@@ -201,7 +201,7 @@
                     scope.row.styleFieldObj[item.key].listClass == '' ||
                     scope.row.styleFieldObj[item.key].listClass == 'default'
                   "
-                >{{ scope.row.styleFieldObj[item.key].dictLabel }}</span
+                  >{{ scope.row.styleFieldObj[item.key].dictLabel }}</span
                 >
                 <el-tag
                   v-else
@@ -210,9 +210,8 @@
                       ? ''
                       : scope.row.styleFieldObj[item.key].listClass
                   "
-                >{{ scope.row.styleFieldObj[item.key].dictLabel }}
-                </el-tag
-                >
+                  >{{ scope.row.styleFieldObj[item.key].dictLabel }}
+                </el-tag>
               </template>
             </template>
             <!-- 显示默认值 -->
@@ -266,9 +265,8 @@
         />
         <div slot="footer" class="dialog-footer">
           <el-button type="primary" @click="editConfirmHandler"
-          >确 定
-          </el-button
-          >
+            >确 定
+          </el-button>
           <el-button @click="kCancel">取 消</el-button>
         </div>
       </el-dialog>
@@ -298,7 +296,7 @@
                 <el-input size="small" v-model="formData.lotNumber"></el-input>
               </el-form-item>
             </el-col> -->
-            <el-col :span="12">
+            <!-- <el-col :span="12">
               <el-form-item prop="saleDate" label="日期:">
                 <el-date-picker
                   size="small"
@@ -310,7 +308,7 @@
                 >
                 </el-date-picker>
               </el-form-item>
-            </el-col>
+            </el-col> -->
             <el-col :span="12">
               <el-form-item prop="saleCustomNo" label="客户名称:">
                 <el-select
@@ -391,7 +389,7 @@
               sum-text="小计"
               style="width: 100%"
             >
-              <el-table-column prop="productNo" label="品名" width="180">
+              <el-table-column prop="productName" label="品名" width="180">
                 <template slot-scope="scope">
                   <!-- <el-input
                 v-model="scope.row.productName"
@@ -399,39 +397,65 @@
                 clearable
               ></el-input> -->
                   <el-form-item
-                    :prop="'productNo-' + scope.$index"
-                    :name="'productNo-' + scope.$index"
+                    :prop="'productName-' + scope.$index"
+                    :name="'productName-' + scope.$index"
                     style="margin: 0px; padding: 0px"
                   >
+                    <!-- @change="
+                        handleProductChange(scope.row.productNo, scope.row)
+                        :filter-method="(val) => mySelectFilter(val, scope.row)"
+                      " -->
                     <el-select
-                      v-model="scope.row.productNo"
+                      v-model="scope.row.productName"
                       placeholder=""
-                      :filter-method="(val) => mySelectFilter(val, scope.row)"
-                      clearable
                       filterable
                       @change="
-                        handleProductChange(scope.row.productNo, scope.row)
+                        newProductChange(scope.row.productName, scope.row)
                       "
-                      @blur="handleProductBlur(scope.row.productNo, scope.row)"
                     >
                       <el-option
                         v-for="item in productionOptions"
                         :key="item.productNo"
                         :label="item.productName"
-                        :value="item.productNo"
+                        :value="item.productName"
                       >
                         <span class="discribe" style="float: left">{{
-                            item.productName
-                          }}</span>
-                        <span
+                          item.productName
+                        }}</span>
+                        <!-- <span
                           style="float: right; color: #8492a6; font-size: 13px"
-                        >{{ item.productSpecifications }}</span
-                        >
+                          >{{ item.productSpecifications }}</span
+                        > -->
                       </el-option>
                     </el-select>
                   </el-form-item>
                 </template>
               </el-table-column>
+              <el-table-column prop="productSpecifications" label="规格">
+                <template slot-scope="scope">
+                  <el-select
+                    v-model="scope.row.productSpecifications"
+                    @change="handleSpecificationsChange(scope.row)"
+                    placeholder=""
+                    filterable
+                  >
+                    <el-option
+                      v-for="item in scope.row.specificationsList"
+                      :key="item.productSpecifications"
+                      :label="item.productSpecifications"
+                      :value="item.productSpecifications"
+                    >
+                      <span class="discribe" style="float: left">{{
+                        item.productSpecifications
+                      }}</span>
+                      <span
+                        style="float: right; color: #8492a6; font-size: 13px"
+                        >{{ item.productType }}</span
+                      >
+                    </el-option>
+                  </el-select>
+                </template>
+              </el-table-column>
               <el-table-column prop="productType" label="类型">
               </el-table-column>
               <el-table-column prop="productNumber" label="数量/kg">
@@ -519,8 +543,8 @@
                         :value="item.materielCode"
                       >
                         <span class="discribe" style="float: left">{{
-                            item.materieEncoding + item.materieColorNumber
-                          }}</span>
+                          item.materieEncoding + item.materieColorNumber
+                        }}</span>
                         <!-- <span
                         style="float: right; color: #8492a6; font-size: 13px"
                         >{{ item.materielCode }}</span
@@ -545,9 +569,8 @@
                     type="danger"
                     size="small"
                     @click="deleteProduct(scope.$index)"
-                  >删除
-                  </el-button
-                  >
+                    >删除
+                  </el-button>
                 </template>
               </el-table-column>
             </el-table>
@@ -557,9 +580,8 @@
               style="width: 100%"
               size="small"
               @click="addProduct"
-            >添加货品
-            </el-button
-            >
+              >添加货品
+            </el-button>
             <el-col :span="12">
               <el-form-item label-width="120px" label="合计金额(大写)">
                 <!-- <el-input
@@ -751,7 +773,7 @@
         <span slot="footer" class="dialog-footer">
           <el-button @click="detailShow = false">取 消</el-button>
           <el-button type="primary" @click="detailPrintHandler"
-          >打 印</el-button
+            >打 印</el-button
           >
         </span>
       </el-dialog>
@@ -800,33 +822,35 @@ import {
   updateProductInvoice,
   saleOrderList,
   queryMaterielList,
+  getSaleOrderProductionListDistinct,
+  getProductSpecificationsByProductName,
 } from "@/api/tablelist/commonTable";
-import {listData} from "@/api/system/tenant/data";
-import {getToken} from "@/utils/auth";
+import { listData } from "@/api/system/tenant/data";
+import { getToken } from "@/utils/auth";
 import Queryfrom from "@/views/tablelist/commonTable/queryfrom.vue";
-import {camelCase, toUnderline} from "@/utils";
-import {inputDisableComplete} from "@/utils/other";
+import { camelCase, toUnderline } from "@/utils";
+import { inputDisableComplete } from "@/utils/other";
 import Menu from "@/views/tablelist/commonTable/BtnMenu.vue";
-import {checkRole} from "@/utils/permission";
+import { checkRole } from "@/utils/permission";
 import DialogTemplate from "@/views/dialogTemplate/components/index.vue";
 import {
   queryDropDownBoxData,
   getSaleOrderProductionList,
 } from "@/api/dragform/form";
-import {v4 as uuidv4} from "uuid";
-import {mapState} from "vuex";
+import { v4 as uuidv4 } from "uuid";
+import { mapState } from "vuex";
 import moment from "moment";
 import Deliver from "@/views/orderMange/components/dialogForm/Deliver.vue";
 import OutBound from "@/views/orderMange/components/dialogForm/OutBound.vue";
 import outBoundPrint from "@/utils/print/outBoundPrint";
-import {listCustomer} from "@/api/system/customer";
+import { listCustomer } from "@/api/system/customer";
 import OutStock from "@/views/orderMange/components/dialogForm/OutStock.vue";
-import {numToCapital} from "@/utils/other";
+import { numToCapital } from "@/utils/other";
 
 export default {
   name: "listInfo",
   dicts: ["payment_method", "direction_of_twist"],
-  components: {Queryfrom, Menu, DialogTemplate, Deliver, OutBound, OutStock},
+  components: { Queryfrom, Menu, DialogTemplate, Deliver, OutBound, OutStock },
   data() {
     return {
       totalMoney: "", //总金额 小写
@@ -911,13 +935,13 @@ export default {
         // },
       ],
       rules: {
-        deliveryDate: [
-          {
-            required: true,
-            message: "请选择交货日期",
-            trigger: "change",
-          },
-        ],
+        // deliveryDate: [
+        //   {
+        //     required: true,
+        //     message: "请选择交货日期",
+        //     trigger: "change",
+        //   },
+        // ],
         salePayType: [
           {
             required: true,
@@ -957,20 +981,20 @@ export default {
             trigger: "change",
           },
         ],
-        saleOrderEstimatedTime: [
-          {
-            required: true,
-            message: "请选择预计下单时间",
-            trigger: "change",
-          },
-        ],
-        saleLeadTime: [
-          {
-            required: true,
-            message: "请输入交货天数",
-            trigger: "blur",
-          },
-        ],
+        // saleOrderEstimatedTime: [
+        //   {
+        //     required: true,
+        //     message: "请选择预计下单时间",
+        //     trigger: "change",
+        //   },
+        // ],
+        // saleLeadTime: [
+        //   {
+        //     required: true,
+        //     message: "请输入交货天数",
+        //     trigger: "blur",
+        //   },
+        // ],
         earnestMoney: [
           {
             validator: this.validateEarnestMoney,
@@ -1019,7 +1043,7 @@ export default {
         // 是否更新已经存在的数据
         updateSupport: 0,
         // 设置上传的请求头部
-        headers: {Authorization: "Bearer " + getToken()},
+        headers: { Authorization: "Bearer " + getToken() },
         // 上传的地址
         url: process.env.VUE_APP_BASE_API1 + "common/uploadData",
       },
@@ -1116,7 +1140,59 @@ export default {
     }),
   },
   methods: {
-
+    // 规格变化回调
+    handleSpecificationsChange(row) {
+      let { productSpecifications, specificationsList } = row;
+      if (productSpecifications) {
+        let targetItem = specificationsList.find(
+          (item) => item.productSpecifications == productSpecifications
+        );
+        console.log(targetItem);
+        row.productNo = targetItem?.productNo;
+        row.productType = targetItem?.productType;
+      } else {
+        row.productNo = "";
+        row.productType = "";
+      }
+    },
+    // 新的产品改变回调
+    async newProductChange(productName, row) {
+      // 发请求获取对应的规格数据
+      if (!productName) {
+        row.specificationsList = [];
+        (row.productNo = ""), (row.productType = "");
+        row.productSpecifications = "";
+        return;
+      }
+      // let targetItem = this.productionOptions.find(
+      //   (item) => item.productNo == productNo
+      // );
+      // row.productName = targetItem?.productName;
+      // row.productType = targetItem?.productType;
+      // 获取规格数据
+      let res = await getProductSpecificationsByProductName({
+        productName: productName,
+      });
+      if (res.code == 200) {
+        row.specificationsList = res.data;
+        console.log(row.specificationsList);
+        let defaultItem = row.specificationsList.find(
+          (item) => item.isDefaultSpecifications
+        );
+        if (defaultItem) {
+          row.productSpecifications = defaultItem.productSpecifications;
+          row.productNo = defaultItem.productNo;
+          row.productType = defaultItem.productType;
+        } else {
+          row.productSpecifications =
+            row.specificationsList[0]?.productSpecifications || "";
+          row.productNo = row.specificationsList[0]?.productNo || "";
+          row.productType = row.specificationsList[0]?.productType || "";
+        }
+      } else {
+        row.specificationsList = [];
+      }
+    },
     // 自定义筛选方法
     mySelectFilter(value, row) {
       console.log(value);
@@ -1191,14 +1267,22 @@ export default {
     orderTypeChange(type) {
       this.getList(false, type);
     },
+    // 生成合同号
+    getSaleNo() {
+      let timeStr = moment().format("YYYYMMDD");
+      for (var i = 0; i < 5; i++) {
+        timeStr += parseInt(Math.random() * 10);
+      }
+      return timeStr;
+    },
     // 重置审计表单数据
     resetFormData() {
       Object.assign(this.formData, {
         //订单表数据
-        saleNo: "", //合同号
+        saleNo: this.getSaleNo(), //合同号
         saleCustomNo: "", //客户编号
-        saleDate: "", //销售单日期
-        saleOrderEstimatedTime: "", //预计下单时间
+        saleDate: moment(new Date()).format("YYYY-MM-DD"), //销售单日期
+        saleOrderEstimatedTime: moment(new Date()).format("YYYY-MM-DD"), //预计下单时间
         saleLeadTime: "", //交货周期
         deliveryDate: "",
         saleAmounts: "", //合计金额 小写
@@ -1240,7 +1324,7 @@ export default {
     },
     // 自定义的小计计算方法
     getSummaries(param) {
-      const {columns, data} = param;
+      const { columns, data } = param;
       console.log(columns, data);
       const sums = [];
       columns.forEach((column, index) => {
@@ -1251,10 +1335,11 @@ export default {
         const values = data.map((item) => Number(item[column.property]));
         if (
           index === 1 ||
-          index === 5 ||
+          index === 2 ||
           index === 6 ||
           index === 7 ||
-          index === 8
+          index === 8 ||
+          index === 9
         ) {
           sums[index] = "";
         } else if (!values.every((value) => isNaN(value))) {
@@ -1299,6 +1384,7 @@ export default {
         colourNumberLabel: "",
         colourNumber: "", //色号
         remark: "", //备注
+        specificationsList: [],
       });
       // 添加校验规则
       this.initTableValidate();
@@ -1306,7 +1392,7 @@ export default {
     // 自定义校验规则
     validateTableField(rule, value, callback) {
       console.log("校验规则", rule, value);
-      let {message, field} = rule;
+      let { message, field } = rule;
       let index = field.split("-")[1],
         fieldName = field.split("-")[0];
       console.log(
@@ -1407,7 +1493,7 @@ export default {
         // let res = await queryDropDownBoxData(payLoad);
 
         // 新的获取客户选项数据的接口
-        let res = await listCustomer({isEnablePaging: false});
+        let res = await listCustomer({ isEnablePaging: false });
         if (res.code == 200) {
           // let { customer } = res.data.resultMap;
           // this.allProductionOptions = production || [];
@@ -1417,13 +1503,15 @@ export default {
         } else {
           throw Error("获取下拉框数据失败");
         }
-        let proRes = await getSaleOrderProductionList();
+        let proRes = await getSaleOrderProductionListDistinct();
+        console.log("proRes", proRes);
         if (proRes.code == 200) {
           console.log(proRes.data);
           // let { production, customer } = proRes.data.resultMap;
-          this.allProductionOptions = proRes.data || [];
-          this.productionOptions =
-            this.allProductionOptions.slice(0, 500) || [];
+          // this.allProductionOptions = proRes.data || [];
+          // this.productionOptions =
+          //   this.allProductionOptions.slice(0, 500) || [];
+          this.productionOptions = proRes.data;
         } else {
           throw Error("获取下拉框数据失败");
         }
@@ -1469,7 +1557,7 @@ export default {
         let res = await queryDropDownBoxData(payLoad);
         if (res.code == 200) {
           console.log(res.data.resultMap);
-          let {materiel} = res.data.resultMap;
+          let { materiel } = res.data.resultMap;
           this.sliceTypeOptions = materiel || [];
         } else {
           throw Error("获取下拉框数据失败");
@@ -1483,7 +1571,7 @@ export default {
     getRowKey(row) {
       return row[
         camelCase(this.tableName + "_" + this.templateInfo.template?.primaryKey)
-        ];
+      ];
     },
     /** 查询列表 */
     getList(queryParams, orderType = 0) {
@@ -1491,7 +1579,7 @@ export default {
       // 序列化当前查询参数列表
       queryParams && (this.queryParams.queryMap = queryParams.queryMap);
       // 获取当前表单结构信息
-      dragTableInfo({queryMap: {tableKey: this.tableKey}})
+      dragTableInfo({ queryMap: { tableKey: this.tableKey } })
         .then((res) => {
           // 得到当前模版信息 --- sql columns queryWhere
           this.templateInfo = res.data.resultMap;
@@ -1886,14 +1974,14 @@ export default {
                 saleProductNo: this.productIds,
               },
             };
-            let delRes = {code: 200};
+            let delRes = { code: 200 };
             if (this.productIds.length) {
               delRes = await delTableData(deletPayload); //删除旧数据
             }
 
             let updateSaleRes = await batchEdit(saleData);
             let updateCraftRes = await batchEdit(craftData);
-            let addProductRes = {code: 200};
+            let addProductRes = { code: 200 };
             if (productData.addListMap.length) {
               addProductRes = await addTableData(productData);
             }
@@ -1916,7 +2004,7 @@ export default {
             craftData.addListMap = [craftValue];
             let saleRes = await addTableData(saleData);
             let craftRes = await addTableData(craftData);
-            let productRes = {code: 200};
+            let productRes = { code: 200 };
             if (productData.addListMap.length) {
               productRes = await addTableData(productData);
             }
@@ -1944,7 +2032,7 @@ export default {
     // 审计   编辑回调
     async handleEdit(index, row) {
       console.log(row);
-      let {saleOrderSaleNo} = row;
+      let { saleOrderSaleNo } = row;
       try {
         let payLoad = [
           {
@@ -1975,26 +2063,32 @@ export default {
         let res = await queryDropDownBoxData(payLoad);
         if (res.code == 200) {
           this.isEdit = true;
-          let {sale_craft, sale_order, sale_products} = res.data.resultMap;
+          let { sale_craft, sale_order, sale_products } = res.data.resultMap;
 
           Object.assign(this.formData, {
             ...sale_craft[0],
             ...sale_order[0],
           });
-          let {saleDate, saleOrderEstimatedTime, deliveryDate} =
+          let { saleDate, saleOrderEstimatedTime, deliveryDate } =
             sale_order[0];
           saleDate && (this.formData.saleDate = new Date(saleDate));
           saleOrderEstimatedTime &&
-          (this.formData.saleOrderEstimatedTime = saleOrderEstimatedTime);
+            (this.formData.saleOrderEstimatedTime = saleOrderEstimatedTime);
           deliveryDate && (this.formData.deliveryDate = new Date(deliveryDate));
 
           this.productIds = sale_products.map((item) => item.saleProductNo);
 
           await this.getDropDownData();
           this.productionTableData = sale_products.map((item) => {
-            item.productType = this.allProductionOptions.find(
+            let targetItem = this.allProductionOptions.find(
               (i) => item.productNo == i.productNo
-            )?.productType;
+            );
+            if (
+              !this.productionOptions.some((i) => i.productNo == item.productNo)
+            ) {
+              this.productionOptions.unshift(targetItem);
+            }
+            item.productType = targetItem?.productType;
             return item;
           });
           if (this.formData.saleCustomNo) {
@@ -2059,7 +2153,7 @@ export default {
     },
     // 计算金额
     computedPrice(row) {
-      let {productNumber, productUnitPrice} = row;
+      let { productNumber, productUnitPrice } = row;
       console.log(
         "productNumber, productUnitPrice",
         productNumber,
@@ -2143,9 +2237,9 @@ export default {
       this.$refs.mychild.pageList(
         row == undefined
           ? {
-            limit: this.queryParams.pageSize,
-            page: this.queryParams.pageNum,
-          }
+              limit: this.queryParams.pageSize,
+              page: this.queryParams.pageNum,
+            }
           : row
       );
     },
@@ -2184,7 +2278,7 @@ export default {
     handleAdd(row) {
       // this.reset();
       this.defaultValue = {};
-      getInfoBySqlKey(this.templateInfo.template.sqlKey).then(({data}) => {
+      getInfoBySqlKey(this.templateInfo.template.sqlKey).then(({ data }) => {
         if (!data || !data.dfVueTemplate) {
           this.jsonData = false;
           this.$message.error("当前表格未绑定表单!");
@@ -2280,7 +2374,7 @@ export default {
           }
 
           res.data.template.dfFormSql &&
-          (this.dynamicData = JSON.parse(res.data.template.dfFormSql));
+            (this.dynamicData = JSON.parse(res.data.template.dfFormSql));
           this.addRealFieldName(res.data.result.resultMap);
           let resultMap = res.data.result.resultMap;
 
@@ -2469,8 +2563,7 @@ export default {
           this.$refs.mychild.pageList();
           this.$modal.msgSuccess("删除成功");
         })
-        .catch(() => {
-        });
+        .catch(() => {});
     },
     // 批量删除接口
     handleBatchDelete() {
@@ -2510,8 +2603,7 @@ export default {
           this.$refs.mychild.pageList();
           this.$modal.msgSuccess("删除成功");
         })
-        .catch(() => {
-        });
+        .catch(() => {});
     },
     /** 导出按钮操作 */
     handleExport() {
@@ -2548,7 +2640,7 @@ export default {
     importTemplate() {
       this.download(
         process.env.VUE_APP_BASE_API1 +
-        `common/exportTemplate?tableName=${this.tableName}&sqlkey=${this.templateInfo.template.sqlKey}`,
+          `common/exportTemplate?tableName=${this.tableName}&sqlkey=${this.templateInfo.template.sqlKey}`,
         {},
         `下载模版名称${new Date().getTime()}.xlsx`
       );
@@ -2564,10 +2656,10 @@ export default {
       this.$refs.upload.clearFiles();
       this.$alert(
         "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
-        response.msg +
-        "</div>",
+          response.msg +
+          "</div>",
         "导入结果",
-        {dangerouslyUseHTMLString: true}
+        { dangerouslyUseHTMLString: true }
       );
       this.$refs.mychild.pageList({
         limit: this.queryParams.pageSize,
@@ -2596,7 +2688,7 @@ export default {
     // 绑定弹窗Dialog确定按钮
     async btnComfirm() {
       let res = await this.$refs.deliverRef.getAllData();
-      let {flag, isEdit, data} = res;
+      let { flag, isEdit, data } = res;
       if (flag) {
         if (isEdit) {
           //编辑
@@ -2663,7 +2755,7 @@ export default {
                   item.fieldValue
                     ? item.fieldValue
                     : this.currentRow[
-                      camelCase(item.fieldName.replace(".", "_"))
+                        camelCase(item.fieldName.replace(".", "_"))
                       ];
               });
               conditionData.forEach((item) => {
@@ -2671,7 +2763,7 @@ export default {
                   item.fieldValue
                     ? item.fieldValue
                     : this.currentRow[
-                      camelCase(item.fieldName.replace(".", "_"))
+                        camelCase(item.fieldName.replace(".", "_"))
                       ];
               });
             }
@@ -2767,7 +2859,7 @@ export default {
         });
     },
     // 判断是否生效行样式
-    cellStyle({row, column, rowIndex, columnIndex}) {
+    cellStyle({ row, column, rowIndex, columnIndex }) {
       let rowStyleList = this.styleList.filter((item) => item.styleType == 0);
       if (!rowStyleList.length) return "";
       let mainTableName = this.templateInfo.querySql.tableAlias; //主表名
@@ -2890,7 +2982,7 @@ export default {
 
     // 内链页面跳转
     routerHandler(btnData, type) {
-      let {url, commonFieldData} = JSON.parse(btnData.btnParams);
+      let { url, commonFieldData } = JSON.parse(btnData.btnParams);
       let tempArr = [];
       if (commonFieldData) {
         let queryArr = JSON.parse(commonFieldData);
@@ -2922,7 +3014,7 @@ export default {
     },
     // 切片类型改变回调
     sliceTypeChangeHandler(row) {
-      let {sliceType} = row;
+      let { sliceType } = row;
       if (sliceType) {
         row.sliceTypeLabel = this.sliceTypeOptions.find(
           (item) => item.materielCode == sliceType
@@ -2931,7 +3023,7 @@ export default {
     },
     // 色号改变回调
     colourNumberChangeHandler(row) {
-      let {colourNumber} = row;
+      let { colourNumber } = row;
       if (colourNumber) {
         let target = this.colourNumberOptions.find(
           (item) => item.materielCode == colourNumber
@@ -2963,7 +3055,7 @@ export default {
     },
     // 获取详情html字符串
     async getDetailTableString(row) {
-      let {saleOrderSaleNo} = row;
+      let { saleOrderSaleNo } = row;
       let payLoad = [
         {
           basicMap: {
@@ -2993,7 +3085,7 @@ export default {
       let res = await queryDropDownBoxData(payLoad);
       if (res.code == 200) {
         console.log(res);
-        let {sale_craft, sale_order, sale_products} = res.data.resultMap;
+        let { sale_craft, sale_order, sale_products } = res.data.resultMap;
         let {
           //订单表数据
           saleNo, //合同号
@@ -3032,7 +3124,7 @@ export default {
           craftOther, //其它工艺要求
           craftMark, //包装/贴唛
           shippingMethod, //运输方式
-        } = {...sale_craft[0], ...sale_order[0]};
+        } = { ...sale_craft[0], ...sale_order[0] };
         let customData = this.customerOptions.find(
           (item) => item.customNo == saleCustomNo
         );
@@ -3052,9 +3144,9 @@ export default {
                 <tr>
                     <td width="600px" colspan="4">合同号:${saleNo}</td>
                     <td width="600px" colspan="4">日期:${saleDate.replace(
-          "T",
-          " "
-        )}</td>
+                      "T",
+                      " "
+                    )}</td>
                 </tr>
                 <tr align="center">
                     <td width="300px" colspan="2">客户名称:</td>
@@ -3071,9 +3163,9 @@ export default {
                 <tr align="center">
                     <td width="300px" colspan="2">预计下单时间:</td>
                     <td  colspan="1">${saleOrderEstimatedTime.replace(
-          "T",
-          " "
-        )}</td>
+                      "T",
+                      " "
+                    )}</td>
                     <td  colspan="1">交货周期:</td>
                     <td >${saleLeadTime}</td>
                     <td  colspan="2">交货日期:</td>
@@ -3103,7 +3195,7 @@ export default {
           let productData = this.allProductionOptions.find(
             (pro) => pro.productNo == item.productNo
           );
-          console.log("item", item);
+          console.log(item.productNo, productData, this.allProductionOptions);
           item.sliceTypeLabel =
             this.sliceTypeOptions.find((k) => k.materielCode == item.sliceType)
               ?.materielName || "";
@@ -3261,8 +3353,7 @@ export default {
         } else {
           this.$message.error(res.msg);
         }
-      } catch (error) {
-      }
+      } catch (error) {}
     },
     // 发货回调
     myDeliverHandler(row) {
@@ -3281,7 +3372,7 @@ export default {
     },
     // 操作列回调
     excuteHandler(btnData, row) {
-      let {btnType, btnParams, btnFormType} = btnData;
+      let { btnType, btnParams, btnFormType } = btnData;
       this.currentBtnData = btnData;
       this.currentRow = JSON.parse(JSON.stringify(row));
       console.log("btnData", btnType, btnData, row);
@@ -3365,7 +3456,7 @@ export default {
                 item.fieldValue
                   ? item.fieldValue
                   : this.currentRow[
-                    camelCase(item.fieldName.replace(".", "_"))
+                      camelCase(item.fieldName.replace(".", "_"))
                     ];
             });
           }
@@ -3388,8 +3479,7 @@ export default {
           this.$refs.mychild.pageList();
           // this.$modal.msgSuccess("操作成功");
         })
-        .catch(() => {
-        });
+        .catch(() => {});
     },
 
     // k-form-build表单变化回调

+ 9 - 2
zkqy-ui/src/views/orderMange/retailMange/index.vue

@@ -1953,9 +1953,16 @@ export default {
           colourNumber, //色号
           remark, //备注
         } = item;
-        let productType = this.allProductionOptions.find(
+        let targetItem = this.allProductionOptions.find(
           (i) => productNo == i.productNo
-        )?.productType;
+        );
+        if (
+          !this.productionOptions.some((i) => i.productNo == item.productNo)
+        ) {
+          this.productionOptions.unshift(targetItem);
+        }
+        // item.productType = targetItem?.productType;
+        let productType = targetItem?.productType;
         return {
           id,
           saleProductNo,