Просмотр исходного кода

预订明细的操作方法优化

shish 2 лет назад
Родитель
Сommit
4fd6186fbd
3 измененных файлов с 108 добавлено и 18 удалено
  1. 22 0
      ghs/src/service/book-item-custom/index.js
  2. 14 0
      ghs/src/service/check-order/index.js
  3. 72 18
      ghs/src/views/book/itemCustom.vue

+ 22 - 0
ghs/src/service/book-item-custom/index.js

@@ -2,5 +2,27 @@ import { BaseService, Service } from '@/cool';
 @Service('book-item-custom')
 @Service('book-item-custom')
 export class BookItemCustomService extends BaseService {
 export class BookItemCustomService extends BaseService {
 
 
+	batchGoOn(data) {
+		return this.request({
+			url: '/batch-go-on',
+			method: 'POST',
+			data: data
+		});
+	}
+
+	goOn(params) {
+		return this.request({
+			url: '/go-on',
+			params
+		});
+	}
+
+	goOff(params) {
+		return this.request({
+			url: '/go-off',
+			params
+		});
+	}
+
 }
 }
 export default new BookItemCustomService();
 export default new BookItemCustomService();

+ 14 - 0
ghs/src/service/check-order/index.js

@@ -10,5 +10,19 @@ export class CheckOrderService extends BaseService {
 		});
 		});
 	}
 	}
 
 
+	bookAddStock(data) {
+		return this.request({
+			url: '/book-add-stock',
+			params: data
+		});
+	}
+
+	bookDelStock(data) {
+		return this.request({
+			url: '/book-del-stock',
+			params: data
+		});
+	}
+
 }
 }
 export default new CheckOrderService();
 export default new CheckOrderService();

+ 72 - 18
ghs/src/views/book/itemCustom.vue

@@ -14,12 +14,12 @@
 				<el-button @click.stop="getOnRecord(scope.row)" size="small" type="primary">上下架记录</el-button>
 				<el-button @click.stop="getOnRecord(scope.row)" size="small" type="primary">上下架记录</el-button>
 				<el-button @click.stop="getRoadRecord(scope.row)" size="small" type="primary">路上记录</el-button>
 				<el-button @click.stop="getRoadRecord(scope.row)" size="small" type="primary">路上记录</el-button>
 				<el-button @click.stop="getCgRecord(scope.row)" size="small" type="primary">待采记录</el-button>
 				<el-button @click.stop="getCgRecord(scope.row)" size="small" type="primary">待采记录</el-button>
-				<el-button @click.stop="getCgRecord(scope.row)" size="small" type="primary">上齐</el-button>
-				<el-button @click.stop="getCgRecord(scope.row)" size="small" type="primary">上架</el-button>
-				<el-button @click.stop="getCgRecord(scope.row)" size="small" type="primary">下架</el-button>
-				<el-button @click.stop="getCgRecord(scope.row)" size="small" type="primary">借库</el-button>
-				<el-button @click.stop="getCgRecord(scope.row)" size="small" type="primary">加库</el-button>
-				<el-button @click.stop="getCgRecord(scope.row)" size="small" type="primary">减库</el-button>
+				<el-button @click.stop="goOn(scope.row)" size="small" type="primary">上齐</el-button>
+				<el-button @click.stop="goUp(scope.row)" size="small" type="primary">上架</el-button>
+				<el-button @click.stop="goOff(scope.row)" size="small" type="primary">下架</el-button>
+				<el-button @click.stop="loanStock(scope.row)" size="small" type="primary">借库</el-button>
+				<el-button @click.stop="addStock(scope.row)" size="small" type="primary">加库</el-button>
+				<el-button @click.stop="delStock(scope.row)" size="small" type="primary">减库</el-button>
 			</template>
 			</template>
 
 
 			<template #slot-search-option="{scope}">
 			<template #slot-search-option="{scope}">
@@ -36,7 +36,7 @@
 			</template>
 			</template>
 
 
 			<template #slot-more-do-btn>
 			<template #slot-more-do-btn>
-				<el-dropdown size="medium" split-button type="primary" @click="modifyClassFn" @command="doMore">
+				<el-dropdown size="medium" split-button type="primary" @click="batchGoOn" @command="doMore">
 				上齐
 				上齐
 				<el-dropdown-menu slot="dropdown">
 				<el-dropdown-menu slot="dropdown">
 					<el-dropdown-item command="developing">开发中</el-dropdown-item>
 					<el-dropdown-item command="developing">开发中</el-dropdown-item>
@@ -99,22 +99,18 @@ export default {
 		};
 		};
 	},
 	},
 	methods: {
 	methods: {
-		modifyClassFn(){
+		batchGoOn(){
 			let that = this
 			let that = this
 			if (this.$util.isEmpty(this.selectedIds)) {
 			if (this.$util.isEmpty(this.selectedIds)) {
-				this.$message.error('请选花材')
+				this.$message.error('请选要上齐项')
 				return false
 				return false
 			}
 			}
-			if(this.selectedClassId == 0){
-				this.$message.error('请选修改后的分类')
-				return false
-			}
-			this.$confirm('确认修改?', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then(() => {
-				this.$service.ptCp.batchModifyClass({ids:JSON.stringify(this.selectedIds),classId:this.selectedClassId}).then((res) => {
+			this.$confirm('确认全上齐?', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then(() => {
+				this.$service.bookItemCustom.batchGoOn({ids:JSON.stringify(this.selectedIds)}).then((res) => {
 					that.$message.success('操作成功')
 					that.$message.success('操作成功')
-					that.selectedClassId = 0
-					that.selectedClassName = ''
-					that.app.refresh({ classStyle:that.classStyle,classId:that.currentCpClassId })
+					setTimeout(()=>{
+						that.app.refresh({itemId:this.itemId,customId:this.customId})
+					},1500)
 				})
 				})
 			})
 			})
 		},
 		},
@@ -123,6 +119,64 @@ export default {
 				this.$message.error('开发中')
 				this.$message.error('开发中')
 			}
 			}
 		},
 		},
+		goUp(info){
+			let that = this
+			this.$prompt('请输入数量','提示',{confirmButtonText:'确定',cancelButtonText:'取消',inputPattern:/^\+?[1-9][0-9]*$/,inputErrorMessage:'数量错误'}).then(({value}) => {
+				this.$service.bookItemCustom.goOn({ id:info.id}).then(data => {
+					that.$message.success('操作成功')
+					setTimeout(()=>{
+						that.app.refresh({itemId:this.itemId,customId:this.customId})
+					},1500)
+				})
+			})
+		},
+		delStock(info){
+			let that = this
+			this.$prompt('请输入数量','提示',{confirmButtonText:'确定',cancelButtonText:'取消',inputPattern:/^\+?[1-9][0-9]*$/,inputErrorMessage:'数量错误'}).then(({value}) => {
+				this.$service.checkOrder.bookDelStock({bookItemCustomId:info.id,num:value,itemId:info.itemId}).then(data => {
+					that.$message.success('操作成功')
+					setTimeout(()=>{
+						that.app.refresh({itemId:this.itemId,customId:this.customId})
+					},1500)
+				})
+			})
+		},
+		addStock(info){
+			let that = this
+			this.$prompt('请输入数量','提示',{confirmButtonText:'确定',cancelButtonText:'取消',inputPattern:/^\+?[1-9][0-9]*$/,inputErrorMessage:'数量错误'}).then(({value}) => {
+				this.$service.checkOrder.bookAddStock({bookItemCustomId:info.id,num:value,itemId:info.itemId}).then(data => {
+					that.$message.success('操作成功')
+					setTimeout(()=>{
+						that.app.refresh({itemId:this.itemId,customId:this.customId})
+					},1500)
+				})
+			})
+		},
+		loanStock(info){
+
+		},
+		goOff(info){
+			let that = this
+			this.$prompt('请输入数量','提示',{confirmButtonText:'确定',cancelButtonText:'取消',inputPattern:/^\+?[1-9][0-9]*$/,inputErrorMessage:'数量错误'}).then(({value}) => {
+				this.$service.bookItemCustom.goOff({ id:info.id,num:value}).then(data => {
+					that.$message.success('操作成功')
+					setTimeout(()=>{
+						that.app.refresh({itemId:this.itemId,customId:this.customId})
+					},1500)
+				})
+			})
+		},
+		goOn(info){
+			let that = this
+			this.$confirm('确认上齐?', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then(() => {
+				this.$service.bookItemCustom.goOn({id:info.id}).then((res) => {
+					that.$message.success('操作成功')
+					setTimeout(()=>{
+						that.app.refresh({itemId:this.itemId,customId:this.customId})
+					},1500)
+				})
+			})
+		},
 		goItemGh(info){
 		goItemGh(info){
 			this.bookItemGhsData = {customId:info.customId,customName:info.customName,id:info.id,itemName:info.name,itemId:info.itemId}
 			this.bookItemGhsData = {customId:info.customId,customName:info.customName,id:info.id,itemName:info.name,itemId:info.itemId}
 			setTimeout(() => {
 			setTimeout(() => {