shish před 1 rokem
rodič
revize
a721a193e6

+ 59 - 0
ghs/src/components/select-staff.vue

@@ -0,0 +1,59 @@
+<template>
+    <el-dialog :title="title" :visible.sync="showDtail" top="1vh" width="40%">
+    <el-table :data="staffList">
+        <el-table-column property="id" label="ID" width="120" align="center"></el-table-column>
+        <el-table-column property="name" label="姓名" width="190" align="center"></el-table-column>
+        <el-table-column property="mobile" label="手机号" width="130" align="center"></el-table-column>
+        <el-table-column prop="cover" label="操作" align="center">
+          <template slot-scope="scope">
+            <el-button @click="getStaff(scope.row)" type="primary">选择</el-button>    
+          </template>
+        </el-table-column>
+    </el-table>
+    <div slot="footer" class="dialog-footer">
+        <el-button @click="showDtail = false">关 闭</el-button>
+    </div>
+    </el-dialog>
+</template>
+<script>
+export default {
+	name: 'select-staff',
+	props: {
+		staffData: {
+			type: Object,
+			default: () => {}
+		}
+	},
+	data() {
+		return {
+			showDtail: false,
+            staffList:[],
+            title:'请选择'
+		};
+	},
+	computed: {
+
+	},
+	methods: {
+		init() {
+            if(this.staffData.title){
+                this.title = this.staffData.title
+            }
+			this.staffList = []
+			this.showDtail = true
+            this.$service.shopAdmin.getAllStaff().then(res => {
+                this.staffList = res.list
+            })
+		},
+		closeFn() {
+			this.showDtail = false;
+		},
+        getStaff(info){
+            this.$emit('getStaff',info)
+            this.closeFn()
+        }
+	}
+};
+</script>
+<style lang="scss">
+</style>

+ 7 - 0
ghs/src/service/order/index.js

@@ -5,6 +5,13 @@ import { baseUrl } from '@/config/env';
 @Service('order')
 export class OrderService extends BaseService {
 
+	changeSendStaff(data) {
+		return this.request({
+			url: '/change-send-staff',
+			params: data
+		});
+	}
+
 	arrival(data) {
 		return this.request({
 			url: '/arrival',

+ 8 - 0
ghs/src/service/product/index.js

@@ -3,6 +3,14 @@ import { BaseService, Service } from '@/cool';
 @Service('product')
 export class ProductService extends BaseService {
 
+  batchModifyCgStaff(data) {
+    return this.request({
+      url: '/batch-modify-cg-staff',
+      method: 'POST',
+      data: data
+    });
+   }
+
   showProduct(data) {
     return this.request({
       url: '/show',

+ 1 - 1
ghs/src/views/in/confirm.vue

@@ -147,7 +147,7 @@
       <div class="remark">Esc 取消,Enter 确认</div>
     </el-dialog>
 
-    <el-dialog title="确认提交" v-if="showCommitPop" :visible.sync="showCommitPop" width="655px" center :close-on-click-modal="false">
+    <el-dialog title="确认提交" v-if="showCommitPop" :visible.sync="showCommitPop" width="655px" center :close-on-click-modal="false" top="0vh">
       <div>
         <div class="accounts-list">
           供货商

+ 131 - 20
ghs/src/views/item/list.vue

@@ -20,6 +20,13 @@
 		</el-popover>
 	</template>
 
+	<template #table-column-cgStaffName="{scope}">
+          <span v-if="scope.row.cgStaffName!=''" style="cursor:pointer;" @click="changeCgStaff(scope.row)">{{ scope.row.cgStaffName }}</span>
+          <span v-else>
+            <i class="el-icon-edit" style="color:#409eff;font-size:17px;cursor:pointer;" slot="reference" @click="changeCgStaff(scope.row)"></i>
+          </span>
+      </template>
+
       <template #table-column-name="{scope}">
 		<span class="item-name" v-if="scope.row.delStatus == 0">{{ scope.row.name }}</span>
 		<span class="item-name" v-else style="color:#CCCCCC;">{{ scope.row.name }}</span>
@@ -133,6 +140,14 @@
 
 	<template #slot-option-area>
 		<el-input v-model="search" placeholder="搜索花材" size="mini" style="width:160px;" ref="itemSearchRef" @input="changeSearch()" @focus="clearSearch()"></el-input>
+
+		<el-select size="mini" v-model="currentItemClassName" placeholder="分类" style="width:150px;margin-left:10px;" @change="getItemClass" clearable>
+			<el-option v-for="item in itemClassList" :key="item.value" :label="item.name" :value="item.id"> </el-option>
+		</el-select>
+
+		<el-select size="mini" v-model="currentCgStaffName" placeholder="采购人" style="width:110px;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>
 		<el-radio-group v-model="hasStock" @change="changeHasStock" style="padding-top:6px;margin-left:10px;">
 			<el-radio label="-1">全部</el-radio>
 			<el-radio label="0">没库存</el-radio>
@@ -140,6 +155,15 @@
 		</el-radio-group>
 	</template>
 
+	<template #slot-more-do-btn>
+		<el-dropdown size="medium" split-button type="primary" @click="batchChangeCgStaff" @command="bottomDoMore($event)">
+		修改采购人
+		<el-dropdown-menu slot="dropdown">
+			<el-dropdown-item command="batchChangeKd">修改开单人</el-dropdown-item>
+		</el-dropdown-menu>
+		</el-dropdown>
+	</template>
+
     </x-crud>
     <item-list-layer :show.sync="showItemModal" :classId.sync="classId" :className.sync="className" @confirm="selectItemFn" @cancel="showItemModal = false">
     </item-list-layer>
@@ -249,19 +273,25 @@
 
 	  <stock-detail ref="stockDetail" :itemData="itemData" @searchFocus="searchFocus" />
 
+	  <select-staff ref="selectStaffRef" @getStaff="getStaff" :staffData="staffData" />
+
   </div>
 </template>
 <script>
 import itemListLayer from '@/components/module/item-list-layer';
 import stockDetail from './components/stock-detail';
+import selectStaff from '@/components/select-staff';
 export default {
   name: 'list',
   components: {
     itemListLayer,
-	stockDetail
+	stockDetail,
+	selectStaff
   },
   data () {
     return {
+		currentItemClassName:'',
+		staffData:{},
 		app: null,
 		hasStock:'-1',
 		sortLink: '',
@@ -308,7 +338,7 @@ export default {
 		batchAlterNum:'',
 		batchAddNum:'',
 		dialogFormVisible:false,
-
+		selectedData:[],
 		canAddPrice:false,
 		canSkAddPrice:false,
 		canByAddPrice:false,
@@ -396,20 +426,81 @@ export default {
 		unitList: [],
 		currentItemId: 0,
 		itemData:{},
-		search:''
+		search:'',
+		currentCgStaffName:'',
+		currentCgStaffId:0,
+		currentCgStaffName:'',
+		staffList:[]
     };
   },
   computed: {
   },
   mounted() {
+	let that = this
+
     this.init()
 
     this.$nextTick(() => {
       this.$refs.itemSearchRef.focus()
     })
 
+    that.$service.shopAdmin.getAllStaff().then(res => {
+      that.staffList = res.list
+    })
+
   },
   methods: {
+	getItemClass(e){
+		this.classId = e
+		this.refreshData()
+	},
+	getCgStaff(e){
+		this.currentCgStaffId = e
+		this.refreshData()
+	},
+	batchChangeCgStaff(){
+		let that = this
+		if (this.$util.isEmpty(this.selectedData)) {
+			this.$message.error('请选择花材')
+			return false
+		}
+		this.staffData = {title:'修改采购负责人',changeType:'batchChangeCgStaff',obj:null}
+		this.$refs.selectStaffRef.init()
+	},
+    bottomDoMore(cmd){
+      if(cmd == 'batchChangeKd'){
+		this.$message.error('开发中')
+      }
+    },
+    getStaff(staff){
+      let that = this
+      if(this.staffData.changeType == 'changeCgStaff'){
+        let item = this.staffData.obj
+		let json = JSON.stringify([item.id])
+        this.$service.product.batchModifyCgStaff({ids:json,staffId:staff.id}).then(res=>{
+          this.$message.success('修改成功')
+          setTimeout(() => {
+            that.refreshData()
+          }, 1000)
+        })
+      }
+	  //批量修改采购负责人
+	  if(this.staffData.changeType == 'batchChangeCgStaff'){
+		let ids = this.selectedData.map(ele=>{
+			return ele.id
+		})
+        this.$service.product.batchModifyCgStaff({ids:JSON.stringify(ids),staffId:staff.id}).then(res=>{
+          this.$message.success('修改成功')
+          setTimeout(() => {
+            that.refreshData()
+          }, 1000)
+        })
+	  }
+    },
+    changeCgStaff(item){
+      this.staffData = {title:'修改采购负责人',changeType:'changeCgStaff',obj:item}
+      this.$refs.selectStaffRef.init()
+    },
     doMore(cmd,data){
       if(cmd == 'downCode'){
 		let id = data.id
@@ -425,7 +516,7 @@ export default {
 	},
 	changeHasStock(e){
 		this.hasStock = e
-		this.goRefresh()
+		this.refreshData()
 	},
 	clearSearch(){
 		if(this.search != ''){
@@ -439,12 +530,12 @@ export default {
         clearTimeout(this.T)
       }
       this.T = setTimeout(function(){
-        that.goRefresh()
+        that.refreshData()
       },650)			
 	},
-	goRefresh(){
+	refreshData(){
 		let that = this
-		that.app.refresh({ classId: that.classId,status:that.status,delStatus:that.delStatus,showPage:1,name:that.search,hasStock:that.hasStock})
+		that.app.refresh({ classId: that.classId,status:that.status,delStatus:that.delStatus,showPage:1,name:that.search,hasStock:that.hasStock,cgStaffId:this.currentCgStaffId})
 	},
 	getStockList(item){
 		this.itemData = {id:item.id,name:item.name}
@@ -594,15 +685,13 @@ export default {
 		}
     },
     onLoad ({ ctx, app }) {
-      this.app = app
-      if (this.$route.query.classId) {
-        this.classId = Number(this.$route.query.classId);
-        if (this.$route.query.className != '') {
-          this.tabsData[0].text = this.$route.query.className;
-          this.$forceUpdate();
-        }
-      }
-
+		this.app = app
+		if (this.$route.query.classId) {
+			this.classId = Number(this.$route.query.classId);
+		}
+		if (this.$route.query.className != '') {
+			this.currentItemClassName = this.$route.query.className
+		}
 		if(this.$route.query.status){
 			this.status = this.$route.query.status
 		}
@@ -614,6 +703,11 @@ export default {
         .set('table', {
           columns: [
 		  	{
+                type: 'selection',
+                align: 'center',
+                width: '40'
+            },
+		  	{
               prop: 'id',
               label: 'ID',
               align: 'center',
@@ -696,6 +790,12 @@ export default {
               label: '上架',
               align: 'center',
               minWidth: 60
+            },
+			{
+              prop: 'cgStaffName',
+              label: '采购人',
+              align: 'center',
+              minWidth:90
             },
 			{
               prop: 'delStatus',
@@ -704,6 +804,13 @@ export default {
               minWidth: 60
             }
           ],
+		  on: {
+              'selection-change': selection => {
+                this.selectedData = selection.map(e => { 
+	                return {id:e.id}
+                })
+              }
+            },
           op: {
             visible: true,
             props: {
@@ -718,14 +825,18 @@ export default {
 		.set('pagination', {
 			size: 50
 		})
-        .set('layout', [['slot-tabs'],['slot-option-area','flex1', 'slot-addNew-goods-btn','slot-add-goods-btn','slot-download-price-btn', 'refresh-btn'],
-		['data-table'],['flex1', 'pagination']]).done();
-		app.refresh({ classId: this.classId,status:this.status,delStatus:this.delStatus,showPage: 1,name:this.search,hasStock:this.hasStock});
+        .set('layout', [
+		['slot-tabs'],
+		['slot-option-area','flex1', 'slot-addNew-goods-btn','slot-add-goods-btn','slot-download-price-btn', 'refresh-btn'],
+		['data-table'],
+		['slot-more-do-btn','flex1', 'pagination']
+		]).done();
+		app.refresh({ classId: this.classId,status:this.status,delStatus:this.delStatus,showPage: 1,name:this.search,hasStock:this.hasStock,cgStaffId:this.currentCgStaffId});
     },
     uploadSuccess() {
 		console.log('valid',this.$refs['replaceForm'].validateField('cover'))
 	},
-    refresh (params) {
+    refresh(params) {
       this.app.refresh(params);
     },
     showAddPrice(){

+ 1 - 1
ghs/src/views/order/components/arrival.vue

@@ -225,7 +225,7 @@ export default {
 			this.$emit('addNewItem',this.arrivalData)
 		},
 		init() {
-			this.data = []
+			this.detailInfo = []
 			this.showDtail = true
 			this.$service.order.arrivalDetail({ id: this.arrivalData.id }).then(res => {
 				this.detailInfo = res

+ 3 - 3
ghs/src/views/order/components/stock-detail.vue

@@ -77,12 +77,12 @@ export default {
 	methods: {
 		clearType(){
 			this.typeValue = ''
-			this.goRefresh()
+			this.refreshData()
 		},
 		changeType(e){
-			this.goRefresh()
+			this.refreshData()
 		},
-		goRefresh(){
+		refreshData(){
 			this.app.refresh({id:this.itemData.id,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,recordType:this.typeValue})
 		},
 		closeTrigger(){

+ 44 - 7
ghs/src/views/order/list.vue

@@ -14,10 +14,17 @@
       </template>
 
       <template #table-column-sendStaffName="{scope}">
-        <span v-if="scope.row.sendStaffName!=''">{{ scope.row.sendStaffName }}</span>
-        <span v-else>
-          <i class="el-icon-edit" style="color:#409eff;font-size:17px;cursor:pointer;" slot="reference"></i>
-        </span>
+          <span v-if="scope.row.sendStaffName!=''" style="cursor:pointer;" @click="changeSendStaff(scope.row)">{{ scope.row.sendStaffName }}</span>
+          <span v-else>
+            <i class="el-icon-edit" style="color:#409eff;font-size:17px;cursor:pointer;" slot="reference" @click="changeSendStaff(scope.row)"></i>
+          </span>
+      </template>
+
+      <template #table-column-shopAdminName="{scope}">
+          <span v-if="scope.row.shopAdminName!=''" style="cursor:pointer;" @click="changeKdStaff(scope.row)">{{ scope.row.shopAdminName }}</span>
+          <span v-else>
+            <i class="el-icon-edit" style="color:#409eff;font-size:17px;cursor:pointer;" slot="reference" @click="changeKdStaff(scope.row)"></i>
+          </span>
       </template>
 
       <template #table-column-clearSign="{scope}">
@@ -174,6 +181,8 @@
 
     </x-crud>
 
+    <select-staff ref="selectStaffRef" @getStaff="getStaff" :staffData="staffData" />
+
     <arrival ref="arrivalRef" :arrivalData="arrivalData" @addNewItem="addNewItem" @refreshData="refreshData" />
 
     <simple-item ref="simpleItemRef" :simpleData="simpleData" @renewArrival="renewArrival" />
@@ -242,6 +251,7 @@
 </template>
 
 <script>
+import selectStaff from '@/components/select-staff';
 import SelOrder from './components/sel-order';
 import OrderDetail from './components/order-detail';
 import arrival from './components/arrival';
@@ -256,7 +266,8 @@ export default {
     arrival,
     simpleItem,
     beginRefund,
-    refundRecord
+    refundRecord,
+    selectStaff
   },
   data() {
     return {
@@ -292,6 +303,7 @@ export default {
       optionData: {},
       arrivalData:{},
       simpleData:{},
+      staffData:{title:'',changeType:'',obj:null},
       orderData:'',
       book:"-1",
       clearSign:"-1",
@@ -361,6 +373,31 @@ export default {
 
 	},
   methods: {
+    getStaff(staff){
+      let that = this
+      if(this.staffData.changeType == 'changeSend'){
+        let order = this.staffData.obj
+        this.$service.order.changeSendStaff({orderId:order.id,staffId:staff.id}).then(res=>{
+          this.$message.success('修改成功')
+          setTimeout(() => {
+            that.refreshData()            
+          }, 1000)
+        })
+        return true
+      }
+      if(this.staffData.changeType == 'changeKd'){
+        this.$message.error('开发中')
+        return false
+      }
+    },
+    changeSendStaff(order){
+      this.staffData = {title:'修改送货员',changeType:'changeSend',obj:order}
+      this.$refs.selectStaffRef.init()
+    },
+    changeKdStaff(order){
+      this.staffData = {title:'修改开单人',changeType:'changeKd',obj:order}
+      this.$refs.selectStaffRef.init()
+    },
     doMore(cmd,data){
       if(cmd == 'cancel'){
         this.$message.error('开发中')
@@ -536,7 +573,7 @@ export default {
 		batchDown(){
 			let that = this
 			if (this.$util.isEmpty(this.selectedData)) {
-				this.$message.error('请选要下载项')
+				this.$message.error('请选择订单')
 				return false
 			}
       this.$confirm('确认下载?确认后请稍等30秒', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then(() => {
@@ -557,7 +594,7 @@ export default {
       if(cmd == 'batchAllDown'){
         let that = this
         if (this.$util.isEmpty(this.selectedData)) {
-          this.$message.error('请选要下载项')
+          this.$message.error('请选择订单')
           return false
         }
 

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

@@ -63,7 +63,7 @@
 			<template #slot-item-class="{scope}">
 				<el-select size="mini" v-model="currentItemClassName" placeholder="花材分类" style="width:150px;margin-right:10px;" @change="getItemClass" clearable>
 					<el-option v-for="item in itemClassList" :key="item.value" :label="item.name" :value="item.id"> </el-option>
-				</el-select>				
+				</el-select>
 			</template>
 
 			<template #slot-item-suggest-class="{scope}">