浏览代码

售后需求查询条件增加

8521520123jsy 1 年之前
父节点
当前提交
30380dcf2f

+ 175 - 18
src/BIZComponents/product-list.vue

@@ -4,19 +4,100 @@
     :visible.sync="visible"
     v-if="visible"
     :before-close="handleClose"
-    :close-on-click-modal="false"
     top="5vh"
-    :close-on-press-escape="false"
     append-to-body
     width="70%"
+    :maxable="true"
   >
     <el-card shadow="never">
-      <searchProduct @search="reload"></searchProduct>
-      <ele-split-layout
-        width="244px"
-        allow-collapse
-        :right-style="{ overflow: 'hidden' }"
-      >
+      <searchProduct v-if="dataSources == '1'" @search="reload"></searchProduct>
+      <el-form :model="searchForm" label-width="100px" @submit.native.prevent v-else>
+        <el-row>
+          <el-row>
+            <!-- <el-col :span="6">
+              <el-form-item label="仓库名称:">
+                <el-select v-model="searchForm.warehouseId" style="width: 100%">
+                  <el-option
+                    v-for="item in warehouseList"
+                    :key="item.id"
+                    :value="item.id"
+                    :label="item.name"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+            </el-col> -->
+            <el-col :span="6">
+              <el-form-item label="牌号">
+                <el-input type="text" placeholder="搜索牌号" v-model="searchForm.brandNum"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6" style="height: 43px">
+              <el-form-item label="列表维度:" prop="dimension">
+                <template>
+                  <el-select
+                    style="width: 100%"
+                    @change="changeDimensionHandler"
+                    v-model="dimension"
+                    placeholder="请选择"
+                  >
+                    <el-option label="物料维度" value="4"></el-option>
+                    <el-option label="包装维度" value="3"></el-option>
+                    <el-option label="批次维度" value="2"></el-option>
+                    <el-option label="物品维度" value="1"></el-option>
+                  </el-select>
+                </template>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="物品编码:">
+                <el-input
+                  style="width: 100%"
+                  type="text"
+                  placeholder="搜索物品编码"
+                  v-model="searchForm.categoryCode"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="物品名称:">
+                <el-input
+                  style="width: 100%"
+                  type="text"
+                  placeholder="搜索物品名称"
+                  v-model="searchForm.categoryName"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col style="text-align: right;margin-bottom: 10px;">
+              <el-button type="primary" @click="doSearch">搜索</el-button>
+              <el-button icon="el-icon-refresh-left" @click="reset">重置</el-button>
+            </el-col>
+          </el-row>
+          <!-- <el-row>
+            <el-col :span="6">
+              <el-form-item label="批次号:">
+                <el-input type="text" placeholder="搜索批次号" v-model="searchForm.batchNo"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="刻码">
+                <el-input type="text" placeholder="搜索物品刻码" v-model="searchForm.engrave"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="发货码">
+                <el-input type="text" placeholder="搜索发货码" v-model="searchForm.barcodes"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="牌号">
+                <el-input type="text" placeholder="搜索牌号" v-model="searchForm.brandNum"></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row> -->
+        </el-row>
+      </el-form>
+      <ele-split-layout width="244px" allow-collapse :right-style="{ overflow: 'hidden' }">
         <div class="ele-border-lighter split-layout-right-content">
           <productTree
             @handleNodeClick="handleNodeClick"
@@ -45,14 +126,12 @@
           >
             <!-- 表头工具栏 -->
             <template v-slot:action="{ row }">
-              <el-radio class="radio" v-model="radio" :label="row.code"
-                ><i></i
-              ></el-radio>
+              <el-radio class="radio" v-model="radio" :label="row.code">
+                <i></i>
+              </el-radio>
             </template>
             <template v-slot:cz="{ row }">
-              <el-button type="text" @click="handleDoubleClick(row)">
-                选择Bom
-              </el-button>
+              <el-button type="text" @click="handleDoubleClick(row)">选择Bom</el-button>
             </template>
           </ele-pro-table>
         </template>
@@ -74,6 +153,12 @@
 </template>
 
 <script>
+import {
+  getOutindetailtwoList,
+  getBatchList,
+  getMaterialList,
+  getPackingList
+} from '@/api/wms';
 import {
   getProductList,
   queryLastContractProductList
@@ -142,7 +227,22 @@ export default {
       cBomListDialogFlag: null,
       dictList: {},
       selection: [],
-      ids: []
+      ids: [],
+      dataSources: '1', // 0:仓库;1:主数据
+      dimension: '1',
+      searchForm: {
+        categoryCode: '',
+        categoryName: '',
+        batchNo: '',
+        brandNum: '',
+        engrave: '',
+        barcodes: '',
+        categoryLevelId: '',
+        warehouseId: '',
+        pageNum: 1,
+        size: 10
+      },
+      datasourceList: []
     };
   },
   watch: {},
@@ -318,13 +418,18 @@ export default {
         };
       });
     },
-    open(item, currentIndex) {
+    open(item, currentIndex, value) {
+      this.dataSources = value || '1';
       this.currentIndex = currentIndex;
       this.visible = true;
       this.getDictList('productionType');
     },
     /* 表格数据源 */
     datasource({ page, limit, where, order }) {
+     if(this.dataSources == '0'){
+      this.searchForm.pageNum = page;
+      return this.changeDimension(this.dimension);
+     }
       return getProductList({
         pageNum: page,
         size: limit,
@@ -347,7 +452,7 @@ export default {
     /* 刷新表格 */
     reload(where) {
       where.categoryLevelId = this.curNodeData?.id;
-
+      this.searchForm.categoryLevelId = this.curNodeData?.id;
       this.$refs.table.reload({ pageNum: 1, where: where });
     },
 
@@ -442,9 +547,61 @@ export default {
           }
         });
       }
-      console.log(list, 'list');
       this.$emit('changeParent', list, this.currentIndex);
       this.handleClose();
+    },
+    // 仓库查询
+    doSearch() {
+    // this.searchForm.pageNum = 1;
+     this.reload({pageNum: 1, where: this.searchForm})
+    },
+
+    // 仓库查询重置
+    reset() {
+      this.searchForm = {
+        categoryCode: '',
+        categoryName: '',
+        batchNo: '',
+        brandNum: '',
+        engrave: '',
+        barcodes: '',
+        categoryLevelId: this.categoryLevelId,
+        pageNum: 1,
+        warehouseId: '',
+        size: 10
+      };
+      this.doSearch();
+    },
+    // 切换维度
+    changeDimensionHandler(e) {
+      // this.searchForm.pageNum = 1;
+      // this.selectionList = [];
+      // this.$refs.multipleTable.clearSelection();
+      this.reload({pageNum: 1, where: this.searchForm});
+    },
+    // 仓库数据
+    async changeDimension(e) {
+      this.dimension = e;
+      let data = [];
+      if (this.dimension == 1) {
+        // 物品维度
+         data = await getOutindetailtwoList(this.searchForm);
+      } else if (this.dimension == 2) {
+        // 批次维度
+         data = await getBatchList(this.searchForm);
+      } else if (this.dimension == 4) {
+        // 物料维度
+         data = await getMaterialList(this.searchForm);
+      } else {
+        // 包装维度
+         data = await getPackingList(this.searchForm);
+      }
+      data.list.map((el)=>{
+        el.modelType = el.categoryModel;
+        el.name = el.categoryName;
+        el.code = el.categoryCode;
+      })
+      return data
     }
   }
 };

+ 27 - 10
src/views/salesServiceManagement/accessory/components/spareInfo.vue

@@ -1,6 +1,6 @@
 <template>
   <el-form ref="spareInfoRef">
-    <headerTitle :title=title style="margin-top: 15px"></headerTitle>
+    <headerTitle :title="title" style="margin-top: 15px"></headerTitle>
     <ele-pro-table
       ref="table"
       :columns="columns"
@@ -35,8 +35,13 @@
           :disabled="types == 'view'"
         />
       </template>
-      <template v-slot:action="{ row }">
-        <el-popconfirm v-if="types != 'view'" class="ele-action" title="确定要删除吗?" @confirm="del(row.id)">
+      <template v-slot:action="{ row,$index }">
+        <el-popconfirm
+          v-if="types != 'view'"
+          class="ele-action"
+          title="确定要删除吗?"
+          @confirm="del(row.id,$index)"
+        >
           <template v-slot:reference>
             <el-link type="danger" :underline="false" icon="el-icon-delete">删除</el-link>
           </template>
@@ -49,6 +54,7 @@
 
 <script>
 import AssetsDialog from '../../components/AssetsDialog.vue';
+// import { parameterGetByCode } from '@/api/main/index.js';
 export default {
   components: {
     AssetsDialog
@@ -62,7 +68,7 @@ export default {
       type: String,
       default: ''
     },
-    title:{
+    title: {
       type: String,
       default: '配件信息'
     }
@@ -164,7 +170,7 @@ export default {
       ]
     };
   },
-  mounted(){
+  mounted() {
     this.tableList = this.detailList;
   },
   methods: {
@@ -180,11 +186,22 @@ export default {
         );
       }
     },
-    del(id) {
-      this.tableList = this.tableList.filter((item) => item.id != id);
+    del(id, index) {
+      console.log(index,'index')
+      console.log(this.tableList, 'this.tableList');
+      // this.tableList = this.tableList.filter((item) => item.id != id);
+      this.tableList.splice(index, 1);
     },
-    addEquipment() {
-      this.$refs.selectStockLedgerDialogRef.open(this.tableList);
+    async addEquipment() {
+      // const res = await parameterGetByCode({
+      //   code: 'after_sales_accessory_source'
+      // });
+      // 配件回收清单进来的时候需要 查主数据
+      if (this.title == '配件回收清单') {
+        this.$refs.selectStockLedgerDialogRef.open(this.tableList, '1');
+      } else {
+        this.$refs.selectStockLedgerDialogRef.open(this.tableList, '0');
+      }
     },
     confirmChoose(data) {
       data.map((item) => {
@@ -198,7 +215,7 @@ export default {
     },
     getSpareData() {
       return this.tableList;
-    },
+    }
   }
 };
 </script>

+ 457 - 415
src/views/salesServiceManagement/components/AssetsDialog.vue

@@ -7,106 +7,148 @@
     @close="visible1 = false"
     :maxable="true"
   >
-    <el-form :model="searchForm" label-width="100px">
-      <el-row>
-        <el-col :span="6">
-          <el-form-item label="仓库名称:">
-            <el-select v-model="searchForm.warehouseId" style="width: 100%">
-              <el-option
-                v-for="item in warehouseList"
-                :key="item.id"
-                :value="item.id"
-                :label="item.name"
-              ></el-option> </el-select
-          ></el-form-item>
-        </el-col>
-
-        <el-col :span="6" style="height: 43px">
-          <el-form-item label="列表维度:" prop="dimension">
-            <template>
-              <el-select
-                style="width: 100%"
-                @change="changeDimensionHandler"
-                v-model="dimension"
-                placeholder="请选择"
-              >
-                <el-option label="物料维度" value="4"> </el-option>
-                <el-option label="包装维度" value="3"> </el-option>
-                <el-option label="批次维度" value="2"> </el-option>
-                <el-option label="物品维度" value="1"> </el-option>
+    <el-form :model="searchForm" label-width="100px" @submit.native.prevent>
+      <el-row v-if="fieldShow">
+        <el-row>
+          <el-col :span="6">
+            <el-form-item label="仓库名称:">
+              <el-select v-model="searchForm.warehouseId" style="width: 100%">
+                <el-option
+                  v-for="item in warehouseList"
+                  :key="item.id"
+                  :value="item.id"
+                  :label="item.name"
+                ></el-option>
               </el-select>
-            </template>
-          </el-form-item>
-        </el-col>
-        <el-col :span="6">
-          <el-form-item label="物品编码:">
-            <el-input
-              style="width: 100%"
-              type="text"
-              placeholder="搜索物品编码"
-              v-model="searchForm.categoryCode"
-            ></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :span="6">
-          <el-form-item label="物品名称:">
-            <el-input
-              style="width: 100%"
-              type="text"
-              placeholder="搜索物品名称"
-              v-model="searchForm.categoryName"
-            ></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :span="6">
-          <el-form-item label="批次号:">
-            <el-input
-              type="text"
-              placeholder="搜索批次号"
-              v-model="searchForm.batchNo"
-            ></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :span="6">
-          <el-form-item label="刻码">
-            <el-input
-              type="text"
-              placeholder="搜索物品刻码"
-              v-model="searchForm.engrave"
-            ></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :span="6">
-          <el-form-item label="发货码">
-            <el-input
-              type="text"
-              placeholder="搜索发货码"
-              v-model="searchForm.barcodes"
-            ></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :span="6">
-          <el-form-item label="牌号">
-            <el-input
-              type="text"
-              placeholder="搜索牌号"
-              v-model="searchForm.brandNum"
-            ></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col style="text-align: right">
-          <el-button type="primary" @click="doSearch">搜索</el-button>
-          <el-button icon="el-icon-refresh-left" @click="reset">重置</el-button>
-        </el-col>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6" style="height: 43px">
+            <el-form-item label="列表维度:" prop="dimension">
+              <template>
+                <el-select
+                  style="width: 100%"
+                  @change="changeDimensionHandler"
+                  v-model="dimension"
+                  placeholder="请选择"
+                >
+                  <el-option label="物料维度" value="4"></el-option>
+                  <el-option label="包装维度" value="3"></el-option>
+                  <el-option label="批次维度" value="2"></el-option>
+                  <el-option label="物品维度" value="1"></el-option>
+                </el-select>
+              </template>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="物品编码:">
+              <el-input
+                style="width: 100%"
+                type="text"
+                placeholder="搜索物品编码"
+                v-model="searchForm.categoryCode"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="物品名称:">
+              <el-input
+                style="width: 100%"
+                type="text"
+                placeholder="搜索物品名称"
+                v-model="searchForm.categoryName"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="6">
+            <el-form-item label="批次号:">
+              <el-input type="text" placeholder="搜索批次号" v-model="searchForm.batchNo"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="刻码">
+              <el-input type="text" placeholder="搜索物品刻码" v-model="searchForm.engrave"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="发货码">
+              <el-input type="text" placeholder="搜索发货码" v-model="searchForm.barcodes"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="牌号">
+              <el-input type="text" placeholder="搜索牌号" v-model="searchForm.brandNum"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col style="text-align: right">
+            <el-button type="primary" @click="doSearch">搜索</el-button>
+            <el-button icon="el-icon-refresh-left" @click="reset">重置</el-button>
+          </el-col>
+        </el-row>
+      </el-row>
+      <el-row v-else>
+        <el-row :gutter="10">
+          <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+            <el-form-item label="编码">
+              <el-input @keyup.enter.native="doSearch" clearable size="small" v-model="searchForm.code" placeholder="请输入" />
+            </el-form-item>
+          </el-col>
+          <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+            <el-form-item label="名称">
+              <el-input @keyup.enter.native="doSearch" clearable size="small" v-model="searchForm.name" placeholder="请输入" />
+            </el-form-item>
+          </el-col>
+
+          <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+            <el-form-item label="型号">
+              <el-input @keyup.enter.native="doSearch"  clearable size="small" v-model="searchForm.modelType" placeholder="请输入" />
+            </el-form-item>
+          </el-col>
+
+          <el-col v-bind="styleResponsive ? { md: 6 } : { span: 4 }">
+            <el-form-item>
+              <el-button
+                size="small"
+                type="primary"
+                icon="el-icon-search"
+                class="ele-btn-icon"
+                @click="doSearch"
+              >查询</el-button>
+
+              <el-button @click="reset" icon="el-icon-refresh" class="ele-btn-icon" size="medium">重置</el-button>
+              <slot></slot>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="10">
+          <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+            <el-form-item label="牌号">
+              <el-input @keyup.enter.native="doSearch" clearable size="small" v-model="searchForm.brandNum" placeholder="请输入" />
+            </el-form-item>
+          </el-col>
+          <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+            <el-form-item label="规格">
+              <el-input
+              @keyup.enter.native="doSearch"
+                clearable
+                size="small"
+                v-model="searchForm.specification"
+                placeholder="请输入"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+            <el-form-item label="关键字">
+              <el-input @keyup.enter.native="doSearch" clearable size="small" v-model="searchForm.searchKey" placeholder="请输入" />
+            </el-form-item>
+          </el-col>
+        </el-row>
       </el-row>
     </el-form>
     <el-container class="assets-dialog">
       <el-aside width="200px" class="wrapper-assets">
-        <AssetTree
-          ref="treeList"
-          :treeIds="[6]"
-          @handleNodeClick="handleNodeClick"
-        />
+        <AssetTree ref="treeList" :treeIds="[6]" @handleNodeClick="handleNodeClick" />
       </el-aside>
       <el-main>
         <el-table
@@ -128,37 +170,23 @@
             width="55"
             align="center"
             v-if="isAll"
-          >
-          </el-table-column>
-          <el-table-column label="序号" type="index" width="50">
-          </el-table-column>
+          ></el-table-column>
+          <el-table-column label="序号" type="index" width="50"></el-table-column>
           <el-table-column
             prop="categoryCode"
-            label="物品编码"
+            :label="!fieldShow?'编码':'物品编码'"
             min-width="120"
             :show-overflow-tooltip="true"
           ></el-table-column>
           <el-table-column
             prop="categoryName"
             width="200"
-            label="物品名称"
-            :show-overflow-tooltip="true"
-          ></el-table-column>
-          <el-table-column
-            prop="brandNum"
-            label="牌号"
-            :show-overflow-tooltip="true"
-          ></el-table-column>
-          <el-table-column
-            prop="categoryModel"
-            label="型号"
-            :show-overflow-tooltip="true"
-          ></el-table-column>
-          <el-table-column
-            prop="specification"
-            label="规格"
+            :label="!fieldShow?'名称':'物品名称'"
             :show-overflow-tooltip="true"
           ></el-table-column>
+          <el-table-column prop="brandNum" label="牌号" :show-overflow-tooltip="true"></el-table-column>
+          <el-table-column prop="categoryModel" label="型号" :show-overflow-tooltip="true"></el-table-column>
+          <el-table-column prop="specification" label="规格" :show-overflow-tooltip="true"></el-table-column>
           <!-- <el-table-column
        
             label="出库数量"
@@ -173,7 +201,7 @@
                 @input="handleInput(row, $event)"
               ></el-input>
             </template>
-          </el-table-column> -->
+          </el-table-column>-->
           <el-table-column
             v-if="dimension == 3"
             prop="batchNo"
@@ -182,26 +210,10 @@
             min-width="80"
           ></el-table-column>
           <el-table-column prop="level" label="级别"></el-table-column>
-          <el-table-column
-            prop="measureQuantity"
-            label="计量数量"
-            width="120"
-          ></el-table-column>
-          <el-table-column
-            prop="measureUnit"
-            label="计量单位"
-            width="90"
-          ></el-table-column>
-          <el-table-column
-            prop="weight"
-            label="重量"
-            min-width="120"
-          ></el-table-column>
-          <el-table-column
-            prop="weightUnit"
-            label="重量单位"
-            min-width="120"
-          ></el-table-column>
+          <el-table-column prop="measureQuantity" v-if="fieldShow" label="计量数量" width="120"></el-table-column>
+          <el-table-column prop="measureUnit" v-if="fieldShow" label="计量单位" width="90"></el-table-column>
+          <el-table-column prop="weight" label="重量" min-width="120"></el-table-column>
+          <el-table-column prop="weightUnit" label="重量单位" min-width="120"></el-table-column>
           <el-table-column
             v-if="dimension == 3"
             prop="packageNo"
@@ -275,8 +287,8 @@
         >
           <template v-slot:toolbar>
             <el-button type="primary" size="small" @click="add">添加</el-button>
-            <el-button size="small" @click="del">移除</el-button></template
-          >
+            <el-button size="small" @click="del">移除</el-button>
+          </template>
         </ele-pro-table>
         <div style="text-align: right; padding: 10px">
           <el-pagination
@@ -288,8 +300,7 @@
             :current-page.sync="searchForm.pageNum"
             @current-change="handleCurrentChange"
             @size-change="handleSizeChange"
-          >
-          </el-pagination>
+          ></el-pagination>
         </div>
       </el-main>
     </el-container>
@@ -302,296 +313,327 @@
 </template>
 
 <script>
-  import {
-    getOutindetailtwoList,
-    getBatchList,
-    getMaterialList,
-    getPackingList
-  } from '@/api/wms';
-  import AssetTree from './assetTree.vue';
-
-  import { getWarehouseList } from '@/api/saleManage/saleorder';
-  // import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
+import {
+  getOutindetailtwoList,
+  getBatchList,
+  getMaterialList,
+  getPackingList
+} from '@/api/wms';
+import AssetTree from './assetTree.vue';
+import { getProductList } from '@/api/saleManage/quotation';
+import { getWarehouseList } from '@/api/saleManage/saleorder';
+// import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
 
-  export default {
-    components: { AssetTree },
-    props: {
-      treeIds: { type: Array, default: () => [] },
-      isAll:{
-        default:true
-      }
+export default {
+  components: { AssetTree },
+  props: {
+    treeIds: { type: Array, default: () => [] },
+    isAll: {
+      default: true
+    }
+  },
+  computed: {
+    // 物品字段
+    fieldShow() {
+      return this.dataSources == '0';
     },
-    data() {
-      return {
-        fullscreen: false,
-        isShowTable: true,
-        qualityResultOption: [
-          {
-            value: 0,
-            label: '合格'
-          },
-          {
-            value: 1,
-            label: '不合格'
-          }
-        ],
-        qualityStatusOption: [
-          {
-            value: 1,
-            label: '已质检'
-          },
-          {
-            value: 0,
-            label: '未质检'
-          }
-        ],
-        visible1: false,
-        tableData: [],
-        total: 0,
+    // 是否开启响应式布局
+    styleResponsive() {
+      return this.$store.state.theme.styleResponsive;
+    }
+  },
+  data() {
+    return {
+      fullscreen: false,
+      isShowTable: true,
+      qualityResultOption: [
+        {
+          value: 0,
+          label: '合格'
+        },
+        {
+          value: 1,
+          label: '不合格'
+        }
+      ],
+      qualityStatusOption: [
+        {
+          value: 1,
+          label: '已质检'
+        },
+        {
+          value: 0,
+          label: '未质检'
+        }
+      ],
+      visible1: false,
+      tableData: [],
+      total: 0,
+      categoryLevelId: '',
+      // warehouseList: [],
+      searchForm: {
+        categoryCode: '',
+        categoryName: '',
+        batchNo: '',
+        brandNum: '',
+        engrave: '',
+        barcodes: '',
         categoryLevelId: '',
-        warehouseList: [],
-        searchForm: {
-          categoryCode: '',
-          categoryName: '',
-          batchNo: '',
-          brandNum: '',
-          engrave: '',
-          barcodes: '',
-          categoryLevelId: '',
-          warehouseId: '',
-          pageNum: 1,
-          size: 20
+        warehouseId: '',
+        pageNum: 1,
+        size: 20
+      },
+      selectionList: [],
+      materialType: '',
+      warehouseList: [],
+      dimension: '1',
+      selection: [],
+      tableList: [],
+      columns: [
+        {
+          columnKey: 'selection',
+          type: 'selection',
+          width: 45,
+          align: 'center',
+          fixed: 'left'
+        },
+        {
+          columnKey: 'index',
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'left'
         },
-        selectionList: [],
-        materialType: '',
-        warehouseList: [],
-        dimension: '1',
-        selection: [],
-        tableList: [],
-        columns: [
-          {
-            columnKey: 'selection',
-            type: 'selection',
-            width: 45,
-            align: 'center',
-            fixed: 'left'
-          },
-          {
-            columnKey: 'index',
-            label: '序号',
-            type: 'index',
-            width: 55,
-            align: 'center',
-            showOverflowTooltip: true,
-            fixed: 'left'
-          },
 
-          {
-            prop: 'categoryCode',
-            label: '物品编码',
-            align: 'center'
-          },
-          {
-            prop: 'categoryName',
-            label: '物品名称',
-            align: 'center'
-          },
+        {
+          prop: 'categoryCode',
+          label: !this.fieldShow ? '编码' : '物品编码',
+          align: 'center'
+        },
+        {
+          prop: 'categoryName',
+          // label: '物品名称',
+          label: !this.fieldShow ? '名称' : '物品名称',
+          align: 'center'
+        },
 
-          {
-            prop: 'categoryModel',
-            label: '型号',
-            align: 'center'
-          },
-          {
-            prop: 'specification',
-            label: '规格',
-            align: 'center'
-          },
-          {
-            prop: 'level',
-            label: '级别',
-            align: 'center'
-          },
-          {
-            prop: 'measureQuantity',
-            label: '库存',
-            align: 'center'
-          },
-          {
-            prop: 'measureUnit',
-            label: '计量单位',
-            align: 'center'
-          },
+        {
+          prop: 'categoryModel',
+          label: '型号',
+          align: 'center'
+        },
+        {
+          prop: 'specification',
+          label: '规格',
+          align: 'center'
+        },
+        {
+          prop: 'level',
+          label: '级别',
+          align: 'center'
+        },
+        {
+          prop: 'measureQuantity',
+          label: '库存',
+          align: 'center'
+        },
+        {
+          prop: 'measureUnit',
+          label: '计量单位',
+          align: 'center',
+          show: this.dataSources == '0'
+        },
 
-          {
-            prop: 'warehouseName',
-            label: '仓库',
-            align: 'center'
-          }
-        ],
-        currentRow:{}
-      };
+        {
+          prop: 'warehouseName',
+          label: '仓库',
+          align: 'center'
+        }
+      ],
+      currentRow: {},
+      dataSources: '0' // 0:仓库;1:主数据
+    };
+  },
+  created() {
+    getWarehouseList({}).then((res) => {
+      this.warehouseList = res;
+    });
+  },
+  methods: {
+    getRowKeys(row) {
+      return row.id;
+    },
+
+    // 切换维度
+    changeDimensionHandler(e) {
+      this.searchForm.pageNum = 1;
+      this.selectionList = [];
+      this.$refs.multipleTable.clearSelection();
+      this.changeDimension(e);
     },
-    created() {
-      getWarehouseList({}).then((res) => {
-        this.warehouseList = res;
+    currentChange(val) {
+      this.currentRow = val;
+    },
+    async warehouseData() {
+      const res = await getProductList(this.searchForm);
+      this.tableData = res.list.map((el) => {
+        el.categoryModel = el.modelType;
+        el.categoryName = el.name;
+        el.categoryCode = el.code;
+        return el;
       });
+      this.total = res.count;
     },
-    methods: {
-      getRowKeys(row) {
-        return row.id;
-      },
-
-      // 切换维度
-      changeDimensionHandler(e) {
-        this.searchForm.pageNum = 1;
-        this.selectionList = [];
-        this.$refs.multipleTable.clearSelection();
-        this.changeDimension(e);
-      },
-      currentChange(val) {
-        this.currentRow = val;
-      },
-      async changeDimension(e) {
-        this.dimension = e;
-        if (this.dimension == 1) {
-          // 物品维度
-          const data = await getOutindetailtwoList(this.searchForm);
-          this.tableData = data.list;
-          this.total = data.count;
-        } else if (this.dimension == 2) {
-          // 批次维度
-          const data = await getBatchList(this.searchForm);
-          this.tableData = data.list;
-          this.total = data.count;
-        } else if (this.dimension == 4) {
-          // 物料维度
-          const data = await getMaterialList(this.searchForm);
-          this.tableData = data.list;
-          this.total = data.count;
-        } else {
-          // 包装维度
-          const data = await getPackingList(this.searchForm);
-          this.tableData = data.list;
-          this.total = data.count;
-        }
-        console.log(this.tableData);
-      },
-      open(tableList) {
-        this.visible1 = true;
-        this.tableList = JSON.parse(JSON.stringify(tableList));
-        this.$nextTick(() => {
-          console.log(this.$refs, 'this.$refs.treeList');
-          this.$refs.treeList.getTreeData().then((data) => {
-            this.handleNodeClick(data);
-          });
-        });
-      },
-      async confirm() {
-        this.$emit('choose', this.isAll?this.tableList:this.currentRow, this.dimension);
-        this.cancel();
-      },
-      async add() {
-        if (!this.selectionList.length) {
-          this.$message.error('请至少选择一条数据!');
-          return;
-        }
-        // if (this.dimension == 1) {
-        //   let boolen = this.selectionList.every((item) => item.outboundNum > 0);
-        //   if (!boolen) {
-        //     this.$message.error('请输入出库数量!');
-        //     return;
-        //   }
-        // }
-        // let data = null;
-        // if (this.dimension != 1) {
-        //   data = await storageApi.getHierarchyList({
-        //     ids: this.selectionList.map((item) => item.id).join(','),
-        //     type: this.dimension
-        //   });
-        // } else {
-        //   data = await storageApi.getHierarchyFifo({
-        //     type: this.dimension,
-        //     builders: this.selectionList.map((item) => {
-        //       return {
-        //         categoryId: item.categoryId,
-        //         num: item.outboundNum || item.measureQuantity
-        //       };
-        //     })
-        //   });
-        // }
-
-        this.selectionList = this.selectionList.filter((item) => {
-          if (item.warehouseList?.length > 0) {
-            item['warehouseId'] = item.warehouseList[0].warehouse_id;
-            item['warehouseName'] = item.warehouseList[0].warehouse_name;
-          }
-          return !this.tableList
-            .map((item) => item.categoryCode)
-            .includes(item.categoryCode);
+    async changeDimension(e) {
+      // 查询主数据
+      if (this.dataSources == '1') {
+        this.warehouseData();
+        return;
+      }
+      this.dimension = e;
+      if (this.dimension == 1) {
+        // 物品维度
+        const data = await getOutindetailtwoList(this.searchForm);
+        this.tableData = data.list;
+        this.total = data.count;
+      } else if (this.dimension == 2) {
+        // 批次维度
+        const data = await getBatchList(this.searchForm);
+        this.tableData = data.list;
+        this.total = data.count;
+      } else if (this.dimension == 4) {
+        // 物料维度
+        const data = await getMaterialList(this.searchForm);
+        this.tableData = data.list;
+        this.total = data.count;
+      } else {
+        // 包装维度
+        const data = await getPackingList(this.searchForm);
+        this.tableData = data.list;
+        this.total = data.count;
+      }
+      console.log(this.tableData);
+    },
+    open(tableList, value) {
+      this.dataSources = value || '0';
+      console.log(value, 'value -- ==');
+      this.visible1 = true;
+      this.tableList = JSON.parse(JSON.stringify(tableList));
+      this.$nextTick(() => {
+        console.log(this.$refs, 'this.$refs.treeList');
+        this.$refs.treeList.getTreeData().then((data) => {
+          this.handleNodeClick(data);
         });
-        this.tableList.push(...this.selectionList);
-      },
-      del() {
-        let ids = this.selection.map((item) => item.id);
-        this.tableList = this.tableList.filter(
-          (item) => !ids.includes(item.id)
-        );
-      },
-      cancel() {
-        this.selectionList = [];
-        this.$refs.multipleTable.clearSelection();
-        this.visible1 = false;
-      },
-      handleSelectionChange(val) {
-        this.selectionList = val;
-      },
-      handleNodeClick(data) {
-        console.log(data);
-        this.categoryLevelId = data.id;
-        this.searchForm.categoryLevelId = data.id;
-        this.doSearch();
-      },
-      handleCurrentChange() {
-        this.changeDimension(this.dimension);
-      },
-      reset() {
-        this.searchForm = {
-          categoryCode: '',
-          categoryName: '',
-          batchNo: '',
-          brandNum: '',
-          engrave: '',
-          barcodes: '',
-          categoryLevelId: this.categoryLevelId,
-          pageNum: 1,
-          warehouseId: '',
-          size: 20
-        };
-        this.doSearch();
-      },
-      doSearch() {
-        this.searchForm.pageNum = 1;
-        this.changeDimension(this.dimension);
-      },
-      handleSizeChange() {
-        this.searchForm.pageNum = 1;
-        this.changeDimension(this.dimension, 'page');
+      });
+    },
+    async confirm() {
+      this.$emit(
+        'choose',
+        this.isAll ? this.tableList : this.currentRow,
+        this.dimension
+      );
+      this.cancel();
+    },
+    async add() {
+      if (!this.selectionList.length) {
+        this.$message.error('请至少选择一条数据!');
+        return;
       }
+      // if (this.dimension == 1) {
+      //   let boolen = this.selectionList.every((item) => item.outboundNum > 0);
+      //   if (!boolen) {
+      //     this.$message.error('请输入出库数量!');
+      //     return;
+      //   }
+      // }
+      // let data = null;
+      // if (this.dimension != 1) {
+      //   data = await storageApi.getHierarchyList({
+      //     ids: this.selectionList.map((item) => item.id).join(','),
+      //     type: this.dimension
+      //   });
+      // } else {
+      //   data = await storageApi.getHierarchyFifo({
+      //     type: this.dimension,
+      //     builders: this.selectionList.map((item) => {
+      //       return {
+      //         categoryId: item.categoryId,
+      //         num: item.outboundNum || item.measureQuantity
+      //       };
+      //     })
+      //   });
+      // }
+      this.selectionList = this.selectionList.filter((item) => {
+        if (item.warehouseList?.length > 0) {
+          item['warehouseId'] = item.warehouseList[0].warehouse_id;
+          item['warehouseName'] = item.warehouseList[0].warehouse_name;
+        }
+        return !this.tableList
+          .map((item) => item.categoryCode)
+          .includes(item.categoryCode);
+      });
+      this.tableList.push(...this.selectionList);
+    },
+    del() {
+      let ids = this.selection.map((item) => item.id);
+      this.tableList = this.tableList.filter((item) => !ids.includes(item.id));
+    },
+    cancel() {
+      this.selectionList = [];
+      this.$refs.multipleTable.clearSelection();
+      this.visible1 = false;
+    },
+    handleSelectionChange(val) {
+      this.selectionList = val;
+    },
+    handleNodeClick(data) {
+      console.log(data);
+      this.categoryLevelId = data.id;
+      this.searchForm.categoryLevelId = data.id;
+      this.doSearch();
+    },
+    handleCurrentChange() {
+      this.changeDimension(this.dimension);
+    },
+    reset() {
+      this.searchForm = {
+        categoryCode: '',
+        categoryName: '',
+        batchNo: '',
+        brandNum: '',
+        engrave: '',
+        barcodes: '',
+        categoryLevelId: this.categoryLevelId,
+        pageNum: 1,
+        warehouseId: '',
+        size: 20
+      };
+      this.doSearch();
+    },
+    doSearch() {
+      this.searchForm.pageNum = 1;
+      this.changeDimension(this.dimension);
+    },
+    handleSizeChange() {
+      this.searchForm.pageNum = 1;
+      this.changeDimension(this.dimension, 'page');
     }
-  };
+  }
+};
 </script>
 
 <style lang="scss" scoped>
-  .el-dialog__wrapper {
-    ::v-deep .el-aside {
-      background-color: #fff !important;
-      border: 1px solid #ccc;
-    }
+.el-dialog__wrapper {
+  ::v-deep .el-aside {
+    background-color: #fff !important;
+    border: 1px solid #ccc;
   }
+}
 
-  .wrapper-assets {
-    max-height: 53vh;
-    overflow: auto;
-  }
+.wrapper-assets {
+  max-height: 53vh;
+  overflow: auto;
+}
 </style>

+ 20 - 3
src/views/salesServiceManagement/components/applyForSpare.vue

@@ -141,6 +141,14 @@
       <el-button type="primary" @click="save" :loading="loading">提交</el-button>
     </template>
     <AssetsDialog ref="selectStockLedgerDialogRef" :assetType="6" @choose="confirmChoose"></AssetsDialog>
+    <product-list
+      ref="productListRef"
+      classType="1"
+      :is-get-inventory-total="true"
+      @choose="confirmChoose"
+      :ids="[6]"
+      :isFirstRefreshTable="true"
+    ></product-list>
   </ele-modal>
 </template>
 
@@ -151,13 +159,15 @@ import {
   getSalesWorkOrderById
 } from '@/api/salesServiceManagement/index';
 import AssetsDialog from './AssetsDialog.vue';
+import productList from '@/BIZComponents/product-list.vue';
 import deptSelect from '@/components/CommomSelect/dept-select.vue';
 import { getUserPage } from '@/api/system/organization';
-
+import { parameterGetByCode } from '@/api/main/index.js';
 export default {
   components: {
     AssetsDialog,
-    deptSelect
+    deptSelect,
+    productList
   },
   props: {
     inlet: {
@@ -345,8 +355,15 @@ export default {
       this.visible = false;
       this.executorList = [];
     },
-    addEquipment() {
+    async addEquipment() {
+      // const res = await parameterGetByCode({code: 'after_sales_accessory_source'});
       this.$refs.selectStockLedgerDialogRef.open(this.tableList);
+      // if(res.value == '1'){
+      //   this.$refs.productListRef.open('', index);
+      // }else{
+      //   this.$refs.selectStockLedgerDialogRef.open(this.tableList);
+      // }
+      console.log(res,'res --')
     },
     /* 保存编辑 */
     async save() {

+ 37 - 5
src/views/salesServiceManagement/components/sparePartsList.vue

@@ -166,6 +166,29 @@
         </template>
         <template v-slot:warehouseId="scope">
           <el-form-item
+            v-if="scope.row.typeId == '2'"
+            style="margin-bottom: 20px"
+            :prop="'tableList.' + scope.$index + '.warehouseId'"
+          >
+            <el-select
+              v-if="obtain == '主数据'"
+              v-model="scope.row.warehouseId"
+              placeholder="请选择仓库"
+              class="w100"
+              :disabled="type == 'view' || scope.row.isApply == 1"
+            >
+              <el-option
+                v-for="item in scope.row.warehouseList"
+                @click="warehouseChange(item, scope.row, scope.$index)"
+                :key="item.warehouseId"
+                :label="item.warehouseName"
+                :value="item.warehouseId"
+              ></el-option>
+            </el-select>
+            <el-input v-model="scope.row.warehouseName" disabled v-else></el-input>
+          </el-form-item>
+          <el-form-item
+            v-else
             style="margin-bottom: 20px"
             :prop="'tableList.' + scope.$index + '.warehouseId'"
           >
@@ -223,7 +246,7 @@ import {
   getWarehouseOutStock,
   getIdWarehouseList
 } from '@/api/saleManage/saleorder';
-
+import { parameterGetByCode } from '@/api/main/index.js';
 import AssetsDialog from './AssetsDialog.vue';
 import productList from '@/BIZComponents/product-list.vue';
 
@@ -248,6 +271,10 @@ export default {
     detailList: {
       type: Array,
       default: () => []
+    },
+    obtain: {
+      type: '',
+      default: '主数据'
     }
   },
   data() {
@@ -412,7 +439,6 @@ export default {
 
     // 添加 按钮显示权限
     buttonJud() {
-      console.log(this.type,'type')
       if (this.source == '派单进来') {
         return true;
       }
@@ -422,7 +448,6 @@ export default {
     // 故障列表删除权限
     schemeOperate() {
       return (row) => {
-        console.log(row,'row ----')
         if (this.source == '配件回收') {
           return true;
         }
@@ -504,9 +529,16 @@ export default {
         settlementPrice: ''
       });
     },
-    addEquipment(row, index) {
+    async addEquipment(row, index) {
+      // const res = await parameterGetByCode({
+      //   code: 'after_sales_accessory_source'
+      // });
       this.currentIndex = index;
-      this.$refs.productListRef.open('', index);
+      if (this.obtain == '仓库') {
+        this.$refs.productListRef.open('', index, '0');
+      } else {
+        this.$refs.productListRef.open('', index, '1');
+      }
     },
     getTableValue() {
       return this.form.tableList;

+ 94 - 0
src/views/salesServiceManagement/demandList/components/searchTable.vue

@@ -0,0 +1,94 @@
+<!-- 搜索表单 -->
+<template>
+  <seekPage :seekList="seekList" :formLength="4" @search="search"></seekPage>
+</template>
+<script>
+export default {
+  data() {
+    return {
+      auditStatus: [
+        {
+          label: '待审核',
+          value: '0'
+        },
+        {
+          label: '已拒绝',
+          value: 2
+        },
+        {
+          label: '已通过',
+          value: 1
+        },
+        {
+          label: '已撤回',
+          value: 3
+        }
+      ]
+    };
+  },
+  props:{
+    levelList:{
+      type:Array,
+      default:()=>[]
+    }
+  },
+  computed: {
+    // 表格列配置
+    seekList() {
+      return [
+        {
+          label: '客户名称:',
+          value: 'contactName',
+          type: 'input',
+          placeholder: ''
+        },
+        // {
+        //   label: '创建人:',
+        //   value: 'code',
+        //   type: 'input',
+        //   placeholder: ''
+        // },
+        {
+          label: '报修编码:',
+          value: 'code',
+          type: 'input',
+          placeholder: ''
+        },
+        {
+          label: '故障等级:',
+          value: 'faultLevel',
+          type: 'select',
+          planList:this.levelList,
+          placeholder: ''
+        },
+        {
+          label: '状态:',
+          value: 'demandStatus',
+          type: 'select',
+          planList:this.auditStatus,
+          placeholder: ''
+        },
+        {
+          label: '报修时间:',
+          value: 'time',
+          type: 'date',
+          dateType: 'datetimerange',
+          placeholder: '',
+          width: 380,
+          valueAr: ['createTimeStart', 'createTimeEnd']
+        },
+
+      ];
+    }
+  },
+  methods: {
+    /* 搜索 */
+    search(e) {
+      console.log('是否调用');
+      this.$emit('search', {
+        ...e
+      });
+    }
+  }
+};
+</script>

+ 8 - 3
src/views/salesServiceManagement/demandList/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="ele-body">
     <el-card shadow="never" v-loading="loading">
-      <search @search="reload"></search>
+      <search :levelList="levelList" @search="reload"></search>
       <!-- 数据表格 -->
       <ele-pro-table
         ref="table"
@@ -123,7 +123,7 @@ import {
   auditSalesDemand,
   revokeSalesDemand
 } from '@/api/salesServiceManagement/index.js';
-import search from './components/search.vue';
+import search from './components/searchTable.vue';
 import AddDialog from './components/addDialog.vue';
 import { getByCode } from '@/api/system/dictionary-data';
 import dictMixins from '@/mixins/dictMixins';
@@ -251,7 +251,9 @@ export default {
         { label: '驳回', value: 0 },
         { label: '同意', value: 1 }
       ],
-      levelData: {}
+      levelData: {},
+      levelList: [],
+
     };
   },
   computed: {},
@@ -281,9 +283,12 @@ export default {
       const res = await getByCode(code);
       if (res?.code === '0') {
         let obj = {};
+        let arr = [];
         res.data.map((el) => {
+          arr.push({ label: Object.values(el)[0], value: Object.keys(el)[0] });
           obj = { ...obj, ...el };
         });
+        this.levelList = arr;
         this.levelData = obj;
       }
     },

+ 1 - 0
src/views/salesServiceManagement/recycle/component/recycleDialog.vue

@@ -154,6 +154,7 @@
       <spareInfo
         ref="spareCycleRef"
         :types="type"
+        title="配件回收清单"
         :detailList="detailList"
         v-if="editRepairNotesDialog"
       />

+ 1 - 1
src/views/salesServiceManagement/toDoList/components/addOrUpdateDialog.vue

@@ -155,7 +155,7 @@
         </el-tab-pane>
         <el-tab-pane label="方案" name="方案">
           <!-- :type="type" -->
-          <spareParts ref="sparePartsRef" :type="title=='详情'?'view':'edit'"></spareParts>
+          <spareParts obtain="仓库" ref="sparePartsRef" :type="title=='详情'?'view':'edit'"></spareParts>
         </el-tab-pane>
       </el-tabs>
     </div>

+ 15 - 12
src/views/salesServiceManagement/workOrder/components/declarationDialog.vue

@@ -136,6 +136,7 @@
                   ref="sparePartsRef2"
                   :state="type == 'edit' ? '可操作' : ''"
                   :type="type == 'edit' ? 'edit' : 'view'"
+                  obtain="仓库"
                 ></spareParts>
                 <!--  source="报工信息" -->
               </el-col>
@@ -303,7 +304,6 @@ export default {
       return flag;
     },
     infoShow() {
-      console.log(this.addForm, 'this.addForm --');
       let flag =
         this.type == 'report' ||
         this.addForm.orderStatus == 3 ||
@@ -522,17 +522,20 @@ export default {
           if (type == 'report') {
             let list = this.$refs.spareCycleRef.getSpareData() || [];
             let detailList = this.listData(list);
-            // 指定绑定第一条设备信息
-            let item = data.salesDemandUpdatePO.productDetail[0];
-            let accessoryApply = {
-              demandDetailId: item.id,
-              categoryCode: item.categoryCode,
-              categoryName: item.categoryName,
-              contactName: obj.contractInfo.name,
-              contactCode: obj.contractInfo.code,
-              detailList
-            };
-            data.accessoryApply = accessoryApply;
+            // 判断清单数据是否存在
+            if (detailList.length > 0) {
+              // 指定绑定第一条设备信息
+              let item = data.salesDemandUpdatePO.productDetail[0];
+              let accessoryApply = {
+                demandDetailId: item.id,
+                categoryCode: item.categoryCode,
+                categoryName: item.categoryName,
+                contactName: obj.contractInfo.name,
+                contactCode: obj.contractInfo.code,
+                detailList
+              };
+              data.accessoryApply = accessoryApply;
+            }
           }
           // let api = this.type == 'edit' ? updateScheme : reportWorkingSalesWorkOrder;
           let api = type == 'edit' ? updateScheme : reportWorkingSalesWorkOrder;