Browse Source

Merge branch 'moss_bug' into develop

* moss_bug:
  feat:商品与物料的绑定关系,支持不选物料也能上架物料
  师傅管理绑定师傅修改
  销售单工程保存地址修改
  销售订单提交修改

# Conflicts:
#	src/views/auxiliaryFittings/salesManagement/components/attachmentSalesOrderDetail.vue
Moss 1 year ago
parent
commit
02cb92b6bb

+ 9 - 0
src/api/goods.js

@@ -367,4 +367,13 @@ export function getGoodsSpecList(params) {
     method: 'post',
     method: 'post',
     params
     params
   })
   })
+}
+
+// 获取大类列表
+export function getMainList(params) {
+  return request({
+    url: '/goods/category/list',
+    method: 'get',
+    params
+  })
 }
 }

+ 3 - 1
src/views/auxiliaryFittings/salesManagement/components/attachmentSalesOrderDetail.vue

@@ -642,7 +642,9 @@
 							salesType: this.formData.salesType
 							salesType: this.formData.salesType
 						}).then(res => {
 						}).then(res => {
 							if(res.code == 200){
 							if(res.code == 200){
-								this.confirmSubmit()
+								this.$nextTick(() => {
+									that.confirmSubmit()
+								})
 							}
 							}
 						})
 						})
 					}
 					}

+ 66 - 22
src/views/mallManagement/goods/goods_add/index.vue

@@ -163,24 +163,56 @@
             highlight-current-row
             highlight-current-row
             stripe
             stripe
             style="margin-bottom: 20px">
             style="margin-bottom: 20px">
-            <el-table-column align="center" label="大类" prop="mainName" min-width="120">
+            <el-table-column align="center" label="大类" prop="mainId" min-width="120">
               <template slot-scope="scope">
               <template slot-scope="scope">
-                {{scope.row.mainName}}
+                <el-select
+                  size="small"
+                  v-model="scope.row.mainId"
+                  filterable
+                  placeholder="请选择"
+                  :disabled="scope.row.goodsCode != ''"
+                  @change="scope.row.mainName = mainList.find(o => o.categoryId == scope.row.mainId).name">
+                  <el-option
+                    v-for="item in mainList"
+                    :key="item.categoryId"
+                    :label="item.name"
+                    :value="item.categoryId">
+                  </el-option>
+                </el-select>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
-            <el-table-column align="center" label="小类" prop="smallName" min-width="120">
+            <el-table-column align="center" label="小类" prop="smallId" min-width="120">
               <template slot-scope="scope">
               <template slot-scope="scope">
-                {{scope.row.smallName}}
+                <el-select
+                  size="small"
+                  v-model="scope.row.smallId"
+                  filterable
+                  placeholder="请选择"
+                  :disabled="scope.row.goodsCode != ''"
+                  @change="scope.row.smallName = mainList.find(o => o.categoryId == scope.row.mainId).children.find(o => o.categoryId == scope.row.smallId).name">
+                  <el-option
+                    v-for="item in scope.row.mainId ? mainList.find(o => o.categoryId == scope.row.mainId).children : []"
+                    :key="item.categoryId"
+                    :label="item.name"
+                    :value="item.categoryId">
+                  </el-option>
+                </el-select>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
-            <el-table-column align="center" label="商品名称" prop="goodsName" min-width="120">
+            <el-table-column align="center" label="商品名称" prop="specValue" min-width="180">
               <template slot-scope="scope">
               <template slot-scope="scope">
-                {{scope.row.goodsName}}
+                <el-input size="small" v-model="scope.row.specValue" :disabled="scope.row.goodsCode != ''"></el-input>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
-            <el-table-column align="center" label="规格型号" prop="goodsCode" min-width="120">
+            <el-table-column align="center" label="规格型号" prop="goodsCode" min-width="180">
               <template slot-scope="scope">
               <template slot-scope="scope">
-                <el-select size="small" v-model="scope.row.goodsCode" filterable placeholder="请选择" @change="changeSpec(scope.$index, scope.row)">
+                <el-select
+                  size="small"
+                  v-model="scope.row.goodsCode"
+                  filterable
+                  clearable
+                  placeholder="请选择"
+                  @change="changeSpec(scope.$index, scope.row)">
                   <el-option
                   <el-option
                     v-for="item in goodsSpecList"
                     v-for="item in goodsSpecList"
                     :key="item.id"
                     :key="item.id"
@@ -351,7 +383,7 @@
 
 
 <script>
 <script>
 import { getToken } from '@/utils/auth'
 import { getToken } from '@/utils/auth'
-import { getClassifyList, getFreightList, addGoods, editGoods, getGoodsDetail, getModuleList, getTagList, getBrand, getGoodsSpecList } from '@/api/goods'
+import { getClassifyList, getFreightList, addGoods, editGoods, getGoodsDetail, getModuleList, getTagList, getBrand, getGoodsSpecList, getMainList } from '@/api/goods'
 import { getTypeList } from "@/api/workOrder/settlementStandardInstall";
 import { getTypeList } from "@/api/workOrder/settlementStandardInstall";
 import { quillEditor } from 'vue-quill-editor'
 import { quillEditor } from 'vue-quill-editor'
 import 'quill/dist/quill.core.css'
 import 'quill/dist/quill.core.css'
@@ -499,6 +531,8 @@ export default {
       tagList: [],
       tagList: [],
 
 
       showImageListUpload2: false,
       showImageListUpload2: false,
+
+      mainList: [],
     }
     }
   },
   },
 
 
@@ -522,6 +556,7 @@ export default {
     this.getTypeList();
     this.getTypeList();
     this.getBrand();
     this.getBrand();
     this.getGoodsSpecList();
     this.getGoodsSpecList();
+    this.getMainList();
 
 
     if (this.isEdit) {
     if (this.isEdit) {
       this.getGoodsDetail(id);
       this.getGoodsDetail(id);
@@ -625,6 +660,16 @@ export default {
       })
       })
     },
     },
 
 
+    // 获取大类列表
+    getMainList() {
+      getMainList({
+        type: 2,
+        status: true
+      }).then(res => {
+        this.mainList = res.data;
+      })
+    },
+
     // 获取详情
     // 获取详情
     getGoodsDetail(goodsId) {
     getGoodsDetail(goodsId) {
       getGoodsDetail({ goodsId }).then(res => {
       getGoodsDetail({ goodsId }).then(res => {
@@ -654,7 +699,6 @@ export default {
           status: data.status,
           status: data.status,
         }
         }
         data.goodsSpecs.forEach(item => {
         data.goodsSpecs.forEach(item => {
-          item.goodsName = item.goodsMaterialName;
           item.stockQty = item.goodsMaterialStock;
           item.stockQty = item.goodsMaterialStock;
         })
         })
         this.specList = data.goodsSpecs;
         this.specList = data.goodsSpecs;
@@ -693,7 +737,7 @@ export default {
         mainName: '', // 大类名称
         mainName: '', // 大类名称
         smallId: '', // 小类id
         smallId: '', // 小类id
         smallName: '', // 小类名称
         smallName: '', // 小类名称
-        goodsName: '', // 商品名称
+        specValue: '', // 商品名称
         specsName: '', // 规格名称
         specsName: '', // 规格名称
         unit: '', // 单位
         unit: '', // 单位
         price: '', // 销售价格
         price: '', // 销售价格
@@ -717,17 +761,17 @@ export default {
 
 
     // 选择规格型号
     // 选择规格型号
     changeSpec(index, row) {
     changeSpec(index, row) {
-      let item = this.goodsSpecList.find(o => o.id == row.goodsCode);
-      this.specList[index].goodsCode = item.id;
-      this.specList[index].mainId = item.mainId;
-      this.specList[index].mainName = item.mainName;
-      this.specList[index].smallId = item.smallId;
-      this.specList[index].smallName = item.smallName;
-      this.specList[index].goodsName = item.goodsName;
-      this.specList[index].specsName = item.specsName;
-      this.specList[index].unit = item.unit;
-      this.specList[index].costAmount = item.costAmount;
-      this.specList[index].stockQty = item.stockQty;
+      let item = this.goodsSpecList.find(o => o.id == row.goodsCode) || {};
+      this.specList[index].goodsCode = item.id || '';
+      this.specList[index].mainId = item.mainId || '';
+      this.specList[index].mainName = item.mainName || '';
+      this.specList[index].smallId = item.smallId || '';
+      this.specList[index].smallName = item.smallName || '';
+      this.specList[index].specValue = item.goodsName || '';
+      this.specList[index].specsName = item.specsName || '';
+      this.specList[index].unit = item.unit || '';
+      this.specList[index].costAmount = item.costAmount || '';
+      this.specList[index].stockQty = item.stockQty || '';
     },
     },
 
 
     // 点击 提交表单
     // 点击 提交表单