Jelajahi Sumber

Merge branch 'sit'

戴艳蓉 3 tahun lalu
induk
melakukan
6ce1226aee
58 mengubah file dengan 2122 tambahan dan 2254 penghapusan
  1. 119 0
      dist/static/js/0.js
  2. 9 0
      dist/static/js/app.js
  3. TEMPAT SAMPAH
      dist/static/收货地址模板.xlsx
  4. TEMPAT SAMPAH
      public/static/收货地址模板.xlsx
  5. 0 10
      src/App.vue
  6. 2 0
      src/apis/service/goodStore/goodsCost/index.js
  7. 3 0
      src/assets/js/btnList.js
  8. 4 7
      src/components/globalComponents/digital-input/main.vue
  9. 1 40
      src/components/globalComponents/show-data-table/main.vue
  10. 1 1
      src/components/globalComponents/status-bar/main.vue
  11. 4 4
      src/components/search-good-online-modal/main.vue
  12. 2 2
      src/components/show-good-data-modal/main.vue
  13. 52 2
      src/styles/index.scss
  14. 22 8
      src/views/goodStore/active/components/baseForm.vue
  15. 4 5
      src/views/goodStore/active/components/edit-minorder-form.vue
  16. 8 7
      src/views/goodStore/active/components/set-active-price-form.vue
  17. 1 1
      src/views/goodStore/brand/addEdit.vue
  18. 3 36
      src/views/goodStore/goodsCost/columns.js
  19. 166 196
      src/views/goodStore/goodsCost/components/baseForm.vue
  20. 215 78
      src/views/goodStore/goodsCost/components/costFormAddEdit.vue
  21. 31 65
      src/views/goodStore/goodsOnline/ShowDataTableColumns.js
  22. 23 13
      src/views/goodStore/goodsOnline/detail.vue
  23. 2 2
      src/views/goodStore/searchSort/addEdit.vue
  24. 3 3
      src/views/goodStore/sort/addEdit.vue
  25. 2 2
      src/views/goodStore/sort/addEditRate.vue
  26. 1 1
      src/views/goodStore/specs/addEdit.vue
  27. 1 1
      src/views/goodStore/unit/addEdit.vue
  28. 22 22
      src/views/purchaseIn/purchaseOrder/columns.js
  29. 98 81
      src/views/purchaseIn/purchaseOrder/components/ShowDataTableColumns.js
  30. 134 76
      src/views/purchaseIn/purchaseOrder/detail.vue
  31. 4 4
      src/views/purchaseIn/purchaseOrder/index.vue
  32. 0 249
      src/views/purchaseIn/purchaseReturn/addEdit.vue
  33. 0 1
      src/views/purchaseIn/purchaseReturn/detail.vue
  34. 73 86
      src/views/purchaseIn/purchaseReturn/index.vue
  35. 152 92
      src/views/purchaseIn/wsmInOrder/components/wsm-in-order-addEdit-form.vue
  36. 3 3
      src/views/purchaseIn/wsmInOrder/components/wsm-in-order-model.vue
  37. 32 25
      src/views/sellOut/salesOrder/columns.js
  38. 189 33
      src/views/sellOut/salesOrder/components/ShowDataTableColumns.js
  39. 96 76
      src/views/sellOut/salesOrder/components/addForm.vue
  40. 0 288
      src/views/sellOut/salesOrder/components/feedback-form.vue
  41. 9 19
      src/views/sellOut/salesOrder/components/order-out-table.vue
  42. 62 100
      src/views/sellOut/salesOrder/detail.vue
  43. 66 40
      src/views/sellOut/salesOrder/index.vue
  44. 6 2
      src/views/sellOut/sellOutOrder/ShowDataTableColumns.js
  45. 51 45
      src/views/sellOut/sellOutOrder/detail.vue
  46. 48 132
      src/views/sellOut/sellReturn/components/addForm.vue
  47. 3 3
      src/views/serviceParam/business/addEdit.vue
  48. 1 1
      src/views/serviceParam/exclusive/addEdit.vue
  49. 1 1
      src/views/serviceParam/orderuse/addEdit.vue
  50. 1 1
      src/views/serviceParam/parameter/addEdit.vue
  51. 1 1
      src/views/serviceParam/terrace/addEdit.vue
  52. 56 19
      src/views/stock/allot/components/addForm.vue
  53. 54 67
      src/views/stock/allot/index.vue
  54. 51 47
      src/views/stock/stockCount/components/dataWeido/index.vue
  55. 94 107
      src/views/stock/stockCount/components/spaceCount/index.vue
  56. 9 6
      src/views/stock/stockCount/index.vue
  57. 98 115
      src/views/stock/stockWarning/index.vue
  58. 29 28
      src/views/stock/survey/index.vue

File diff ditekan karena terlalu besar
+ 119 - 0
dist/static/js/0.js


File diff ditekan karena terlalu besar
+ 9 - 0
dist/static/js/app.js


TEMPAT SAMPAH
dist/static/收货地址模板.xlsx


TEMPAT SAMPAH
public/static/收货地址模板.xlsx


+ 0 - 10
src/App.vue

@@ -15,16 +15,6 @@ export default {
     };
   },
   async created() {
-    // let list1=''
-    // let list2=""
-    // const key=".",zhkey='xiaod',mmkey='223322'
-    // for(let i=0;i<500;i++){
-    //   list1+=`${i===0?'':key}${zhkey}${i+1}`
-    //   list2+=`${i===0?'':key}${mmkey}`
-
-    // }
-    // console.log(list1);
-    // console.log(list2);
     if (JudgeEnvironment() === "isDingDing") {
       await this.testing();
     } else {

+ 2 - 0
src/apis/service/goodStore/goodsCost/index.js

@@ -28,5 +28,7 @@ export default {
   catinfo: (data, params) => http(api + "catinfo", data, "post", params),
   // 删除
   copy: (data, params) => http(api + "goodupcopy", data, "post", params),
+  // 取实时金价
+  golpricelast: (data, params) => http(api + "golpricelast", data, "post", params),
 
 };

+ 3 - 0
src/assets/js/btnList.js

@@ -78,6 +78,9 @@ const btnList = [
   { code: "077", name: "删除支持品牌" },
   { code: "078", name: "再次发起审核流程" },
   { code: "079", name: "下线商品" },
+  { code: "080", name: "库管发货" },
+  { code: "081", name: "添加发货申请" },
+  // { code: "082", name: "发货申请" },
 
 ];
 export default btnList;

+ 4 - 7
src/components/globalComponents/digital-input/main.vue

@@ -50,15 +50,12 @@ export default {
   ],
   watch: {
     values: function (val) {
-      if (val) {
-        // console.log(this.name + "=" + val);
-        this.num = val;
-      }
+      // console.log(this.name + "=" + val);
+      this.num = val;
     },
     newTime: function (val) {
-      if (val) {
-        this.num = this.values;
-      }
+      // console.log(this.name + "=" + this.values);
+      this.num = this.values;
     },
   },
   data() {

+ 1 - 40
src/components/globalComponents/show-data-table/main.vue

@@ -72,44 +72,5 @@ export default {
 
 
 <style lang="scss" scoped>
-.show-data-table {
-  padding: 0 0 20px 0;
-  width: 100%;
-  box-sizing: border-box;
-  .purchaseOrderDetail-addForm {
-    border-top: 1px solid #ebeef5 !important;
-    border-left: 1px solid #ebeef5 !important;
-    width: 100%;
-    box-sizing: border-box;
-    .purchaseOrderDetail-addForm-el-col {
-      display: flex;
-      align-items: stretch;
-      //  width: 100%;
-      box-sizing: border-box;
-      //
-      border-right: 1px solid #ebeef5 !important;
-      .label {
-        width: 100px;
-        line-height: 35px;
-        text-align: right;
-        background: #fafafa !important;
-        font-weight: 400 !important;
-        color: #909399 !important;
-        font-size: 12px !important;
-        border-bottom: 1px solid #ebeef5 !important;
-        border-right: 1px solid #ebeef5 !important;
-      }
-      .name {
-        width: calc(100% - 100px);
-        text-align: left;
-        line-height: 23px;
-        font-size: 12px !important;
-        border-bottom: 1px solid #ebeef5 !important;
-        padding: 6px 0 6px 10px !important;
-        word-break: break-all !important;
-        color: #606266 !important;
-      }
-    }
-  }
-}
+
 </style>

+ 1 - 1
src/components/globalComponents/status-bar/main.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="statusBar" style="padding: 0 0 12px 0">
-    <el-steps :active="sIndex" align-center :process-status="(sIndex+1)===options.length?'finish':'process'">
+    <el-steps :active="sIndex" align-center :size="'mini'" :process-status="(sIndex+1)===options.length?'finish':'process'">
       <!-- : index === sIndex
             ? 'el-icon-s-check' -->
 

+ 4 - 4
src/components/search-good-online-modal/main.vue

@@ -291,10 +291,10 @@ export default {
         model.cat_id.length > 0 ? model.cat_id[model.cat_id.length - 1] : "";
       model.brandid =
         model.brandid.length > 0 ? model.brandid[model.brandid.length - 1] : "";
-      model.platform_code =
-        model.platform_code.length > 0
-          ? model.platform_code[model.platform_code.length - 1]
-          : "";
+      // model.platform_code =
+      //   model.platform_code.length > 0
+      //     ? model.platform_code[model.platform_code.length - 1]
+      //     : "";
       const res = await asyncRequest.list(model);
       if (res && res.code === 0 && res.data) {
         this.tableData = res.data.list;

+ 2 - 2
src/components/show-good-data-modal/main.vue

@@ -111,7 +111,7 @@
             "
           />
         </template>
-        <template slot="purchase">
+        <!-- <template slot="purchase">
           <el-table
             :data="sitem.nakelist"
             :size="'mini'"
@@ -124,7 +124,7 @@
             <el-table-column prop="cost_fee" label="工艺费" />
             <el-table-column prop="delivery_fee" label="物流费" />
           </el-table>
-        </template>
+        </template> -->
         <template slot="ladderlist">
           <el-table
             :data="sitem.ladderlist"

+ 52 - 2
src/styles/index.scss

@@ -582,7 +582,7 @@ aside {
   height: 28px!important;
   // font-size: 16px!important;
   padding:0!important;
-  margin: 20px 0 30px 0!important;
+  // margin: 20px 0 30px 0!important;
 
   // span.title{
   //   line-height: 50px!important;
@@ -672,4 +672,54 @@ aside {
     cursor: pointer!important;
   }
 }
-
+.show-data-table {
+  padding: 0 0 0 0;
+  width: 100%;
+  box-sizing: border-box;
+  .purchaseOrderDetail-addForm {
+    
+    border-left: 1px solid #ebeef5 !important;
+    width: 100%;
+    box-sizing: border-box;
+    &.borderBottom{
+      border-bottom: 1px solid #ebeef5 !important;
+    }
+    .purchaseOrderDetail-addForm-el-col {
+      display: flex;
+      align-items: stretch;
+      //  width: 100%;
+      box-sizing: border-box;
+      //
+      border-right: 1px solid #ebeef5 !important;
+      .label {
+        width: 100px;
+        line-height: 35px;
+        text-align: right;
+        background: #fafafa !important;
+        font-weight: 400 !important;
+        color: #909399 !important;
+        font-size: 12px !important;
+        border-top: 1px solid #ebeef5 !important;
+        border-right: 1px solid #ebeef5 !important;
+      }
+      .name {
+        width: calc(100% - 100px);
+        text-align: left;
+        line-height: 23px;
+        font-size: 12px !important;
+        border-top: 1px solid #ebeef5 !important;
+        padding: 6px 0 6px 10px !important;
+        word-break: break-all !important;
+        color: #606266 !important;
+        .el-icon-warning-outline {
+          font-size: 16px!important;
+          margin: 4px 6px 0 0!important;
+          color: #abaea5!important;
+          &:hover{
+            cursor: pointer;
+          }
+        }
+      }
+    }
+  }
+}

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

@@ -145,12 +145,23 @@
                 show-overflow-tooltip
               />
               <el-table-column
-                v-if="!(status === '' || status === '0')"
                 prop="activity_stock"
                 label="活动库存"
-                width="100"
-                show-overflow-tooltip
-              />
+                width="180"
+              >
+                <template slot-scope="scope">
+                  <el-input-number
+                    v-show="type !== 'view'"
+                    style="width: 100%"
+                    v-model="scope.row.activity_stock"
+                    :min="1"
+                    :max="100000000000"
+                    :precision="0"
+                    label="活动库存"
+                  ></el-input-number>
+                  <span v-show="type === 'view'">{{ scope.row.activity_stock }}</span>
+                </template>
+              </el-table-column>
               <el-table-column
                 prop="moq_num"
                 label="起订量"
@@ -499,14 +510,14 @@ export default {
       //
     },
     platform_codesearchChange(e) {
-      let old = 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 || "";
       }
       this.$refs.ruleForm.validateField("platform_code");
-      let  newList= this.ruleForm.platform_code;
+      let newList = this.ruleForm.platform_code;
       if (old !== newList) {
         this.ruleForm.good_list = [];
       }
@@ -520,6 +531,9 @@ export default {
         let index = oldList.findIndex((a) => e.skucode === a.skucode);
         if (index === -1) {
           let item = JSON.parse(JSON.stringify(list[ei]));
+          item.activity_stock = "1";
+          item.newTime = new Date().valueOf();
+          console.log(item.activity_stock);
           this.ruleForm.good_list.push(item);
         }
       });
@@ -557,7 +571,7 @@ export default {
     },
     openEdit() {
       const { company_id, platform_code, is_stock } = this.ruleForm;
-      if (platform_code==='') {
+      if (platform_code === "") {
         this.$message.warning("请选择平台!");
         return;
       }
@@ -589,7 +603,7 @@ export default {
           list.forEach((e) => {
             let item = {
               skuCode: e.skuCode,
-              activity_stock: 1 + "",
+              activity_stock: e.activity_stock,
             };
             newList.push(item);
           });

+ 4 - 5
src/views/goodStore/active/components/edit-minorder-form.vue

@@ -28,7 +28,7 @@
               <el-input
                 v-model="ruleForm.skuCode"
                 placeholder="商品编号"
-                minlength="100"
+                maxlength="100"
                 disabled
               />
             </el-form-item>
@@ -37,15 +37,15 @@
                 v-model="ruleForm.good_name"
                 disabled
                 placeholder="商品名称"
-                minlength="100"
+                maxlength="100"
               />
             </el-form-item>
             <el-form-item label="活动库存" prop="activity_stock">
               <el-input
                 v-model="ruleForm.activity_stock"
-                disabled
                 placeholder="活动库存"
-                minlength="100"
+                disabled
+                maxlength="100"
               />
             </el-form-item>
             <el-form-item label="起订量" prop="moq_num">
@@ -62,7 +62,6 @@
               />
             </el-form-item>
             <el-form-item label="成本单价" prop="cost_price">
-              
               <digital-input
                 :values="ruleForm.cost_price"
                 :placeholder="'起订量'"

+ 8 - 7
src/views/goodStore/active/components/set-active-price-form.vue

@@ -29,7 +29,7 @@
               <el-input
                 v-model="ruleForm.skuCode"
                 placeholder="商品编号"
-                minlength="100"
+                maxlength="100"
                 disabled
               />
             </el-form-item>
@@ -38,15 +38,15 @@
                 v-model="ruleForm.good_name"
                 disabled
                 placeholder="商品名称"
-                minlength="100"
+                maxlength="100"
               />
             </el-form-item>
             <el-form-item label="活动库存" prop="activity_stock">
               <el-input
                 v-model="ruleForm.activity_stock"
-                disabled
                 placeholder="活动库存"
-                minlength="100"
+                 disabled
+                maxlength="100"
               />
             </el-form-item>
             <el-form-item label="起订量" prop="moq_num">
@@ -54,7 +54,7 @@
                 v-model="ruleForm.moq_num"
                 disabled
                 placeholder="起订量"
-                minlength="100"
+                maxlength="100"
               />
             </el-form-item>
             <el-form-item label="成本单价" prop="cost_price">
@@ -62,7 +62,7 @@
                 v-model="ruleForm.cost_price"
                 disabled
                 placeholder="成本单价"
-                minlength="100"
+                maxlength="100"
               >
                 <template slot="append">元</template></el-input
               >
@@ -72,7 +72,7 @@
                 v-model="ruleForm.sale_price"
                 disabled
                 placeholder="非活动价"
-                minlength="100"
+                maxlength="100"
               >
                 <template slot="append">元</template></el-input
               >
@@ -85,6 +85,7 @@
                 :max="100000000000"
                 :position="'right'"
                 :precision="2"
+                :size="'large'"
                 :controls="false"
                 :append="'元'"
                 @reschange="activity_price_change"

+ 1 - 1
src/views/goodStore/brand/addEdit.vue

@@ -29,7 +29,7 @@
                 v-model="ruleForm.brand_name"
                 :disabled="id == '007'"
                 placeholder="品牌名称"
-                minlength="20"
+                maxlength="20"
               />
             </el-form-item>
             <el-form-item

+ 3 - 36
src/views/goodStore/goodsCost/columns.js

@@ -413,35 +413,8 @@ const rules = {
     },
   ],
 
-  //固定成本
-  cert_fee: [
-    {
-      required: true,
-      validator: validate_num,
-      trigger: "blur",
-    },
-  ],
-  packing_fee: [
-    {
-      required: true,
-      validator: validate_num,
-      trigger: "blur",
-    },
-  ],
-  cost_fee: [
-    {
-      required: true,
-      validator: validate_num,
-      trigger: "blur",
-    },
-  ],
-  mark_fee: [
-    {
-      required: true,
-      validator: validate_num,
-      trigger: "blur",
-    },
-  ],
+  
+
   demo_fee: [
     {
       required: true,
@@ -492,13 +465,7 @@ const rules = {
       trigger: "blur",
     },
   ],
-  nake_price: [
-    {
-      required: true,
-      validator: validate_num,
-      trigger: "blur",
-    },
-  ],
+
   cgd_gold_price: [
     {
       required: true,

+ 166 - 196
src/views/goodStore/goodsCost/components/baseForm.vue

@@ -249,6 +249,7 @@
                     "
                     style="width: 100%"
                     placeholder="启用实时金价"
+                    @change="is_goold_price_change"
                   >
                     <el-option
                       v-for="group in options5"
@@ -734,10 +735,6 @@
                 <p>1:1</p>
               </div>
             </el-form-item>
-            <div style="font-size: 12px; color: #606266">
-              <span style="padding: 0 0 0 20px">图片大小:小于1M</span>
-              <span style="padding: 0 0 0 20px">图片类型.jpg/png/jpeg</span>
-            </div>
           </el-col>
           <el-col :span="9">
             <el-form-item label="商品主图" prop="good_img">
@@ -837,92 +834,29 @@
               </div>
             </el-form-item>
           </el-col>
+          <el-col :span="24">
+            <div style="font-size: 12px; color: #606266">
+              <span style="padding: 0 0 0 20px">图片大小:小于1M</span>
+              <span style="padding: 0 0 0 20px">图片类型.jpg/png/jpeg</span>
+            </div>
+          </el-col>
         </el-row>
       </el-col>
     </el-row>
     <el-row class="ddiv">
       <el-col :span="1" class="dtitle">
-        <ul style="padding: 30px 0 0 0">
+        <ul>
           <li>固</li>
           <li>定</li>
+          <li>与</li>
+          <li>阶</li>
+          <li>梯</li>
           <li>成</li>
           <li>本</li>
         </ul></el-col
       >
       <el-col :span="23" class="dmain">
         <el-row>
-          <el-col :span="6">
-            <el-form-item label="证书费" prop="cert_fee" label-width="75px">
-              <digital-input
-                :values="ruleForm.cert_fee"
-                :placeholder="'证书费'"
-                :min="0"
-                :name="'ruleForm.cert_fee'"
-                :disabled="type === 'view' || type === 'editBase'"
-                :max="100000000000"
-                :position="'right'"
-                :precision="2"
-                :size="'mini'"
-                :controls="false"
-                :append="'元'"
-                @reschange="number_change($event, 'cert_fee')"
-              />
-            </el-form-item>
-          </el-col>
-          <el-col :span="6">
-            <el-form-item label="包装费" prop="packing_fee" label-width="75px">
-              <digital-input
-                :values="ruleForm.packing_fee"
-                :placeholder="'包装费'"
-                :min="0"
-                :name="'ruleForm.packing_fee'"
-                :disabled="type === 'view' || type === 'editBase'"
-                :max="100000000000"
-                :position="'right'"
-                :precision="2"
-                :size="'mini'"
-                :controls="false"
-                :append="'元'"
-                @reschange="number_change($event, 'packing_fee')"
-              />
-            </el-form-item>
-          </el-col>
-          <el-col :span="6">
-            <el-form-item label="工艺费" prop="cost_fee" label-width="75px">
-              <digital-input
-                :values="ruleForm.cost_fee"
-                :placeholder="'工艺费'"
-                :min="0"
-                :name="'ruleForm.cost_fee'"
-                :disabled="type === 'view' || type === 'editBase'"
-                :max="100000000000"
-                :position="'right'"
-                :precision="2"
-                :size="'mini'"
-                :controls="false"
-                :append="'元'"
-                @reschange="number_change($event, 'cost_fee')"
-              />
-            </el-form-item>
-          </el-col>
-          <el-col :span="6">
-            <el-form-item label="加标费" prop="mark_fee" label-width="75px">
-              <digital-input
-                :values="ruleForm.mark_fee"
-                :placeholder="'加标费'"
-                :min="0"
-                :name="'ruleForm.mark_fee'"
-                :disabled="type === 'view' || type === 'editBase'"
-                :max="100000000000"
-                :position="'right'"
-                :precision="2"
-                :size="'mini'"
-                :controls="false"
-                :append="'元'"
-                @reschange="number_change($event, 'mark_fee')"
-              />
-            </el-form-item>
-          </el-col>
           <el-col :span="6">
             <el-form-item label="打样费" prop="demo_fee" label-width="75px">
               <digital-input
@@ -995,25 +929,30 @@
               />
             </el-form-item>
           </el-col>
+
           <el-col :span="6">
-            <el-form-item label="裸价" prop="nake_price" label-width="75px">
-              <digital-input
-                :values="ruleForm.nake_price"
-                :placeholder="'裸价'"
-                :min="0"
-                :name="'ruleForm.nake_price'"
+            <el-form-item label="启用阶梯" prop="is_step">
+              <el-select
+                v-model="ruleForm.is_step"
+                filterable
                 :disabled="type === 'view' || type === 'editBase'"
-                :max="100000000000"
-                :position="'right'"
-                :precision="2"
-                :size="'mini'"
-                :controls="false"
-                :append="'元'"
-                @reschange="number_change($event, 'nake_price')"
-              />
+                style="width: 100%"
+                placeholder="启用阶梯"
+                @change="is_step_change"
+              >
+                <el-option
+                  v-for="group in options5"
+                  :key="group.id"
+                  :label="group.name"
+                  :value="group.id"
+                />
+              </el-select>
             </el-form-item>
           </el-col>
-          <el-col :span="8" v-show="is_noble">
+          <el-col
+            :span="6"
+            v-show="is_noble && ruleForm && ruleForm.is_gold_price === '1'"
+          >
             <el-form-item
               label="供应商采购金价"
               prop="cgd_gold_price"
@@ -1035,37 +974,18 @@
               />
             </el-form-item>
           </el-col>
-        </el-row>
-      </el-col>
-    </el-row>
-    <el-row class="ddiv">
-      <el-col :span="1" class="dtitle">
-        <ul>
-          <li>阶</li>
-          <li>梯</li>
-          <li>成</li>
-          <li>本</li>
-        </ul></el-col
-      >
-      <el-col :span="23" class="dmain">
-        <el-row>
-          <el-col :span="6">
-            <el-form-item label="启用阶梯" prop="is_step">
-              <el-select
-                v-model="ruleForm.is_step"
-                filterable
-                :disabled="type === 'view' || type === 'editBase'"
-                style="width: 100%"
-                placeholder="启用阶梯"
-                @change="is_step_change"
+          <el-col
+            :span="6"
+            v-show="is_noble && ruleForm && ruleForm.is_gold_price === '1'"
+          >
+            <el-form-item label="当前金价">
+              <el-input
+                v-model="ruleForm.noble_price"
+                disabled
+                placeholder="当前金价"
+              >
+                <template slot="append">元/g</template></el-input
               >
-                <el-option
-                  v-for="group in options5"
-                  :key="group.id"
-                  :label="group.name"
-                  :value="group.id"
-                />
-              </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="24" style="padding-left: 18px">
@@ -1077,12 +997,18 @@
               style="width: 100%; margin: 0 0 20px 0"
             >
               <el-table-column prop="min_num" label="起订量(>=)" />
-              <el-table-column prop="nake_fee" label="成本合计" />
+              <el-table-column prop="nake_fee" label="成本单价" />
               <el-table-column prop="cost_fee" label="工艺费" />
               <el-table-column prop="delivery_fee" label="物流费" />
+              <el-table-column prop="cert_fee" label="证书费" />
+              <el-table-column prop="mark_fee" label="加标费" />
+              <el-table-column prop="package_fee" label="包装费" />
+              <el-table-column prop="other_fee" label="其他费用" />
+              <el-table-column prop="nake_total" label="成本合计" />
               <el-table-column
                 fixed="right"
                 v-if="type === 'add' || type === 'editCoin' || type === 'edit'"
+                width="80px"
               >
                 <template slot="header" slot-scope="scope">
                   <span>操作</span>
@@ -1236,11 +1162,13 @@ export default {
       await this.resetForm();
       this.sch_is_noble();
       this.good_type_change();
+      await this.get_golpricelast();
       this.loading = false;
     },
-    number_change(e, key) {
+    async number_change(e, key) {
       this.ruleForm[key] = e + "" || "0";
       this.$refs.ruleForm.validateField(key);
+      await this.get_all_fee();
     },
     openEdit(index, sitem) {
       this.modelIndex = index;
@@ -1445,6 +1373,10 @@ export default {
             nake_fee: a.nake_fee,
             cost_fee: a.cost_fee,
             delivery_fee: a.delivery_fee,
+            cert_fee: a.cert_fee,
+            mark_fee: a.mark_fee,
+            package_fee: a.package_fee,
+            other_fee: a.other_fee,
             is_del: a.is_del || "0",
           };
           resList.push(m);
@@ -1509,7 +1441,7 @@ export default {
           ffindex = findex;
           this.spec_tableData[findex].id = id;
           this.spec_tableData[findex].spec_id = spec_id;
-          this.spec_tableData[findex].isMust = isMust;
+          // this.spec_tableData[findex].isMust = isMust;
           this.spec_tableData[findex].spec_value = spec_value;
           this.spec_tableData[findex].spec_value_id = spec_value_id;
           this.spec_tableData[findex].spec_value_value = spec_value_value;
@@ -1521,25 +1453,101 @@ export default {
       this.showModel = false;
     },
     //阶梯成本修改
-    costrefreshEdit(e) {
+    async costrefreshEdit(e) {
       let item = JSON.parse(JSON.stringify(e));
-      const { index, id, cost_fee, delivery_fee, min_num, nake_fee } = item;
+      const {
+        index,
+        id,
+        cost_fee,
+        delivery_fee,
+        min_num,
+        nake_fee,
+        cert_fee,
+        mark_fee,
+        package_fee,
+        other_fee,
+      } = item;
       let ffindex = -1;
       this.ladder_tableData.forEach((i, findex) => {
         if (findex === parseInt(index + "")) {
           ffindex = findex;
           this.ladder_tableData[findex].id = id;
+          this.ladder_tableData[findex].min_num = min_num;
           this.ladder_tableData[findex].cost_fee = cost_fee;
           this.ladder_tableData[findex].delivery_fee = delivery_fee;
-          this.ladder_tableData[findex].min_num = min_num;
           this.ladder_tableData[findex].nake_fee = nake_fee;
+          this.ladder_tableData[findex].cert_fee = cert_fee;
+          this.ladder_tableData[findex].mark_fee = mark_fee;
+          this.ladder_tableData[findex].package_fee = package_fee;
+          this.ladder_tableData[findex].other_fee = other_fee;
         }
       });
       if (ffindex === -1) {
         this.ladder_tableData.push(item);
       }
+      await this.get_all_fee();
       this.showModel = false;
     },
+    async get_golpricelast() {
+      const { noble_metal } = this.ruleForm;
+      if (noble_metal) {
+        let model = {
+          type: noble_metal,
+        };
+        const { code, data, message } = await asyncRequest.golpricelast(model);
+        if (code === 0) {
+          data.forEach((e) => {
+            if (e.type) {
+              this.ruleForm.noble_price = e.price;
+            }
+          });
+        } else if (code >= 100 && code <= 104) {
+          await this.logout();
+        } else {
+          this.$message.warning(message);
+        }
+      } else {
+        this.ruleForm.noble_price = "0";
+      }
+    },
+    async get_all_fee() {
+      await this.get_golpricelast();
+      this.ladder_tableData.forEach((si, sii) => {
+        this.ladder_tableData[sii].nake_total = this.count_fee(si);
+      });
+    },
+    count_fee(e) {
+      const {
+        noble_price, //贵金属实时金价
+        is_gold_price, //是否启用实时金价
+        noble_weight, //贵金属重量
+      } = this.ruleForm;
+      const {
+        cost_fee, //工艺费
+        delivery_fee, //物流费
+        nake_fee, //成本单价
+        cert_fee, //证书费
+        mark_fee, //加标费
+        package_fee, //包装费
+        other_fee, //其他费用
+      } = e;
+      let total =
+        package_fee * 100 +
+        nake_fee * 100 +
+        mark_fee * 100 +
+        cert_fee * 100 +
+        delivery_fee * 100 +
+        other_fee * 100;
+      if (this.is_noble && is_gold_price==='1') {
+        let a = noble_price * 100;
+        let b = noble_weight * 1000;
+        let c = cost_fee * 100;
+        let ab = parseInt((a * b) / 1000);
+        let bc = parseInt((b * c) / 1000);
+        total += ab + bc;
+      }
+      return parseFloat(total / 100);
+    },
     dataSort(key) {
       return function (a, b) {
         let value1 = a[key];
@@ -1565,7 +1573,7 @@ export default {
         cat_id: [],
         brandid: [],
         noble_weight: "0",
-        weight: "",
+        weight: "0",
         good_type: "0",
         is_stock: "0",
         supplierNo: [],
@@ -1577,8 +1585,8 @@ export default {
         is_exclusive: [],
         noble_metal: "",
         is_gold_price: "",
-        moq: "0",
-        customized: "0",
+        moq: "",
+        customized: "",
         after_sales: "",
         craft_desc: "",
         good_remark: "",
@@ -1600,16 +1608,12 @@ export default {
         good_img: [],
         good_info_img: [],
         //固定阶梯成本
-        cert_fee: "0",
-        packing_fee: "0",
-        cost_fee: "0",
-        mark_fee: "0",
         demo_fee: "0",
         open_fee: "0",
         sample_fee: "0",
         market_price: "0",
-        nake_price: "0",
         cgd_gold_price: "0",
+        noble_price: "0",
         is_step: "0",
         is_diff: "",
         config: [],
@@ -1670,22 +1674,18 @@ export default {
             good_img, //	string	商品图片
             good_thumb_img, //	string	商品说略图
             good_info_img, //	string	商品详情图
-            cert_fee, //	string	证书费
-            packing_fee, //	string	打包费
-            cost_fee, //	string	工艺费
-            mark_fee, //	string	加标费
             demo_fee, //	string	打样费
             open_fee, //	string	开模费
             noble_metal, //	string	金属类别
             noble_weight, //	string	金属重量
             is_gold_price, //	string	是否使用实时金价
             market_price, //	string	市场价
-            nake_price, //	string	成本裸价
             cgd_gold_price, //	string	供应商采购金价
+            noble_price,
             is_step, //	string	是否使用阶梯价
             // is_online, //	string	是否上线
             status, //		string	状态
-            nakelist, //梯成本
+            nakelist, //梯成本
             speclist, //商品规格
             brand_name,
             config,
@@ -1765,7 +1765,7 @@ export default {
             unit: good_unit ? [good_unit] : [],
             is_exclusive: exclusiveList || [],
             noble_metal: noble_metal || "",
-            is_gold_price: is_gold_price || "",
+            is_gold_price: is_gold_price || "0",
             moq: moq || "0",
             customized: customized || "0",
             after_sales: after_sales || "",
@@ -1793,16 +1793,12 @@ export default {
               ? (good_info_img || "").split(",")
               : [],
             //固定阶梯成本
-            cert_fee: cert_fee || "",
-            packing_fee: packing_fee || "",
-            cost_fee: cost_fee || "",
-            mark_fee: mark_fee || "",
             demo_fee: demo_fee || "",
             open_fee: open_fee || "",
             sample_fee: sample_fee || "",
             market_price: market_price || "",
-            nake_price: nake_price || "",
             cgd_gold_price: cgd_gold_price || "",
+            noble_price: noble_price || "0",
             is_step: is_step || "0",
             is_diff: is_diff || "",
             config: config ? config.split(",") : [],
@@ -1823,8 +1819,15 @@ export default {
         'cgd_gold_price'
       ];
       for (let i = 0; i < list.length; i++) {
-        this.rulesThis[list[i]][0].required = this.is_noble;
-        console.log(list[i] + "===" + this.rulesThis[list[i]][0].required);
+        if (list[i] === "cgd_gold_price") {
+          const { is_gold_price } = this.ruleForm;
+          this.rulesThis[list[i]][0].required =
+            this.is_noble && is_gold_price === "1";
+          console.log(list[i] + "===" + this.rulesThis[list[i]][0].required);
+        } else {
+          this.rulesThis[list[i]][0].required = this.is_noble;
+        }
+
         this.$refs.ruleForm.validateField(list[i]);
       }
     },
@@ -1832,50 +1835,35 @@ export default {
       let item = null;
       if (type === 1) {
         item = JSON.parse(JSON.stringify(model));
-        delete item["cert_fee"];
-        delete item["packing_fee"];
-        delete item["cost_fee"];
-        delete item["mark_fee"];
         delete item["demo_fee"];
         delete item["open_fee"];
         delete item["noble_metal"];
         delete item["noble_weight"];
         delete item["is_gold_price"];
         delete item["market_price"];
-        delete item["nake_price"];
         delete item["cgd_gold_price"];
         delete item["is_step"];
         delete item["good_ladder"];
       } else {
         const {
-          cert_fee,
-          packing_fee,
-          cost_fee,
-          mark_fee,
           demo_fee,
           open_fee,
           noble_metal,
           noble_weight,
           is_gold_price,
           market_price,
-          nake_price,
           cgd_gold_price,
           is_step,
           good_ladder,
           spuCode,
         } = model;
         item = {
-          cert_fee: cert_fee || "",
-          packing_fee: packing_fee || "",
-          cost_fee: cost_fee || "",
-          mark_fee: mark_fee || "",
           demo_fee: demo_fee || "",
           open_fee: open_fee || "",
           noble_metal: noble_metal || "",
           noble_weight: noble_weight || "",
           is_gold_price: is_gold_price || "",
           market_price: market_price || "",
-          nake_price: nake_price || "",
           cgd_gold_price: cgd_gold_price || "",
           is_step: is_step || "",
           good_ladder: good_ladder || [],
@@ -1894,6 +1882,7 @@ export default {
       this.is_noble = pid === "6";
       this.sch_is_noble();
       await this.set_must_spec();
+      await this.get_all_fee();
     },
     async set_must_spec() {
       const { cat_id } = this.ruleForm;
@@ -1962,36 +1951,25 @@ export default {
         });
       }
     },
-
+    async is_goold_price_change(e) {
+      await this.get_all_fee();
+    },
     //商品品牌选择
     brandidsearchChange(e) {
       const { id, code, label } = e;
-      if (id) {
-        this.ruleForm.brandid = [id];
-      } else {
-        this.ruleForm.brandid = [];
-      }
+      this.ruleForm.brandid = id ? [id] : [];
       this.$refs.ruleForm.validateField("brandid");
     },
     //供应商选择
     supplierNosearchChange(e) {
-      console.log(e);
       const { id, code, label } = e;
-      if (id) {
-        this.ruleForm.supplierNo = [code];
-      } else {
-        this.ruleForm.supplierNo = [];
-      }
+      this.ruleForm.supplierNo = code ? [code] : [];
       this.$refs.ruleForm.validateField("supplierNo");
     },
     //业务企业选择
     company_idsearchChange(e) {
       const { id, code, label } = e;
-      if (id) {
-        this.ruleForm.company_id = code;
-      } else {
-        this.ruleForm.company_id = "";
-      }
+      this.ruleForm.company_id = code || "";
       this.$refs.ruleForm.validateField("company_id");
     },
     //税点选择
@@ -2007,23 +1985,15 @@ export default {
     //单位选择
     unitsearchChange(e) {
       const { id, code, label } = e;
-      if (id) {
-        this.ruleForm.unit = [code];
-      } else {
-        this.ruleForm.unit = [];
-      }
+      this.ruleForm.unit = code ? [code] : [];
       this.$refs.ruleForm.validateField("unit");
     },
     //贵金属种类选择
-    noble_metalsearchChange(e) {
-      console.log(e);
+    async noble_metalsearchChange(e) {
       const { id, code, label } = e;
-      if (id) {
-        this.ruleForm.noble_metal = id;
-      } else {
-        this.ruleForm.noble_metal = "";
-      }
+      this.ruleForm.noble_metal = id || "";
       this.$refs.ruleForm.validateField("noble_metal");
+      await this.get_all_fee();
     },
     //省市区
     selectAreaChange(e, key) {
@@ -2054,11 +2024,11 @@ export default {
       let list = ["moq", "customized"];
       for (let i = 0; i < list.length; i++) {
         this.rulesThis[list[i]][0].required = this.ruleForm.good_type === "1";
-        console.log(list[i] + "===" + this.rulesThis[list[i]][0].required);
+        // console.log(list[i] + "===" + this.rulesThis[list[i]][0].required);
         this.$refs.ruleForm.validateField(list[i]);
       }
     },
-    imgUploadError(res, key) {
+    UploadErrorEvent(res, key) {
       if (res !== "break") {
         this.$message.error("图片上传失败!");
         this.$refs.ruleForm.validateField(key);

+ 215 - 78
src/views/goodStore/goodsCost/components/costFormAddEdit.vue

@@ -5,7 +5,7 @@
     :center="true"
     align="left"
     top="18vh"
-    width="500px"
+    width="700px"
     :close-on-click-modal="false"
     :visible.sync="showModelThis"
     element-loading-text="拼命加载中"
@@ -25,81 +25,156 @@
             label-width="80px"
             class="demo-ruleForm"
           >
-            <el-form-item label="起订量" prop="min_num">
-              <digital-input
-                :values="ruleForm.min_num"
-                :placeholder="'起订量'"
-                :min="0"
-                :name="'ruleForm.min_num'"
-                :disabled="false"
-                :max="100000000000"
-                :position="'right'"
-                :precision="0"
-                :size="'mini'"
-                :controls="false"
-                :append="''"
-                @reschange="number_change($event, 'min_num')"
-              />
-            </el-form-item>
-            <el-form-item label="成本合计" prop="nake_fee">
-              <digital-input
-                :values="ruleForm.nake_fee"
-                :placeholder="'成本合计'"
-                :min="0"
-                :name="'ruleForm.nake_fee'"
-                :disabled="false"
-                :max="100000000000"
-                :position="'right'"
-                :precision="2"
-                :size="'mini'"
-                :controls="false"
-                :append="'元'"
-                @reschange="number_change($event, 'nake_fee')"
-              />
-            </el-form-item>
-            <el-form-item label="工艺费" prop="cost_fee">
-              <digital-input
-                :values="ruleForm.cost_fee"
-                :placeholder="'工艺费'"
-                :min="0"
-                :name="'ruleForm.cost_fee'"
-                :disabled="false"
-                :max="100000000000"
-                :position="'right'"
-                :precision="2"
-                :size="'mini'"
-                :controls="false"
-                :append="'元'"
-                @reschange="number_change($event, 'cost_fee')"
-              />
-            </el-form-item>
+            <el-row>
+              <el-col :span="12">
+                <el-form-item label="起订量" prop="min_num">
+                  <digital-input
+                    :values="ruleForm.min_num"
+                    :placeholder="'起订量'"
+                    :min="0"
+                    :disabled="false"
+                    :max="100000000000"
+                    :position="'right'"
+                    :precision="0"
+                    :size="'mini'"
+                    :controls="false"
+                    :append="''"
+                    @reschange="number_change($event, 'min_num')"
+                  />
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="成本单价" prop="nake_fee">
+                  <digital-input
+                    :values="ruleForm.nake_fee"
+                    :placeholder="'成本单价'"
+                    :min="0"
+                    :disabled="false"
+                    :max="100000000000"
+                    :position="'right'"
+                    :precision="2"
+                    :size="'mini'"
+                    :controls="false"
+                    :append="'元'"
+                    @reschange="number_change($event, 'nake_fee')"
+                  />
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="工艺费" prop="cost_fee">
+                  <digital-input
+                    :values="ruleForm.cost_fee"
+                    :placeholder="'工艺费'"
+                    :min="0"
+                    :disabled="false"
+                    :max="100000000000"
+                    :position="'right'"
+                    :precision="2"
+                    :size="'mini'"
+                    :controls="false"
+                    :append="'元'"
+                    @reschange="number_change($event, 'cost_fee')"
+                  />
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="物流费" prop="delivery_fee">
+                  <digital-input
+                    :values="ruleForm.delivery_fee"
+                    :placeholder="'物流费'"
+                    :min="0"
+                    :disabled="false"
+                    :max="100000000000"
+                    :position="'right'"
+                    :precision="2"
+                    :size="'mini'"
+                    :controls="false"
+                    :append="'元'"
+                    @reschange="number_change($event, 'delivery_fee')"
+                  />
+                </el-form-item>
+              </el-col>
 
-            <el-form-item label="物流费" prop="delivery_fee">
-              <digital-input
-                :values="ruleForm.delivery_fee"
-                :placeholder="'物流费'"
-                :min="0"
-                :name="'ruleForm.delivery_fee'"
-                :disabled="false"
-                :max="100000000000"
-                :position="'right'"
-                :precision="2"
-                :size="'mini'"
-                :controls="false"
-                :append="'元'"
-                @reschange="number_change($event, 'delivery_fee')"
-              />
-            </el-form-item>
+              <el-col :span="12">
+                <el-form-item label="证书费" prop="cert_fee">
+                  <digital-input
+                    :values="ruleForm.cert_fee"
+                    :placeholder="'证书费'"
+                    :min="0"
+                    :disabled="false"
+                    :max="100000000000"
+                    :position="'right'"
+                    :precision="2"
+                    :size="'mini'"
+                    :controls="false"
+                    :append="'元'"
+                    @reschange="number_change($event, 'cert_fee')"
+                  />
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="加标费" prop="mark_fee">
+                  <digital-input
+                    :values="ruleForm.mark_fee"
+                    :placeholder="'加标费'"
+                    :min="0"
+                    :disabled="false"
+                    :max="100000000000"
+                    :position="'right'"
+                    :precision="2"
+                    :size="'mini'"
+                    :controls="false"
+                    :append="'元'"
+                    @reschange="number_change($event, 'mark_fee')"
+                  />
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="包装费" prop="package_fee">
+                  <digital-input
+                    :values="ruleForm.package_fee"
+                    :placeholder="'包装费'"
+                    :min="0"
+                    :disabled="false"
+                    :max="100000000000"
+                    :position="'right'"
+                    :precision="2"
+                    :size="'mini'"
+                    :controls="false"
+                    :append="'元'"
+                    @reschange="number_change($event, 'package_fee')"
+                  />
+                </el-form-item>
+              </el-col>
+
+              <el-col :span="12">
+                <el-form-item label="其他费用" prop="other_fee">
+                  <digital-input
+                    :values="ruleForm.other_fee"
+                    :placeholder="'其他费用'"
+                    :min="0"
+                    :disabled="false"
+                    :max="100000000000"
+                    :position="'right'"
+                    :precision="2"
+                    :size="'mini'"
+                    :controls="false"
+                    :append="'元'"
+                    @reschange="number_change($event, 'other_fee')"
+                  />
+                </el-form-item>
+              </el-col>
+              <el-col :span="24" style="text-align: right">
+                <el-button :size="'small'" type="primary" @click="submitForm"
+                  >保 存
+                </el-button>
+                <el-button @click="showModelThis = false" :size="'small'">{{
+                  "取 消"
+                }}</el-button>
+              </el-col>
+            </el-row>
           </el-form>
         </el-col>
-        <el-col :span="24" style="text-align: right">
-          <el-button :size="'small'" type="primary" @click="submitForm"
-            >保 存
-          </el-button>
-          <el-button @click="showModelThis = false" :size="'small'">{{
-            "取 消"
-          }}</el-button>
-        </el-col>
       </el-row>
     </el-card>
   </el-dialog>
@@ -120,6 +195,14 @@ export default {
         callback();
       }
     };
+    const validate_num = (rule, value, callback) => {
+      const { required } = rule;
+      if (required && value === "") {
+        callback(new Error("不能为空!"));
+      } else {
+        callback();
+      }
+    };
     return {
       loading: false,
       title: "",
@@ -130,14 +213,49 @@ export default {
         min_num: [
           { required: true, validator: validate_num_0, trigger: "blur" },
         ],
+        nake_price: [
+          {
+            required: true,
+            validator: validate_num,
+            trigger: "blur",
+          },
+        ],
+        //固定成本
+        cert_fee: [
+          {
+            required: true,
+            validator: validate_num,
+            trigger: "blur",
+          },
+        ],
+        package_fee: [
+          {
+            required: true,
+            validator: validate_num,
+            trigger: "blur",
+          },
+        ],
+
         cost_fee: [
-          { required: true, message: "工艺费不能为空!", trigger: "blur" },
+          {
+            required: true,
+            validator: validate_num,
+            trigger: "blur",
+          },
+        ],
+
+        mark_fee: [
+          {
+            required: true,
+            validator: validate_num,
+            trigger: "blur",
+          },
         ],
         nake_fee: [
-          { required: true, message: "成本合计不能为空!", trigger: "blur" },
+          { required: true, validator: validate_num, trigger: "blur" },
         ],
         delivery_fee: [
-          { required: true, message: "物流费不能为空!", trigger: "blur" },
+          { required: true, validator: validate_num, trigger: "blur" },
         ],
       },
     };
@@ -187,12 +305,26 @@ export default {
           id: "",
           index: "-1",
           min_num: "0",
-          cost_fee: "0",
           nake_fee: "0",
+          cost_fee: "0",
           delivery_fee: "0",
+          cert_fee: "0",
+          mark_fee: "0",
+          package_fee: "0",
+          other_fee: "0",
         };
       } else {
-        const { id, min_num, cost_fee, nake_fee, delivery_fee } = this.sitem;
+        const {
+          id,
+          min_num,
+          nake_fee,
+          cost_fee,
+          delivery_fee,
+          cert_fee,
+          mark_fee,
+          package_fee,
+          other_fee,
+        } = this.sitem;
         this.ruleForm = {
           id: id || "",
           index: this.index,
@@ -200,6 +332,10 @@ export default {
           cost_fee: cost_fee || "0",
           nake_fee: nake_fee || "0",
           delivery_fee: delivery_fee || "0",
+          cert_fee: cert_fee || "0",
+          mark_fee: mark_fee || "0",
+          package_fee: package_fee || "0",
+          other_fee: other_fee || "0",
         };
       }
     },
@@ -208,6 +344,7 @@ export default {
       this.ruleForm[key] = e + "" || "0";
       this.$refs.ruleForm.validateField(key);
     },
+
     async submitForm() {
       await this.$refs.ruleForm.validate(async (valid) => {
         if (valid) {

+ 31 - 65
src/views/goodStore/goodsOnline/ShowDataTableColumns.js

@@ -226,97 +226,63 @@ const public_listCol = [
 
 ]
 const purchase_listCol = [
-  {
-    prop: "spuCode",
-    label: "商品成本编号",
-    span: 7,
-  },
-  {
-    prop: "supplierNo",
-    label: "供应商编号",
-    span: 7,
-  },
+  // {
+  //   prop: "spuCode",
+  //   label: "商品成本编号",
+  //   span: 7,
+  // },
+  // {
+  //   prop: "supplierNo",
+  //   label: "供应商编号",
+  //   span: 7,
+  // },
   {
     prop: "supplierName",
     label: "供应商名称",
-    span: 10,
+    span: 12,
   },
   {
-    prop: "is_auth",
-    label: "供应商权限",
-    _slot_: "is_auth",
+    prop: "cgd_gold_price",
+    label: "供应商采购金价",
+    append: '元/g',
     span: 6,
   },
 
-
   {
-    prop: "cert_fee",
-    label: "证书费",
-    append: '元',
-    span: 6,
-  },
-  {
-    prop: "packing_fee",
-    label: "包装费",
-    append: '元',
-    span: 6,
-  },
-  {
-    prop: "cost_fee",
-    label: "成本工艺费",
-    append: '元',
+    prop: "is_auth",
+    label: "供应商权限",
+    _slot_: "is_auth",
     span: 6,
   },
-
   {
-    prop: "mark_fee",
-    label: "加标费",
-    append: '元',
-    span: 6,
+    prop: "is_step",
+    label: "启用成本阶梯",
+    _slot_: "is_step",
+    span: 4,
   },
   {
     prop: "demo_fee",
-    label: "打样费",
-    append: '元',
-    span: 6,
+    label: "打样费(元)",
+    span: 5,
   },
   {
     prop: "open_fee",
-    label: "开模费",
-    append: '元/件',
-    span: 6,
+    label: "开模费(元/件)",
+    span: 5,
   },
 
   {
     prop: "sample_fee",
-    label: "调样费",
-    append: '元',
-    span: 6,
+    label: "调样费(元)",
+    span: 5,
   },
   {
     prop: "market_price",
-    label: "市场价",
-    append: '元',
-    span: 6,
-  },
-  {
-    prop: "nake_price",
-    label: "裸价",
-    append: '元',
-    span: 6,
-  },
-  {
-    prop: "cgd_gold_price",
-    label: "供应商采购金价",
-    append: '元/g',
-    span: 6,
-  },
-  {
-    prop: "is_step",
-    label: "启用成本阶梯",
-    _slot_: "is_step",
-    span: 6,
+    label: "市场价(元)",
+    span: 5,
   },
+ 
+  
   {
     prop: "nakelist",
     label: "采购起订量",

+ 23 - 13
src/views/goodStore/goodsOnline/detail.vue

@@ -138,18 +138,26 @@
                 </template>
 
                 <template slot="nakelist">
-                  <el-table
-                    :data="nakelist"
-                    :size="'mini'"
-                    border
-                    stripe
-                    style="width: 99%; margin: 10px 10px 10px 0"
-                  >
-                    <el-table-column prop="min_num" label="起订量(>=)" />
-                    <el-table-column prop="nake_fee" label="成本合计" />
-                    <el-table-column prop="cost_fee" label="工艺费" />
-                    <el-table-column prop="delivery_fee" label="物流费" />
-                  </el-table>
+                  <div v-if="nakelist">
+                    <el-table
+                      :data="nakelist"
+                      :size="'mini'"
+                      border
+                      stripe
+                      style="width: 99%; margin: 10px 10px 10px 0"
+                    >
+                      <el-table-column prop="min_num" label="起订量(>=)" />
+                      <el-table-column prop="nake_fee" label="成本单价" />
+                      <el-table-column prop="cost_fee" label="工艺费" />
+                      <el-table-column prop="delivery_fee" label="物流费" />
+                      <el-table-column prop="cert_fee" label="证书费" />
+                      <el-table-column prop="mark_fee" label="加标费" />
+                      <el-table-column prop="package_fee" label="包装费" />
+                      <el-table-column prop="other_fee" label="其他费用" />
+                      <el-table-column prop="nake_total" label="成本合计" />
+                    </el-table>
+                  </div>
+                  <div v-else>--</div>
                 </template>
               </show-data-table>
               <show-data-table
@@ -158,7 +166,9 @@
                   newTime !== '' &&
                   private_field &&
                   private_field.length > 0 &&
-                  private_field.some((item) => item == '2')
+                  private_field.some((item) => item == '2') &&
+                  ladderlist &&
+                  ladderlist.length > 0
                 "
                 :sitem="sitem"
                 :columns="sale_listCol"

+ 2 - 2
src/views/goodStore/searchSort/addEdit.vue

@@ -30,7 +30,7 @@
                 v-model="ruleForm.cat_name"
                 disabled
                 placeholder="分类名称"
-                minlength="20"
+                maxlength="20"
               />
             </el-form-item>
             <el-form-item label="财务核算码" prop="fund_code">
@@ -38,7 +38,7 @@
                 v-model="ruleForm.fund_code"
                 disabled
                 placeholder="财务核算码"
-                minlength="50"
+                maxlength="50"
               />
             </el-form-item>
             <el-form-item label="预算→成本" prop="order_rate">

+ 3 - 3
src/views/goodStore/sort/addEdit.vue

@@ -29,7 +29,7 @@
                 v-model="ruleForm.cat_name"
                 :disabled="id == '007'"
                 placeholder="分类名称"
-                minlength="20"
+                maxlength="20"
               >
                 <template slot="prepend" v-if="pid_name">{{
                   pid_name
@@ -58,7 +58,7 @@
                 v-model="ruleForm.fund_code"
                 :disabled="id == '007'"
                 placeholder="财务核算码"
-                minlength="50"
+                maxlength="50"
               />
             </el-form-item>
             <el-form-item label="售后说明" prop="cat_desc">
@@ -68,7 +68,7 @@
                 placeholder="售后说明"
                 type="textarea"
                 :rows="5"
-                minlength="2000"
+                maxlength="2000"
               />
             </el-form-item>
           </el-form>

+ 2 - 2
src/views/goodStore/sort/addEditRate.vue

@@ -30,7 +30,7 @@
                 v-model="ruleForm.cat_name"
                 disabled
                 placeholder="分类名称"
-                minlength="20"
+                maxlength="20"
                 ><template slot="prepend" v-if="pid_name">{{
                   pid_name
                 }}</template></el-input
@@ -41,7 +41,7 @@
                 v-model="ruleForm.fund_code"
                 disabled
                 placeholder="财务核算码"
-                minlength="50"
+                maxlength="50"
               />
             </el-form-item>
             <el-form-item label="预算→成本" prop="order_rate">

+ 1 - 1
src/views/goodStore/specs/addEdit.vue

@@ -29,7 +29,7 @@
                 v-model="ruleForm.spec_name"
                 :disabled="id == '007'"
                 placeholder="规格名称"
-                minlength="20"
+                maxlength="20"
               />
             </el-form-item>
         

+ 1 - 1
src/views/goodStore/unit/addEdit.vue

@@ -29,7 +29,7 @@
                 v-model="ruleForm.unit"
                 :disabled="id == '007'"
                 placeholder="单位名称"
-                minlength="20"
+                maxlength="20"
               />
             </el-form-item>
           </el-form>

+ 22 - 22
src/views/purchaseIn/purchaseOrder/columns.js

@@ -26,30 +26,30 @@ export default [
     width: "155px",
   },
   
+  // {
+  //   prop: "wsm_supplierNo",
+  //   label: "仓库公司编号",
+  //   width: "145px",
+  // },
+  // {
+  //   prop: "wsm_supplier",
+  //   label: "仓库公司名称",
+  //   width: "155px",
+  // },
+  // {
+  //   prop: "wsm_code",
+  //   label: "仓库编号",
+  //   width: "172px",
+  // },
+  // {
+  //   prop: "wsm_name",
+  //   label: "仓库名称",
+  //   width: "80px",
+  // },
   {
-    prop: "wsm_supplierNo",
-    label: "仓库公司编号",
-    width: "145px",
-  },
-  {
-    prop: "wsm_supplier",
-    label: "仓库公司名称",
-    width: "155px",
-  },
-  {
-    prop: "wsm_code",
-    label: "仓库编号",
-    width: "172px",
-  },
-  {
-    prop: "wsm_name",
-    label: "仓库名称",
-    width: "80px",
-  },
-  {
-    prop: "good_code",
+    prop: "spuCode",
     label: "商品属性编号",
-    width: "145px",
+    width: "158px",
   },
   {
     prop: "good_name",

+ 98 - 81
src/views/purchaseIn/purchaseOrder/components/ShowDataTableColumns.js

@@ -1,85 +1,102 @@
-export default  [
+export default [
 
-    {
-      prop: "cgdNo",
-      label: "采购单编号",
-    },
-    {
-      prop: "bkcode",
-      label: "备库单编号",
-    },
-    // {
-    //   prop: "cgder",
-    //   label: "申请人",
-    // },
-    // {
-    //   prop: "good_code",
-    //   label: "商品编号",
-    // },
-    {
-      prop: "good_type_code",
-      label: "商品属性编号",
-    },
-    {
-      prop: "good_name",
-      label: "商品名称",
-    },
-    {
-      prop: "wsm_supplierNo",
-      label: "仓库供应商编号",
-    },
-    {
-      prop: "wsm_supplier",
-      label: "仓库供应商名称",
-    },
-    {
-      prop: "wsm_code",
-      label: "仓库编号",
-    },
-    {
-      prop: "wsm_name",
-      label: "仓库名称",
-    },
+  {
+    prop: "status",
+    label: "采购单状态",
+    _slot_: "status",
+    span: 6
+  },
+  {
+    prop: "cgder",
+    label: "申请人",
+    span: 6
+  },
+  {
+    prop: "lasttime",
+    label: "要求入库时间",
+    span: 6
+  },
+  {
+    prop: "addtime",
+    label: "创建时间",
+    span: 6
+  },
+  {
+    prop: "supplier_name",
+    label: "销售方公司",
+    _slot_: "supplier_name",
+  },
+  {
+    prop: "supplier_name1",
+    label: "购买方公司",
+    _slot_: "supplier_name1",
+  },
 
-    {
-      prop: "class_cat",
-      label: "商品分类",
-    },
-    {
-      prop: "status",
-      label: "采购单状态",
-      _slot_: "status",
-    },
-    {
-      prop: "good_price",
-      label: "采购单价",
-    },
-    {
-      prop: "good_num",
-      label: "采购总数量",
-    },
-    {
-      prop: "total_fee",
-      label: "采购总成本",
-    },
+  {
+    prop: "wsm",
+    label: "仓库信息",
+    _slot_: "wsm",
+  },
+  {
+    prop: "class_cat",
+    label: "商品分类",
+  },
+  {
+    prop: "good_name",
+    label: "商品名称",
+    _slot_: "good_name",
+    span: 24
+  },
+  {
+    prop: "brand_name",
+    label: "品牌",
+    _slot_: "brand_name",
+    span: 6
+  },
+  {
+    prop: "total_fee",
+    label: "采购总成本",
+    span: 6
+  },
+  {
+    prop: "good_price",
+    label: "采购单价",
+    span: 6
+  },
+  {
+    prop: "good_num",
+    label: "采购总数量",
+    span: 6
+  },
+  {
+    prop: "send_num",
+    label: "已发货数量",
+    span: 6
+  },
+  {
+    prop: "wsend_num",
+    label: "未发货数量",
+    span: 6
+  },
+  {
+    prop: "exclusive",
+    label: "专属类型",
+    _slot_: "exclusive",
+    span: 6
+  },
+  {
+    prop: "weight",
+    label: "商品总重",
+    _slot_: "weight",
+    span: 6
+  },
 
-    {
-      prop: "send_num",
-      label: "已发货数量",
-    },
-    {
-      prop: "wsend_num",
-      label: "未发货数量",
-    },
+  {
+    prop: "remark",
+    label: "贵金属信息",
+    _slot_: "remark",
+    span: 24
+  },
+
+]
 
-    {
-      prop: "lasttime",
-      label: "预计最晚入库时间",
-    },
-    
-    {
-      prop: "addtime",
-      label: "创建时间",
-    },
-  ]
-  

+ 134 - 76
src/views/purchaseIn/purchaseOrder/detail.vue

@@ -5,49 +5,8 @@
       v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
     >
       <p>{{ status }}---{{ powers }}</p>
-     <div class="detail-page-title">
-        <span>采购单编号:</span><span>{{ queryId }}</span>
-        <el-button
-          @click="statusConfirm('-1', '作废该条信息')"
-          type="danger"
-          plain
-          style="margin: 0 0 0 12px"
-          class="fr"
-          :size="'mini'"
-          v-if="
-            status !== '' &&
-            status !== '5' &&
-            powers.some((item) => item == '015')
-          "
-          >作废该条信息</el-button
-        >
-        <el-button
-          @click="statusConfirm('0', '取消发货')"
-          class="fr"
-          :size="'mini'"
-          style="margin: 0 0 0 12px"
-          v-if="status === '1' && powers.some((item) => item == '027')"
-          >取消入库</el-button
-        >
-        <el-button
-          type="primary"
-          class="fr"
-          style="margin: 0 0 0 12px"
-          :size="'mini'"
-          @click="statusConfirm('1', '开始入库')"
-          v-if="status === '0' && powers.some((item) => item == '026')"
-          >开始入库
-        </el-button>
-        <el-button
-          type="primary"
-          :size="'mini'"
-          class="fr"
-          style="margin: 0 0 0 12px"
-          @click="addForm"
-          v-if="status === '0' && powers.some((item) => item == '007')"
-          >修改采购反馈
-        </el-button>
-
+      <div class="detail-page-title">
+        <span>采购单编号:</span><span>{{ queryId }}---{{ sitem.bkcode }}</span>
         <el-button
           type="primary"
           :size="'mini'"
@@ -60,14 +19,6 @@
           @click="diffAdd = true"
           >填写总工差</el-button
         >
-        <el-button
-          type="primary"
-          :size="'mini'"
-          class="fr"
-          style="margin: 0 0 0 12px"
-          @click="ReturnAddModel = true"
-          >新建采购单退货</el-button
-        >
       </div>
       <status-bar
         v-if="newTime !== ''"
@@ -77,14 +28,97 @@
       />
       <el-tabs v-model="activeTabs">
         <el-tab-pane label="业务详情" name="1">
-          <el-collapse v-model="activeNames" style="margin:-18px 0 0 0">
+          <el-collapse v-model="activeNames" style="margin: -18px 0 0 0">
             <el-collapse-item title="采购单信息" name="1">
-              <show-data-table 
+              <show-data-table
                 :newTime="newTime"
                 v-if="newTime !== ''"
                 :sitem="sitem"
                 :columns="ShowDataTableColumns"
               >
+                <template slot="supplier_name">
+                  <span>{{ sitem.supplier_name }}</span>
+                  <el-popover placement="top" width="300" trigger="hover">
+                    <ul>
+                      <li>
+                        <span>销售方编号:</span
+                        ><span>{{ sitem.supplierNo }}</span>
+                      </li>
+                    </ul>
+                    <i class="el-icon-warning-outline fr" slot="reference"></i>
+                  </el-popover>
+                </template>
+                <template slot="supplier_name1">
+                  <span>{{ sitem.supplier_name }}</span>
+                  <el-popover placement="top" width="300" trigger="hover">
+                    <ul>
+                      <li>
+                        <span>销售方编号:</span
+                        ><span>{{ sitem.supplierNo }}</span>
+                      </li>
+                    </ul>
+                    <i class="el-icon-warning-outline fr" slot="reference"></i>
+                  </el-popover>
+                </template>
+                <template slot="good_name">
+                  <span v-if="sitem.goodinfo">
+                    <img
+                      style="display: inline-block; width: 20px; height: 20px"
+                      class="hover fl"
+                      v-viewer
+                      v-if="sitem.goodinfo.good_thumb_img"
+                      :src="sitem.goodinfo.good_thumb_img"
+                      alt=""
+                    />
+                    <span style="padding: 0 0 0 5px">{{
+                      sitem.goodinfo.good_name
+                    }}</span>
+                    <span
+                      v-for="(si, sii) in sitem.goodinfo.speclist"
+                      :key="sii + si.id"
+                    >
+                      <span>{{ sii === 0 ? "_" : "--" }}</span
+                      ><span>{{ si.spec_name }}[{{ si.spec_value }}]</span>
+                    </span>
+                    <el-popover placement="top" width="300" trigger="hover">
+                      <ul>
+                        <li>
+                          <span>商品编号:</span
+                          ><span>{{ sitem.spuCode }}</span>
+                        </li>
+                      </ul>
+                      <i
+                        class="el-icon-warning-outline fr my-class"
+                        slot="reference"
+                      ></i>
+                    </el-popover>
+                  </span>
+                </template>
+                <template slot="brand_name">
+                  <span v-if="sitem.goodinfo">{{
+                    sitem.goodinfo.brand_name
+                  }}</span>
+                </template>
+                <template slot="exclusive">
+                  <span
+                    v-if="
+                      sitem.goodinfo &&
+                      sitem.goodinfo.exclusive &&
+                      sitem.goodinfo.exclusive.length > 0
+                    "
+                  >
+                    <span
+                      v-for="(si, sii) in sitem.goodinfo.exclusive"
+                      :key="si.id + sii"
+                    >
+                      <span v-if="sii !== 0">/</span><span>{{ si.name }}</span>
+                    </span> </span
+                  ><span v-else>--</span>
+                </template>
+                <template slot="weight">
+                  <span v-if="sitem.goodinfo">{{ sitem.goodinfo.weight }}</span
+                  >/g
+                </template>
                 <template slot="status">
                   <el-tag
                     :size="'mini'"
@@ -98,11 +132,45 @@
                     "
                   ></el-tag>
                 </template>
-              </show-data-table>
 
-              <!-- <work-diff-table></work-diff-table> -->
+                <template slot="wsm">
+                  <span>{{ sitem.wsm_supplier }}/{{ sitem.wsm_name }}</span>
+                  <el-popover placement="top" width="300" trigger="hover">
+                    <ul>
+                      <li>
+                        <span>仓库公司编号:</span
+                        ><span>{{ sitem.wsm_supplierNo }}</span>
+                      </li>
+                      <li>
+                        <span>仓库名称编号:</span
+                        ><span>{{ sitem.wsm_code }}</span>
+                      </li>
+                    </ul>
+                    <i class="el-icon-warning-outline fr" slot="reference"></i>
+                  </el-popover>
+                </template>
+                <template slot="remark">
+                  <span v-if="sitem.goodinfo && sitem.goodinfo.noble_metal"
+                    >{{
+                      sitem.goodinfo.noble_weight
+                        ? sitem.goodinfo.noble_weight
+                        : "0"
+                    }}g-{{ sitem.goodinfo.noble_name }}-{{
+                      sitem.goodinfo.gold_price
+                        ? sitem.goodinfo.gold_price
+                        : "0"
+                    }}元/g-{{
+                      sitem.goodinfo.is_gold_price === "0" ? "不" : ""
+                    }}启用实时金价-{{
+                      sitem.goodinfo.is_diff === "1" ? "有" : "无"
+                    }}工差-{{ sitem.goodinfo.config }}-{{
+                      sitem.goodinfo.other_config
+                    }}</span
+                  >
+                </template>
+              </show-data-table>
             </el-collapse-item>
-            <el-collapse-item title="备货入库单" name="2">
+            <el-collapse-item title="入库单" name="2">
               <order-in-table
                 :newTime="newTime"
                 v-if="newTime !== ''"
@@ -111,6 +179,9 @@
                 @refresh="initData()"
               />
             </el-collapse-item>
+            <el-collapse-item title="工差单" name="3">
+              <work-diff-table></work-diff-table>
+            </el-collapse-item>
           </el-collapse>
         </el-tab-pane>
         <el-tab-pane label="审批记录" name="2">
@@ -122,19 +193,13 @@
           />
         </el-tab-pane>
       </el-tabs>
-      <!-- <diff-order-add
+      <diff-order-add
         :sitem="sitem"
         :show-model="diffAdd"
         @refresh="initData"
         @cancel="diffAdd = false"
-      /> -->
-      <!-- 采购单退货弹窗 -->
-      <purchase-return-add
-        :sitem="sitem"
-        :show-model="ReturnAddModel"
-        @refresh="initData()"
-        @cancel="ReturnAddModel = false"
       />
+
       <order-addedit-model
         :id="modelId"
         :show-model="showModel"
@@ -154,17 +219,13 @@ import resToken from "@/mixins/resToken";
 import asyncRequest from "@/apis/service/purchaseIn/purchaseOrder";
 import orderInTable from "./components/order-in-table";
 import ShowDataTableColumns from "./components/ShowDataTableColumns";
-// import diffOrderAdd from "@/views/purchaseIn/purchaseDiffOrder/addEditModel";
-// import WorkDiffTable from "./components/workDiff-table.vue";
 import orderAddeditModel from "./components/order-addedit-model";
-import PurchaseReturnAdd from "@/views/purchaseIn/purchaseReturn/addEdit"; //采购单退货弹窗
 export default {
   name: "purchaseOrderDetail",
   mixins: [mixinPage, resToken],
   components: {
     orderInTable,
     orderAddeditModel,
-    PurchaseReturnAdd, //采购单退货弹窗
   },
 
   computed: {
@@ -192,16 +253,12 @@ export default {
       activeNames: ["0", "1", "2", "3", "4", "5", "10"],
       sitem: null,
       statusOptions: [
-        { value: "0", label: "待同意开始入库" },
-        { value: "1", label: "待入库" },
-        { value: "2", label: "部分入库" },
-        { value: "3", label: "入库完成" },
+        { value: "1", label: "待发货" },
+        { value: "2", label: "部分发货" },
+        { value: "3", label: "发货完成" },
+        { value: "4", label: "已取消订单" },
       ],
       statusList: [
-        {
-          code: "0",
-          label: "待同意发货",
-        },
         {
           code: "1",
           label: "待发货",
@@ -214,6 +271,7 @@ export default {
           code: "3",
           label: "发货完成",
         },
+        { value: "4", label: "已取消订单" },
       ],
       status: "",
       newTime: "",

+ 4 - 4
src/views/purchaseIn/purchaseOrder/index.vue

@@ -239,10 +239,6 @@ export default {
       sselect: "创建时间",
       // 状态
       statusOptions: [
-        {
-          code: "0",
-          label: "待同意发货",
-        },
         {
           code: "1",
           label: "待发货",
@@ -255,6 +251,10 @@ export default {
           code: "3",
           label: "发货完成",
         },
+        {
+          code: "4",
+          label: "已取消订单",
+        },
       ],
 
       loading: false,

+ 0 - 249
src/views/purchaseIn/purchaseReturn/addEdit.vue

@@ -1,249 +0,0 @@
-<template>
-  <el-dialog
-    :title="title"
-    :center="true"
-    align="left"
-    top="15vh"
-    width="600px"
-    @close="showModelThis = false"
-    :close-on-click-modal="false"
-    :visible.sync="showModelThis"
-    v-loading="loading"
-    element-loading-text="拼命加载中"
-    element-loading-spinner="el-icon-loading"
-    element-loading-background="rgba(0, 0, 0, 0.8)"
-  >
-    <el-card style="margin: -20px 0 0 0">
-      <el-row :gutter="10">
-        <el-col :span="24">
-          <el-form
-            :model="ruleForm"
-            status-icon
-            :rules="rulesThis"
-            ref="ruleForm"
-            label-width="100px"
-            class="demo-ruleForm"
-          >
-            <el-row>
-              <el-form-item label="商品分类" prop="goods_class">
-                <el-input v-model="ruleForm.goods_class" disabled></el-input>
-              </el-form-item>
-              <el-form-item label="商品名称" prop="good_name">
-                <el-input v-model="ruleForm.good_name" disabled></el-input>
-              </el-form-item>
-              <el-col :span="12">
-                <el-form-item label="采购总数量" prop="good_num">
-                  <el-input
-                    v-model="ruleForm.good_num"
-                    disabled
-                  /> </el-form-item
-              ></el-col>
-              <el-col :span="12">
-                <el-form-item label="已入库数量" prop="send_num">
-                  <el-input
-                    v-model="ruleForm.send_num"
-                    disabled
-                  /> </el-form-item
-              ></el-col>
-              <el-col :span="12">
-                <el-form-item label="未入库数量" prop="wsend_num">
-                  <el-input v-model="ruleForm.wsend_num" disabled />
-                </el-form-item>
-              </el-col>
-              <el-col :span="12">
-                <el-form-item label="退货数量" prop="return_num">
-                  <el-input
-                    v-model="ruleForm.return_num"
-                    :disabled="isDetail"
-                  />
-                </el-form-item>
-              </el-col>
-            </el-row>
-          </el-form>
-        </el-col>
-        <el-col :span="24" style="text-align: right">
-          <el-button
-            type="primary"
-            :size="'mini'"
-            @click="submitForm"
-            v-if="!isDetail"
-            >保 存
-          </el-button>
-          <el-button :size="'mini'" @click="showModelThis = false">{{
-            isDetail ? "关 闭" : "取 消"
-          }}</el-button>
-        </el-col>
-      </el-row>
-    </el-card>
-  </el-dialog>
-</template>
-   <script>
-import asyncRequest from "@/apis/service/purchaseIn/purchaseReturn";
-import resToken from "@/mixins/resToken";
-import { isnumber } from "@/utils/validate";
-export default {
-  name: "purchaseReturnAdd",
-  props: ["showModel", "id", "isDetail", "sitem"],
-  mixins: [resToken],
-  data() {
-    const validatename = (rule, value, callback) => {
-      if (value === "") {
-        callback(new Error("退货数量不能为空!"));
-      } else {
-        if (value.length > 50) {
-          callback(new Error("退货数量位数不能超过50位!"));
-        } else {
-          if (!isnumber(value)) {
-            callback(new Error("请填写正确的退货数量!"));
-          } else {
-            callback();
-          }
-        }
-      }
-    };
-    return {
-      loading: false,
-      title: "新建采购单退货",
-      showModelThis: this.showModel,
-      ruleForm: {
-        cgdNo: "",
-        return_num: "", //退货数量
-        good_name: "",
-        wsend_num: "",
-      },
-      rulesThis: this.rules,
-      rules: {
-        return_num: [
-          {
-            required: true,
-            validator: validatename,
-            trigger: "blur",
-          },
-        ],
-        good_name: [
-          {
-            required: true,
-            trigger: "blur",
-            message: "请填写商品名称",
-          },
-        ],
-        goods_class: [
-          {
-            required: true,
-            trigger: "blur",
-            message: "请填写商品分类名称",
-          },
-        ],
-        wsend_num: [
-          {
-            required: true,
-            trigger: "blur",
-            message: "请填写商品数量",
-          },
-        ],
-      },
-    };
-  },
-  watch: {
-    showModel: function (val) {
-      this.showModelThis = val;
-      if (val) {
-        this.initForm();
-      }
-    },
-    showModelThis(val) {
-      if (!val) {
-        this.$emit("cancel");
-      }
-    },
-  },
-  methods: {
-    async initForm() {
-      this.loading = true;
-      this.rulesThis = this.rules;
-      await this.resetForm(this.sitem);
-      this.loading = false;
-    },
-    async initData() {
-      const res = await asyncRequest.detail({ id: this.id });
-      if (res && res.code === 0 && res.data) {
-        this.ruleForm = res.data;
-        this.ruleForm.role_id = this.ruleForm.role;
-      } else if (res && res.code >= 100 && res.code <= 104) {
-        await this.logout();
-      } else {
-        this.$message.warning(res.message);
-      }
-    },
-    async resetForm(sitem) {
-      // 重置
-      await this.$nextTick(() => {
-        if (this.$refs.ruleForm) {
-          this.$refs.ruleForm.resetFields();
-          this.$refs.ruleForm.clearValidate();
-          console.log(this.sitem);
-          const {
-            good_name,
-            goods_class,
-            wsend_num,
-            cgdNo,
-            good_num,
-            send_num,
-          } = this.sitem;
-          this.ruleForm = {
-            good_num: good_num || "",
-            send_num: send_num || "",
-            cgdNo: cgdNo || "",
-            return_num: "", //退货数量
-            good_name: good_name || "",
-            goods_class: goods_class || "",
-            wsend_num: wsend_num || "",
-          };
-        }
-      });
-    },
-
-    async submitForm() {
-      await this.$refs.ruleForm.validate(async (valid) => {
-        if (valid) {
-          this.loading = true;
-
-          const model = JSON.parse(JSON.stringify(this.ruleForm));
-          if (Number(model.return_num) > Number(model.wsend_num)) {
-            this.$message.warning("退货数量不能大于未发货数量");
-            this.loading = false;
-            return;
-          }
-          delete model["good_name"];
-          delete model["goods_class"];
-          delete model["wsend_num"];
-          const res = await asyncRequest.add(model);
-          this.loading = false;
-          if (res && res.code === 0) {
-            this.$notify.success({
-              title: "添加成功",
-              message: "",
-            });
-            this.showModelThis = false;
-            // 刷新
-            this.$emit("refresh");
-          } else if (res && res.code >= 100 && res.code <= 104) {
-            await this.logout();
-          } else {
-            this.$message.warning(res.message);
-          }
-        } else {
-          console.log("error submit!!");
-          return false;
-        }
-      });
-    },
-  },
-};
-</script>
-
-   <style lang="scss" scoped>
-.purchaseReturn {
-}
-</style>
-   

+ 0 - 1
src/views/purchaseIn/purchaseReturn/detail.vue

@@ -8,7 +8,6 @@
       <div class="detail-page-title">
         <span>采购退货单编号:</span
         ><span v-if="sitem">{{ sitem.bk_code }}</span>
-
         <el-button
           v-if="
             powers.some((item) => item === '015') &&

+ 73 - 86
src/views/purchaseIn/purchaseReturn/index.vue

@@ -26,86 +26,86 @@
         <template #table-header="{}">
           <div style="width: 100%">
             <el-row style="padding: 0 0 0 80px">
-                <el-col :span="4" style="width: 150px; padding: 0 0 0 0px">
+              <el-col :span="4" style="width: 150px; padding: 0 0 0 0px">
+                <el-select
+                  :size="searchSize"
+                  v-model="parmValue.status"
+                  filterable
+                  clearable
+                  placeholder="状态"
+                  style="width: 100%"
+                  @change="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                >
+                  <el-option
+                    v-for="item in statusOptions"
+                    :key="'status' + item.id"
+                    :label="item.label"
+                    :value="item.id"
+                  />
+                </el-select>
+              </el-col>
+              <!-- 下拉筛选 -->
+              <el-col :span="6" style="width: 400px; padding: 0 0 0 10px">
+                <el-input
+                  clearable
+                  placeholder="关键字"
+                  v-model="s_input"
+                  :size="searchSize"
+                  class="input-with-select"
+                >
                   <el-select
-                    :size="searchSize"
-                    v-model="parmValue.status"
-                    filterable
-                    clearable
-                    placeholder="状态"
-                    style="width: 100%"
-                    @change="
-                      pageInfo.curr = 1;
-                      parmValue.page = 1;
-                      searchList();
-                    "
+                    v-model="select"
+                    style="width: 125px"
+                    slot="prepend"
+                    placeholder="请选择"
                   >
                     <el-option
-                      v-for="item in statusOptions"
-                      :key="'status' + item.id"
-                      :label="item.label"
-                      :value="item.id"
-                    />
+                      label="退货单编号"
+                      value="returnCode"
+                    ></el-option>
+                    <el-option label="采购单编号" value="cgdNo"></el-option>
+                    <el-option
+                      label="商品属性编码"
+                      value="good_type_code"
+                    ></el-option>
+                    <el-option label="商品名称" value="good_name"></el-option>
                   </el-select>
-                </el-col>
-                <!-- 下拉筛选 -->
-                <el-col :span="6" style="width: 400px; padding: 0 0 0 10px">
-                  <el-input
-                    clearable
-                    placeholder="关键字"
-                    v-model="s_input"
-                    :size="searchSize"
-                    class="input-with-select"
-                  >
-                    <el-select
-                      v-model="select"
-                      style="width: 125px"
-                      slot="prepend"
-                      placeholder="请选择"
-                    >
-                      <el-option
-                        label="退货单编号"
-                        value="returnCode"
-                      ></el-option>
-                      <el-option label="采购单编号" value="cgdNo"></el-option>
-                      <el-option
-                        label="商品属性编码"
-                        value="good_type_code"
-                      ></el-option>
-                      <el-option label="商品名称" value="good_name"></el-option>
-                    </el-select>
-                    <el-button
-                      slot="append"
-                      icon="el-icon-search"
-                      @click="handleValue"
-                    ></el-button>
-                  </el-input>
-                </el-col>
-             
-                <el-col :span="3" style="width: 66px; float: right">
                   <el-button
-                    :size="searchSize"
-                    type="primary"
-                    style="float: right; margin-left: 5px"
-                    @click="searchList"
-                  >
-                    刷新
-                  </el-button>
-                </el-col>
-                   <el-col
-                  :span="4"
+                    slot="append"
+                    icon="el-icon-search"
+                    @click="handleValue"
+                  ></el-button>
+                </el-input>
+              </el-col>
+
+              <el-col :span="3" style="width: 66px; float: right">
+                <el-button
+                  :size="searchSize"
+                  type="primary"
+                  style="float: right; margin-left: 5px"
+                  @click="searchList"
+                >
+                  刷新
+                </el-button>
+              </el-col>
+              <el-col
+                :span="4"
+                class="fr"
+                style="width: 66px; padding: 0 0 0 10px"
+              >
+                <el-button
+                  type="warning"
                   class="fr"
-                  style="width: 66px; padding: 0 0 0 10px"
+                  :size="searchSize"
+                  @click="restSearch"
                 >
-                  <el-button
-                    type="warning"
-                    class="fr"
-                    :size="searchSize"
-                    @click="restSearch"
-                  >
-                    重置
-                  </el-button>
-                </el-col>
+                  重置
+                </el-button>
+              </el-col>
             </el-row>
           </div>
         </template>
@@ -142,7 +142,6 @@
           ></p>
         </template>
         <template #operation="{ scope }">
-
           <el-tooltip
             v-if="powers.some((item) => item == '007')"
             effect="dark"
@@ -195,14 +194,6 @@
           </el-tooltip>
         </template>
       </ex-table>
-      <add-edit
-        :id="modelId"
-        :sitem="sitem"
-        :show-model="showModel"
-        :is-detail="isDetail"
-        @refresh="searchList"
-        @cancel="showModel = false"
-      />
     </div>
     <div v-else>
       <no-auth></no-auth>
@@ -214,15 +205,11 @@ import mixinPage from "@/mixins/elPaginationHandle";
 import resToken from "@/mixins/resToken";
 import columns from "./columns";
 import asyncRequest from "@/apis/service/purchaseIn/purchaseReturn";
-import addEdit from "./addEdit";
 import { mapGetters } from "vuex";
 
 export default {
   name: "purchaseReturn",
   mixins: [mixinPage, resToken],
-  components: {
-    addEdit,
-  },
   computed: {
     ...mapGetters(["tablebtnSize", "searchSize", "size"]),
     powers() {

+ 152 - 92
src/views/purchaseIn/wsmInOrder/components/wsm-in-order-addEdit-form.vue

@@ -2,14 +2,15 @@
   <el-form
     v-loading="loading"
     :model="ruleForm"
-    :rules="rules"
+    :rules="rulesThis"
     status-icon
+    :size="'small'"
     ref="ruleForm"
     label-width="85px"
     class="demo-ruleForm"
   >
     <el-row>
-      <el-col :span="id === 'add' ? 24 : 12">
+      <el-col :span="id === 'add' ? 12 : 12">
         <el-form-item label="可入库总数" prop="wsend_num">
           <el-input
             disabled
@@ -19,17 +20,62 @@
           />
         </el-form-item>
       </el-col>
-      <el-col :span="id === 'add' ? 24 : 12">
+      <el-col :span="id === 'add' ? 12 : 12">
         <el-form-item label="入库数量" prop="send_num">
-          <el-input
+          <digital-input
+            :values="ruleForm.send_num"
+            :placeholder="'入库数量'"
+            :min="0"
+            :name="'ruleForm.send_num'"
             :disabled="id !== 'add'"
-            placeholder="入库数量"
-            v-model="ruleForm.send_num"
-            maxlength="100"
+            :max="ruleForm.wsend_num"
+            :position="'right'"
+            :precision="0"
+            :size="'small'"
+            :controls="false"
+            :append="''"
+            @reschange="number_change($event, 'send_num')"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col :span="id === 'add' ? 12 : 12">
+        <el-form-item label="发货方式" prop="sendtype">
+          <el-select
+            v-model="ruleForm.sendtype"
+            style="width: 100%"
+            :disabled="id !== 'add'"
+            placeholder="发货方式"
+            @change="sendtypeChange"
+          >
+            <el-option
+              v-for="item in options"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+      </el-col>
+      <el-col :span="id === 'add' ? 12 : 12">
+        <el-form-item label="物流费用" prop="post_fee">
+          <digital-input
+            :values="ruleForm.post_fee"
+            :placeholder="'物流费用'"
+            :min="0"
+            :name="'ruleForm.post_fee'"
+            :disabled="id !== 'add'"
+            :max="ruleForm.post_fee"
+            :position="'right'"
+            :precision="2"
+            :size="'small'"
+            :controls="false"
+            :append="'元'"
+            @reschange="number_change($event, 'post_fee')"
           />
         </el-form-item>
       </el-col>
-      <el-col :span="id === 'add' ? 24 : 12">
+      <el-col :span="id === 'add' ? 24 : 12" v-if="ruleForm.sendtype === '1'">
         <el-form-item label="物流公司" prop="post_company">
           <search-express
             :disabled="id !== 'add'"
@@ -41,7 +87,7 @@
           />
         </el-form-item>
       </el-col>
-      <el-col :span="id === 'add' ? 24 : 12">
+      <el-col :span="id === 'add' ? 24 : 12" v-if="ruleForm.sendtype === '1'">
         <el-form-item label="物流单号" prop="post_code">
           <el-input
             :disabled="id !== 'add'"
@@ -51,19 +97,8 @@
           />
         </el-form-item>
       </el-col>
-      <el-col :span="id === 'add' ? 24 : 12">
-        <el-form-item label="物流费用" prop="post_fee">
-          <el-input
-            :disabled="id !== 'add'"
-            placeholder="物流费用"
-            v-model="ruleForm.post_fee"
-            maxlength="100"
-          >
-            <template slot="append">元</template>
-          </el-input>
-        </el-form-item>
-      </el-col>
-      <el-col :span="id === 'add' ? 24 : 12">
+
+      <el-col :span="id === 'add' ? 12 : 12">
         <el-form-item label="发货时间" prop="post_time">
           <el-date-picker
             :disabled="id !== 'add'"
@@ -78,7 +113,7 @@
           </el-date-picker>
         </el-form-item>
       </el-col>
-      <el-col :span="24" style="text-align: right" v-if="id === 'add'">
+      <el-col :span="12" style="text-align: right" v-if="id === 'add'">
         <el-button type="primary" :size="'mini'" @click="submitForm"
           >保 存
         </el-button>
@@ -95,28 +130,29 @@ export default {
   props: ["id", "sitem", "newTime", "modelSitem"],
   mixins: [resToken],
   data() {
-    const validatePrice = (rule, value, callback) => {
-      if (value === "") {
+    const validate_num = (rule, value, callback) => {
+      const { required } = rule;
+      if (required && value === "") {
         callback(new Error("不能为空!"));
       } else {
-        if (isnumber(value)) {
-          callback();
-        } else if (isnumber2(value)) {
-          callback();
-        } else {
-          callback(new Error("仅支持整数或两位小数!"));
-        }
+        callback();
       }
     };
-    const validateWeight = (rule, value, callback) => {
-      if (value === "") {
-        callback(new Error("不能为空!"));
+    const validate_num_0 = (rule, value, callback) => {
+      const { required } = rule;
+      if (required && value === "") {
+        callback(new Error("不能为空!"));
+      } else if (
+        required &&
+        (value === "0" ||
+          value === "0." ||
+          value === "0.0" ||
+          value === "0.00" ||
+          value === "0.000")
+      ) {
+        callback(new Error("不能为零!"));
       } else {
-        if (!isnumber(value)) {
-          callback(new Error("仅支持整数!"));
-        } else {
-          callback();
-        }
+        callback();
       }
     };
     const validateCode = (rule, value, callback) => {
@@ -146,34 +182,67 @@ export default {
         send_num: "",
         status: "1",
       },
-      rules: {
-        send_num: {
-          required: true,
-          validator: validateWeight,
-          trigger: "blur",
-        },
-        post_company: {
-          type: "array",
-          required: true,
-          trigger: "change",
-          message: "请输入物流公司",
+      rulesThis: this.rules,
+      options: [
+        {
+          value: "1",
+          label: "公司自提",
         },
-        post_code: {
-          required: true,
-          validator: validateCode,
-          trigger: "blur",
+        {
+          value: "2",
+          label: "供应商包邮",
         },
-        post_fee: {
-          required: true,
-          validator: validatePrice,
-          trigger: "blur",
-        },
-        post_time: {
-          required: true,
-          message: "请选择发货时间",
-          trigger: "change",
+      ],
+      pickerOptions: {
+        disabledDate: (time) => {
+          return time.getTime() > new Date().valueOf();
         },
       },
+      rules: {
+        send_num: [
+          {
+            required: true,
+            validator: validate_num_0,
+            trigger: "blur",
+          },
+        ],
+        post_company: [
+          {
+            type: "array",
+            required: true,
+            trigger: "change",
+            message: "请输入物流公司",
+          },
+        ],
+        sendtype: [
+          {
+            required: true,
+            trigger: "change",
+            message: "选择发货方式",
+          },
+        ],
+        post_code: [
+          {
+            required: true,
+            validator: validateCode,
+            trigger: "blur",
+          },
+        ],
+        post_fee: [
+          {
+            required: true,
+            validator: validate_num,
+            trigger: "blur",
+          },
+        ],
+        post_time: [
+          {
+            required: true,
+            message: "请选择发货时间",
+            trigger: "change",
+          },
+        ],
+      },
     };
   },
   watch: {
@@ -189,6 +258,7 @@ export default {
   methods: {
     async initForm() {
       this.loading = true;
+      this.rulesThis = this.rules;
       await this.resetForm();
       this.loading = false;
     },
@@ -209,6 +279,7 @@ export default {
               wsm_code,
               send_num,
               wsend_num,
+              sendtype,
             } = this.sitem;
             this.ruleForm = {
               // wsm_mobile,
@@ -221,57 +292,46 @@ export default {
               post_code: post_code || "",
               post_fee: post_fee || "",
               post_time: sendtime || "",
+              sendtype: sendtype || "1",
               send_num: send_num || "",
               status: "1",
             };
           }
           console.log(this.sitem);
-
-          // const {
-          //   wsm_mobile,
-          //   wsm_contactor,
-          //   wsm_addr,
-          //   wsend_num,
-          //   cgdNo,
-          //   wsm_code,
-          // } = this.modelSitem;
-          // this.ruleForm = {
-          //   wsm_mobile,
-          //   wsm_contactor,
-          //   wsm_addr,
-          //   wsend_num,
-          //   cgdNo: cgdNo || "",
-          //   wsm_code: wsm_code || "",
-          //   post_company: [post_company] || [],
-          //   post_code: post_code || "",
-          //   post_fee: post_fee || "",
-          //   post_time: sendtime || "",
-          //   send_num: send_num || "",
-          //   status: "1",
-          // };
         }
       });
     },
+    number_change(e, key) {
+      this.ruleForm[key] = e + "" || "0";
+      this.$refs.ruleForm.validateField(key);
+    },
+    sendtypeChange() {
+      const { sendtype } = this.ruleForm;
+      this.rulesThis.post_code[0].required = sendtype === "1";
+      this.rulesThis.post_company[0].required = sendtype === "1";
+    },
     // 保存更改
     async submitForm() {
+      console.log(this.rules);
       await this.$refs.ruleForm.validate(async (valid) => {
         if (valid) {
           this.loading = true;
           let model = JSON.parse(JSON.stringify(this.ruleForm));
           model.post_company = model.post_company.toString();
-
-          const res = await asyncRequest.orderinadd(model);
+          const { code, message } = await asyncRequest.orderinadd(model);
           this.loading = false;
-          if (res && res.code === 0) {
+          if (code === 0) {
             this.$notify.success({
               title: "添加成功",
               message: "",
             });
             this.$emit("refresh"); //抛出事件给详情页。
-          } else if (res && res.code >= 100 && res.code <= 104) {
+          } else if (code >= 100 && code <= 104) {
             await this.logout();
+          } else if (code === "1009") {
+            this.$message.warning(`${message},请刷新采购单详情重试!`);
           } else {
-            this.$message.warning(res.message);
+            this.$message.warning(message);
           }
         } else {
           console.log("error submit!!");

+ 3 - 3
src/views/purchaseIn/wsmInOrder/components/wsm-in-order-model.vue

@@ -1,10 +1,10 @@
 <template>
   <el-dialog
-    :title="'新建备货入库单'"
+    :title="'新建入库单'"
     :center="true"
     align="left"
-    top="5vh"
-    width="500px"
+    top="15vh"
+    width="700px"
     @close="showModelThis = false"
     :close-on-click-modal="false"
     :visible.sync="showModelThis"

+ 32 - 25
src/views/sellOut/salesOrder/columns.js

@@ -2,37 +2,24 @@ export default [
   {
     prop: "orderCode",
     label: "销售订单编号",
-    width: "150px",
-  },
-  {
-    prop: "apply_name",
-    label: "申请人",
-    width: "60px",
-  },
-  {
-    prop: "customer_code",
-    label: "客户公司编码",
-    width: "125px",
-  },
-  {
-    prop: "customerName",
-    label: "企业客户名称",
-    width: "125px",
-  },
-  {
-    prop: "good_code",
-    label: "商品编码",
-    width:"128"
+    width: "155px",
   },
+
+
+  // {
+  //   prop: "good_code",
+  //   label: "商品编码",
+  //   width:"128"
+  // },
   {
     prop: "good_name",
     label: "商品名称",
-    width:"150"
+    width: "150"
   },
   {
     prop: "good_class",
     label: "商品分类",
-    width:"120"
+    width: "120"
 
   },
 
@@ -48,8 +35,8 @@ export default [
     prop: "total_price",
     label: "总价",
   },
- 
- 
+
+
 
 
   {
@@ -58,6 +45,26 @@ export default [
     _slot_: "status",
     width: "120px",
   },
+  {
+    prop: "apply_name",
+    label: "申请人",
+    width: "60px",
+  },
+  {
+    prop: "customer_code",
+    label: "客户公司编码",
+    width: "155px",
+  },
+  {
+    prop: "customerName",
+    label: "企业客户名称",
+    width: "125px",
+  },
+  {
+    prop: "supplierName",
+    label: "销售方公司",
+    width: "125px",
+  },
 
   {
     prop: "addtime",

+ 189 - 33
src/views/sellOut/salesOrder/components/ShowDataTableColumns.js

@@ -1,18 +1,10 @@
-export default [
+const addColumns = [
   {
     prop: "good_name",
     label: "商品名称",
     _slot_: "good_name",
     span: 24,
   },
-
-  // {
-  //   prop: "speclist",
-  //   label: "规格",
-  //   _slot_: "speclist",
-  //   span: 24,
-  // },
-
   {
     prop: "good_info_img",
     _slot_: "good_info_img",
@@ -49,34 +41,13 @@ export default [
     span: 8,
   },
 
-
-
-
-
-  // {
-  //   prop: "delivery_day",
-  //   label: "物流时间",
-  //   append: '天',
-  //   span: 12,
-  // },
-  // {
-  //   prop: "lead_time",
-  //   label: "供货周期",
-  //   append: '天',
-  //   span: 12,
-  // },
   {
     prop: "exclusive",
     label: "专属类型",
     _slot_: "exclusive",
     span: 24,
   },
-  // {
-  //   prop: "sample_day",
-  //   label: "调样周期",
-  //   append: '天',
-  //   span: 12,
-  // },
+
   {
     prop: "weight",
     label: "商品总克重",
@@ -88,15 +59,200 @@ export default [
     label: "售后说明",
     span: 24,
   },
+]
+const showColumns = [
+  {
+    prop: "orderCode",
+    label: "订单编号",
+    span: 6,
+  },
+  {
+    prop: "status",
+    label: "订单状态",
+    _slot_: "status",
+    span: 6,
+  },
+  {
+    prop: "order_type",
+    label: "订单类型",
+    _slot_: "order_type",
+    span: 6,
+  }, {
+    prop: "apply_name",
+    label: "创建人",
+    span: 6,
+  },
+
+  {
+    prop: "supplierName",
+    label: "销售方公司",
+    span: 12,
+  },
+  {
+    prop: "companyName",
+    label: "企业客户",
+    span: 12,
+  },
+  {
+    prop: "good_name",
+    label: "商品名称",
+    _slot_: "good_name",
+    span: 12,
+  },
 
+  {
+    prop: "good_code",
+    label: "SPU编号",
+    span: 6,
+  },
+  {
+    prop: "skuCode",
+    label: "SKU编号",
+    span: 6,
+  },
+  {
+    prop: "cat",
+    label: "分类",
+    _slot_: "cat",
+    span: 10,
+  },
+  {
+    prop: "brand_name",
+    label: "品牌",
+    span: 8,
+  },
+  {
+    prop: "platform_id",
+    label: "所属平台",
+    span: 6,
+  },
+  {
+    prop: "unit",
+    label: "单位",
+    span: 6,
+  },
+  {
+    prop: "tax",
+    label: "税点",
+    append: '%',
+    span: 6,
+  },
+  {
+    prop: "good_num",
+    label: "购买数量",
+    span: 6,
+  },
+  {
+    prop: "send_num",
+    label: "已发数量",
+    span: 6,
+  },
+  {
+    prop: "wsend_num",
+    label: "未发数量",
+    span: 6,
+  },
+  {
+    prop: "th_num",
+    label: "退货数量",
+    span: 6,
+  },
   // {
-  //   prop: "craft_desc",
-  //   label: "工艺说明",
+  //   prop: "is_stock",
+  //   label: "是否库存品",
+  //   _slot_: "is_stock",
+  //   span: 4,
+  // },
+
+
+
+  // {
+  //   prop: "exclusive",
+  //   label: "专属类型",
+  //   _slot_: "exclusive",
   //   span: 24,
   // },
 
+  // {
+  //   prop: "weight",
+  //   label: "商品总克重",
+  //   _slot_: "weight",
+  //   span: 24,
+  // },
 
+  {
+    prop: "arrive_time",
+    label: "要求到货时间",
+    span: 6,
+  },
+  {
+    prop: "origin_price",
+    label: "原价",
+    append: '元',
+    span: 6,
+  },
+  {
+    prop: "sale_price",
+    label: "售价",
+    append: '元',
+    span: 6,
+  },
+  {
+    prop: "sale_price",
+    label: "总金额",
+    append: '元',
+    span: 6,
+  },
 
+  {
+    prop: "paytime",
+    label: "承诺付款时间",
+    span: 6,
+  },
 
+  {
+    prop: "post_fee",
+    label: "物流费用",
+    append: '元',
+    span: 6,
+  },
+
+  {
+    prop: "useage",
+    label: "订单用途",
+    span: 12,
+  },
+  {
+    prop: "send_type",
+    label: "发货类型",
+    _slot_: "send_type",
+    span: 6,
+  },
+  {
+    prop: "addtime",
+    label: "创建时间",
+    span: 6,
+  },
+  {
+    prop: "platform_order",
+    label: "平台订单号",
+    span: 12,
+  },
+  {
+    prop: "workNo",
+    label: "其他单号",
+    span: 12,
+  },
+  {
+    prop: "remark",
+    label: "备注",
+    span: 24,
+  },
+  {
+    prop: "remark",
+    label: "其他信息",
+    span: 24,
+  },
 ]
 
+export { addColumns, showColumns }

+ 96 - 76
src/views/sellOut/salesOrder/components/addForm.vue

@@ -172,7 +172,7 @@
                 </show-data-table>
               </el-form-item>
             </el-col>
-            <el-col :span="12" v-if="ruleForm.good_code">
+            <el-col :span="12" v-show="ruleForm.good_code">
               <el-row>
                 <el-col :span="24">
                   <el-form-item label="活动类型" prop="goodtype">
@@ -182,11 +182,19 @@
                       placeholder="活动类型"
                       style="width: 100%"
                       :props="{ expandTrigger: 'hover' }"
-                      @change="handleChange"
+                      @change="get_new_price"
                     ></el-cascader>
                   </el-form-item>
                 </el-col>
-                <el-col :span="24">
+                <el-col :span="12">
+                  <el-form-item label="剩余库存">
+                    <el-input
+                      v-model="ruleForm.activity_stock"
+                      disabled
+                      placeholder="剩余库存"
+                    /> </el-form-item
+                ></el-col>
+                <el-col :span="12">
                   <el-form-item label="凭证文件" prop="proof_id">
                     <el-tooltip
                       effect="dark"
@@ -279,7 +287,11 @@
                 </el-col>
                 <el-col :span="12">
                   <el-form-item label="销售单价" prop="good_price">
-                    <el-input v-model="ruleForm.good_price" disabled>
+                    <el-input
+                      v-model="ruleForm.good_price"
+                      disabled
+                      v-loading="priceLoding"
+                    >
                       <template slot="append">元</template></el-input
                     >
                   </el-form-item>
@@ -357,6 +369,7 @@
             border
             :size="'mini'"
             style="width: 100%"
+            max-height="200px"
             row-key="key"
           >
             <el-table-column type="index" width="50" show-overflow-tooltip />
@@ -596,7 +609,7 @@ import { isnumber, isMobile } from "@/utils/validate";
 import inAddrModel from "@/components/in-addr-model";
 import showVoucherModel from "@/components/show-voucher-model";
 import searchGoodOnlineModal from "@/components/search-good-online-modal";
-import ShowDataTableColumns from "./ShowDataTableColumns";
+import { addColumns } from "./ShowDataTableColumns";
 export default {
   name: "salesOrderDetail",
   mixins: [mixinPage, resToken],
@@ -651,13 +664,14 @@ export default {
       }
     };
     return {
-      ShowDataTableColumns: ShowDataTableColumns,
+      ShowDataTableColumns: addColumns,
       AddrAddEditModalIndex: -1,
       AddrAddEditModalSitem: {},
       showGoodsModel: false,
       showVoucher: false,
       companyName: "",
       showModel: false,
+      addrmodel: false,
       addshowModel: {},
       pickerOptions: {
         disabledDate(time) {
@@ -708,7 +722,7 @@ export default {
         proof_id: "", //凭证ID
         proof_type: "", //凭证类型
         proof_url: "", //凭证地址
-
+        activity_stock: "0",
         is_activity: "0", //是否参与活动,
         goodtype: ["is_activity_0", "1"], //活动类型
         good_num: "", //商品数量
@@ -836,6 +850,11 @@ export default {
       queryId: "",
       status: "",
       goods_sitem: {},
+      order_good_num: {
+        ogood_type: "",
+        ogood_num: "0",
+      },
+      priceLoding: false,
     };
   },
   mounted() {
@@ -865,18 +884,19 @@ export default {
             supplierNo: "", //销售方编码
             customer_code: [], // 企业客户选择
             platform_id: "",
-            arrtime: "2022-03-31", //要求到货时间
+            arrtime: "", //要求到货时间
             proof_id: "", //凭证ID
             proof_type: "", //凭证类型
             proof_url: "", //凭证地址
+            activity_stock: "0",
             goodtype: ["is_activity_0", "1"], //活动类型
-            good_num: "10", //商品数量
+            good_num: "0", //商品数量
             good_price: "0", //商品单价
             platform_order: "", //平台订单号
             paytime: "", //承诺回款时间
             workNo: "", //其他单号
             sendtype: "1", //发货方式
-            remark: "11", //备注
+            remark: "", //备注
             good_code: "", // 商品编号
           };
         }
@@ -927,6 +947,10 @@ export default {
       this.ruleForm.proof_url = "";
       this.$refs.ruleForm.validateField("proof_id");
     },
+    addrRefresh(e) {
+      const { list } = e;
+      this.addrForm.order_addr.push(...list);
+    },
     async resultList(e) {
       this.showModel = false;
       if (e.length === 1) {
@@ -953,15 +977,25 @@ export default {
         companyNo: supplierNo,
         platform_id,
       };
-      let { code, data, message } = await asyncRequest.goods_active(model);
+      const { code, data, message } = await asyncRequest.goods_active(model);
       if (code === 0) {
-        let list =
-          data && data.length > 0 ? JSON.parse(JSON.stringify(data)) : [];
-        list.forEach((a) => {
+        const { act, good } = data;
+        let actlist = act.length > 0 ? JSON.parse(JSON.stringify(act)) : [];
+        actlist.forEach((a) => {
           a.value = a.activity_code;
           a.label = a.activity_name;
         });
-        this.goodtype_options[1].children = list;
+        this.goodtype_options[1].children = [];
+        this.goodtype_options[1].children.push(...actlist);
+        let goodItem =
+          good.length > 0 ? JSON.parse(JSON.stringify(good[0])) : {};
+        if (goodItem.good_name) {
+          this.goodtype_options[0].children.map((b) => {
+            b.activity_stock = goodItem ? goodItem.stock_num + "" : "0";
+            return b;
+          });
+          console.log(this.goodtype_options);
+        }
       } else if (code >= 100 && code <= 104) {
         await this.logout();
       } else {
@@ -1018,68 +1052,53 @@ export default {
       } else {
       }
     },
-    //商品类型选择
-    async handleChange(e) {
-      const { goodtype, good_num } = this.ruleForm;
-      if (good_num === "0" || good_num === "") {
-        this.ruleForm.good_price = "0";
-      } else {
-        if (goodtype.length === 2) {
-          let key_1 = goodtype[1];
-          if (key_1 === "1" || key_1 === "2") {
-            this.ruleForm.good_price = "0";
-          } else {
-            const { isok, price } = await this.set_salegetprice();
-            this.ruleForm.good_price = isok ? price : "0";
-          }
-        } else {
-          this.ruleForm.good_price = "0";
-        }
-      }
-    },
     async number_change(e, key) {
       this.ruleForm[key] = e + "" || "0";
       this.$refs.ruleForm.validateField(key);
+      if (key === "good_num") {
+        await this.get_new_price();
+      }
+    },
+    async get_new_price() {
       const { goodtype, good_num } = this.ruleForm;
 
-      if (good_num === "0" || good_num === "") {
-        this.ruleForm.good_price = "0";
-      } else {
-        if (goodtype.length === 2) {
-        
-          let key_1 = goodtype[1];
-          if (key_1 === "2" || key_1 === "3") {
-            this.ruleForm.good_price = "0";
-          } else {
-            const { isok, price } = await this.set_salegetprice();
-            this.ruleForm.good_price = isok ? price : "0";
-          }
-        } else {
-          this.ruleForm.good_price = "0";
-        }
+      let oldGood_type = goodtype.length === 2 ? goodtype[1] : "";
+      const { ogood_type, ogood_num } = this.order_good_num;
+      console.log(
+        `oldGood_type${oldGood_type}-ogood_type${ogood_type}-good_num${good_num}-ogood_num${ogood_num}`
+      );
+      if (oldGood_type === ogood_type && good_num === ogood_num) {
+        this.order_good_num = {
+          ogood_type: goodtype.length === 2 ? goodtype[1] : "",
+          ogood_num: this.ruleForm.good_num,
+        };
+        return;
       }
-    },
-    async get_goods_active() {
-      const { good_code, supplierNo, platform_id } = this.ruleForm;
-      let model = {
-        skuCode: good_code,
-        companyNo: supplierNo,
-        platform_id,
-      };
-      let { code, data, message } = await asyncRequest.goods_active(model);
-      if (code === 0) {
-        let list =
-          data && data.length > 0 ? JSON.parse(JSON.stringify(data)) : [];
-        list.forEach((a) => {
-          a.value = a.activity_code;
-          a.label = a.activity_name;
+
+      //activity_stock
+      if (goodtype.length === 2) {
+        this.goodtype_options.forEach((a) => {
+          if (a.children && a.children.length) {
+            a.children.forEach((b) => {
+              if (b.value === goodtype[1]) {
+                console.log(b.activity_stock);
+                this.ruleForm.activity_stock = b.activity_stock || "0";
+              }
+            });
+          }
         });
-        this.goodtype_options[1].children = list;
-      } else if (code >= 100 && code <= 104) {
-        await this.logout();
       } else {
-        this.$message.warning(message);
+        this.ruleForm.activity_stock = 0 + "";
+      }
+      if (!this.priceLoding) {
+        const { isok, price } = await this.set_salegetprice();
+        this.ruleForm.good_price = isok ? price : "0";
       }
+
+      this.order_good_num = {
+        ogood_type: goodtype.length === 2 ? goodtype[1] : "",
+        ogood_num: this.ruleForm.good_num,
+      };
     },
     change_good_code() {
       const { supplierNo, platform_id } = this.ruleForm;
@@ -1172,15 +1191,11 @@ export default {
       await this.$refs.ruleForm.validate(async (valid) => {
         if (valid) {
           this.loading = true;
-          const { sendtype, good_num } = JSON.parse(
+          const { sendtype, good_num, goodtype } = JSON.parse(
             JSON.stringify(this.ruleForm)
           );
           const { order_addr } = JSON.parse(JSON.stringify(this.addrForm));
-          if (sendtype.length !== 2) {
-            this.$message.warning("请选择商品类型!");
-            this.loading = false;
-            return;
-          }
+
           let key_0 = goodtype[0];
           let key_1 = goodtype[1];
           if (order_addr.length === 0 && sendtype === "1") {
@@ -1255,19 +1270,23 @@ export default {
     },
 
     async set_salegetprice() {
+      this.priceLoding = true;
       let resModel = {
         isok: true,
         price: "0",
       };
       const { good_num, good_code, goodtype } = this.ruleForm;
       let key_1 = goodtype[1];
+      let key_0 = goodtype[0];
       let model = {
         skuCode: good_code,
         sale_num: good_num,
-        is_activity: key_1,
+        is_activity: key_0 === "is_activity_0" ? "0" : "1",
+        act_code: key_0 === "is_activity_1" ? key_1 : "",
       };
+      console.log(model);
       let { code, message, data } = await asyncRequest.salegetprice(model);
-
+      console.log(code, message, data);
       if (code === 0) {
         const { sale_price } = data;
         resModel.price = sale_price + "";
@@ -1277,6 +1296,7 @@ export default {
         this.$message.warning(message);
         resModel.isok = false;
       }
+      this.priceLoding = false;
       return resModel;
     },
   },

+ 0 - 288
src/views/sellOut/salesOrder/components/feedback-form.vue

@@ -1,288 +0,0 @@
-<template>
-  <div class="salesOrderDetail">
-    <el-row>
-      <el-col :span="24" style="padding: 0 0 22px 0">
-        <el-form :model="addrForm" ref="addrForm" :size="'mini'">
-          <el-table
-            :data="addrForm.order_addr"
-            border
-            :size="'mini'"
-            style="width: 100%"
-            row-key="key"
-          >
-            <el-table-column
-              show-overflow-tooltip
-              prop="receipt_quantity"
-              label="收货总数"
-              width="110"
-            />
-
-            <el-table-column
-              show-overflow-tooltip
-              prop="arrive_time"
-              label="最晚收货日期"
-              width="145"
-            />
-            <el-table-column
-              show-overflow-tooltip
-              prop="contactor"
-              label="收件联系人"
-              width="85"
-            />
-
-            <el-table-column
-              show-overflow-tooltip
-              prop="mobile"
-              label="收货联系电话"
-              width="110"
-            />
-
-            <el-table-column
-              show-overflow-tooltip
-              prop="addr"
-              label="收货地址"
-              min-width="200"
-            />
-
-            <el-table-column
-              prop="post_fee"
-              label="预计物流费用"
-              min-width="170"
-            >
-              <template slot-scope="scope">
-                <el-form-item
-                  :prop="'order_addr.' + scope.$index + '.' + 'post_fee'"
-                  :rules="addrRules.post_fee"
-                  :size="'mini'"
-                  :style="{ marginBottom: scope.row.edit ? '13px' : '0' }"
-                >
-                  <el-input
-                    v-model="scope.row.post_fee"
-                    :disabled="!scope.row.edit"
-                  />
-                </el-form-item>
-              </template>
-            </el-table-column>
-            <el-table-column
-              fixed="right"
-              width="50"
-              label="操作"
-              v-if="status === '1' && powers.some((item) => item == '033')"
-            >
-              <template slot-scope="scope">
-                <el-tooltip
-                  effect="dark"
-                  content="编辑"
-                  v-if="!scope.row.edit"
-                  placement="top"
-                >
-                  <i
-                    class="el-icon-edit tb-icon"
-                    @click="openHouseModal(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="checkRow(scope.$index)"
-                  ></i>
-                </el-tooltip>
-              </template>
-            </el-table-column>
-          </el-table>
-        </el-form>
-      </el-col>
-      <el-col
-        :span="24"
-        style="text-align: right; padding: 0 0 20px 0"
-        v-if="status === '1' && powers.some((item) => item == '033')"
-      >
-        <el-button :size="'mini'" type="primary" @click="submitForm"
-          >保 存
-        </el-button>
-      </el-col>
-    </el-row>
-  </div>
-</template>
-   <script>
-import mixinPage from "@/mixins/elPaginationHandle";
-import resToken from "@/mixins/resToken";
-import asyncRequest from "@/apis/service/sellOut/salesOrder/detail";
-import searchStockGoodModal from "@/components/search-stock-good-modal";
-import { isnumber, isnumber2 } from "@/utils/validate";
-export default {
-  name: "salesOrderDetail",
-  mixins: [mixinPage, resToken],
-  props: ["newTime", "id", "sitem"],
-  components: { searchStockGoodModal },
-  watch: {
-    newTime: function (val) {
-      if (val) {
-        this.initForm();
-      }
-    },
-  },
-  computed: {
-    powers() {
-      let tran =
-        this.$store.getters.btnList.find(
-          (item) => item.menu_route == "salesOrderDetail"
-        ) || {};
-      if (tran && tran.action && tran.action.length > 0) {
-        return tran.action;
-      } else {
-        return [];
-      }
-    },
-  },
-
-  data() {
-    const validateWeight = (rule, value, callback) => {
-      if (value === "") {
-        callback(new Error("物流费用不能为空"));
-      } else {
-        if (isnumber()) {
-          callback();
-        } else if (isnumber2(value)) {
-          callback();
-        } else {
-          callback(new Error("物流费用仅支持整数或两位小数!"));
-        }
-      }
-    };
-
-    return {
-      showGoodsModel: false,
-      stock_code: "",
-      addrForm: {
-        order_addr: [], //收货地址
-      },
-      addrRules: {
-        post_fee: {
-          required: true,
-          validator: validateWeight,
-          trigger: "blur",
-        },
-      },
-      loading: false,
-      queryId: "",
-      status: "",
-    };
-  },
-  mounted() {
-    this.initForm();
-  },
-  methods: {
-    async initForm() {
-      this.status = "";
-      this.queryId = this.$route.query.id;
-      this.rulesThis = this.rules;
-      this.resetForm();
-    },
-
-    getNewTime() {
-      this.newTime = new Date().valueOf();
-    },
-    async resetForm() {
-      // 重置
-      await this.$nextTick(() => {
-        if (this.$refs.addrForm) {
-          this.$refs.addrForm.resetFields();
-          this.$refs.addrForm.clearValidate();
-          const { addrs, status } = this.sitem;
-          this.status = status;
-          this.addrForm = {
-            order_addr: [],
-          };
-          if (addrs && addrs.length > 0) {
-            addrs.forEach((v) => {
-              let model = {
-                edit: false,
-                arrive_time: v.arrive_time || "",
-                receipt_quantity: v.receipt_quantity || "",
-                contactor: v.contactor || "",
-                mobile: v.mobile || "",
-                addr: v.addr_info + v.addr || "",
-                id: v.id,
-                post_fee: v.post_fee || "",
-                is_del: 0,
-              };
-              this.addrForm.order_addr.push(model);
-            });
-          }
-        }
-      });
-    },
-
-    openHouseModal(index) {
-      let findex = this.addrForm.order_addr.findIndex((v) => v.edit === true);
-      if (findex !== -1) {
-        this.$message.warning("当前已有地址在编辑,请保存后再试!");
-        return;
-      } else {
-        this.addrForm.order_addr[index].edit = true;
-      }
-    },
-
-    //省市区保存某一行
-    checkRow(rowIndex) {
-      this.$refs.addrForm.validate((valid) => {
-        if (valid) {
-          this.addrForm.order_addr[rowIndex].edit = false;
-        } else {
-          return false;
-        }
-      });
-    },
-    async submitForm() {
-      await this.$refs.addrForm.validate(async (valid) => {
-        if (valid) {
-          this.loading = true;
-          const { order_addr } = JSON.parse(JSON.stringify(this.addrForm));
-          let model = {
-            id: this.queryId,
-            order_addr: [],
-          };
-          order_addr.forEach((v2) => {
-            let model2 = {
-              post_fee: v2.post_fee,
-              id: v2.id,
-            };
-            model.order_addr.push(model2);
-          });
-          let res = await asyncRequest.salefee(model);
-          this.loading = false;
-          if (res && res.code === 0) {
-            this.$notify.success({
-              title: "反馈物流费用成功!",
-              message: "",
-            });
-            this.showModelThis = false;
-            // 刷新
-            this.$emit("refresh");
-          } else if (res && res.code >= 100 && res.code <= 104) {
-            await this.logout();
-          } else {
-            this.$message.warning(res.message);
-          }
-        } else {
-          console.log("error submit!!");
-          return false;
-        }
-      });
-    },
-  },
-};
-</script>
-   <style lang="scss" scoped>
-.salesOrderDetail {
-}
-</style>
-   
-   

+ 9 - 19
src/views/sellOut/salesOrder/components/order-out-table.vue

@@ -5,34 +5,23 @@
       :data="tableData"
       border
       :size="'mini'"
+      max-height="300px"
       style="width: 100%"
       row-key="key"
     >
-      <!-- <el-table-column
-        show-overflow-tooltip
-        prop="orderCode"
-        label="出库订单号"
-        width="150"
-      /> -->
 
       <el-table-column
         show-overflow-tooltip
         prop="outCode"
         label="出库单号"
-        width="150"
+        width="155"
       />
-      <!-- <el-table-column
-        show-overflow-tooltip
-        prop="apply_name"
-        label="申请人名称"
-        width="85"
-      /> -->
 
       <el-table-column
         show-overflow-tooltip
         prop="post_name"
         label="物流公司"
-        width="110"
+        min-width="110"
       />
       <el-table-column
         show-overflow-tooltip
@@ -47,6 +36,7 @@
         width="80"
       >
         <template slot-scope="scope">
+          {{scope.row.status}}
           <el-tag
             :size="tablebtnSize"
             :type="scope.row.status == '0' ? 'warning' : ''"
@@ -60,7 +50,7 @@
 
       <el-table-column
         show-overflow-tooltip
-        prop="send_num"
+        prop="receipt_quantity"
         label="发货数量"
         width="80"
       />
@@ -80,7 +70,7 @@
         show-overflow-tooltip
         prop="addr"
         label="收货地址"
-        width="170"
+        min-width="170"
       >
         <template slot-scope="scope">
           {{ scope.row.addr_info }}{{ scope.row.addr }}
@@ -90,7 +80,7 @@
         show-overflow-tooltip
         prop="sendtime"
         label="发货时间"
-        min-width="170"
+        width="145"
       />
       <el-table-column
         fixed="right"
@@ -234,10 +224,10 @@ export default {
     async resetForm() {
       // 重置
       await this.$nextTick(() => {
-        const { orderout, status } = this.sitem;
+        const { addrs, status } = this.sitem;
         this.status = status;
         console.log(this.status);
-        this.tableData = JSON.parse(JSON.stringify(orderout));
+        this.tableData = JSON.parse(JSON.stringify(addrs));
       });
     },
 

+ 62 - 100
src/views/sellOut/salesOrder/detail.vue

@@ -4,40 +4,12 @@
       style="width: 100%"
       v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
     >
-      <p>{{ status }}----{{ powers }}</p>
-      <!-- class="detail-page-title" -->
-      <div >
-        <span>销售订单编号:</span
+      <div>
+        <span>订单编号:</span
         ><span v-if="sitem">{{ sitem.orderCode }}</span>
+         <!-- v-if="status === '4' && powers.some((item) => item == '051')" -->
         <el-button
-          @click="statusConfirm('-1', '作废该条信息')"
-          type="danger"
-          plain
-          class="fr"
-          :size="'mini'"
-          v-if="
-            (status == '0' ||
-              status == '1' ||
-              status == '2' ||
-              status == '3') &&
-            powers.some((item) => item == '015')
-          "
-          >作废该条信息</el-button
-        >
-        <el-button
-          @click="statusConfirm('0', '取消审核流程')"
-          plain
-          :size="'mini'"
-          class="fr"
-          type="primary"
-          v-if="
-            (status === '1' || status === '2' || status === '3') &&
-            powers.some((item) => item == '014')
-          "
-          >取消审核流程</el-button
-        >
-        <el-button
-          v-if="status === '4' && powers.some((item) => item == '051')"
+         
           style="margin: 0 0 0 10px"
           class="fr"
           type="primary"
@@ -46,86 +18,76 @@
           >新建销售退货单
         </el-button>
       </div>
-
-      <status-bar
-        v-if="newTime !== '' && queryType !== 'add'"
-        :newTime="newTime"
-        :options="statusOptions"
-        :status="status"
-      />
       <el-tabs v-model="activeTabs">
-        <el-tab-pane label="新建销售订单" name="0">
+        <el-tab-pane label="新建销售订单" name="0" v-if="queryType === 'add'">
           <add-form
             :newTime="newTime"
             v-if="newTime !== ''"
             :type="queryType"
             :sitem="sitem"
             :id="queryId"
-            @refresh="initData()"
+            @refresh="routeReGoto('salesOrder', {})"
           />
         </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 !== ''"
+              <show-data-table
+                style="margin: 0; padding: 0"
                 :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', '发起审核流程')"
-                  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>
+                v-if="status"
+                :columns="showColumns"
+              >
+                <template slot="good_name">
+                  <img
+                    v-viewer
+                    style="width: 23px; height: 23px; margin: 0 5px 0 0"
+                    class="fl"
+                    v-if="sitem.good_thumb_img"
+                    :src="sitem.good_thumb_img"
+                    alt=""
+                  />
+                  <span>{{ sitem.good_name }}</span>
+                  <span v-for="(si, i) in sitem.specinfo" :key="si.spec_id + i">
+                    <span>{{ i === 0 ? "--" : "__" }}</span
+                    ><span>{{ si.spec_name }}[{{ si.spec_value }}]</span>
+                  </span>
+                </template>
+              
+                <template slot="cat">
+                  <span v-for="(si, sii) in sitem.can" :key="si.id"
+                    ><span v-if="sii !== 0">_</span><span>{{ si.name }}</span>
+                  </span>
+                </template>
+                <template slot="exclusive">
+                  <span v-for="(si, sii) in sitem.exclusive" :key="si.id"
+                    ><span v-if="sii !== 0">/</span><span>{{ si.name }}</span>
+                  </span>
+                </template>
+                <template slot="is_stock">
+                  <el-tag :size="'mini'">{{
+                    sitem.is_stock === "1" ? "是" : "否"
+                  }}</el-tag>
+                </template>
+                <template slot="weight">
+                  <span
+                    >商品总重:{{ sitem.new_weight }}/{{
+                      sitem.weight_unit
+                    }}</span
+                  >
+                  <span v-if="sitem.metal_id"
+                    >--{{ sitem.noble_weight ? sitem.noble_weight : "0" }}g--{{
+                      sitem.metal_name
+                    }}---{{ sitem.gold_price ? sitem.gold_price : "0" }}元/g--{{
+                      sitem.is_gold_price === "0" ? "不" : ""
+                    }}启用实时金价--{{
+                      sitem.is_diff === "1" ? "有" : "无"
+                    }}工差--{{ sitem.config }}---{{ sitem.other_config }}</span
+                  >
+                </template>
+              </show-data-table>
             </el-collapse-item>
-            <el-collapse-item title="销售出库单" name="3">
-              <!-- && status == 3 && (status == 3 || status == 4)-->
+            <el-collapse-item title="发货单" name="3">
               <order-out-table
                 :newTime="newTime"
                 v-if="newTime !== ''"
@@ -172,16 +134,15 @@ import mixinPage from "@/mixins/elPaginationHandle";
 import resToken from "@/mixins/resToken";
 import asyncRequest from "@/apis/service/sellOut/salesOrder/detail";
 import addForm from "./components/addForm";
-import feedbackForm from "./components/feedback-form";
 import orderOutTable from "./components/order-out-table";
 import addModel from "@/views/sellOut/sellReturn/components/addModel";
+import { showColumns } from "./components/ShowDataTableColumns";
 export default {
   name: "salesOrderDetail",
   mixins: [mixinPage, resToken],
   components: {
     addModel,
     addForm,
-    feedbackForm,
     orderOutTable,
   },
   computed: {
@@ -202,6 +163,7 @@ export default {
       finishStatus: "finish",
       activeTabs: "1",
       activeNames: ["-1", "0", "1", "2", "3", "4", "5", "6"],
+      showColumns: showColumns,
       statusOptions: [
         { value: "0", label: "待发起流程" },
         { value: "1", label: "待反馈物流" },

+ 66 - 40
src/views/sellOut/salesOrder/index.vue

@@ -36,8 +36,30 @@
                   @timeReturned="handleTime"
                 />
               </el-col>
+              <el-col :span="4" style="width: 148px; padding: 0 0 0 8px">
+                <el-select
+                  :size="searchSize"
+                  v-model="parmValue.status"
+                  filterable
+                  clearable
+                  placeholder="订单状态"
+                  style="width: 100%"
+                  @change="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                >
+                  <el-option
+                    v-for="item in statusOptions"
+                    :key="'status' + item.id"
+                    :label="item.label"
+                    :value="item.id"
+                  />
+                </el-select>
+              </el-col>
               <!-- 客户公司 -->
-              <el-col :span="4" style="width: 320px; padding: 0px 0 0 10px">
+              <el-col :span="4" style="width: 400px; padding: 0 0 0 10px">
                 <search-customer
                   :value="customerCode"
                   :size="searchSize"
@@ -45,6 +67,7 @@
                   @searchChange="customerChange"
                 />
               </el-col>
+
               <el-col :span="3" style="width: 66px; float: right">
                 <el-button
                   :size="searchSize"
@@ -57,13 +80,25 @@
               </el-col>
             </el-row>
             <el-row style="padding: 10px 0 0 0">
-              <el-col :span="4" style="width: 150px; padding: 0 0 0 0px">
+              <el-col :span="6" style="width: 371px; ">
+                <search-work-company
+                  :type="'1'"
+                  :value="parmValue.supplierNo"
+                  :size="'mini'"
+                  :placeholder="'销售方公司'"
+                  :disabled="false"
+                  :isDetail="false"
+                  @searchChange="supplierChange"
+                />
+              </el-col>
+
+              <el-col :span="4" style="width: 150px; padding: 0 0 0 9px">
                 <el-select
                   :size="searchSize"
-                  v-model="parmValue.status"
+                  v-model="parmValue.order_type"
                   filterable
                   clearable
-                  placeholder="销售订单状态"
+                  placeholder="订单类型"
                   style="width: 100%"
                   @change="
                     pageInfo.curr = 1;
@@ -72,35 +107,37 @@
                   "
                 >
                   <el-option
-                    v-for="item in statusOptions"
-                    :key="'status' + item.id"
+                    v-for="item in orderOptions"
+                    :key="'orderstatus' + item.id"
                     :label="item.label"
                     :value="item.id"
                   />
                 </el-select>
               </el-col>
-              <el-col :span="6" style="width: 500px; padding: 0 0 0 10px">
+              <el-col :span="6" style="width: 450px; padding: 0 0 0 10px">
                 <el-input
                   clearable
                   placeholder="关键字"
                   v-model="input"
                   :size="searchSize"
+                  @blur="searchList"
                   class="input-with-select"
                 >
                   <el-select
                     v-model="select"
-                    style="width: 125px"
+                    style="width: 137px"
                     slot="prepend"
                     placeholder="请选择"
+                    @change="searchList"
                   >
                     <el-option
                       label="销售订单编号"
                       value="orderCode"
                     ></el-option>
-                    <el-option
+                    <!-- <el-option
                       label="商品属性编号"
                       value="good_code"
-                    ></el-option>
+                    ></el-option> -->
                     <!-- <el-option
                       label="供应商编号"
                       value="supplierNo"
@@ -109,14 +146,9 @@
                       label="客户编号"
                       value="customer_code"
                     ></el-option> -->
-                    <el-option label="品名称" value="good_name"></el-option>
+                    <el-option label="品名称" value="good_name"></el-option>
                     <el-option label="申请人" value="apply_name"></el-option>
                   </el-select>
-                  <el-button
-                    slot="append"
-                    icon="el-icon-search"
-                    @click="searchList"
-                  ></el-button>
                 </el-input>
               </el-col>
 
@@ -223,22 +255,25 @@ export default {
       select: "orderCode",
       input: "",
       customerCode: [],
-      options: ["创建时间", "最晚入库时间"],
       // 状态
       statusOptions: [
-        { id: "0", label: "待发起流程" },
-        { id: "1", label: "待反馈物流" },
-        { id: "2", label: "待同意下单" },
-        { id: "3", label: "待发货" },
-        { id: "4", label: "待发货完成" },
-        { id: "5", label: "发货已完成" },
+        { id: "0", label: "待发货" },
+        { id: "1", label: "待发货完成" },
+        { id: "2", label: "发货已完成" },
+        { id: "3", label: "订单已取消" },
+      ],
+      orderOptions: [
+        { id: "1", label: "线上商品销售" },
+        { id: "2", label: "项目线上商品销售" },
+        { id: "3", label: "咨询单销售" },
+        { id: "4", label: "项目咨询单销售" },
       ],
       loading: false,
       showModel: false,
       isDetail: false,
       modelId: 0,
       parmValue: {
-        order_type: "", //订单类型1为销售 2为咨询
+        order_type: "", //订单类型
         orderCode: "", //销售订单code
         apply_name: "", // 申请人
         good_name: "", // 产品名称
@@ -307,14 +342,9 @@ export default {
       this.showModel = true;
     },
     async supplierChange(e) {
-      if (e && e.id) {
-        this.parmValue.supplierNo = [e.code];
-        this.supplierNo = e.code;
-      } else {
-        this.parmValue.supplierNo = [];
-        this.supplierNo = "";
-      }
-      this.parmValue.stockNo = [];
+      console.log(e);
+      const { id, code, label } = e;
+      this.parmValue.supplierNo = code || "";
       this.parmValue.page = 1;
       this.pageInfo.curr = 1;
       await this.searchList();
@@ -346,14 +376,10 @@ export default {
     },
     async searchList() {
       this.loading = true;
-      this.parmValue.orderCode = this.select === "orderCode" ? this.input : ""; // 采购单编码
-      this.parmValue.good_code = this.select === "good_code" ? this.input : ""; // 入库单号
-      this.parmValue.supplierNo =
-        this.select === "supplierNo" ? this.input : ""; // 产品属性编号
-      this.parmValue.good_name = this.select === "good_name" ? this.input : ""; // 申请人
+      this.parmValue.orderCode = this.select === "orderCode" ? this.input : "";
+      this.parmValue.good_name = this.select === "good_name" ? this.input : "";
       this.parmValue.apply_name =
-        this.select === "apply_name" ? this.input : ""; // 采购供应商编号
-      this.parmValue.order_type = ""; //订单类型1为销售订单 2为咨询订单
+        this.select === "apply_name" ? this.input : "";
       const res = await asyncRequest.list(this.parmValue);
       if (res && res.code === 0 && res.data) {
         this.tableData = res.data.list;
@@ -361,7 +387,7 @@ export default {
           v.good_class = "";
           if (v.can && v.can.length > 0) {
             v.can.forEach((x, i) => {
-              v.good_class += i === 0 ? x.name : "/" + x.name;
+              v.good_class += i === 0 ? x.name : "_" + x.name;
             });
           }
         });

+ 6 - 2
src/views/sellOut/sellOutOrder/ShowDataTableColumns.js

@@ -1,21 +1,25 @@
 export default [
   {
     prop: "outCode",
-    label: "出库单号",
+    label: "发货申请单号",
+    span:6
   },
   {
     prop: "status",
     label: "出库单状态",
     _slot_: "status",
+    span:6
   },
   {
     prop: "orderCode",
-    label: "销售订单编号",
+    label: "订单编号",
+    span:6
   },
   {
     prop: "order_type",
     label: "订单类别",
     _slot_: "order_type",
+    span:6
   },
   {
     prop: "apply_name",

+ 51 - 45
src/views/sellOut/sellOutOrder/detail.vue

@@ -4,9 +4,10 @@
       style="width: 100%"
       v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
     >
-    <p>{{ status }}---{{ powers }}</p>
-     <div class="detail-page-title">
-        <span>销售出库单编号:</span><span v-if="sitem">{{ sitem.outCode }}</span>
+      <p>{{ status }}---{{ powers }}</p>
+      <div class="detail-page-title">
+        <span>销售出库单编号:</span
+        ><span v-if="sitem">{{ sitem.outCode }}</span>
         <el-button
           class="fr"
           v-if="status === '2' && powers.some((item) => item == '049')"
@@ -25,53 +26,58 @@
         :options="statusOptions"
         :status="status"
       />
-       <el-tabs v-model="activeTabs">
+      <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">
-          <show-data-table
-            :newTime="newTime"
-            v-if="newTime !== ''"
-            :sitem="sitem"
-            :columns="ShowDataTableColumns"
-          >
-            <template slot="status">
-              <el-tag
-                :size="'mini'"
-                :type="sitem.status == '0' ? 'warning' : ''"
-                v-text="
-                  (
-                    statusOptions.find((item) => item.value == sitem.status) ||
-                    {}
-                  ).label || '--'
-                "
-              ></el-tag>
-            </template>
+          <el-collapse v-model="activeNames" style="margin: -18px 0 0 0">
+            <el-collapse-item title="销售出库单详情" name="1">
+              <show-data-table
+                :newTime="newTime"
+                v-if="newTime !== ''"
+                :sitem="sitem"
+                :columns="ShowDataTableColumns"
+              >
+                <template slot="status">
+                  <el-tag
+                    :size="'mini'"
+                    :type="sitem.status == '0' ? 'warning' : ''"
+                    v-text="
+                      (
+                        statusOptions.find(
+                          (item) => item.value == sitem.status
+                        ) || {}
+                      ).label || '--'
+                    "
+                  ></el-tag>
+                </template>
                 <template slot="order_type">
-              <el-tag
-                :size="'mini'"
-                :type="''" >{{sitem.status==='1'?'销售出库单':"咨询出库单"}}</el-tag>
-            </template>
-          </show-data-table>
+                  <el-tag :size="'mini'" :type="''">{{
+                    sitem.status === "1" ? "销售出库单" : "咨询出库单"
+                  }}</el-tag>
+                </template>
+              </show-data-table>
 
-          <!-- <add-edit-form
+              <!-- <add-edit-form
             :sitem="sitem"
             :newTime="newTime"
             v-if="newTime != ''"
           ></add-edit-form> -->
-        </el-collapse-item>
-        <el-collapse-item
-          title="客户验收"
-          name="3"
-          v-if="status === '1' && powers.some((item) => item == '052')"
-        >
-          <div class="tr" style="padding: 0 0 20px 0">
-            <el-button type="primary" plain :size="'mini'" @click="goodsCheck"
-              >客户已收到货</el-button
+            </el-collapse-item>
+            <el-collapse-item
+              title="客户验收"
+              name="3"
+              v-if="status === '1' && powers.some((item) => item == '052')"
             >
-          </div>
-        </el-collapse-item>
-        <!-- <el-collapse-item title="填写售后申请单" name="3" v-if="status === '4'">
+              <div class="tr" style="padding: 0 0 20px 0">
+                <el-button
+                  type="primary"
+                  plain
+                  :size="'mini'"
+                  @click="goodsCheck"
+                  >客户已收到货</el-button
+                >
+              </div>
+            </el-collapse-item>
+            <!-- <el-collapse-item title="填写售后申请单" name="3" v-if="status === '4'">
           <sell-return-apply
             :sitem="sitem"
             v-if="newTime != '' || true"
@@ -79,9 +85,8 @@
             @refresh="updateStatus"
           />
         </el-collapse-item> -->
- 
-      </el-collapse>
-      </el-tab-pane>
+          </el-collapse>
+        </el-tab-pane>
         <el-tab-pane label="审批记录" name="2">
           <process-time-line
             v-if="newTime !== ''"
@@ -149,6 +154,7 @@ export default {
       showModel: false,
       loading: false,
       statusOptions: [
+        { value: "0", label: "待库管发货" },
         { value: "1", label: "待客户验收" },
         { value: "2", label: "订单出库完成" },
       ],

+ 48 - 132
src/views/sellOut/sellReturn/components/addForm.vue

@@ -6,95 +6,40 @@
         status-icon
         :rules="rulesThis"
         ref="ruleForm"
-        label-width="95px"
+        :size="'mini'"
+        label-width="80px"
         class="demo-ruleForm"
       >
-        <el-form-item label="退换货原因" prop="errorCode">
-          <abnormal-cause
-            :value="ruleForm.errorCode"
-            :placeholder="'退换货原因'"
-            :type="'5'"
-            @searchChange="errorCode_change"
-          />
-        </el-form-item>
+        <el-row :gutter="10">
+          <el-col :span="8">
+            <el-form-item label="退货原因" prop="errorCode">
+              <abnormal-cause
+                :value="ruleForm.errorCode"
+                :placeholder="'退货原因'"
+                :type="'5'"
+                :size="'mini'"
+                @searchChange="errorCode_change"
+              />
+            </el-form-item> </el-col
+          ><el-col :span="16">
+            <el-form-item label="退货备注" prop="remark">
+              <el-input
+                :disabled="isDetail"
+                type="textarea"
+                maxlength="250"
+                show-word-limit
+                placeholder="请填写备注"
+                v-model="ruleForm.remark"
+              /> </el-form-item></el-col
+        ></el-row>
 
-        <el-form-item label="退货备注" prop="remark">
-          <el-input
-            :disabled="isDetail"
-            type="textarea"
-            maxlength="250"
-            show-word-limit
-            placeholder="请填写备注"
-            v-model="ruleForm.remark"
-          />
-        </el-form-item>
-        <el-form-item label="仓库信息" :size="'mini'" required>
-          <el-table
-            :data="tableForm.product_go"
-            border
-            :size="'mini'"
-            row-key="key"
-            v-if="!isDetail"
-          >
-            <el-table-column
-              label="仓库名称"
-              min-width="300"
-              show-overflow-tooltip
-            >
-              <template slot-scope="scope">
-                {{ scope.row.wsm_supplier }}{{ scope.row.wsm_name }}
-              </template>
-            </el-table-column>
-            <el-table-column label="下单总数量" width="100" prop="num" />
-            <el-table-column label="已发货数量" width="100" prop="send_num" />
-            <el-table-column label="未发货数量" width="100" prop="wsend_num" />
-            <el-table-column label="退货数量" width="120">
-              <template slot-scope="scope">
-                <el-form-item style="margin: 0">
-                  <el-input
-                    :disabled="!scope.row.edit"
-                    :size="'mini'"
-                    v-model="scope.row.return_num"
-                  ></el-input>
-                </el-form-item>
-              </template>
-            </el-table-column>
-
-            <el-table-column fixed="right" label="操作" width="50">
-              <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, 0)"
-                  ></i>
-                </el-tooltip>
-
-                <el-tooltip
-                  effect="dark"
-                  content="保存"
-                  v-if="scope.row.edit"
-                  placement="top"
-                >
-                  <i
-                    class="el-icon-circle-check tb-icon"
-                    @click="checkRow(scope.$index, 0)"
-                  ></i>
-                </el-tooltip>
-              </template>
-            </el-table-column>
-          </el-table>
-        </el-form-item>
         <el-form-item label="收货信息" :size="'mini'" required>
           <el-table
             :data="tableForm.get_product_go"
             border
             :size="'mini'"
             row-key="key"
+            max-height="300px"
           >
             <el-table-column
               label="收货人-联系电话-地址"
@@ -112,18 +57,23 @@
               prop="receipt_quantity"
               width="100"
             />
-            <el-table-column label="已发货数量" prop="send_num" width="100" />
-            <el-table-column label="未发货数量" prop="wsend_num" width="100" />
-            <el-table-column label="退货数量" width="120">
+
+            <el-table-column label="退货数量" width="150">
               <template slot-scope="scope">
                 <el-form-item style="margin: 0" :size="'mini'">
-                  <el-input
-                    :disabled="!scope.row.edit"
+                  <el-input-number
+                    size="mini"
                     v-model="scope.row.return_num"
-                  ></el-input>
+                    :disabled="!scope.row.edit"
+                    :min="0"
+                    :max="scope.row.wsend_num"
+                    :precision="0"
+                  />
                 </el-form-item>
               </template>
             </el-table-column>
+            <el-table-column label="未发货数量" prop="wsend_num" width="90" />
+            <el-table-column label="已发货数量" prop="send_num" width="90" />
 
             <el-table-column fixed="right" label="操作" width="50">
               <template slot-scope="scope">
@@ -157,8 +107,10 @@
       </el-form>
     </el-col>
     <el-col :span="24" style="text-align: right">
-      <el-button type="primary" @click="submitForm">保 存 </el-button>
-      <el-button @click="showModelThis = false" v-if="!isDetail"
+      <el-button type="primary" @click="submitForm" :size="'mini'"
+        >保 存
+      </el-button>
+      <el-button @click="showModelThis = false" v-if="!isDetail" :size="'mini'"
         >关 闭</el-button
       >
     </el-col>
@@ -200,7 +152,6 @@ export default {
         ],
       },
       tableForm: {
-        product_go: [],
         get_product_go: [],
       },
     };
@@ -234,15 +185,16 @@ export default {
           this.$refs.ruleForm.resetFields();
           this.$refs.ruleForm.clearValidate();
           const { info, addrs, orderCode } = this.sitem;
-          console.log(this.sitem)
-          let list =info&&info.length>0?JSON.parse(JSON.stringify(info)):[]; //
+          console.log(this.sitem);
+          let list =
+            info && info.length > 0 ? JSON.parse(JSON.stringify(info)) : []; //
           list.map((v) => {
             v.edit = false;
             v.return_num = v.return_num || "0";
             return v;
           });
-          this.tableForm.product_go = [].concat(...list);
-          let l_list =addrs&&addrs.length>0? JSON.parse(JSON.stringify(addrs)):[];
+          let l_list =
+            addrs && addrs.length > 0 ? JSON.parse(JSON.stringify(addrs)) : [];
           l_list.map((ele) => {
             ele.edit = false;
             ele.return_num = ele.return_num || "0";
@@ -254,7 +206,6 @@ export default {
             errorCode: "", //退货原因
           };
           this.tableForm = {
-            product_go: [].concat(...list),
             get_product_go: [].concat(...l_list),
           };
         }
@@ -266,24 +217,12 @@ export default {
         if (valid) {
           this.loading = true;
           let model = JSON.parse(JSON.stringify(this.ruleForm));
-          let arr = JSON.parse(JSON.stringify(this.tableForm.product_go));
           let arr1 = JSON.parse(JSON.stringify(this.tableForm.get_product_go));
           let wsm_code_edit = false,
             addr_edit = false,
             wsm_code_total = 0,
             addr_total = 0;
-          let list = [];
-          arr.forEach((e) => {
-            if (e.edit) {
-              wsm_code_edit = true;
-            }
-            let obj = {
-              wsm_code: e.wsm_code,
-              return_num: e.return_num,
-            };
-            wsm_code_total += e.return_num;
-            list.push(obj);
-          });
+
           let addr = [];
           arr1.forEach((e) => {
             if (e.edit) {
@@ -296,7 +235,6 @@ export default {
             addr_total += e.return_num;
             addr.push(obj);
           });
-          model.list = list;
           model.addr = addr;
           if (wsm_code_edit) {
             this.$message.warning("仓库信息正在编辑,请保存后再试!");
@@ -337,19 +275,6 @@ export default {
     },
     //保存某一行
     checkRow(rowIndex, type) {
-      if (type === 0) {
-        const { wsend_num, return_num } = this.tableForm.product_go[rowIndex];
-        if (!isnumber(return_num)) {
-          this.$message.warning("退货数量不规范!");
-          return;
-        }
-        if (parseInt(wsend_num) < parseInt(return_num)) {
-          this.$message.warning("退货数量不能大于未发货总数量!");
-          return;
-        }
-        this.tableForm.product_go[rowIndex].edit = false;
-      }
-
       if (type === 1) {
         const { wsend_num, return_num } =
           this.tableForm.get_product_go[rowIndex];
@@ -366,11 +291,7 @@ export default {
     },
     //编辑某一行
     editRow(rowIndex, type) {
-      let list = JSON.parse(
-        JSON.stringify(
-          type === 0 ? this.tableForm.product_go : this.tableForm.get_product_go
-        )
-      );
+      let list = JSON.parse(JSON.stringify(this.tableForm.get_product_go));
       let index = list.findIndex((v) => {
         v.edit;
       });
@@ -378,12 +299,7 @@ export default {
         this.$message.warning("请完成其他行的编辑!");
         return;
       }
-
-      if (type === 0) {
-        this.tableForm.product_go[rowIndex].edit = true;
-      } else {
-        this.tableForm.get_product_go[rowIndex].edit = true;
-      }
+      this.tableForm.get_product_go[rowIndex].edit = true;
     },
   },
 };

+ 3 - 3
src/views/serviceParam/business/addEdit.vue

@@ -44,7 +44,7 @@
                     v-model="organName"
                     disabled
                     :placeholder="organName ? '上级组织' : '暂无上级组织'"
-                    minlength="100"
+                    maxlength="100"
                   />
                 </el-form-item>
               </el-col>
@@ -55,7 +55,7 @@
                     v-model="ruleForm.name"
                     :disabled="isDetail == '007'"
                     placeholder="组织名称"
-                    minlength="50"
+                    maxlength="50"
                   />
                 </el-form-item>
               </el-col>
@@ -65,7 +65,7 @@
                     v-model="ruleForm.companyName"
                     :disabled="isDetail == '007'"
                     placeholder="企业名称"
-                    minlength="50"
+                    maxlength="50"
                     ><template v-if="organName" slot="prepend">{{
                       organName
                     }}</template></el-input

+ 1 - 1
src/views/serviceParam/exclusive/addEdit.vue

@@ -29,7 +29,7 @@
                 v-model="ruleForm.name"
                 :disabled="id == '007'"
                 placeholder="名称"
-                minlength="20"
+                maxlength="20"
               >
                 <template slot="prepend" v-if="pid_name">{{
                   pid_name

+ 1 - 1
src/views/serviceParam/orderuse/addEdit.vue

@@ -29,7 +29,7 @@
                 v-model="ruleForm.order_use"
                 :disabled="id == '007'"
                 placeholder="订单用途"
-                minlength="20"
+                maxlength="20"
               />
             </el-form-item>
           </el-form>

+ 1 - 1
src/views/serviceParam/parameter/addEdit.vue

@@ -29,7 +29,7 @@
                 v-model="ruleForm.parameter_name"
                 :disabled="id == '007'"
                 placeholder="系统参数名称"
-                minlength="20"
+                maxlength="20"
               />
             </el-form-item>
           </el-form>

+ 1 - 1
src/views/serviceParam/terrace/addEdit.vue

@@ -29,7 +29,7 @@
                 v-model="ruleForm.platform_name"
                 :disabled="id == '007'"
                 placeholder="平台名称"
-                minlength="20"
+                maxlength="20"
               />
             </el-form-item>
             <el-form-item label="平台类型" prop="platform_type">

+ 56 - 19
src/views/stock/allot/components/addForm.vue

@@ -7,16 +7,27 @@
         :rules="rulesThis"
         ref="ruleForm"
         :size="'mini'"
-        label-width="60px"
+        label-width="85px"
         class="demo-ruleForm"
       >
         <el-row>
           <el-col :span="12">
             <div class="label-title-model">出库仓库信息:</div>
+            <el-form-item label="业务公司" prop="out_companyNo">
+              <search-work-company
+                  :value="parmValue.out_companyNo"
+                  :names="''"
+                  :size="'mini'"
+                  :is-detail="id !== 'add'"
+                  :placeholder="'业务公司'"
+                  @searchChange="supplierChange($event,'out_companyNo')"
+                />
+            </el-form-item>
             <el-form-item label="公司" prop="supplier_code">
               <search-supplier
                 :value="ruleForm.supplier_code"
                 :placeholder="'请选择公司'"
+                :size="'mini'"
                 :is-detail="id !== 'add'"
                 :disabled="!(id === 'add')"
                 :names="supplier_name"
@@ -28,6 +39,7 @@
                 :value="ruleForm.stock_code"
                 :isDetail="id !== 'add'"
                 :disabled="!(id === 'add')"
+                :size="'mini'"
                 :placeholder="'请选择仓库'"
                 :isRelation="true"
                 :companyCode="supplier_code"
@@ -38,6 +50,17 @@
           </el-col>
           <el-col :span="12">
             <div class="label-title-model">入库仓库信息:</div>
+            <el-form-item label="业务公司" prop="supplier_code">
+              <search-supplier
+                style="width: 100%"
+                :value="ruleForm.supplier_code"
+                :placeholder="'请选择业务公司'"
+                :is-detail="id !== 'add'"
+                :disabled="!(id === 'add')"
+                :names="supplier_name"
+                @searchChange="selectSupplierOut"
+              />
+            </el-form-item>
             <el-form-item label="公司" prop="supplier_in_code">
               <search-supplier
                 :value="ruleForm.supplier_in_code"
@@ -174,22 +197,22 @@
             v-if="status === '0' && powers.some((item) => item == '005')"
             width="80"
           >
-             <template slot="header" slot-scope="scope">
-               <span>操作</span>
-          <el-tooltip
-            style="margin: 3px 0 0 0"
-            effect="dark"
-            class="fr"
-            content="添加"
-            placement="top"
-          >
-            <i
-              class="el-icon-circle-plus-outline tb-icon"
-              style="color: #63cbe7; magin: 0 0 0 10px"
-              @click="openGoodsModel"
-            ></i>
-          </el-tooltip>
-        </template>
+            <template slot="header" slot-scope="scope">
+              <span>操作</span>
+              <el-tooltip
+                style="margin: 3px 0 0 0"
+                effect="dark"
+                class="fr"
+                content="添加"
+                placement="top"
+              >
+                <i
+                  class="el-icon-circle-plus-outline tb-icon"
+                  style="color: #63cbe7; magin: 0 0 0 10px"
+                  @click="openGoodsModel"
+                ></i>
+              </el-tooltip>
+            </template>
             <template slot-scope="scope">
               <el-tooltip
                 effect="dark"
@@ -250,7 +273,7 @@
 </template>
    <script>
 import asyncRequest from "@/apis/service/stock/allot/detail";
-import  searchStockGoodModal  from "@/components/search-stock-good-modal";
+import searchStockGoodModal from "@/components/search-stock-good-modal";
 import resToken from "@/mixins/resToken";
 import { isnumber } from "@/utils/validate";
 import config from "./columns"; //表格列参数
@@ -258,7 +281,7 @@ export default {
   name: "allot",
   props: ["showModel", "id", "sitem", "newTime"],
   mixins: [resToken],
-    components: { searchStockGoodModal },
+  components: { searchStockGoodModal },
   computed: {
     powers() {
       let tran =
@@ -359,6 +382,20 @@ export default {
     closeModel() {
       this.$emit("closeModel");
     },
+
+ //业务公司选择
+    async supplierChange(e,key) {
+      const { code } = e;
+      this.ruleForm[key] = code || ""; //业务公司编码
+      this.parmValue.supplier_code = [];
+      this.supplier_code = "";
+      this.parmValue.stock_code = [];
+      this.stock_code = "";
+      this.parmValue.page = 1;
+      this.pageInfo.curr = 1;
+      await this.searchList();
+    },
+
     openGoodsModel() {
       if (this.ruleForm.stock_code.length === 0) {
         this.$message.warning("请选择出库仓库!");

+ 54 - 67
src/views/stock/allot/index.vue

@@ -57,7 +57,7 @@
                   />
                 </el-col>
 
-                <el-col :span="4" style="width: 260px; padding: 0 0 0 10px">
+                <el-col :span="4" style="width: 235px; padding: 0 0 0 10px">
                   <el-input
                     :size="searchSize"
                     v-model="parmValue.allot_code"
@@ -70,7 +70,7 @@
                   <el-button
                     :size="searchSize"
                     type="primary"
-                    style="float: right; margin-left: 5px"
+                    style="float: right"
                     @click="searchList"
                   >
                     刷新
@@ -78,19 +78,30 @@
                 </el-col>
                 <el-col :span="4" style="width: 66px; float: right">
                   <el-button
-                    style="width: 100%"
                     type="warning"
                     class="mr5"
+                    style="float: right"
                     :size="searchSize"
                     @click="restSearch"
                   >
                     重置
                   </el-button>
                 </el-col>
+                <el-col :span="4" style="width: 66px; float: right">
+                  <el-button
+                    type="success"
+                    class="fr"
+                    style="float: right"
+                    :size="searchSize"
+                    @click="openModal('add', false)"
+                  >
+                    新建
+                  </el-button>
+                </el-col>
               </el-col>
             </el-row>
             <el-row style="padding: 10px 0 0 0">
-              <el-col :span="4" style="width: 165px">
+              <el-col :span="4" style="width: 125px">
                 <el-dropdown @command="handleClick($event)" :size="searchSize">
                   <el-button :size="searchSize">
                     {{ sselect }}
@@ -109,8 +120,17 @@
                   </el-dropdown-menu>
                 </el-dropdown>
               </el-col>
-
-              <el-col :span="4" style="width: 379px; padding: 0 0 0 10px">
+              <el-col :span="12" style="width: 280px; padding: 0 0 0 10px">
+                <search-work-company
+                  :value="parmValue.companyNo"
+                  :names="''"
+                  :size="searchSize"
+                  :is-detail="id !== 'add'"
+                  :placeholder="'业务公司'"
+                  @searchChange="companyNoChange"
+                />
+              </el-col>
+              <el-col :span="4" style="width: 300px; padding: 0 0 0 10px">
                 <search-supplier
                   :size="searchSize"
                   :value="parmValue.supplierNo"
@@ -120,7 +140,7 @@
                   @searchChange="supplierChange"
                 />
               </el-col>
-              <el-col :span="4" style="width: 260px; padding: 0 0 0 10px">
+              <el-col :span="4" style="width: 272px; padding: 0 0 0 10px">
                 <search-stock
                   :size="searchSize"
                   :value="parmValue.stockNo"
@@ -132,20 +152,6 @@
                   @searchChange="stockChange"
                 />
               </el-col>
-              <el-col
-                :span="4"
-                style="width: 66px; padding-left: 10px; float: right"
-              >
-                <el-button
-                  style="width: 100%"
-                  type="success"
-                  class="fr"
-                  :size="searchSize"
-                  @click="openModal('add', false)"
-                >
-                  新建
-                </el-button>
-              </el-col>
             </el-row>
           </div>
         </template>
@@ -234,13 +240,14 @@ export default {
         { id: "5", label: "调拨已完成" },
       ],
       statusList: statusList,
-      options: ["按出库公司/仓库筛选", "按入库公司/仓库筛选"],
+      options: ["按出库方筛选", "按入库方筛选"],
       loading: true,
-      sselect: "按出库公司/仓库筛选",
+      sselect: "按出库筛选",
       showModel: false,
       isDetail: false,
       modelId: 0,
       parmValue: {
+        companyNo: "",
         start: "", //开始日期
         end: "", //结束日期
         allot_code: "", //调拨编号
@@ -267,35 +274,25 @@ export default {
     };
   },
   mounted() {
-    this.sselect = "按出库公司/仓库筛选";
+    this.sselect = "按出库筛选";
     this.searchList();
   },
 
   methods: {
     // 时间选择
     async handleTime(val) {
-      if (val.startTime !== "") {
-        this.parmValue.start = val.startTime;
-      } else {
-        this.parmValue.start = "";
-      }
-      if (val.endTime !== "") {
-        this.parmValue.end = val.endTime;
-      } else {
-        this.parmValue.end = "";
-      }
-      if (this.parmValue.start !== "" && this.parmValue.end !== "") {
-        this.parmValue.page = 1;
-        this.pageInfo.curr = 1;
-        await this.searchList();
-      }
+      this.parmValue.start = val.startTime || "";
+      this.parmValue.end = val.endTime || "";
+      this.parmValue.page = 1;
+      this.pageInfo.curr = 1;
+      await this.searchList();
     },
     handleClick(e) {
       this.sselect = e;
     },
     // 重置搜索框
     restSearch() {
-      this.sselect = "按出库公司/仓库筛选";
+      this.sselect = "按出库方筛选";
       this.supplierNo = "";
       // 表格 - 分页
       this.pageInfo = {
@@ -304,6 +301,7 @@ export default {
         total: 0,
       };
       this.parmValue = {
+        companyNo: "",
         start: "", //开始日期
         end: "", //结束日期
         allot_code: "", //调拨编号
@@ -314,27 +312,24 @@ export default {
       };
       this.searchList();
     },
+    //业务公司选择
+    async companyNoChange(e) {
+      const { code } = e;
+      this.parmValue.companyNo = code || ""; //业务公司编码
+      this.parmValue.page = 1;
+      this.pageInfo.curr = 1;
+      await this.searchList();
+    },
     async supplierChange(e) {
-      if (e && e.id) {
-        this.parmValue.supplierNo = [e.code];
-        this.supplierNo = e.code;
-      } else {
-        this.parmValue.supplierNo = [];
-        this.supplierNo = "";
-      }
-      this.parmValue.stockNo = [];
+      const { code } = e;
+      this.parmValue.supplierNo = code ? [code] : []; //供应商编码
       this.parmValue.page = 1;
       this.pageInfo.curr = 1;
       await this.searchList();
     },
     async stockChange(e) {
-      if (e && e.id) {
-        this.parmValue.stockNo = [e.code];
-      } else {
-        this.parmValue.stockNo = [];
-      }
-
-      console.log(e);
+      const { code } = e;
+      this.parmValue.stockNo = code ? [code] : [];
       this.parmValue.page = 1;
       this.pageInfo.curr = 1;
       await this.searchList();
@@ -346,26 +341,18 @@ export default {
     },
     // 获取调拨列表
     async searchList() {
-      if (
-        (this.parmValue.start !== "" && this.parmValue.end === "") ||
-        (this.parmValue.start === "" && this.parmValue.end !== "")
-      ) {
-        this.$message.warning("时间区间不完整!");
-        return;
-      }
       this.loading = true;
-
       let model = JSON.parse(JSON.stringify(this.parmValue));
       let supplierNo = model.supplierNo.length == 1 ? model.supplierNo[0] : "",
         stockNo = model.stockNo.length == 1 ? model.stockNo[0] : "";
       delete model["supplierNo"];
       delete model["stockNo"];
-      model.wsm_out = this.sselect == "按出库公司/仓库筛选" ? stockNo : "";
-      model.wsm_in = this.sselect != "按出库公司/仓库筛选" ? stockNo : "";
+      model.wsm_out = this.sselect == "按出库方筛选" ? stockNo : "";
+      model.wsm_in = this.sselect != "按出库筛选" ? stockNo : "";
       model.wsm_out_supplierNo =
-        this.sselect == "按出库公司/仓库筛选" ? supplierNo : "";
+        this.sselect == "按出库筛选" ? supplierNo : "";
       model.wsm_in_supplierNo =
-        this.sselect != "按出库公司/仓库筛选" ? supplierNo : "";
+        this.sselect != "按出库筛选" ? supplierNo : "";
       const res = await asyncRequest.list(model);
       if (res && res.code === 0 && res.data) {
         this.tableData = res.data.list;

+ 51 - 47
src/views/stock/stockCount/components/dataWeido/index.vue

@@ -27,10 +27,21 @@
           <div style="width: 100%">
             <el-row style="padding: 0 0 0 80px">
               <el-col :span="24">
-                <el-col :span="12" style="width: 300px; padding: 0">
+                <el-col :span="12" style="width: 300px">
+                  <search-work-company
+                    :value="parmValue.companyNo"
+                    :names="''"
+                    :size="searchSize"
+                    :is-detail="id !== 'add'"
+                    :placeholder="'业务公司'"
+                    @searchChange="supplierChange"
+                  />
+                </el-col>
+                <el-col :span="12" style="width: 300px; padding: 0 0 0 10px">
                   <search-supplier
                     :size="searchSize"
                     :placeholder="'供应商公司'"
+                    :disabled="parmValue.companyNo === ''"
                     :value="parmValue.supplier_code"
                     @searchChange="selectSupplier"
                   />
@@ -40,7 +51,7 @@
                     :isDetail="true"
                     :size="searchSize"
                     :value="parmValue.stock_code"
-                    :disabled="isDisabled"
+                    :disabled="supplier_code === ''"
                     :placeholder="'出库仓库'"
                     :isRelation="true"
                     :companyCode="supplier_code"
@@ -77,62 +88,51 @@
             </el-row>
           </div>
         </template>
-               
         <template #expand="{ scope }">
-                   
           <el-table
             :data="scope.row.child"
             style="width: 100%; paddind: 20px"
             border
             size="small"
           >
-                       
             <el-table-column
               label="商品编码"
               prop="good_code"
               width="150"
             ></el-table-column>
-                       
             <el-table-column
               label="属性编码"
               prop="good_type_code"
               width="130"
             ></el-table-column>
-                       
             <el-table-column
               label="商品名称"
               prop="good_name"
               min-width="150"
               :show-overflow-tooltip="true"
             ></el-table-column>
-                       
             <el-table-column
               label="商品属性"
               prop="attribute"
               min-width="120"
               :show-overflow-tooltip="true"
             ></el-table-column>
-                       
             <el-table-column
               label="分类"
               prop="sort_f"
               width="100"
             ></el-table-column>
-                       
             <el-table-column
               label="可用库存"
               prop="usable_stock"
               width="80"
             ></el-table-column>
-                       
             <el-table-column
               label="在途库存"
               prop="intra_stock"
               width="80"
             ></el-table-column>
-                     
           </el-table>
-                 
         </template>
       </ex-table>
       <add-edit
@@ -176,10 +176,11 @@ export default {
   },
   data() {
     return {
-      loading:false,
+      loading: false,
       stock_code: "",
       supplier_code: "",
       parmValue: {
+        companyNo: "",
         supplier_code: [],
         stock_code: [],
         page: 1, // 页码
@@ -209,35 +210,39 @@ export default {
   },
 
   methods: {
+    //业务公司选择
+    async supplierChange(e) {
+      const { code } = e;
+      this.parmValue.companyNo = code || ""; //业务公司编码
+      this.parmValue.supplier_code = [];
+      this.supplier_code = "";
+      this.parmValue.stock_code = [];
+      this.stock_code = "";
+      this.parmValue.page = 1;
+      this.pageInfo.curr = 1;
+      await this.searchList();
+    },
     // 选择供应商仓库
-    selectStock(e) {
-      if (e && e.id) {
-        this.parmValue.stock_code = [e.code];
-        this.stock_code = e.code;
-      } else {
-        this.parmValue.stock_code = [];
-        this.stock_code = "";
-      }
-      if (this.parmValue.stock_code) {
-        this.searchList();
-      }
+    async selectStock(e) {
+      const { code } = e;
+      this.parmValue.stock_code = code ? [code] : [];
+      this.stock_code = code || "";
+      this.parmValue.stock_code = [];
+      this.stock_code = "";
+      this.parmValue.page = 1;
+      this.pageInfo.curr = 1;
+      await this.searchList();
     },
     // 选择供应商
-    selectSupplier(e) {
-      if (e && e.id) {
-        this.parmValue.supplier_code = [e.code];
-        this.supplier_code = e.code;
-        this.isDisabled = false;
-      } else {
-        this.parmValue.stock_code = [];
-        this.parmValue.supplier_code = [];
-        this.stock_code = "";
-        this.supplier_code = "";
-        this.isDisabled = true;
-      }
-      if (this.parmValue.supplier_code) {
-        this.searchList();
-      }
+    async selectSupplier(e) {
+      const { code } = e;
+      this.parmValue.supplier_code = code ? [code] : [];
+      this.supplier_code = code || "";
+      this.parmValue.stock_code = [];
+      this.stock_code = "";
+      this.parmValue.page = 1;
+      this.pageInfo.curr = 1;
+      await this.searchList();
     },
     restSearch() {
       // 表格 - 分页
@@ -247,6 +252,7 @@ export default {
         total: 0,
       };
       this.parmValue = {
+        companyNo: "",
         supplier_code: [],
         stock_code: [], //仓库编码
         page: 1, // 页码
@@ -256,13 +262,11 @@ export default {
     },
     async searchList() {
       this.loading = true;
-      let { page, size, stock_code, supplier_code } = this.parmValue;
-      let model = {
-        page,
-        size,
-        wsm_code: stock_code != [] ? stock_code.toString() : "",
-        supplier_code: supplier_code != "" ? supplier_code.toString() : "",
-      };
+      let model = JSON.parse(JSON.stringify(this.parmValue));
+      model.supplierNo = model.supplier_code.toString() || "";
+      model.wsm_code = model.stock_code.toString() || "";
+      delete model["supplier_code"];
+      delete model["stock_code"];
       const res = await asyncRequest.list(model);
       if (res && res.code === 0 && res.data) {
         this.tableData = res.data.list;

+ 94 - 107
src/views/stock/stockCount/components/spaceCount/index.vue

@@ -26,58 +26,7 @@
         <template #table-header="{}">
           <div style="width: 100%" class="min">
             <el-row style="padding: 0 0 0 80px">
-              <el-col :span="24">
-                <el-col :span="24">
-                  <el-col :span="12" style="width: 300px; padding: 0">
-                    <search-supplier
-                      :size="searchSize"
-                      :placeholder="'供应商公司'"
-                      :value="parmValue.supplier_code"
-                      @searchChange="selectSupplier"
-                    />
-                  </el-col>
-                  <el-col :span="12" style="width: 200px; padding-left: 10px">
-                    <search-stock
-                      :isDetail="true"
-                      :size="searchSize"
-                      :value="parmValue.stock_code"
-                      :disabled="isDisabled"
-                      :placeholder="'出库仓库'"
-                      :isRelation="true"
-                      :companyCode="supplier_code"
-                      :names="''"
-                      @searchChange="selectStock"
-                    />
-                  </el-col>
-                  <!-- 重置 -->
-                  <el-col :span="4" style="width: 54px; margin-left: 10px">
-                    <el-button
-                      :size="searchSize"
-                      class="fl"
-                      type="warning"
-                      @click="restSearch"
-                      >重置</el-button
-                    >
-                  </el-col>
-                  <!-- 刷新 -->
-                  <el-col
-                    :span="4"
-                    style="width: 54px; margin-left: 10px"
-                    class="fr"
-                  >
-                    <el-button
-                      :size="searchSize"
-                      type="primary"
-                      label=""
-                      @click="searchList"
-                      >刷新</el-button
-                    >
-                  </el-col>
-                </el-col>
-              </el-col>
-            </el-row>
-            <el-row>
-              <el-col :span="6" style="width: 303px; padding: 10px 0 0 0">
+              <el-col :span="6" style="width: 303px; padding: 0 0 0 0">
                 <period-date-picker
                   :start="parmValue.start"
                   :end="parmValue.end"
@@ -86,23 +35,67 @@
                   @timeReturned="handleTime"
                 />
               </el-col>
-              <el-col :span="10" style="width: 290px; padding-top: 10px">
+              <el-col :span="10" style="width: 290px">
                 <el-input
                   v-model="parmValue.type_code"
                   :size="searchSize"
                   placeholder="商品属性编码"
                 />
               </el-col>
-              <!-- 搜索 -->
-              <el-col :span="4" style="width: 54px; padding: 10px 0 0 0px">
+
+              <!-- 刷新 -->
+              <el-col :span="4" style="width: 66px" class="fr">
                 <el-button
                   :size="searchSize"
                   type="primary"
-                  class="fr"
-                  icon="el-icon-search"
                   label=""
                   @click="searchList"
-                ></el-button>
+                  >刷新</el-button
+                >
+              </el-col>
+              <!-- 重置 -->
+              <el-col :span="4" style="width: 66px" class="fr">
+                <el-button
+                  :size="searchSize"
+                  class="fl"
+                  type="warning"
+                  @click="restSearch"
+                  >重置</el-button
+                >
+              </el-col>
+            </el-row>
+            <el-row style="padding: 10px 0 0 0">
+              <el-col :span="12" style="width: 280px">
+                <search-work-company
+                  :value="parmValue.companyNo"
+                  :names="''"
+                  :size="searchSize"
+                  :is-detail="id !== 'add'"
+                  :placeholder="'业务公司'"
+                  @searchChange="supplierChange"
+                />
+              </el-col>
+              <el-col :span="12" style="width: 310px; padding: 0 0 0 10px">
+                <search-supplier
+                  :size="searchSize"
+                  :placeholder="'供应商公司'"
+                  :disabled="parmValue.companyNo === ''"
+                  :value="parmValue.supplier_code"
+                  @searchChange="selectSupplier"
+                />
+              </el-col>
+              <el-col :span="12" style="width: 310px; padding-left: 10px">
+                <search-stock
+                  :isDetail="true"
+                  :size="searchSize"
+                  :value="parmValue.stock_code"
+                  :disabled="supplier_code === ''"
+                  :placeholder="'出库仓库'"
+                  :isRelation="true"
+                  :companyCode="supplier_code"
+                  :names="''"
+                  @searchChange="selectStock"
+                />
               </el-col>
             </el-row>
           </div>
@@ -155,6 +148,7 @@ export default {
       parmValue: {
         supplier_code: [], //供应商编码
         stock_code: [], //仓库编码
+        companyNo: "",
         start: "",
         end: "",
         type_code: "", //商品编码
@@ -185,48 +179,47 @@ export default {
   },
 
   methods: {
+    //业务公司选择
+    async supplierChange(e) {
+      const { code } = e;
+      this.parmValue.companyNo = code || ""; //业务公司编码
+      this.parmValue.supplier_code = [];
+      this.supplier_code = "";
+      this.parmValue.stock_code = [];
+      this.stock_code = "";
+      this.parmValue.page = 1;
+      this.pageInfo.curr = 1;
+      await this.searchList();
+    },
     // 选择时间操作
-    handleTime(e) {
-      if (e && e.startTime && e.endTime) {
-        this.parmValue.start = e.startTime;
-        this.parmValue.end = e.endTime;
-      } else {
-        this.parmValue.start = "";
-        this.parmValue.end = "";
-      }
-      if (this.parmValue.start != "" && this.parmValue.end) {
-        this.searchList();
-      }
+    async handleTime(e) {
+      this.parmValue.start = e.startTime || "";
+      this.parmValue.end = e.endTime || "";
+      this.parmValue.page = 1;
+      this.pageInfo.curr = 1;
+      await this.searchList();
     },
     // 选择供应商仓库
-    selectStock(e) {
-      if (e && e.id) {
-        this.parmValue.stock_code = [e.code];
-        this.stock_code = e.code;
-      } else {
-        this.parmValue.stock_code = [];
-        this.stock_code = "";
-      }
-      if (this.parmValue.stock_code) {
-        this.searchList();
-      }
+    async selectStock(e) {
+      const { code } = e;
+      this.parmValue.stock_code = code ? [code] : [];
+      this.stock_code = code || "";
+      this.parmValue.stock_code = [];
+      this.stock_code = "";
+      this.parmValue.page = 1;
+      this.pageInfo.curr = 1;
+      await this.searchList();
     },
     // 选择供应商
-    selectSupplier(e) {
-      if (e && e.id) {
-        this.parmValue.supplier_code = [e.code];
-        this.supplier_code = e.code;
-        this.isDisabled = false;
-      } else {
-        this.parmValue.stock_code = [];
-        this.parmValue.supplier_code = [];
-        this.stock_code = "";
-        this.supplier_code = "";
-        this.isDisabled = true;
-      }
-      if (this.parmValue.supplier_code) {
-        this.searchList();
-      }
+    async selectSupplier(e) {
+      const { code } = e;
+      this.parmValue.supplier_code = code ? [code] : [];
+      this.supplier_code = code || "";
+      this.parmValue.stock_code = [];
+      this.stock_code = "";
+      this.parmValue.page = 1;
+      this.pageInfo.curr = 1;
+      await this.searchList();
     },
     restSearch() {
       // 表格 - 分页
@@ -238,6 +231,7 @@ export default {
       this.parmValue = {
         start: "",
         end: "",
+        companyNo: "",
         type_code: "", //商品编码
         supplier_code: [],
         stock_code: [], //仓库编码
@@ -249,18 +243,11 @@ export default {
 
     async searchList() {
       this.loading = true;
-      let { page, size, stock_code, supplier_code, type_code, start, end } =
-        this.parmValue;
-      let model = {
-        type_code,
-        page,
-        size,
-        wsm_code: stock_code != [] ? stock_code.toString() : "",
-        suplierNo: supplier_code != "" ? supplier_code.toString() : "",
-        start,
-        end,
-      };
-      console.log(model);
+      let model = JSON.parse(JSON.stringify(this.parmValue));
+      model.supplierNo = model.supplier_code.toString() || "";
+      model.wsm_code = model.stock_code.toString() || "";
+      delete model["supplier_code"];
+      delete model["stock_code"];
       const res = await asyncRequest.list(model);
       if (res && res.code === 0 && res.data) {
         this.tableData = res.data.list;

+ 9 - 6
src/views/stock/stockCount/index.vue

@@ -7,16 +7,19 @@
         <el-row>
           <el-col>
             <el-tabs v-model="activeName">
-              <el-tab-pane label="商品维度" name="productWeido" />
-              <el-tab-pane label="仓库维度" name="dataWeido" />
-              <el-tab-pane label="区间统计" name="count" />
+              <el-tab-pane label="商品维度" name="productWeido"
+                ><product-weido
+              /></el-tab-pane>
+              <el-tab-pane label="仓库维度" name="dataWeido">
+                <data-weido
+              /></el-tab-pane>
+              <el-tab-pane label="区间统计" name="count">
+                <space-count
+              /></el-tab-pane>
             </el-tabs>
           </el-col>
         </el-row>
       </div>
-      <product-weido v-if="activeName === 'productWeido'" />
-      <data-weido v-else-if="activeName === 'dataWeido'" />
-      <space-count v-else />
     </div>
     <div v-else>
       <no-auth></no-auth>

+ 98 - 115
src/views/stock/stockWarning/index.vue

@@ -27,61 +27,18 @@
         <template #table-header="{}">
           <div style="width: 100%" class="min">
             <el-row style="padding: 0 0 0 80px">
-              <el-col :span="24">
-                <el-col :span="12" style="width: 300px; padding: 0">
-                  <search-supplier
-                    :size="searchSize"
-                    :placeholder="'供应商公司'"
-                    :value="parmValue.supplier_code"
-                    @searchChange="selectSupplier"
-                  />
-                </el-col>
-                <el-col :span="12" style="width: 200px; padding-left: 10px">
-                  <search-stock
-                    :isDetail="true"
-                    :size="searchSize"
-                    :value="parmValue.stock_code"
-                    :disabled="isDisabled"
-                    :placeholder="'出库仓库'"
-                    :isRelation="true"
-                    :companyCode="supplier_code"
-                    :names="''"
-                    @searchChange="selectStock"
-                  />
-                </el-col>
-                <el-col style="width: 200px; padding-left: 10px">
-                  <el-input
-                    placeholder="商品编码"
-                    :size="searchSize"
-                    v-model="parmValue.goods_sn"
-                    @blur="searchList"
-                    clearable
-                  />
-                </el-col>
-                <el-col :span="4" style="width: 54px; margin-left: 10px">
-                  <el-button
-                    :size="searchSize"
-                    class="fr"
-                    type="warning"
-                    @click="restSearch"
-                    >重置</el-button
-                  >
-                </el-col>
-                <el-col :span="3" style="width: 56px; float: right">
-                  <el-button
-                    type="primary"
-                    :size="searchSize"
-                    style="float: right; margin-left: 5px"
-                    @click="searchList"
-                  >
-                    刷新
-                  </el-button>
-                </el-col>
+              <el-col :span="12" style="width: 280px">
+                <search-work-company
+                  :value="parmValue.companyNo"
+                  :names="''"
+                  :size="searchSize"
+                  :is-detail="id !== 'add'"
+                  :placeholder="'业务公司'"
+                  @searchChange="supplierChange"
+                />
               </el-col>
-            </el-row>
-            <el-row>
-              <el-col :span="6" style="width: 273px; padding: 10px 0 0 0px">
-                <num-ber-range
+              <el-col :span="6" style="width: 273px; padding: 0 0 0 10px">
+                <number-range
                   :lower="parmValue.stock_num_low"
                   :online="parmValue.stock_num_up"
                   :title="'库存量'"
@@ -90,27 +47,61 @@
                   @numReturned="numReturned($event, 0)"
                 />
               </el-col>
-              <el-col :span="6" style="width: 303px; padding-top: 10px">
-                <num-ber-range
+              <el-col :span="6" style="width: 273px; padding: 0 0 0 10px">
+                <number-range
                   :lower="parmValue.warn_num_low"
                   :online="parmValue.warn_num_up"
-                  :width="'135px'"
+                  :width="'120px'"
                   :title="'预警量'"
                   :size="searchSize"
                   @numReturned="numReturned1($event, 0)"
                 />
               </el-col>
-              <el-col :span="4" style="width: 44px; padding-top: 10px">
+              <el-col :span="3" style="width: 66px; float: right">
                 <el-button
-                  style="width: 100%"
                   type="primary"
-                  icon="el-icon-search"
                   :size="searchSize"
+                  style="float: right; margin-left: 5px"
                   @click="searchList"
                 >
+                  刷新
                 </el-button>
               </el-col>
             </el-row>
+            <el-row style="padding: 10px 0 0 0">
+              <el-col :span="12" style="width: 360px">
+                <search-supplier
+                  :size="searchSize"
+                  :disabled="parmValue.companyNo === ''"
+                  :placeholder="'供应商公司'"
+                  :value="parmValue.supplier_code"
+                  @searchChange="selectSupplier"
+                />
+              </el-col>
+              <el-col :span="12" style="width: 380px; padding-left: 10px">
+                <search-stock
+                  :isDetail="true"
+                  :size="searchSize"
+                  :value="parmValue.stock_code"
+                  :disabled="supplier_code === ''"
+                  :placeholder="'出库仓库'"
+                  :isRelation="true"
+                  :companyCode="supplier_code"
+                  :names="''"
+                  @searchChange="selectStock"
+                />
+              </el-col>
+
+              <el-col :span="4" style="width: 66px; float: right">
+                <el-button
+                  :size="searchSize"
+                  class="fr"
+                  type="warning"
+                  @click="restSearch"
+                  >重置</el-button
+                >
+              </el-col>
+            </el-row>
           </div>
         </template>
         <template #status="{ scope }">
@@ -216,6 +207,7 @@ export default {
       isDetail: false,
       modelId: 0,
       parmValue: {
+        companyNo: "",
         goods_sn: "",
         supplier_code: [],
         stock_code: [],
@@ -223,6 +215,8 @@ export default {
         warn_num_up: "",
         stock_num_low: "",
         stock_num_up: "",
+        page: 1,
+        size: 15,
       },
       // 表格 - 数据
       tableData: [],
@@ -247,38 +241,42 @@ export default {
   },
 
   methods: {
+    //业务公司选择
+    async supplierChange(e) {
+      const { code } = e;
+      this.parmValue.companyNo = code || ""; //业务公司编码
+      this.parmValue.supplier_code = [];
+      this.supplier_code = "";
+      this.parmValue.stock_code = [];
+      this.stock_code = "";
+      this.parmValue.page = 1;
+      this.pageInfo.curr = 1;
+      await this.searchList();
+    },
     // 选择供应商仓库
-    selectStock(e) {
-      if (e && e.id) {
-        this.parmValue.stock_code = [e.code];
-        this.stock_code = e.code;
-      } else {
-        this.parmValue.stock_code = [];
-        this.stock_code = "";
-      }
-      if (this.parmValue.stock_code) {
-        this.searchList();
-      }
+    async selectStock(e) {
+      const { code } = e;
+      this.parmValue.stock_code = code ? [code] : [];
+      this.stock_code = code || "";
+      this.parmValue.stock_code = [];
+      this.stock_code = "";
+      this.parmValue.page = 1;
+      this.pageInfo.curr = 1;
+      await this.searchList();
     },
     // 选择供应商
-    selectSupplier(e) {
-      if (e && e.id) {
-        this.parmValue.supplier_code = [e.code];
-        this.supplier_code = e.code;
-        this.isDisabled = false;
-      } else {
-        this.parmValue.stock_code = [];
-        this.parmValue.supplier_code = [];
-        this.stock_code = "";
-        this.supplier_code = "";
-        this.isDisabled = true;
-      }
-      if (this.parmValue.supplier_code) {
-        this.searchList();
-      }
+    async selectSupplier(e) {
+      const { code } = e;
+      this.parmValue.supplier_code = code ? [code] : [];
+      this.supplier_code = code || "";
+      this.parmValue.stock_code = [];
+      this.stock_code = "";
+      this.parmValue.page = 1;
+      this.pageInfo.curr = 1;
+      await this.searchList();
     },
     // 预警量范围框
-    numReturned1(e) {
+    async numReturned1(e) {
       if (e && e.lower != "" && e.online != "") {
         this.parmValue.warn_num_low = e.lower;
         this.parmValue.warn_num_up = e.online;
@@ -290,11 +288,11 @@ export default {
         this.parmValue.warn_num_low != "" &&
         this.parmValue.warn_num_up != ""
       ) {
-        this.searchList();
+        await this.searchList();
       }
     },
     // 库存量范围框
-    numReturned(e) {
+    async numReturned(e) {
       if (e && e.lower != "" && e.online != "") {
         this.parmValue.stock_num_low = e.lower;
         this.parmValue.stock_num_up = e.online;
@@ -306,11 +304,11 @@ export default {
         this.parmValue.stock_num_low != "" &&
         this.parmValue.stock_num_up != ""
       ) {
-        this.searchList();
+        await this.searchList();
       }
     },
     // 重置搜索栏
-    restSearch() {
+    async restSearch() {
       // 表格 - 分页
       this.pageInfo = {
         size: 15,
@@ -318,6 +316,7 @@ export default {
         total: 0,
       };
       this.parmValue = {
+        companyNo: "",
         goods_sn: "",
         supplier_code: [],
         stock_code: [],
@@ -325,8 +324,10 @@ export default {
         warn_num_up: "",
         stock_num_low: "",
         stock_num_up: "",
+        page: 1,
+        size: 15,
       };
-      this.searchList();
+      await this.searchList();
     },
 
     openModal(id, isDetail, sitem) {
@@ -338,29 +339,11 @@ export default {
 
     async searchList() {
       this.loading = true;
-      const {
-        supplier_code,
-        stock_code,
-        goods_sn,
-        stock_num_low,
-        stock_num_up,
-        warn_num_low,
-        warn_num_up,
-      } = JSON.parse(JSON.stringify(this.parmValue));
-      let model = {
-        supplierNo: supplier_code.toString() || "",
-        wsm_code: stock_code.toString() || "",
-        page: 1,
-        size: 15,
-        stock_low: stock_num_low,
-        stock_up: stock_num_up,
-        warn_low: warn_num_low,
-        warn_up: warn_num_up,
-        good_code: goods_sn,
-        good_name: "",
-        type_code: "",
-      };
-
+      let model = JSON.parse(JSON.stringify(this.parmValue));
+      model.supplierNo = model.supplier_code.toString() || "";
+      model.wsm_code = model.stock_code.toString() || "";
+      delete model["supplier_code"];
+      delete model["stock_code"];
       const res = await asyncRequest.list(model);
       if (res && res.code === 0 && res.data) {
         res.data.list.forEach((element) => {

+ 29 - 28
src/views/stock/survey/index.vue

@@ -5,10 +5,10 @@
     >
       <div style="width: 100%">
         <el-row style="padding: 15px 0 0 0px">
-          <el-col :span="12" style="width: 290px;">
+          <el-col :span="12" style="width: 290px">
             <search-work-company
-              :value="parmValue.supplierNo"
-              :names="supplier_name"
+              :value="parmValue.companyNo"
+              :names="''"
               :size="searchSize"
               :is-detail="id !== 'add'"
               :disabled="isDetail"
@@ -20,6 +20,7 @@
             <search-supplier
               :size="searchSize"
               :placeholder="'供应商公司'"
+              :disabled="parmValue.companyNo === ''"
               :value="parmValue.supplier_code"
               @searchChange="selectSupplier"
             />
@@ -141,7 +142,7 @@ export default {
       stock_code: "",
       supplier_code: "",
       parmValue: {
-        supplierNo:[],
+        companyNo: "",
         supplier_code: [],
         stock_code: [],
         page: 1,
@@ -267,39 +268,38 @@ export default {
   },
 
   methods: {
+    //业务公司选择
+    supplierChange(e) {
+      const { code } = e;
+      this.parmValue.companyNo = code || ""; //供应商编码
+      this.parmValue.supplier_code = [];
+      this.supplier_code = "";
+      this.parmValue.stock_code = [];
+
+      this.parmValue.page = 1;
+      this.pageInfo.curr = 1;
+      this.stockList();
+      this.searchList();
+    },
     // 选择供应商
     selectSupplier(e) {
-      if (e && e.id) {
-        this.parmValue.supplier_code = [e.code];
-        this.supplier_code = e.code;
-      } else {
-        this.parmValue.stock_code = [];
-        this.parmValue.supplier_code = [];
-        this.stock_code = "";
-        this.supplier_code = "";
-      }
+      const { code } = e;
+      this.parmValue.supplier_code = code ? [code] : [];
+      this.supplier_code = code;
+      this.parmValue.stock_code = [];
+      this.stock_code = "";
       this.parmValue.page = 1;
       this.pageInfo.curr = 1;
       this.stockList();
       this.searchList();
     },
-       //供应商公司选择
-    supplierChange(e) {
-      if (e && e.id) {
-        this.parmValue.supplierNo = [e.code]; //供应商编码
-      } else {
-        this.parmValue.supplierNo = [];
-      }
-    },
+
     // 选择供应商仓库
     selectStock(e) {
-      if (e && e.id) {
-        this.parmValue.stock_code = [e.code];
-        this.stock_code = e.code;
-      } else {
-        this.parmValue.stock_code = [];
-        this.stock_code = "";
-      }
+      const { code } = e;
+      this.parmValue.stock_code = code ? [code] : [];
+      this.stock_code = code || "";
+
       this.parmValue.page = 1;
       this.pageInfo.curr = 1;
       this.stockList();
@@ -309,6 +309,7 @@ export default {
     //获取表格上方的卡片数据
     async stockList() {
       let model = {
+        companyNo: this.parmValue.companyNo,
         supplier_code: this.supplier_code,
         stock_code: this.stock_code,
       };

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini