From d492850f1cc64ddcfaf43798af9c76c2505414fd Mon Sep 17 00:00:00 2001
From: renkang <8417338+k94314517@user.noreply.gitee.com>
Date: 星期五, 24 一月 2025 18:24:31 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/2.0.1' into 2.0.1

---
 admin/src/views/stock/components/AssetSel.vue |   62 +++++++++++++++++++++---------
 1 files changed, 43 insertions(+), 19 deletions(-)

diff --git a/admin/src/views/stock/components/AssetSel.vue b/admin/src/views/stock/components/AssetSel.vue
index afbbb23..d4bb919 100644
--- a/admin/src/views/stock/components/AssetSel.vue
+++ b/admin/src/views/stock/components/AssetSel.vue
@@ -1,35 +1,36 @@
 <template>
-  <GlobalWindow title="閫夋嫨鐗╂枡" :visible.sync="isShowModal" :confirm-working="isLoading" width="900px" @close="close"
+  <GlobalWindow title="閫夋嫨鐗╂枡" :visible.sync="isShowModal" :confirm-working="isLoading" width="1000px" @close="close"
     @confirm="confirm">
     <el-form ref="searchForm" :model="searchForm" label-width="100px" inline>
-      <el-form-item prop="areaType" label="鐗╂枡淇℃伅">
-        <el-input v-model="searchForm.aaa" placeholder="璇疯緭鍏ョ墿鏂欑紪鐮�/鍚嶇О" @keypress.enter.native="search"></el-input>
+      <el-form-item prop="code" label="鐗╂枡淇℃伅">
+        <el-input v-model="searchForm.code" placeholder="璇疯緭鍏ョ墿鏂欑紪鐮�/鍚嶇О" @keypress.enter.native="search"></el-input>
       </el-form-item>
       <el-form-item prop="areaIds" label="鐗╂枡鍒嗙被">
         <el-cascader v-model="searchForm.areaIds" @change="changeSel" placeholder="璇烽�夋嫨鐗╂枡鍒嗙被" clearable
           :options="cateList" :props="{
             label: 'name',
             value: 'id',
-            children: 'childCategoryList'
+            children: 'childCategoryList',
+            checkStrictly: true
           }"></el-cascader>
       </el-form-item>
       <span>
-        <el-button type="primary" @click="getList">鎼滅储</el-button>
+        <el-button type="primary" @click="getList(1)">鎼滅储</el-button>
         <el-button @click="reset">閲嶇疆</el-button>
       </span>
     </el-form>
     <!--  -->
     <el-table @selection-change="handleSelectionChange" :data="list" stripe>
       <el-table-column type="selection"  width="55" />
-      <el-table-column prop="categoryName" label="鐗╂枡缂栫爜" min-width="100px"></el-table-column>
-      <el-table-column prop="creatorName" label="鐗╂枡鍚嶇О" min-width="80px"></el-table-column>
-      <el-table-column prop="createDate" label="鏉$爜" min-width="100px"></el-table-column>
-      <el-table-column prop="dealUserName" label="鍝佺墝" min-width="80px"></el-table-column>
-      <el-table-column prop="dealUserName" label="瑙勬牸鍨嬪彿" min-width="80px"></el-table-column>
-      <el-table-column prop="dealUserName" label="鍗曚綅" min-width="80px"></el-table-column>
-      <el-table-column prop="dealUserName" label="搴撳瓨" min-width="80px"></el-table-column>
+      <el-table-column prop="code" label="鐗╂枡缂栫爜" min-width="100px"></el-table-column>
+      <el-table-column prop="name" label="鐗╂枡鍚嶇О" min-width="80px"></el-table-column>
+      <el-table-column prop="qrcode" label="鏉$爜" min-width="100px"></el-table-column>
+      <el-table-column prop="brand" label="鍝佺墝" min-width="80px"></el-table-column>
+      <el-table-column prop="attr" label="瑙勬牸鍨嬪彿" min-width="80px"></el-table-column>
+      <el-table-column prop="unitName" label="鍗曚綅" min-width="80px"></el-table-column>
+      <el-table-column prop="maxStock" label="搴撳瓨" min-width="80px"></el-table-column>
     </el-table>
-    <Pagination @size-change="handleSizeChange" @current-change="getList" :pagination="pagination">
+    <Pagination class="mt10" @size-change="handleSizeChange" @current-change="getList" :pagination="pagination">
     </Pagination>
   </GlobalWindow>
 </template>
@@ -38,6 +39,8 @@
 import BaseOpera from '@/components/base/BaseOpera'
 import GlobalWindow from '@/components/common/GlobalWindow'
 import Pagination from '@/components/common/Pagination'
+import { fetchList } from '@/api/ywMaterial'
+import { ywStockPage } from '@/api/store/index'
 import { fetchList as getCateList } from '@/api/business/category.js'
 export default {
   name: 'OperaCategoryWindow',
@@ -51,6 +54,8 @@
         page: 1,
         total: 0
       },
+      isOut: false,
+      warehouseId: false,
       list: [],
       selList: [],
       cateList: [],
@@ -64,7 +69,7 @@
     }
   },
   created() {
-    this.initData()
+    this.getCate()
   },
   methods: {
     confirm() {
@@ -75,24 +80,39 @@
       this.selList = val
     },
     getList(page) {
-      const { pagination, searchForm } = this
+      const { pagination, searchForm, isOut, warehouseId } = this
       this.listLoading = true
       if(page){pagination.page = page}
-      fetchList({
+      console.log('isOut', isOut);
+      
+      let fn = isOut ? ywStockPage : fetchList
+      fn({
         capacity: pagination.pageSize,
         page: pagination.page,
-        model: {...searchForm}
+        model: {...searchForm,status: 0, warehouseId}
       }).then((res) => {
         this.listLoading = false
         this.list = res.records
         this.pagination.total = res.total || 0
+        if(isOut){
+          this.list.forEach(item => {
+            item.brand = item.materialBrand
+            item.attr = item.materialAttr
+            item.name = item.materialName
+            item.id = item.materialId
+            item.code = item.materialCode
+            item.qrcode = item.materialQrcode
+            item.unitName = item.materialUnitName
+            item.maxStock = item.stock
+          })
+        }
       }, () => {
         this.listLoading = false
       })
     },
-    initData() {
+    getCate() {
       getCateList({
-        model: { type: 3 },
+        model: { type: 7 },
         capacity: 1000,
         page: 1,
       }).then(res => {
@@ -102,6 +122,10 @@
     changeSel(e) {
       if (e && e.length == 2) {
         this.$set(this.searchForm, 'cateId', e[1])
+        this.$set(this.searchForm, 'parentCateId', '')
+      }else if((e && e.length == 1)){
+        this.$set(this.searchForm, 'parentCateId', e[0])
+        this.$set(this.searchForm, 'cateId', '')
       } else {
         this.$set(this.searchForm, 'cateId', '')
       }

--
Gitblit v1.9.3