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

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

@@ -50,12 +50,18 @@ import ghsDebtRecord from '@/service/ghs-debt-record/index';
 import statCgGhs from '@/service/stat-cg-ghs/index';
 import shopYeChange from '@/service/shop-ye-change/index';
 import shopExt from '@/service/shop-ext/index';
+import book from '@/service/book/index';
+import bookCustom from '@/service/book-custom/index';
+import bookItemCustom from '@/service/book-item-custom/index';
 
 export function SET_SERVICE({ store }) {
 	// const files = require.context('@/service/', true, /\.js$/);
 	// const ignore = ['./request.js'];
 
 	let modules = {
+		bookItemCustom,
+		bookCustom,
+		book,
 		shopExt,
 		shopYeChange,
 		statCgGhs,

+ 3 - 1
ghs/src/mock/userInfo.js

@@ -157,9 +157,11 @@ let menu = {
 
 		{id: '3',parentId: null,name: '订单',type: 0,icon: 'icondingdanguanli',orderNum: 3,router: '/order/list',viewPath: 'views/order/list.vue',keepAlive: 1},
         {id: '301',parentId: 3,name: '订单列表',type: 1,icon: 'icondingdanguanli',orderNum: 3,router: '/order/list',viewPath: 'views/order/list.vue',keepAlive: 1},
-		{id: '303',parentId: 3,name: '预订汇总',type: 1,icon: 'icondingdanguanli',orderNum: 3,router: '/order/book',viewPath: 'views/order/book.vue',keepAlive: 1},
         {id: '302',parentId: 3,name: '开单',type: 1,icon: 'icondingdanguanli',orderNum: 3,router: '/order/add',viewPath: 'views/order/add.vue',keepAlive: 1},
 		{id: '306',parentId: 3,name: '确认订单',type: 1,icon: 'icondingdanguanli',orderNum: 3,router: '/order/confirm',viewPath: 'views/order/confirm.vue',keepAlive: 1},
+		{id: '303',parentId: 3,name: '预订汇总',type: 1,icon: 'icondingdanguanli',orderNum: 3,router: '/order/book',viewPath: 'views/order/book.vue',keepAlive: 1},
+		{id: '303',parentId: 3,name: '预订客户',type: 1,icon: 'icondingdanguanli',orderNum: 3,router: '/book/custom',viewPath: 'views/book/custom.vue',keepAlive: 1},
+		{id: '306',parentId: 3,name: '预订明细',type: 1,icon: 'icondingdanguanli',orderNum: 3,router: '/book/itemCustom',viewPath: 'views/book/itemCustom.vue',keepAlive: 1},
 
 		{id: '15',parentId: null,name: '供货',type: 0,icon: 'icondingdanguanli',orderNum: 3,router: '/in/ghs',viewPath: 'views/in/ghs.vue',keepAlive: 1},
 		{id: '1505',parentId: 15,name: '商家列表',type: 1,icon: 'icondingdanguanli',orderNum: 3,router: '/in/ghs',viewPath: 'views/in/ghs.vue',keepAlive: 1},

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

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

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

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

+ 13 - 0
ghs/src/service/book/index.js

@@ -0,0 +1,13 @@
+import { BaseService, Service } from '@/cool';
+@Service('book')
+export class BookService extends BaseService {
+
+	changeBook(params) {
+		return this.request({
+			url: '/change-book',
+			params
+		});
+	}
+
+}
+export default new BookService();

+ 163 - 0
ghs/src/views/book/custom.vue

@@ -0,0 +1,163 @@
+<template>
+	<div class="app-list-content">
+		<x-crud class="liu-crud-wrap" @load="onLoad">
+
+			<template #slot-tabs>
+				<el-tabs class="liu-tabs" type="border-card" v-model="tabIndex">
+					<el-tab-pane v-for="(item, index) in tabsData" :key="index" :label="`${item.text}`" :name="item.key" ></el-tab-pane>
+				</el-tabs>
+			</template>
+
+			<template #slot-column-option="{scope}">
+				<el-button @click.stop="goDetail(scope.row)" size="medium" type="primary">查看明细</el-button>
+			</template>
+
+		</x-crud>
+	</div>
+</template>
+<script>
+import { mapGetters, mapActions } from 'vuex';
+export default {
+	components: {
+	},
+	data() {
+		return {
+			app: null,
+			tabIndex: '0',
+			tabsData: [
+				{
+					text: '列表',
+					key: '0',
+					val: 0
+				},
+			],
+			ghsInfoList: [],
+			loading: false,
+			ghsId:0,
+            endTime:''
+		};
+	},
+	methods: {
+		goDetail(info){
+			let query = {customId:info.customId,customName:info.name}
+			this.$router.push({path:'/book/itemCustom',query})
+		},
+		onLoad({ ctx, app }) {
+			this.app = app;
+			ctx.service(this.$service.bookCustom)
+				.set('table', {
+					columns: [
+                        {
+							prop: 'seatSn',
+							label: '货位号',
+							align: 'center',
+						},
+						{
+							prop: 'name',
+							label: '名称',
+							align: 'center',
+						},
+						{
+							prop: 'bookNum',
+							label: '预订',
+							align: 'center',
+						},
+						{
+							prop: 'onNum',
+							label: '上架',
+							align: 'center',
+						},
+						{
+							prop: 'roadNum',
+							label: '路上',
+							align: 'center',
+						},
+						{
+							prop: 'needCgNum',
+							label: '待采',
+							align: 'center',
+						},
+						{
+							prop: 'hasRemark',
+							label: '是否备注',
+							align: 'center',
+						},
+						{
+							prop: 'box',
+							label: '是否装箱',
+							align: 'center',
+						}
+					],
+					op: {
+						visible: true,
+						props: {
+							width: 500,
+							align: 'left',
+							fixed: 'right',
+							label: '操作'
+						},
+						layout: ['slot-column-option']
+					}
+				})
+				.set('dict', {
+					search: {
+						keyWord: 'name'
+					}
+				})
+				.set('search', {
+					key: { placeholder: '...' }
+				})
+				.set('layout', [
+					['slot-tabs'],
+					['data-table'],
+					['flex1']
+				])
+				.done();
+				app.refresh()
+		}
+	}
+};
+</script>
+
+<style lang="scss" scoped>
+.user-name-warp {
+	display: flex;
+	align-items: center;
+	span {
+		margin-left: 6px;
+	}
+}
+.recharge-modal-content {
+	@include disFlex(center, space-around);
+	.card-name {
+		width: 200px;
+		height: 100%;
+		border-right: 1px solid $borderColor;
+	}
+}
+
+.store-icon {
+	i {
+		font-size: 18px;
+	}
+
+	.el-icon-check {
+		color: #fee470;
+	}
+
+	.el-icon-close {
+		color: #999;
+	}
+}
+.accounts-list{
+    width: 80%;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    margin: 0 auto;
+    padding-bottom: 20px;
+    .accounts-center{
+      width: 80%;
+    }
+  }
+</style>

+ 196 - 0
ghs/src/views/book/itemCustom.vue

@@ -0,0 +1,196 @@
+<template>
+	<div class="app-list-content">
+		<x-crud class="liu-crud-wrap" @load="onLoad">
+
+			<template #slot-tabs>
+				<el-tabs class="liu-tabs" type="border-card" v-model="tabIndex">
+					<el-tab-pane v-for="(item, index) in tabsData" :key="index" :label="`${item.text}`" :name="item.key" ></el-tab-pane>
+				</el-tabs>
+			</template>
+
+			<template #slot-column-option="{scope}">
+			</template>
+
+			<template #slot-search-option="{scope}">
+                <span style="font-size:32upx;color:blue;font-weight:bold;margin-left:30upx;padding:10upx 0 10upx 0;" v-if="remainNum && Number(remainNum)>0 && Number(itemId)>0">
+					{{ remainName }} 剩 {{ remainNum }}份
+				</span>
+				<span v-if="Number(customId)>0" style="font-size:32upx;color:blue;font-weight:bold;margin-left:30upx;padding:10upx 0 10upx 0;">
+					【{{ customName }}】的花材
+				</span>
+			</template>
+
+		</x-crud>
+	</div>
+</template>
+<script>
+import { mapGetters, mapActions } from 'vuex';
+export default {
+	components: {
+	},
+	data() {
+		return {
+			app: null,
+			tabIndex: '0',
+			tabsData: [
+				{
+					text: '列表',
+					key: '0',
+					val: 0
+				},
+			],
+			ghsInfoList: [],
+			loading: false,
+			ghsId:0,
+            endTime:'',
+			itemId:0,
+			itemName:'',
+			customId:0,
+			customName:'',
+			remainName:'',
+			remainNum:0
+		};
+	},
+	methods: {
+		onLoad({ ctx, app }) {
+			this.app = app;
+			
+			this.itemId = this.$route.query.itemId?this.$route.query.itemId:0
+			this.itemName = this.$route.query.itemName?this.$route.query.itemName:''
+			
+			this.customId = this.$route.query.customId?this.$route.query.customId:0
+			this.customName = this.$route.query.customName?this.$route.query.customName:''
+
+			ctx.service(this.$service.bookItemCustom)
+			.set('table', {
+				columns: [
+					{
+						prop: 'seatSn',
+						label: '货位号',
+						align: 'center',
+					},
+					{
+						prop: 'name',
+						label: '名称',
+						align: 'center',
+					},
+					{
+						prop: 'bookNum',
+						label: '预订',
+						align: 'center',
+					},
+					{
+						prop: 'onNum',
+						label: '上架',
+						align: 'center',
+					},
+					{
+						prop: 'roadNum',
+						label: '路上',
+						align: 'center',
+					},
+					{
+						prop: 'needCgNum',
+						label: '待采',
+						align: 'center',
+					},
+					{
+						prop: 'hasRemark',
+						label: '是否备注',
+						align: 'center',
+					},
+					{
+						prop: 'box',
+						label: '是否装箱',
+						align: 'center',
+					},
+					{
+						prop: 'customName',
+						label: '客户',
+						align: 'center',
+					},
+					{
+						prop: 'seatSn',
+						label: '货位',
+						align: 'center',
+					},
+				],
+				op: {
+					visible: true,
+					props: {
+						width: 300,
+						align: 'center',
+						fixed: 'right',
+						label: '操作'
+					},
+					layout: ['slot-column-option']
+				}
+			})
+			.set('dict', {
+				search: {
+					keyWord: 'name'
+				}
+			})
+			.set('search', {
+				key: { placeholder: '...' }
+			})
+			.set('layout', [
+				['slot-tabs'],
+				['slot-search-option'],
+				['data-table'],
+				['flex1']
+			])
+			.on('refresh', async (params, { next }) => {
+				let res = await next(params)
+				this.remainName = res.remainName?res.remainName:''
+				this.remainNum = res.remainNum?res.remainNum:0
+			})
+			.done();
+			app.refresh({itemId:this.itemId,customId:this.customId})
+		}
+	}
+};
+</script>
+
+<style lang="scss" scoped>
+.user-name-warp {
+	display: flex;
+	align-items: center;
+	span {
+		margin-left: 6px;
+	}
+}
+.recharge-modal-content {
+	@include disFlex(center, space-around);
+	.card-name {
+		width: 200px;
+		height: 100%;
+		border-right: 1px solid $borderColor;
+	}
+}
+
+.store-icon {
+	i {
+		font-size: 18px;
+	}
+
+	.el-icon-check {
+		color: #fee470;
+	}
+
+	.el-icon-close {
+		color: #999;
+	}
+}
+.accounts-list{
+    width: 80%;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    margin: 0 auto;
+    padding-bottom: 20px;
+    .accounts-center{
+      width: 80%;
+    }
+  }
+</style>

+ 28 - 17
ghs/src/views/order/book.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="app-list-content">
     <x-crud class="liu-crud-wrap order-list-wrap" @load="onLoad">
-      <!-- tabs -->
+
       <template #slot-tabs>
         <el-tabs class="liu-tabs" type="border-card" v-model="tabIndex">
           <el-tab-pane
@@ -13,36 +13,35 @@
         </el-tabs>
       </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>
 			</template>
 
-			<!-- 添加商品 -->
 			<template #slot-option-area-list>
-
-        <el-popover style="margin-left:40px;" placement="top" width="160" ref="directPrintRef">
+        <el-popover style="margin-left:40px;" placement="top" width="160" ref="openCloseBookRef">
           <p>确认{{ shop.bookSn==0?'开启':'结束' }}?</p>
           <div style="text-align: right; margin: 0">
-          <el-button size="mini" type="text" @click.stop="">取消</el-button>
-          <el-button type="primary" size="mini" @click.stop="">确定</el-button>
+          <el-button size="mini" type="text" @click.stop="cancelBook">取消</el-button>
+          <el-button type="primary" size="mini" @click.stop="changeBook(shop.bookSn)">确定</el-button>
           </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="" style="margin-left:40px;">去采购</el-button>				
 			</template>
 
-      <template #table-column-remainStockNumt="{scope}">
+      <template #table-column-remainStockNum="{scope}">
           <span v-if="Number(scope.row.remainStockNum)>0 && (Number(scope.row.bookNum)-Number(scope.row.onNum))>0" style="color:blue;font-weight:bold;">
             {{scope.row.remainStockNum?parseFloat(scope.row.remainStockNum):0}}
           </span>
           <span v-else>{{scope.row.remainStockNum?parseFloat(scope.row.remainStockNum):0}}</span>
       </template>
 
+			<template #slot-column-option="{scope}">
+        <el-button @click.stop="goDetail(scope.row)" size="medium" type="primary">查看明细</el-button>
+      </template>
+
     </x-crud>
 
   </div>
@@ -111,8 +110,20 @@ export default {
     this.init();
   },
   methods: {
-    cancelLittlePrint(){
-      this.$refs['littlePrintRef'].doClose()
+    goDetail(info){
+      let query = {itemId:info.itemId,itemName:info.name}
+      this.$router.push({path:'/book/itemCustom',query})
+    },
+    cancelBook(){
+      this.$refs['openCloseBookRef'].doClose()
+    },
+    changeBook(bookSn){
+      this.$refs['openCloseBookRef'].doClose()
+      let status = bookSn == 0 ? 1 : 0
+      return this.$service.book.changeBook({status:status}).then((res) => {
+        this.$message.success('操作成功')
+        this.app.refresh({ status: this.tabIndex})
+      })
     },
     init(){
 
@@ -131,7 +142,7 @@ export default {
       this.searchTime = 'custom'
       this.startDate = startDate
       this.endDate = endDate
-      this.app.refresh({ status: this.tabIndex,searchTime:this.searchTime,startTime:startDate,endTime:endDate});
+      this.app.refresh({ status: this.tabIndex})
     },
     onLoad({ ctx, app }) {
       this.app = app;
@@ -182,8 +193,8 @@ export default {
             op: {
               visible: true,
               props: {
-                width: 300,
-                align: 'center',
+                width: 500,
+                align: 'left',
                 fixed: 'right',
                 label: '操作'
               },
@@ -201,7 +212,7 @@ export default {
             this.printData = respond.printData
           })
           .done();
-          app.refresh({ status: this.tabIndex,searchTime:this.searchTime});
+          app.refresh({ status: this.tabIndex});
     }
   }
 };

+ 5 - 2
ghsApp/src/admin/book/itemCustom.vue

@@ -2,9 +2,12 @@
 	<view class="app-content">
 		<view class="ex-page">
             <view class="top-bar">
-                <view style="font-size:32upx;color:blue;font-weight:bold;margin-left:30upx;padding:10upx 0 10upx 0;" v-if="respond.remainNum && Number(respond.remainNum)>0">
+                <view style="font-size:32upx;color:blue;font-weight:bold;margin-left:30upx;padding:10upx 0 10upx 0;" v-if="Number(itemId)>0 && respond.remainNum && Number(respond.remainNum)>0">
 					{{ respond.remainName }} 剩 {{ respond.remainNum }}份
 				</view>
+                <view style="font-size:32upx;color:blue;font-weight:bold;margin-left:30upx;padding:10upx 0 10upx 0;" v-if="Number(customId)>0">
+					【{{ customName }}】预订的花材
+				</view>
             </view>
             <scroll-view scroll-y scroll-with-animation class="main-view">
                 <view class="space-view ex-table">
@@ -313,7 +316,7 @@ export default {
 			}
 			if(this.option.customId){
 				this.customId = this.option.customId
-				this.customName = this.option.custonName
+				this.customName = this.option.customName
 			}
 			uni.showLoading()
 			getBookItemCustomList({itemId:this.itemId,customId:this.customId}).then(res => {