shish 2 лет назад
Родитель
Сommit
ce46f66caa

+ 8 - 0
ghs/src/cool/request/index.js

@@ -62,12 +62,20 @@ import bookCustomCgChange from '@/service/book-custom-cg-change/index';
 import bookCustomChange from '@/service/book-custom-change/index';
 import bookCustomChange from '@/service/book-custom-change/index';
 import bookCustomOnChange from '@/service/book-custom-on-change/index';
 import bookCustomOnChange from '@/service/book-custom-on-change/index';
 import bookCustomRoadChange from '@/service/book-custom-road-change/index';
 import bookCustomRoadChange from '@/service/book-custom-road-change/index';
+import bookCgChange from '@/service/book-cg-change/index';
+import bookChange from '@/service/book-change/index';
+import bookOnChange from '@/service/book-on-change/index';
+import bookRoadChange from '@/service/book-road-change/index';
 
 
 export function SET_SERVICE({ store }) {
 export function SET_SERVICE({ store }) {
 	// const files = require.context('@/service/', true, /\.js$/);
 	// const files = require.context('@/service/', true, /\.js$/);
 	// const ignore = ['./request.js'];
 	// const ignore = ['./request.js'];
 
 
 	let modules = {
 	let modules = {
+		bookCgChange,
+		bookChange,
+		bookOnChange,
+		bookRoadChange,
 		bookCustomCgChange,
 		bookCustomCgChange,
 		bookCustomChange,
 		bookCustomChange,
 		bookCustomOnChange,
 		bookCustomOnChange,

+ 6 - 0
ghs/src/service/book-cg-change/index.js

@@ -0,0 +1,6 @@
+import { BaseService, Service } from '@/cool';
+@Service('book-cg-change')
+export class BookCgChangeService extends BaseService {
+
+}
+export default new BookCgChangeService();

+ 6 - 0
ghs/src/service/book-change/index.js

@@ -0,0 +1,6 @@
+import { BaseService, Service } from '@/cool';
+@Service('book-change')
+export class BookChangeService extends BaseService {
+
+}
+export default new BookChangeService();

+ 6 - 0
ghs/src/service/book-on-change/index.js

@@ -0,0 +1,6 @@
+import { BaseService, Service } from '@/cool';
+@Service('book-on-change')
+export class BookOnChangeService extends BaseService {
+
+}
+export default new BookOnChangeService();

+ 6 - 0
ghs/src/service/book-road-change/index.js

@@ -0,0 +1,6 @@
+import { BaseService, Service } from '@/cool';
+@Service('book-road-change')
+export class BookRoadChangeService extends BaseService {
+
+}
+export default new BookRoadChangeService();

+ 95 - 0
ghs/src/views/book/components/book-cg-record.vue

@@ -0,0 +1,95 @@
+<template>
+	<div>
+		<el-drawer :visible.sync="showArea" size="55vw" :before-close="closeFn" custom-class="drawer-class" direction="ltr">
+			<div>
+				<div style="margin-left:2px;font-weight:bold;">【{{ currentData.customName?currentData.customName:'' }}】待采变动记录</div>
+                <x-crud @load="onLoad">
+					<template #table-column-changeNum="{scope}">
+						{{ scope.row.io == 1 ? '+' : '-' }}<span>{{ scope.row.changeNum }}</span>
+					</template>
+                </x-crud>
+			</div>
+		</el-drawer>
+	</div>
+</template>
+<script>
+export default {
+	name: 'book-custom-cg-record',
+	props: {
+		currentData: {
+			type: Object,
+			default: () => {}
+		}
+	},
+	data() {
+		return {
+			showArea: false
+		};
+	},
+	methods: {
+		init() {
+			this.showArea = true
+			if(this.app){
+				this.app.refresh({relateSecondId:this.currentData.id,customId:this.currentData.customId,itemId:this.currentData.itemId})
+			}
+		},
+		closeFn() {
+			this.showArea = false;
+		},
+		onLoad({ ctx, app }) {
+			this.app = app;
+			ctx.service(this.$service.bookCgChange)
+			.set('table', {
+				columns: [
+					{
+						label: '日期',
+						prop: 'addTime',
+						align: 'center',
+					},
+					{
+						label: '事项',
+						prop: 'event',
+						align: 'center',
+					},
+					{
+						label: '变动',
+						prop: 'changeNum',
+						align: 'center',
+					},
+					{
+						label: '最终',
+						prop: 'num',
+						align: 'center',
+					},
+					{
+						label: '操作人',
+						prop: 'staffName',
+						align: 'center',
+					}
+				],
+				op: {
+					visible: true,
+					props: {
+						width: 60,
+						align: 'center',
+						fixed: 'right',
+						label: '操作'
+					},
+					layout: []
+				}
+			})
+			.set('layout', [
+				[ 'data-table' ],
+				['flex1']
+			])
+			.done()
+			app.refresh({relateSecondId:this.currentData.id,customId:this.currentData.customId,itemId:this.currentData.itemId})
+		}
+	}
+};
+</script>
+<style lang="scss" scoped>
+.drawer-class{
+	height:100vh;
+}
+</style>

+ 95 - 0
ghs/src/views/book/components/book-on-record.vue

@@ -0,0 +1,95 @@
+<template>
+	<div>
+		<el-drawer :visible.sync="showArea" size="55vw" :before-close="closeFn" custom-class="drawer-class" direction="ltr">
+			<div>
+				<div style="margin-left:2px;font-weight:bold;">【{{ currentData.customName?currentData.customName:'' }}】上下架记录</div>
+                <x-crud @load="onLoad">
+					<template #table-column-changeNum="{scope}">
+						{{ scope.row.io == 1 ? '+' : '-' }}<span>{{ scope.row.changeNum }}</span>
+					</template>
+                </x-crud>
+			</div>
+		</el-drawer>
+	</div>
+</template>
+<script>
+export default {
+	name: 'book-custom-on-record',
+	props: {
+		currentData: {
+			type: Object,
+			default: () => {}
+		}
+	},
+	data() {
+		return {
+			showArea: false
+		};
+	},
+	methods: {
+		init() {
+			this.showArea = true
+			if(this.app){
+				this.app.refresh({relateSecondId:this.currentData.id,customId:this.currentData.customId,itemId:this.currentData.itemId})
+			}
+		},
+		closeFn() {
+			this.showArea = false;
+		},
+		onLoad({ ctx, app }) {
+			this.app = app;
+			ctx.service(this.$service.bookOnChange)
+			.set('table', {
+				columns: [
+					{
+						label: '日期',
+						prop: 'addTime',
+						align: 'center',
+					},
+					{
+						label: '事项',
+						prop: 'event',
+						align: 'center',
+					},
+					{
+						label: '变动',
+						prop: 'changeNum',
+						align: 'center',
+					},
+					{
+						label: '最终',
+						prop: 'num',
+						align: 'center',
+					},
+					{
+						label: '操作人',
+						prop: 'staffName',
+						align: 'center',
+					}
+				],
+				op: {
+					visible: true,
+					props: {
+						width: 160,
+						align: 'center',
+						fixed: 'right',
+						label: '操作'
+					},
+					layout: []
+				}
+			})
+			.set('layout', [
+				[ 'data-table' ],
+				['flex1']
+			])
+			.done()
+			app.refresh({relateSecondId:this.currentData.id,customId:this.currentData.customId,itemId:this.currentData.itemId})
+		}
+	}
+};
+</script>
+<style lang="scss" scoped>
+.drawer-class{
+	height:100vh;
+}
+</style>

+ 95 - 0
ghs/src/views/book/components/book-record.vue

@@ -0,0 +1,95 @@
+<template>
+	<div>
+		<el-drawer :visible.sync="showArea" size="55vw" :before-close="closeFn" custom-class="drawer-class" direction="ltr">
+			<div>
+				<div style="margin-left:2px;font-weight:bold;">【{{ currentData.customName?currentData.customName:'' }}】预订记录</div>
+                <x-crud @load="onLoad">
+					<template #table-column-changeNum="{scope}">
+						{{ scope.row.io == 1 ? '+' : '-' }}<span>{{ scope.row.changeNum }}</span>
+					</template>
+                </x-crud>
+			</div>
+		</el-drawer>
+	</div>
+</template>
+<script>
+export default {
+	name: 'book-record',
+	props: {
+		currentData: {
+			type: Object,
+			default: () => {}
+		}
+	},
+	data() {
+		return {
+			showArea: false
+		};
+	},
+	methods: {
+		init() {
+			this.showArea = true
+			if(this.app){
+				this.app.refresh({relateSecondId:this.currentData.id,customId:this.currentData.customId,itemId:this.currentData.itemId})
+			}
+		},
+		closeFn() {
+			this.showArea = false;
+		},
+		onLoad({ ctx, app }) {
+			this.app = app;
+			ctx.service(this.$service.bookChange)
+			.set('table', {
+				columns: [
+					{
+						label: '日期',
+						prop: 'addTime',
+						align: 'center',
+					},
+					{
+						label: '事项',
+						prop: 'event',
+						align: 'center',
+					},
+					{
+						label: '变动',
+						prop: 'changeNum',
+						align: 'center',
+					},
+					{
+						label: '最终',
+						prop: 'num',
+						align: 'center',
+					},
+					{
+						label: '操作人',
+						prop: 'staffName',
+						align: 'center',
+					}
+				],
+				op: {
+					visible: true,
+					props: {
+						width: 160,
+						align: 'center',
+						fixed: 'right',
+						label: '操作'
+					},
+					layout: []
+				}
+			})
+			.set('layout', [
+				[ 'data-table' ],
+				['flex1']
+			])
+			.done()
+			app.refresh({relateSecondId:this.currentData.id,customId:this.currentData.customId,itemId:this.currentData.itemId})
+		}
+	}
+};
+</script>
+<style lang="scss" scoped>
+.drawer-class{
+	height:100vh;
+}
+</style>

+ 95 - 0
ghs/src/views/book/components/book-road-record.vue

@@ -0,0 +1,95 @@
+<template>
+	<div>
+		<el-drawer :visible.sync="showArea" size="55vw" :before-close="closeFn" custom-class="drawer-class" direction="ltr">
+			<div>
+				<div style="margin-left:2px;font-weight:bold;">【{{ currentData.customName?currentData.customName:'' }}】路上记录</div>
+                <x-crud @load="onLoad">
+					<template #table-column-changeNum="{scope}">
+						{{ scope.row.io == 1 ? '+' : '-' }}<span>{{ scope.row.changeNum }}</span>
+					</template>
+                </x-crud>
+			</div>
+		</el-drawer>
+	</div>
+</template>
+<script>
+export default {
+	name: 'book-custom-road-record',
+	props: {
+		currentData: {
+			type: Object,
+			default: () => {}
+		}
+	},
+	data() {
+		return {
+			showArea: false
+		};
+	},
+	methods: {
+		init() {
+			this.showArea = true
+			if(this.app){
+				this.app.refresh({relateSecondId:this.currentData.id,customId:this.currentData.customId,itemId:this.currentData.itemId})
+			}
+		},
+		closeFn() {
+			this.showArea = false;
+		},
+		onLoad({ ctx, app }) {
+			this.app = app;
+			ctx.service(this.$service.bookRoadChange)
+			.set('table', {
+				columns: [
+					{
+						label: '日期',
+						prop: 'addTime',
+						align: 'center',
+					},
+					{
+						label: '事项',
+						prop: 'event',
+						align: 'center',
+					},
+					{
+						label: '变动',
+						prop: 'changeNum',
+						align: 'center',
+					},
+					{
+						label: '最终',
+						prop: 'num',
+						align: 'center',
+					},
+					{
+						label: '操作人',
+						prop: 'staffName',
+						align: 'center',
+					}
+				],
+				op: {
+					visible: true,
+					props: {
+						width: 160,
+						align: 'center',
+						fixed: 'right',
+						label: '操作'
+					},
+					layout: []
+				}
+			})
+			.set('layout', [
+				[ 'data-table' ],
+				['flex1']
+			])
+			.done()
+			app.refresh({relateSecondId:this.currentData.id,customId:this.currentData.customId,itemId:this.currentData.itemId})
+		}
+	}
+};
+</script>
+<style lang="scss" scoped>
+.drawer-class{
+	height:100vh;
+}
+</style>

+ 55 - 3
ghs/src/views/book/itemCustom.vue

@@ -9,6 +9,11 @@
 			</template>
 			</template>
 
 
 			<template #slot-column-option="{scope}">
 			<template #slot-column-option="{scope}">
+				<el-button @click.stop="goGhDetail(scope.row)" size="medium" type="primary">供货明细</el-button>
+				<el-button @click.stop="getBookRecord(scope.row)" size="medium" type="primary">预订记录</el-button>
+				<el-button @click.stop="getOnRecord(scope.row)" size="medium" type="primary">上下架记录</el-button>
+				<el-button @click.stop="getRoadRecord(scope.row)" size="medium" type="primary">路上记录</el-button>
+				<el-button @click.stop="getCgRecord(scope.row)" size="medium" type="primary">待采记录</el-button>
 			</template>
 			</template>
 
 
 			<template #slot-search-option="{scope}">
 			<template #slot-search-option="{scope}">
@@ -25,12 +30,26 @@
 			</template>
 			</template>
 
 
 		</x-crud>
 		</x-crud>
+
+		<book-record ref="bookRecord" :currentData="bookRecordData" />
+		<book-on-record ref="bookOnRecord" :currentData="bookOnRecordData" />
+		<book-road-record ref="bookRoadRecord" :currentData="bookRoadRecordData" />
+		<book-cg-record ref="bookCgRecord" :currentData="bookCgRecordData" />
+
 	</div>
 	</div>
 </template>
 </template>
 <script>
 <script>
 import { mapGetters, mapActions } from 'vuex';
 import { mapGetters, mapActions } from 'vuex';
+import bookRecord from './components/book-record';
+import bookOnRecord from './components/book-on-record';
+import bookCgRecord from './components/book-cg-record';
+import bookRoadRecord from './components/book-road-record';
 export default {
 export default {
 	components: {
 	components: {
+		bookRecord,
+		bookOnRecord,
+		bookCgRecord,
+		bookRoadRecord
 	},
 	},
 	data() {
 	data() {
 		return {
 		return {
@@ -52,10 +71,43 @@ export default {
 			customId:0,
 			customId:0,
 			customName:'',
 			customName:'',
 			remainName:'',
 			remainName:'',
-			remainNum:0
+			remainNum:0,
+			bookCgRecordData:{},
+			bookRoadRecordData:{},
+			bookOnRecordData:{},
+			bookRecordData:{}
 		};
 		};
 	},
 	},
 	methods: {
 	methods: {
+		goGhDetail(info){
+
+		},
+		getCgRecord(info){
+			this.bookCgRecordData = {customId:info.customId,customName:info.customName,id:info.id,itemName:info.name,itemId:info.itemId}
+			setTimeout(() => {
+				this.$refs.bookCgRecord.init()
+			})
+		},
+		getRoadRecord(info){
+			this.bookRoadRecordData = {customId:info.customId,customName:info.customName,id:info.id,itemName:info.name,itemId:info.itemId}
+			setTimeout(() => {
+				this.$refs.bookRoadRecord.init()
+			})
+		},
+		getOnRecord(info){
+			this.bookOnRecordData = {customId:info.customId,customName:info.customName,id:info.id,itemName:info.name,itemId:info.itemId}
+			setTimeout(() => {
+				this.$refs.bookOnRecord.init()
+			})
+		},
+		getBookRecord(info){
+			let that = this
+			console.log(info)
+			this.bookRecordData = {customId:info.customId,customName:info.customName,id:info.id,itemName:info.name,itemId:info.itemId}
+			setTimeout(() => {
+				that.$refs.bookRecord.init()
+			})
+		},
 		onLoad({ ctx, app }) {
 		onLoad({ ctx, app }) {
 			this.app = app;
 			this.app = app;
 			
 			
@@ -112,8 +164,8 @@ export default {
 				op: {
 				op: {
 					visible: true,
 					visible: true,
 					props: {
 					props: {
-						width: 600,
-						align: 'center',
+						width: 760,
+						align: 'left',
 						fixed: 'right',
 						fixed: 'right',
 						label: '操作'
 						label: '操作'
 					},
 					},