shish 2 лет назад
Родитель
Сommit
404cbc80f7
3 измененных файлов с 96 добавлено и 59 удалено
  1. 51 48
      ghs/src/views/in/list.vue
  2. 1 1
      ghs/src/views/item/list.vue
  3. 44 10
      ghs/src/views/order/book.vue

+ 51 - 48
ghs/src/views/in/list.vue

@@ -110,9 +110,15 @@
 			</template>
 
       <template #slot-search-option="{scope}">
-        入库时间:
+        <el-input v-model="searchContent" placeholder="核销码 / 供货商名 / 手机号" size="medium" style="width:240px;" :clearable="true" ref="itemSearchRef" @input="changeSearch()" @focus="search=''"></el-input>
+
+				<el-select size="medium" v-model="currentCgStaffName" placeholder="采购人" style="width:150px;margin-left:10px;" @change="getCgStaff" :clearable="true">
+					<el-option v-for="item in staffList" :key="item.id" :label="item.name" :value="item.id"></el-option>
+				</el-select>
+
+        <span style="font-size:22px;margin-left:20px;">入库时间:</span>
         <el-date-picker v-model="currentDateList" type="daterange" align="right" unlink-panels range-separator="至" start-placeholder="开始日期" @change="getSearchDate" value-format="yyyy-MM-dd"
-                end-placeholder="结束日期" :picker-options="pickerOptions" size="mini" style="margin-right:20px;">
+                end-placeholder="结束日期" :picker-options="pickerOptions" size="medium">
         </el-date-picker>
       </template>
 
@@ -120,30 +126,6 @@
 
     <order-detail ref="orderDetail" :orderOperate="optionData" />
 
-		<el-dialog title="添加供货商" :visible.sync="addPop" width="600px" center :close-on-click-modal="false">
-			<div>
-				<div class="accounts-list">
-					名称
-					<el-input style="width: 80%" v-model="name"></el-input>
-				</div>
-				<div class="accounts-list">
-					所在地
-					<div class="accounts-center">
-						<el-button :type="location == 0?'primary':''" @click="location=0" size="small">上游</el-button>
-						<el-button :type="location == 1?'primary':''" @click="location=1" size="small">本地</el-button>
-					</div>
-				</div>
-
-				<div class="accounts-list" style="margin-top:20px;">
-					<span></span>
-					<div class="accounts-center">
-						<el-button @click="resetAdd()">取消</el-button>
-						<el-button type="primary" @click="confirmAdd()" style="margin-left:80px;">确认</el-button>
-					</div>
-				</div>
-			</div>
-    	</el-dialog>
-
   </div>
 </template>
 
@@ -188,7 +170,11 @@ export default {
       startTime:'',
       endTime:'',
       searchTime:'',
+      name:'',
       currentDateList:[],
+      staffList:[],
+      currentCgStaffName:'',
+      currentCgStaffId:0,
       pickerOptions: {
             shortcuts: [{
                 text: '最近一周',
@@ -233,10 +219,32 @@ export default {
 				that.$router.push({path:'/in/add',query})
 			}
 		}
+
+    this.$nextTick(() => {
+      this.$refs.itemSearchRef.focus()
+    })
+
+    that.$service.shopAdmin.getAllStaff().then(res => {
+        that.staffList = res.list
+    })
+
 	},
   methods: {
+		getCgStaff(e){
+			this.currentCgStaffId = e
+			this.app.refresh({ status: this.tabIndex,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,search:this.searchContent,cgStaffId:this.currentCgStaffId})
+		},
+		changeSearch(){
+      let that = this
+      if(this.T != null){
+        clearTimeout(this.T)
+      }
+      this.T = setTimeout(function(){
+        that.app.refresh({ status: that.tabIndex,searchTime:that.searchTime,startTime:that.startTime,endTime:that.endTime,search:that.searchContent,cgStaffId:that.currentCgStaffId})
+      },700)			
+		},
 		exportData(){
-			this.$service.purchaseOrder.getOrderList({status: this.tabIndex,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,name:this.searchContent,export:1,pageSize:9999999}).then(res => {
+			this.$service.purchaseOrder.getOrderList({status: this.tabIndex,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,search:this.searchContent,export:1,pageSize:9999999}).then(res => {
 				if(res.file){
 					window.location.href = res.file
 				}
@@ -246,17 +254,12 @@ export default {
 			this.$prompt('请输入货位号','提示',{confirmButtonText:'确定',cancelButtonText:'取消'}).then(({value}) => {
 				this.$service.purchaseOrder.modifySeatSn({ seatSn: value,id:info.id}).then(data => {
 					this.$notify({ title: '成功', message: '操作成功', type: 'success'})
-					this.app.refresh({ status: this.tabIndex})
+					this.app.refresh({ status: this.tabIndex,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,search:this.searchContent,cgStaffId:this.currentCgStaffId})
 				})
 			})
 		},
     confirmAdd(){
 
-    },
-    resetAdd(){
-      this.addPop = false
-      this.location = 0
-      this.name = ''
     },
 		addGhs(){
 			let query = {}
@@ -339,7 +342,7 @@ export default {
 			this.$confirm('确认取消?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => {
         this.$service.purchaseOrder.cancelOrder({id:item.id}).then(data => {
           this.$notify({ title: '已取消', message: '操作成功', type: 'success'})
-          this.app.refresh({ status: this.tabIndex,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,name:this.searchContent})
+          this.app.refresh({ status: this.tabIndex,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,search:this.searchContent,cgStaffId:this.currentCgStaffId})
         })
 			})
     },
@@ -350,7 +353,7 @@ export default {
       });
     },
     changeTab(tab, e) {
-      this.app.refresh({ status: this.tabIndex,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,name:this.searchContent});
+      this.app.refresh({ status: this.tabIndex,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,search:this.searchContent,cgStaffId:this.currentCgStaffId});
     },
     getSearchDate(){
       if (this.$util.isEmpty(this.currentDateList)) {
@@ -362,7 +365,7 @@ export default {
         this.startTime = this.currentDateList[0]
         this.endTime = this.currentDateList[1]
       }
-      this.app.refresh({ status: this.tabIndex,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,name:this.searchContent})
+      this.app.refresh({ status: this.tabIndex,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,search:this.searchContent,cgStaffId:this.currentCgStaffId})
     },
     onLoad({ ctx, app }) {
       this.app = app;
@@ -381,6 +384,15 @@ export default {
       if(this.$route.query.endTime){
         this.endTime = this.$route.query.endTime
       }
+
+      //采购人
+      if(this.$route.query.currentCgStaffId){
+        this.currentCgStaffId = this.$route.query.currentCgStaffId
+      }
+      if(this.$route.query.currentCgStaffName){
+        this.currentCgStaffName = this.$route.query.currentCgStaffName
+      }
+
       ctx.service(this.$service.purchaseOrder)
           .set('table', {
             columns: [
@@ -494,26 +506,17 @@ export default {
               layout: ['slot-column-option']
             }
           })
-          .set('dict', {
-            search: {
-              keyWord: 'name'
-            }
-          })
-          .set('search', {
-            key: { placeholder: '核销码 / 订单号 / 供货商名称' }
-          })
           .set('layout', [
             ['slot-tabs'],
-            ['slot-search-option','search-key','slot-new-cg','flex1','slot-export-order'],
+            ['slot-search-option','slot-new-cg','flex1','slot-export-order'],
             ['data-table'],
             ['flex1', 'pagination']
           ])
           .on('refresh', async (params, { next }) => {
-            let  asset  = await next(params);
-            this.searchContent = params.name?params.name:''
+            let  asset  = await next(params)
           })
           .done();
-          app.refresh({ status: this.tabIndex,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,name:this.searchContent})
+          app.refresh({ status: this.tabIndex,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,search:this.searchContent,cgStaffId:this.currentCgStaffId})
     }
   }
 };

+ 1 - 1
ghs/src/views/item/list.vue

@@ -115,7 +115,7 @@
       </template>
 
       <template #slot-add-goods-btn>
-        <el-button type="primary" size="mini" @click="$util.pageTo({url: '/item/import'})">批量导入花材</el-button>
+        <el-button type="primary" size="mini" @click="$util.pageTo({url: '/item/import'})">批量添加花材</el-button>
       </template>
 
 		<template #slot-addNew-goods-btn>

+ 44 - 10
ghs/src/views/order/book.vue

@@ -14,11 +14,13 @@
       </template>
 
 			<template #slot-search-date="{scope}">
-        <el-date-picker v-model="searchDate" @change="changeDate()" value-format="yyyy-MM-dd" type="daterange" align="right" unlink-panels range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions">
+        <el-date-picker v-model="searchDate" style="margin-left:30px;" @change="changeDate()" value-format="yyyy-MM-dd" type="daterange" align="right" unlink-panels range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions">
         </el-date-picker>
 			</template>
 
 			<template #slot-option-area-list>
+        <el-input v-model="search" placeholder="搜索花材" size="big" style="width:200px;" ref="itemSearchRef" @input="changeSearch()" @focus="search=''"></el-input>
+
         <el-popover style="margin-left:40px;" placement="top" width="160" ref="openCloseBookRef">
           <p>确认{{ shop.bookSn==0?'开启':'结束' }}?</p>
           <div style="text-align: right; margin: 0">
@@ -27,8 +29,8 @@
           </div>
           <el-button slot="reference" type="primary">{{ shop.bookSn==0?'开启预订':'结束预订' }}</el-button>
         </el-popover>
-        <el-button type="primary" size="mini" @click="" style="margin-left:40px;">我的采购</el-button>
-        <el-button type="primary" size="mini" @click="" style="margin-left:40px;">去采购</el-button>
+        <el-button type="primary" size="mini" @click="myCgOrder()" style="margin-left:40px;">我的采购</el-button>
+        <el-button type="primary" size="mini" @click="goCg" style="margin-left:40px;">去采购</el-button>
         <el-button type="primary" size="mini" @click="exportStockAssign()" style="margin-left:40px;">导出库存分配</el-button>
 			</template>
 
@@ -52,12 +54,16 @@
 import SelOrder from './components/sel-order';
 import OrderDetail from './components/order-detail';
 import { getLodop } from '@/utils/lodop';
+import { mapGetters } from 'vuex';
 import {hiprint, defaultElementTypeProvider} from 'vue-plugin-hiprint'
 export default {
   components: {
     SelOrder,
     OrderDetail
   },
+  computed: {
+        ...mapGetters(['shopInfo', 'userInfo'])
+  },
   data() {
     return {
       pickerOptions: {
@@ -104,13 +110,41 @@ export default {
       startDate:'',
       endDate:'',
       printData:{},
-      shop:{}
+      shop:{},
+      T:null,
+      search:''
     };
   },
   created() {
     this.init();
+  },
+	mounted() {
+
+    this.$nextTick(() => {
+      this.$refs.itemSearchRef.focus()
+    })
+
   },
   methods: {
+    myCgOrder(){
+      let staffId = this.shopInfo && this.shopInfo.staff.id ? this.shopInfo.staff.id: 0
+      let staffName = this.shopInfo && this.shopInfo.staff.name ? this.shopInfo.staff.name: ''
+      let query = {currentCgStaffId:staffId,currentCgStaffName:staffName}
+      this.$router.push({path:'/in/list',query})
+    },
+    goCg(){
+      let query = {}
+      this.$router.push({path:'/in/add',query})
+    },
+		changeSearch(){
+      let that = this
+      if(this.T != null){
+        clearTimeout(this.T)
+      }
+      this.T = setTimeout(function(){
+        that.app.refresh({status:this.tabIndex,search:this.search})
+      },700)			
+		},
     exportStockAssign(){
 			this.$service.statBook.exportStockAssign({}).then(res => {
 				if(res.file){
@@ -130,7 +164,7 @@ export default {
       let status = bookSn == 0 ? 1 : 0
       return this.$service.book.changeBook({status:status}).then((res) => {
         this.$message.success('操作成功')
-        this.app.refresh({ status: this.tabIndex})
+        this.app.refresh({status:this.tabIndex,search:this.search})
       })
     },
     init(){
@@ -150,13 +184,13 @@ export default {
       this.searchTime = 'custom'
       this.startDate = startDate
       this.endDate = endDate
-      this.app.refresh({ status: this.tabIndex})
+      this.app.refresh({status:this.tabIndex,search:this.search})
     },
     onLoad({ ctx, app }) {
       this.app = app;
       ctx.service({
               page: () => {
-                  return this.$service.statBook.getProfile().then((res) => {
+                  return this.$service.statBook.getProfile({search:this.search}).then((res) => {
                       this.shop = res.shop?res.shop:{}
                       return {
                           list: res.list,shop:res.shop
@@ -201,7 +235,7 @@ export default {
             op: {
               visible: true,
               props: {
-                width: 500,
+                width: 800,
                 align: 'left',
                 fixed: 'right',
                 label: '操作'
@@ -211,7 +245,7 @@ export default {
           })
           .set('layout', [
             ['slot-tabs'],
-            ['slot-search-date','slot-option-area-list'],
+            ['slot-option-area-list','slot-search-date'],
             ['data-table'],
             []
           ])
@@ -220,7 +254,7 @@ export default {
             this.printData = respond.printData
           })
           .done();
-          app.refresh({ status: this.tabIndex});
+          app.refresh({status:this.tabIndex,search:this.search})
     }
   }
 };