戴艳蓉 3 years ago
parent
commit
3c0558c5a9

+ 30 - 37
src/components/globalComponents/search-terrace/main.vue

@@ -1,14 +1,10 @@
 <template>
   <el-select
     v-model="value"
-    multiple
-    filterable
-    remote
-    clearable
-    :multiple-limit="1"
-    reserve-keyword
     :size="size || 'medium'"
     style="width: 100%"
+    filterable
+    clearable
     :placeholder="placeholder || ''"
     :disabled="disabled"
     :remote-method="remoteMethod"
@@ -41,21 +37,21 @@ export default {
     "type",
     "names",
   ],
-   watch: {
-    names: function (val, old) {
-      // console.log(val, old, this.isDetail, "1");
-      this.searchName = val;
-      if (this.isDetail && this.searchName) {
-        this.remoteMethod(this.searchName);
-      }
-    },
-    isDetail: function (val, old) {
-      // console.log(val, old, this.isDetail, "2");
-      if (val && this.searchName) {
-        this.remoteMethod(this.searchName);
-      }
-    },
-  },
+  //  watch: {
+  //   names: function (val, old) {
+  //     // console.log(val, old, this.isDetail, "1");
+  //     this.searchName = val;
+  //     if (this.isDetail && this.searchName) {
+  //       this.remoteMethod(this.searchName);
+  //     }
+  //   },
+  //   isDetail: function (val, old) {
+  //     // console.log(val, old, this.isDetail, "2");
+  //     if (val && this.searchName) {
+  //       this.remoteMethod(this.searchName);
+  //     }
+  //   },
+  // },
   /**
    * 属性集合
    * @param {String}        size             : 组件大小            非必填
@@ -87,11 +83,12 @@ export default {
   mounted() {
     this.options = [];
     this.selectLoading = false;
+    this.remoteMethod();
   },
   methods: {
     async selectChange(e) {
-      if (e && e.length > 0) {
-        let index = this.options.findIndex((v) => v.id === e[0]);
+      if (e) {
+        let index = this.options.findIndex((v) => v.id === e);
         if (index !== -1) {
           let model = {
             id: this.options[index].id,
@@ -106,23 +103,19 @@ export default {
         this.$emit("searchChange", {});
       }
     },
-    async remoteMethod(query) {
+    async remoteMethod() {
       this.selectLoading = true;
-      if (query !== "") {
-        this.options = [];
-        this.formValue.platform_name = query;
-        const { code, data, message } = await asyncRequest.list(this.formValue);
+      this.options = [];
+      // this.formValue.platform_name = query;
+      const { code, data, message } = await asyncRequest.list(this.formValue);
 
-        if (code === 0) {
-          const { list } = data;
-          this.options = list;
-        } else if (code >= 100 && code <= 104) {
-          await this.logout();
-        } else {
-          this.$message.warning(message);
-        }
+      if (code === 0) {
+        const { list } = data;
+        this.options = list;
+      } else if (code >= 100 && code <= 104) {
+        await this.logout();
       } else {
-        this.options = [];
+        this.$message.warning(message);
       }
       this.selectLoading = false;
     },

+ 6 - 8
src/views/goodStore/active/components/baseForm.vue

@@ -397,7 +397,6 @@ export default {
         ],
         platform_code: [
           {
-            type: "array",
             required: true,
             message: "所属平台不能为空",
             trigger: "change",
@@ -500,15 +499,15 @@ export default {
       //
     },
     platform_codesearchChange(e) {
-      let old = JSON.parse(JSON.stringify(this.ruleForm.platform_code));
+      let old = this.ruleForm.platform_code
       console.log(e);
       if (e) {
         const { id, code, label } = e;
-        this.ruleForm.platform_code = id ? [id] : [];
+        this.ruleForm.platform_code = id || "";
       }
       this.$refs.ruleForm.validateField("platform_code");
-      let newList = JSON.parse(JSON.stringify(this.ruleForm.platform_code));
-      if (old !== this.ruleForm.platform_code) {
+      let  newList= this.ruleForm.platform_code;
+      if (old !== newList) {
         this.ruleForm.good_list = [];
       }
     },
@@ -540,7 +539,7 @@ export default {
       } = this.sitem;
       this.ruleForm = {
         activity_name: activity_name || "",
-        platform_code: platform_code ? [platform_code] : [],
+        platform_code: platform_code || "",
         company_id: company_id || "",
         activity_start: start || "",
         activity_end: end || "",
@@ -558,7 +557,7 @@ export default {
     },
     openEdit() {
       const { company_id, platform_code, is_stock } = this.ruleForm;
-      if (platform_code.length === 0) {
+      if (platform_code==='') {
         this.$message.warning("请选择平台!");
         return;
       }
@@ -582,7 +581,6 @@ export default {
             return;
           }
           let model = JSON.parse(JSON.stringify(this.ruleForm));
-          model.platform_code = model.platform_code.toString();
           const { good_list } = model;
 
           let list = JSON.parse(JSON.stringify(good_list));

+ 3 - 4
src/views/goodStore/active/index.vue

@@ -223,7 +223,7 @@ export default {
         activity_name: "",
         activity_code: "",
         status: "",
-        platform_code: [],
+        platform_code: "",
         starttime: "",
         endtime: "",
         page: 1, // 页码
@@ -276,7 +276,7 @@ export default {
         activity_name: "",
         activity_code: "",
         status: "",
-        platform_code: [],
+        platform_code: "",
         starttime: "",
         endtime: "",
         page: 1, // 页码
@@ -288,7 +288,7 @@ export default {
     },
    async platform_codesearchChange(e) {
         const { id, code, label } = e;
-        this.parmValue.platform_code = id ? [id] : [];
+        this.parmValue.platform_code = id ||"";
          this.pageInfo.curr = 1;
         this.parmValue.page = 1;
         await this.searchList();
@@ -387,7 +387,6 @@ export default {
     async searchList() {
       this.loading = true;
       let model = JSON.parse(JSON.stringify(this.parmValue));
-      model.platform_code = model.platform_code.toString();
       model.activity_name = this.select === "1" ? this.sinput : "";
       model.activity_code = this.select === "2" ? this.sinput : "";
       model.creater = this.select === "3" ? this.sinput : "";

+ 12 - 13
src/views/goodStore/activeGood/index.vue

@@ -52,7 +52,7 @@
                 <el-input
                   :size="searchSize"
                   v-model="parmValue.skuCode"
-                   clearable
+                  clearable
                   :maxlength="40"
                   @blur="
                     pageInfo.curr = 1;
@@ -67,7 +67,7 @@
                   :size="searchSize"
                   v-model="parmValue.good_name"
                   :maxlength="40"
-                   clearable
+                  clearable
                   @blur="
                     pageInfo.curr = 1;
                     parmValue.page = 1;
@@ -121,7 +121,7 @@
                   :size="searchSize"
                   v-model="parmValue.activity_name"
                   :maxlength="40"
-                   clearable
+                  clearable
                   @blur="
                     pageInfo.curr = 1;
                     parmValue.page = 1;
@@ -223,7 +223,7 @@ export default {
         start: "",
         end: "",
         status: "",
-        platform_code: [],
+        platform_code: "",
         skuCode: "",
         good_name: "",
         activity_name: "",
@@ -255,7 +255,7 @@ export default {
         {
           prop: "skuCode",
           label: "商品编号",
-            fixed: "left",
+          fixed: "left",
           width: "160",
         },
         {
@@ -285,12 +285,12 @@ export default {
         {
           prop: "sale_price",
           label: "非活动价",
-            width:"100px"
+          width: "100px",
         },
         {
           prop: "activity_price",
           label: "活动价",
-          width:"100px"
+          width: "100px",
         },
         // {
         //   prop: "platform_code",
@@ -299,17 +299,17 @@ export default {
         {
           prop: "platform_name",
           label: "平台名称",
-           width:"100px"
+          width: "100px",
         },
         {
           prop: "activity_code",
           label: "活动编号",
-          width:"160px"
+          width: "160px",
         },
         {
           prop: "activity_name",
           label: "活动名称",
-          width:"120px"
+          width: "120px",
         },
         {
           prop: "",
@@ -339,7 +339,7 @@ export default {
         start: "",
         end: "",
         status: "",
-        platform_code: [],
+        platform_code: "",
         skuCode: "",
         good_name: "",
         activity_name: "",
@@ -374,7 +374,7 @@ export default {
     async platform_codesearchChange(e) {
       if (e) {
         const { id, code, label } = e;
-        this.parmValue.platform_code = id ? [id] : [];
+        this.parmValue.platform_code = id || "";
       }
       this.pageInfo.curr = 1;
       this.parmValue.page = 1;
@@ -447,7 +447,6 @@ export default {
     async searchList() {
       this.loading = true;
       let model = JSON.parse(JSON.stringify(this.parmValue));
-      model.platform_code = model.platform_code.toString();
       const res = await asyncRequest.list(model);
       if (res && res.code === 0 && res.data) {
         this.tableData = res.data.list;

+ 1 - 2
src/views/goodStore/goodsCost/components/addEdit.vue

@@ -194,7 +194,6 @@ export default {
       rules: {
         platform: [
           {
-            type: "array",
             required: true,
             message: "请选择所属平台",
             trigger: "change",
@@ -253,7 +252,7 @@ export default {
     },
     platform_codesearchChange(e) {
       const { id, code, label } = e;
-      this.ruleForm.platform = id ? [id] : [];
+      this.ruleForm.platform = id ||"";
       this.$refs.ruleForm.validateField("platform");
     },
     async submitForm() {

+ 14 - 14
src/views/goodStore/goodsCost/components/baseForm.vue

@@ -1205,20 +1205,20 @@ export default {
               return;
             }
           }
-          if (good_type === "1") {
-            let set_num = moq * 1;
-            let isok = true;
-            this.ladder_tableData.forEach((e) => {
-              if (e.min_num * 1 < set_num) {
-                isok = false;
-              }
-            });
-            if (!isok) {
-              this.$message.warning("阶梯成本的起订量不能小于定制起订量!");
-              this.loading = false;
-              return;
-            }
-          }
+          // if (good_type === "1") {
+          //   let set_num = moq * 1;
+          //   let isok = true;
+          //   this.ladder_tableData.forEach((e) => {
+          //     if (e.min_num * 1 < set_num) {
+          //       isok = false;
+          //     }
+          //   });
+          //   if (!isok) {
+          //     this.$message.warning("阶梯成本的起订量不能小于定制起订量!");
+          //     this.loading = false;
+          //     return;
+          //   }
+          // }
 
           let model = JSON.parse(JSON.stringify(this.ruleForm));
           model.cat_id = model.cat_id.toString();

+ 1 - 1
src/views/goodStore/goodsOnline/add.vue

@@ -319,7 +319,7 @@ export default {
 
     platform_codesearchChange(e) {
       const { id, code, label } = e;
-      this.ruleForm.platform = id ? [id] : [];
+      this.ruleForm.platform = id ||"";
       this.$refs.ruleForm.validateField("platform");
     },
   },

+ 0 - 1
src/views/goodStore/goodsOnline/columns.js

@@ -135,7 +135,6 @@ const listCol = [
 const rules = {
   platform: [
     {
-      type: "array",
       required: true,
       message: "请选择所属平台",
       trigger: "change",

+ 1 - 2
src/views/sellOut/project/components/addForm.vue

@@ -298,7 +298,6 @@ export default {
         ],
         platform: [
           {
-            type: "array",
             required: true,
             message: "请选择所属平台",
             trigger: "change",
@@ -423,7 +422,7 @@ export default {
     platform_codesearchChange(e) {
       if (e) {
         const { id, code, label } = e;
-        this.ruleForm.platform = id ? [id] : [];
+        this.ruleForm.platform = id||"";
         this.$refs.ruleForm.validateField("platform");
       }
     },

+ 127 - 266
src/views/sellOut/salesOrder/components/addForm.vue

@@ -6,38 +6,18 @@
           ref="ruleForm"
           :model="ruleForm"
           status-icon
+          :size="'mini'"
           :rules="rulesThis"
           label-width="95px"
           class="demo-ruleForm"
         >
           <el-row>
             <el-col :span="12">
-              <el-form-item label="商品名称" prop="goods_class">
-                search-sort
-                555
-                <!-- <good-class
-                  :value="ruleForm.goods_class"
-                  :disabled="true"
-                  :placeholder="'商品分类'"
-                /> -->
-              </el-form-item>
-            </el-col>
-            <el-col :span="12">
-              <el-form-item label="商品名称" prop="good_code">
-                <el-input
-                  v-model="ruleForm.good_name"
-                  disabled
-                  readonly
-                  @focus="showGoodsModel = true"
-                />
-              </el-form-item>
-            </el-col>
-            <el-col :span="12">
-              <el-form-item label="销售方" prop="supplierName">
+              <el-form-item label="销售方" prop="supplierNo">
                 <search-supplier
                   :type="'1'"
-                  :size="searchSize"
-                  :value="ruleForm.supplierName"
+                  :value="ruleForm.supplierNo"
+                  :size="'mini'"
                   :disabled="
                     !(status === '0' && powers.some((item) => item == '005'))
                   "
@@ -50,6 +30,7 @@
               <el-form-item label="企业客户" prop="customer_code">
                 <search-customer
                   :value="ruleForm.customer_code"
+                  :size="'mini'"
                   :names="companyName"
                   :disabled="
                     !(status === '0' && powers.some((item) => item == '005'))
@@ -60,6 +41,116 @@
               </el-form-item>
             </el-col>
 
+            <el-col :span="6">
+              <el-form-item label="所属平台" prop="is_activity">
+                <el-input
+                  v-model="ruleForm.good_name"
+                  disabled
+                  readonly
+                  @focus="showGoodsModel = true"
+                />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item
+                label="平台订单编号"
+                label-width="120px"
+                prop="is_activity"
+              >
+                <el-input
+                  v-model="ruleForm.good_name"
+                  disabled
+                  readonly
+                  @focus="showGoodsModel = true"
+                />
+              </el-form-item>
+            </el-col>
+
+            <el-col :span="6">
+              <el-form-item label="参与活动" prop="is_activity">
+                <el-input
+                  v-model="ruleForm.good_name"
+                  disabled
+                  readonly
+                  @focus="showGoodsModel = true"
+                />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item
+                label="商品类型"
+                prop="is_activity"
+              >
+                <el-input
+                  v-model="ruleForm.good_name"
+                  disabled
+                  readonly
+                  @focus="showGoodsModel = true"
+                />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="发货类型" prop="is_activity">
+                <el-input
+                  v-model="ruleForm.good_name"
+                  disabled
+                  readonly
+                  @focus="showGoodsModel = true"
+                />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item
+                label="要求到货时间"
+                label-width="120px"
+                prop="is_activity"
+              >
+                <el-input
+                  v-model="ruleForm.good_name"
+                  disabled
+                  readonly
+                  @focus="showGoodsModel = true"
+                />
+              </el-form-item>
+            </el-col>
+
+            <el-col :span="6">
+              <el-form-item
+                label="销售数量"
+                prop="is_activity"
+              >
+                <el-input
+                  v-model="ruleForm.good_name"
+                  disabled
+                  readonly
+                  @focus="showGoodsModel = true"
+                />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item
+                label="销售单价"
+                prop="is_activity"
+              >
+                <el-input
+                  v-model="ruleForm.good_name"
+                  disabled
+                  readonly
+                  @focus="showGoodsModel = true"
+                />
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item label="商品名称" prop="good_code">
+                <el-input
+                  v-model="ruleForm.good_name"
+                  disabled
+                  readonly
+                  @focus="showGoodsModel = true"
+                />
+              </el-form-item>
+            </el-col>
+
             <el-col :span="24">
               <search-stock-good-modal
                 :show-model="showGoodsModel"
@@ -71,99 +162,6 @@
           </el-row>
         </el-form>
       </el-col>
-      <el-col :span="24" style="padding: 0 0 20px 0">
-        <el-form :model="stockForm" ref="stockForm" :size="'mini'">
-          <el-table
-            :data="stockForm.good_stock"
-            border
-            :size="'mini'"
-            style="width: 100%"
-            row-key="key"
-          >
-            <el-table-column
-              prop="wsm_supplierNo"
-              label="发货公司编号"
-              width="142"
-            />
-
-            <el-table-column
-              show-overflow-tooltip
-              prop="wsm_supplier"
-              label="发货公司名称"
-              min-width="165"
-            />
-            <el-table-column prop="wsm_code" label="发货仓库编码" width="170" />
-            <el-table-column
-              show-overflow-tooltip
-              prop="wsm_name"
-              label="发货仓库名称"
-              min-width="100"
-            />
-            <el-table-column
-              prop="usable_stock"
-              label="商品可用库存"
-              width="120"
-            />
-
-            <el-table-column prop="num" label="下单数量" width="150">
-              <template slot-scope="scope">
-                <el-form-item
-                  :prop="'good_stock.' + scope.$index + '.' + 'num'"
-                  :rules="{}"
-                  :size="'mini'"
-                  style="margin-bottom: 0"
-                >
-                  <el-input
-                    v-model="scope.row.num"
-                    :disabled="!scope.row.edit"
-                  />
-                </el-form-item>
-              </template>
-            </el-table-column>
-            <el-table-column prop="original_price" label="销售价" width="110" />
-
-            <el-table-column
-              fixed="right"
-              width="80"
-              label="操作"
-              v-if="status === '0' && powers.some((item) => item == '005')"
-            >
-              <template slot-scope="scope">
-                <el-tooltip
-                  effect="dark"
-                  content="编辑"
-                  v-if="!scope.row.edit"
-                  placement="top"
-                >
-                  <i
-                    class="el-icon-edit tb-icon"
-                    @click="editRow(scope.$index)"
-                  ></i>
-                </el-tooltip>
-
-                <el-tooltip
-                  effect="dark"
-                  content="保存"
-                  v-if="scope.row.edit"
-                  placement="top"
-                >
-                  <i
-                    class="el-icon-circle-check tb-icon"
-                    @click="checkStockRow(scope.$index)"
-                  ></i>
-                </el-tooltip>
-
-                <el-tooltip effect="dark" content="删除" placement="top">
-                  <i
-                    class="el-icon-delete tb-icon"
-                    @click="deleteRow(scope.$index, stockForm.good_stock, 0)"
-                  ></i>
-                </el-tooltip>
-              </template>
-            </el-table-column>
-          </el-table>
-        </el-form>
-      </el-col>
       <el-col :span="24" style="padding: 0 0 22px 0">
         <el-form :model="addrForm" ref="addrForm" :size="'mini'">
           <el-table
@@ -260,7 +258,7 @@
       </el-col>
       <el-col
         :span="24"
-        style="text-align: right;padding:0 0 20px 0;"
+        style="text-align: right; padding: 0 0 20px 0"
         v-if="status === '0' && powers.some((item) => item == '005')"
       >
         <el-button :size="'mini'" type="primary" @click="submitForm"
@@ -281,7 +279,7 @@ import AddrAddEditModal from "@/components/addr-add-edit-modal";
 export default {
   name: "salesOrderDetail",
   mixins: [mixinPage, resToken],
-  props: ["newTime", "id", "sitem"],
+  props: ["newTime", "id", "sitem", "type"],
   components: { searchStockGoodModal, inAddrModel, AddrAddEditModal },
   watch: {
     newTime: function (val) {
@@ -336,7 +334,7 @@ export default {
       companyName: "",
       ruleForm: {
         supplierNo: "", //销售方编码
-        supplierName: "", //
+        supplierNo: "", //
         goods_class: [],
         good_name: "",
         good_code: "", // 商品选择
@@ -367,7 +365,7 @@ export default {
             trigger: "change",
           },
         ],
-        supplierName: [
+        supplierNo: [
           {
             type: "array",
             required: true,
@@ -416,9 +414,7 @@ export default {
           trigger: "blur",
         },
       },
-      stockForm: {
-        good_stock: [], //出货仓库
-      },
+
       loading: false,
       queryId: "",
       status: "",
@@ -461,50 +457,6 @@ export default {
       }
       this.$refs.addrForm.validateField("addrlist");
     },
-    async getstock(code) {
-      this.loading = true;
-      let model = {
-        wsm_code: "",
-        page: 1,
-        size: 100,
-        type_code: code,
-        good_code: "",
-        good_name: "",
-        supplierNo: "",
-        stock_low: "",
-        stock_up: "",
-        warn_low: "",
-        warn_up: "",
-        stock_max: "1",
-      };
-      const res = await asyncRequest.getGoodStock(model);
-      if (res && res.code === 0 && res.data) {
-        this.stockForm = {
-          good_stock: [], //出货仓库
-        };
-        const { list } = res.data;
-        list.forEach((v) => {
-          let model = {
-            num: v.usable_stock,
-            usable_stock: v.usable_stock,
-            wsm_name: v.wsm_name,
-            wsm_supplier: v.wsm_supplier,
-            wsm_supplierNo: v.wsm_supplierNo,
-            wsm_code: v.wsm_code,
-            original_price: v.original_price,
-            id: "",
-            is_del: 0,
-            edit: false,
-          };
-          this.stockForm.good_stock.push(model);
-        });
-      } else if (res && res.code >= 100 && res.code <= 104) {
-        await this.logout();
-      } else {
-        this.$message.warning(res.message);
-      }
-      this.loading = false;
-    },
 
     getNewTime() {
       this.newTime = new Date().valueOf();
@@ -522,7 +474,6 @@ export default {
             customer_code,
             companyName,
             status,
-            supplierName,
             supplierNo,
           } = this.sitem;
           this.companyName = companyName;
@@ -534,40 +485,14 @@ export default {
           });
           this.ruleForm = {
             supplierNo: supplierNo ? [supplierNo] : [], //销售方编码
-            supplierName: [supplierName] || "", //
+            supplierNo: [supplierNo] || "", //
             goods_class: goods_class || [],
             good_code: good_code || "", // 商品选择
             good_name: good_name || "",
             customer_code: customer_code ? [customer_code] : "", // 企业客户选择
           };
         }
-        if (this.$refs.stockForm) {
-          this.$refs.stockForm.resetFields();
-          this.$refs.stockForm.clearValidate();
-          const { info } = this.sitem;
-          this.stockForm = {
-            good_stock: [], //出货仓库
-          };
-          this.delStockList = [];
-          if (info && info.length > 0) {
-            info.forEach((v) => {
-              let model = {
-                id: v.id,
-                num: v.num || "",
-                usable_stock: v.usable_stock || "",
-                wsm_name: v.wsm_name || "",
-                wsm_supplier: v.wsm_supplier || "",
-                wsm_supplierNo: v.wsm_supplierNo || "",
-                wsm_code: v.wsm_code || "",
-                original_price: v.sale_price || "",
-                edit: false,
-                is_del: 0,
-              };
-              this.delStockList.push(model);
-              this.stockForm.good_stock.push(model);
-            });
-          }
-        }
+
         if (this.$refs.addrForm) {
           this.$refs.addrForm.resetFields();
           this.$refs.addrForm.clearValidate();
@@ -611,37 +536,10 @@ export default {
       }
       this.$refs.ruleForm.validateField("good_code");
       if (this.ruleForm.good_code !== "" && this.queryId === "add") {
-        await this.getstock(this.ruleForm.good_code);
-      } else {
-        // this.stockForm = {
-        //   good_stock: [], //出货仓库
-        // };
-      }
-    },
-    editRow(index) {
-      let findex = this.stockForm.good_stock.findIndex((v) => v.edit === true);
-      if (findex !== -1) {
-        this.$message.warning("当前已有发货仓库信息在编辑,请保存后再试!");
-        return;
-      } else {
-        this.stockForm.good_stock[index].edit = true;
-      }
-    },
-    checkStockRow(index) {
-      let total = parseInt(this.stockForm.good_stock[index].usable_stock),
-        num = parseInt(this.stockForm.good_stock[index].num);
-      if (total === 0) {
-        this.$message.warning("该仓库已无该商品库存!不能销售!");
-        return;
       } else {
-        if (num > total) {
-          this.$message.warning("销售数量不能大于可用库存!");
-          return;
-        } else {
-          this.stockForm.good_stock[index].edit = false;
-        }
       }
     },
+
     customer_code_change(e) {
       if (e && e.code) {
         this.ruleForm.customer_code = [e.code];
@@ -719,13 +617,8 @@ export default {
           const { good_code, customer_code, supplierNo } = JSON.parse(
             JSON.stringify(this.ruleForm)
           );
-          const { good_stock } = JSON.parse(JSON.stringify(this.stockForm));
           const { order_addr } = JSON.parse(JSON.stringify(this.addrForm));
-          if (good_stock.length === 0) {
-            this.$message.warning("请填写仓库信息!");
-            this.loading = false;
-            return;
-          }
+
           if (order_addr.length === 0) {
             this.$message.warning("请填写仓库信息!");
             this.loading = false;
@@ -737,29 +630,9 @@ export default {
             good_code,
             customer_code: customer_code.join(","), // 账号
             order_addr: [],
-            good_stock: [],
           };
-          let stockT = 0,
-            addrT = 0,
-            isStockOk = true,
-            isSEdit = false,
-            isAEdit = false;
-          good_stock.forEach((v1) => {
-            if (v1.edit) {
-              isSEdit = true;
-            }
-            if (parseInt(v1.usable_stock) < parseInt(v1.num)) {
-              isStockOk = false;
-            }
-            stockT += parseInt(v1.num);
-            let model1 = {
-              num: v1.num,
-              wsm_code: v1.wsm_code,
-              id: v1.id,
-              is_del: 0,
-            };
-            model.good_stock.push(model1);
-          });
+          (addrT = 0), (isStockOk = true), (isSEdit = false), (isAEdit = false);
+
           order_addr.forEach((v2) => {
             if (v2.edit) {
               isAEdit = true;
@@ -792,21 +665,9 @@ export default {
             this.loading = false;
             return;
           }
-          if (stockT !== addrT) {
-            this.$message.warning(
-              "库存出库总数量,与收货地址信息中的总数量不一致!"
-            );
-            this.loading = false;
-            return;
-          }
           let dAList = JSON.parse(JSON.stringify(this.delAddrList));
           let dSList = JSON.parse(JSON.stringify(this.delStockList));
-          good_stock.forEach((v) => {
-            let findex = dSList.findIndex((v1) => v1.wsm_code === v.wsm_code);
-            if (findex !== -1) {
-              dSList.splice(findex, 1);
-            }
-          });
+
           order_addr.forEach((v) => {
             let findex = dAList.findIndex(
               (v1) => v1.id !== "" && v1.id === v.id

+ 95 - 74
src/views/sellOut/salesOrder/detail.vue

@@ -5,7 +5,8 @@
       v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
     >
       <p>{{ status }}----{{ powers }}</p>
-      <div class="detail-page-title">
+      <!-- class="detail-page-title" -->
+      <div >
         <span>销售订单编号:</span
         ><span v-if="sitem">{{ sitem.orderCode }}</span>
         <el-button
@@ -28,7 +29,7 @@
           plain
           :size="'mini'"
           class="fr"
-           type="primary"
+          type="primary"
           v-if="
             (status === '1' || status === '2' || status === '3') &&
             powers.some((item) => item == '014')
@@ -47,85 +48,95 @@
       </div>
 
       <status-bar
-        v-if="newTime !== ''"
+        v-if="newTime !== '' && queryType !== 'add'"
         :newTime="newTime"
         :options="statusOptions"
         :status="status"
       />
-       <el-tabs v-model="activeTabs">
-        <el-tab-pane label="业务详情" name="1">
-      <el-collapse v-model="activeNames" style="margin:-18px 0 0 0">
-        <el-collapse-item title="销售订单信息" name="-1">
+      <el-tabs v-model="activeTabs">
+        <el-tab-pane label="新建销售订单" name="0">
           <add-form
             :newTime="newTime"
             v-if="newTime !== ''"
+            :type="queryType"
             :sitem="sitem"
             :id="queryId"
             @refresh="initData()"
           />
-        </el-collapse-item>
-        <el-collapse-item
-          title="发起申请流程"
-          name="0"
-          v-if="status === '0' && powers.some((item) => item == '012')"
-        >
-          <div style="height: 60px" class="tr">
-            <el-button
-              type="primary"
-              plain
-              :size="'mini'"
-              @click="statusConfirm('1', '发起审核流程')"
+        </el-tab-pane>
+        <el-tab-pane label="业务详情" name="1" v-if="queryType !== 'add'">
+          <el-collapse v-model="activeNames" style="margin: -18px 0 0 0">
+            <el-collapse-item title="销售订单信息" name="-1">
+              <add-form
+                :newTime="newTime"
+                v-if="newTime !== ''"
+                :sitem="sitem"
+                :id="queryId"
+                @refresh="initData()"
+              />
+            </el-collapse-item>
+            <el-collapse-item
+              title="发起申请流程"
+              name="0"
               v-if="status === '0' && powers.some((item) => item == '012')"
-              >发起审核流程
-            </el-button>
-          </div>
-        </el-collapse-item>
-        <el-collapse-item
-          title="采购反馈物流"
-          name="1"
-          v-if="
-            (status === '1' && powers.some((item) => item == '033')) ||
-            status === '2' ||
-            status === '3' ||
-            status === '4'
-          "
-        >
-          <feedback-form
-            :newTime="newTime"
-            v-if="newTime !== ''"
-            :sitem="sitem"
-            :id="queryId"
-            @refresh="initData()"
-          />
-        </el-collapse-item>
-        <el-collapse-item
-          title="同意下单"
-          name="6"
-          v-if="status === '2' && powers.some((item) => item == '026')"
-        >
-          <el-button
-            class="fr"
-            style="margin: 0 0 20px 0"
-            type="primary"
-            plain
-            :size="'mini'"
-            @click="statusConfirm('3', '同意下单')"
-            >同意下单,开始发货
-          </el-button>
-        </el-collapse-item>
-        <el-collapse-item title="销售出库单" name="3">
-          <!-- && status == 3 && (status == 3 || status == 4)-->
-          <order-out-table
-            :newTime="newTime"
-            v-if="newTime !== ''"
-            :sitem="sitem"
-            :id="queryId"
-            @refresh="initData()"
-          />
-        </el-collapse-item>
-      </el-collapse>
-       </el-tab-pane>
-        <el-tab-pane label="审批记录" name="2">
+            >
+              <div style="height: 60px" class="tr">
+                <el-button
+                  type="primary"
+                  plain
+                  :size="'mini'"
+                  @click="statusConfirm('1', '发起审核流程')"
+                  v-if="status === '0' && powers.some((item) => item == '012')"
+                  >发起审核流程
+                </el-button>
+              </div>
+            </el-collapse-item>
+            <el-collapse-item
+              title="采购反馈物流"
+              name="1"
+              v-if="
+                (status === '1' && powers.some((item) => item == '033')) ||
+                status === '2' ||
+                status === '3' ||
+                status === '4'
+              "
+            >
+              <feedback-form
+                :newTime="newTime"
+                v-if="newTime !== ''"
+                :sitem="sitem"
+                :id="queryId"
+                @refresh="initData()"
+              />
+            </el-collapse-item>
+            <el-collapse-item
+              title="同意下单"
+              name="6"
+              v-if="status === '2' && powers.some((item) => item == '026')"
+            >
+              <el-button
+                class="fr"
+                style="margin: 0 0 20px 0"
+                type="primary"
+                plain
+                :size="'mini'"
+                @click="statusConfirm('3', '同意下单')"
+                >同意下单,开始发货
+              </el-button>
+            </el-collapse-item>
+            <el-collapse-item title="销售出库单" name="3">
+              <!-- && status == 3 && (status == 3 || status == 4)-->
+              <order-out-table
+                :newTime="newTime"
+                v-if="newTime !== ''"
+                :sitem="sitem"
+                :id="queryId"
+                @refresh="initData()"
+              />
+            </el-collapse-item>
+          </el-collapse>
+        </el-tab-pane>
+        <el-tab-pane label="审批记录" name="2" v-if="queryType !== 'add'">
           <process-time-line
             v-if="newTime !== ''"
             :newTime="newTime"
@@ -172,7 +183,6 @@ export default {
     addForm,
     feedbackForm,
     orderOutTable,
-    // editAdd,
   },
   computed: {
     powers() {
@@ -190,8 +200,8 @@ export default {
   data() {
     return {
       finishStatus: "finish",
-      activeTabs:"1",
-      activeNames: ["-1", "0", "1", "2", "3", "4", "5", "6", ],
+      activeTabs: "1",
+      activeNames: ["-1", "0", "1", "2", "3", "4", "5", "6"],
       statusOptions: [
         { value: "0", label: "待发起流程" },
         { value: "1", label: "待反馈物流" },
@@ -208,12 +218,23 @@ export default {
       newTime: "",
       loading: false,
       queryId: "",
+      queryType: "",
     };
   },
   mounted() {
     this.status = "";
-    this.queryId = this.$route.query.id;
-    this.initData();
+    const { id, type } = this.$route.query;
+    this.queryId = id;
+    this.queryType = type;
+    this.activeTabs = type === "add" ? "0" : "1";
+    this.loading = true;
+    if (this.queryType === "add") {
+      this.sitem = {};
+      this.getNewTime();
+    } else {
+      this.initData();
+    }
+    this.loading = false;
   },
   methods: {
     async statusConfirm(status, message) {

+ 9 - 2
src/views/sellOut/salesOrder/index.vue

@@ -140,7 +140,9 @@
                   :size="searchSize"
                   type="success"
                   style="float: right"
-                  @click="openModal('add', false, {})"
+                  @click="
+                    routeGoto('salesOrderDetail', { id: 'add', type: 'add' })
+                  "
                 >
                   新建
                 </el-button>
@@ -162,7 +164,12 @@
           <el-tooltip effect="dark" content="详情" placement="top">
             <i
               class="el-icon-view tb-icon"
-              @click="routeGoto('salesOrderDetail', { id: scope.row.id })"
+              @click="
+                routeGoto('salesOrderDetail', {
+                  id: scope.row.id,
+                  type: 'view',
+                })
+              "
             ></i>
           </el-tooltip>
         </template>

+ 5 - 7
src/views/sellOut/zixunOrder/components/addEditForm.vue

@@ -407,7 +407,7 @@ export default {
         companyNo: "",
         endtime: "", //咨询截止时间
         pendtime: "", //项目咨询截止时间
-        platform_code: [], //平台id
+        platform_code: "", //平台id
         use_desc: "",
         budget_total: "",
         arrtime: "",
@@ -432,7 +432,6 @@ export default {
         ],
         platform_code: [
           {
-            type: "array",
             required: true,
             message: "请选择所属平台",
             trigger: "change",
@@ -600,7 +599,7 @@ export default {
             customer_name: customer_name || "", //客户名称
             companyNo: companyNo || "",
             endtime: endtime || "", //咨询截止时间
-            platform_code: platform_code ? [platform_code] : [], //平台id
+            platform_code: platform_code||"", //平台id
             use_desc: "",
             budget_total: "",
             arrtime: "",
@@ -636,7 +635,6 @@ export default {
             return;
           }
           model.khNo = model.khNo.toString();
-          model.platform_code = model.platform_code.toString();
           model.projectNo = model.projectNo.toString();
           model.ladder = [];
           let list = JSON.parse(JSON.stringify(this.tableData));
@@ -794,7 +792,7 @@ export default {
         this.selectLoading = false;
         return;
       }
-      if (platform_code.length === 0) {
+      if (platform_code==="") {
         this.$message.warning("请选择所属平台!");
         this.selectLoading = false;
         return;
@@ -809,7 +807,7 @@ export default {
         size: 100,
         khNo: khNo.toString(),
         companyNo: companyNo,
-        platform_code: platform_code.toString(),
+        platform_code: platform_code,
         status: "1",
         project_name: query,
       };
@@ -830,7 +828,7 @@ export default {
     //平台选择
     platform_code_codesearchChange(e) {
       const { id, code, label } = e;
-      this.ruleForm.platform_code = id ? [id] : [];
+      this.ruleForm.platform_code = id ||"";
       this.$refs.ruleForm.validateField("platform_code");
       this.ruleForm.projectNo = [];
       this.ruleForm.budget_total = "0";

+ 6 - 6
src/views/sellOut/zixunOrder/components/editForm.vue

@@ -696,7 +696,7 @@ export default {
         companyNo: "",
         endtime: "", //咨询截止时间
         pendtime: "", //项目咨询截止时间
-        platform_code: [], //平台id
+        platform_code: "", //平台id
         puse_desc: "",
         budget_total: "",
         arrtime: "",
@@ -890,7 +890,7 @@ export default {
             khname: khname || "", //客户名称
             companyNo: companyNo || "",
             endtime: endtime || "", //咨询截止时间
-            platform_code: platform_code ? [platform_code] : [""], //平台id
+            platform_code: platform_code||"", //平台id
             puse_desc: "",
             budget_total: "",
             arrtime: "",
@@ -971,7 +971,7 @@ export default {
             return;
           }
           model.khNo = model.khNo.toString();
-          model.platform_code = model.platform_code.toString();
+          // model.platform_code = model.platform_code.toString();
           model.projectNo = model.projectNo.toString();
           model.brand_id = model.brand_id.toString();
           model.unit = model.unit.toString();
@@ -1092,7 +1092,7 @@ export default {
         this.selectLoading = false;
         return;
       }
-      if (platform_code.length === 0) {
+      if (platform_code==='') {
         this.$message.warning("请选择所属平台!");
         this.selectLoading = false;
         return;
@@ -1107,7 +1107,7 @@ export default {
         size: 100,
         khNo: khNo.toString(),
         companyNo: companyNo,
-        platform_code: platform_code.toString(),
+        platform_code: platform_code,
         status: "1",
         project_name: query,
       };
@@ -1129,7 +1129,7 @@ export default {
     platform_code_codesearchChange(e) {
       if (e) {
         const { id, code, label } = e;
-        this.ruleForm.platform_code = id ? [id] : [];
+        this.ruleForm.platform_code = id||"";
         this.$refs.ruleForm.validateField("platform_code");
         this.ruleForm.projectNo = [];
         this.ruleForm.budget_total = "0";