shish 1 год назад
Родитель
Сommit
7c4887cb71

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

@@ -3,6 +3,13 @@ import { BaseService, Service } from '@/cool';
 @Service('custom')
 @Service('custom')
 export class CustomService extends BaseService {
 export class CustomService extends BaseService {
 
 
+	getAllList(data) {
+		return this.request({
+			url: '/list',
+			params: data
+		});
+	}
+
 	createCustomers(data) {
 	createCustomers(data) {
 		return this.request({
 		return this.request({
 			url: '/create-customers',
 			url: '/create-customers',

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

@@ -10,5 +10,12 @@ export class LiveOrderService extends BaseService {
 		});
 		});
 	}
 	}
 
 
+	getDetail(data) {
+		return this.request({
+			url: '/get-detail',
+			params: data
+		});
+	}
+
 }
 }
 export default new LiveOrderService();
 export default new LiveOrderService();

+ 147 - 0
ghs/src/views/order/components/live-custom.vue

@@ -0,0 +1,147 @@
+<template>
+	<div>
+		<el-drawer :visible.sync="showArea" size="40vw" :before-close="closeFn" custom-class="drawer-class" direction="rtl">
+			<div>
+                <x-crud @load="onLoad">
+
+                    <template #table-column-name="{ scope }">
+                        <span style="font-size:16px;">{{ scope.row.name }}</span>
+                    </template>
+
+                    <template #table-column-showUsePrice="{ scope }">
+                        <el-input v-model="scope.row.showUsePrice" placeholder="单价"></el-input>
+                    </template>
+
+                    <template #table-column-bigCount="{ scope }">
+                        <el-input v-model="scope.row.bigCount" placeholder="数量"></el-input>
+                    </template>
+
+                    <template #slot-column-option="{scope}">
+                        <el-button @click.stop="confirmAdd(scope.row)" size="medium" type="primary">添加</el-button>
+                    </template>
+
+                    <template #slot-option-area-list>
+                        <el-input v-model="search" placeholder="搜索客户" size="big" style="width:200px;" :clearable="true" ref="customSearchRef" @input="changeSearch()" @focus="search=''"></el-input>
+                    </template>
+                </x-crud>
+			</div>
+		</el-drawer>
+	</div>
+</template>
+<script>
+export default {
+	name: 'simple-item',
+	props: {
+		customData: {
+			type: Object,
+			default: () => {}
+		}
+	},
+	data() {
+		return {
+			showArea: false,
+            search:''
+		};
+	},
+	methods: {
+		changeSearch(){
+            let that = this
+            if(this.T != null){
+                clearTimeout(this.T)
+            }
+            this.T = setTimeout(function(){
+                that.app.refresh({name:this.search})
+            },650)
+		},
+		init() {
+			this.showArea = true
+            this.search = ''
+			if(this.app){
+				this.app.refresh({name:this.search})
+			}
+            this.$nextTick(() => {
+                this.$refs.customSearchRef.focus()
+            })
+		},
+		closeFn() {
+			this.showArea = false;
+		},
+        confirmAdd(info){
+			if(Number(info.bigCount)<=0){
+				this.$message.error('请填写数量')
+				return false
+			}
+			let showUsePrice = Number(info.showUsePrice)>0 ? info.showUsePrice: 100
+			let data = [{id:info.id,bigCount:info.bigCount,price:showUsePrice}]
+			this.$service.orderItem.addItem({data:JSON.stringify(data),id:this.customData.id}).then(res => {
+				that.$message.success('添加成功')
+				this.$emit('renewArrival',this.customData)
+				this.closeFn()
+			})
+        },
+		onLoad({ ctx, app }) {
+			this.app = app;
+			let customHost = () => {
+				return this.$service.custom.getAllList({name:this.search})
+			};
+			ctx.service({
+				page: customHost
+			})
+			.set('table', {
+				columns: [
+					{
+						label: '数量',
+						prop: 'bigCount',
+						align: 'center',
+                        width:135
+					},
+					{
+						label: '单价',
+						prop: 'showUsePrice',
+						align: 'center',
+                        width:135
+					},
+					{
+						label: '名称',
+						prop: 'name',
+						align: 'center',
+                        width:230
+					},
+                    {
+						label: 'ID',
+						prop: 'id',
+						align: 'center',
+                        width:100
+					}
+				],
+				op: {
+					visible: true,
+					props: {
+						width: 160,
+						align: 'center',
+						fixed: 'left',
+						label: '操作'
+					},
+					layout: ['slot-column-option']
+				}
+			})
+			.set('layout', [
+                ['slot-option-area-list'],
+				[ 'data-table' ],
+				['flex1']
+			])
+			.done()
+			app.refresh({name:this.search})
+		}
+	}
+};
+</script>
+<style lang="scss" scoped>
+.drawer-class{
+	height:100vh;
+}
+::v-deep .el-input__inner {
+  padding:0;
+  text-align:center;
+}
+</style>

+ 33 - 46
ghs/src/views/order/components/live-detail.vue

@@ -1,44 +1,42 @@
 <template>
 <template>
 	<div class="order-detail">
 	<div class="order-detail">
-		<el-drawer :visible.sync="showOrderDetail" size="1000px" :before-close="closeFn" custom-class="order-draw-wrap" direction="ltr" @close="closeTrigger">
-			<div class="order-manage-wrap" v-if="!$util.isEmpty(data)">
-				<div class="card-wrap" style="margin-top:0px;">
-					<div class="card-tit">备注</div>
-					<div class="card-body">
-						<el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="data[0].remark"></el-input>
-					</div>
-					<div style="text-align:center;margin-top:4px;">
-					<el-button @click.stop="modifyRemark()" size="small" type="primary" style="margin:0 auto;">修改</el-button>
-					</div>
-				</div>
+		<el-drawer :visible.sync="showOrderDetail" size="850px" :before-close="closeFn" custom-class="order-draw-wrap" direction="ltr" @close="closeTrigger">
+			<div class="order-manage-wrap" v-if="!$util.isEmpty(customList)">
 				<div class="card-wrap">
 				<div class="card-wrap">
-					<div class="card-tit">花材信息</div>
+					<div class="card-tit">
+						预订客户
+						<el-button type="primary" @click="addCustom()" style="margin-left:620px;">添加客户</el-button>
+					</div>
 					<div class="card-body">
 					<div class="card-body">
-						<el-table :data="data[0].product">
-							<el-table-column label="图片">
+						<el-table :data="customList">
+							<el-table-column property="customId" label="客户ID"></el-table-column>
+							<el-table-column property="customName" label="客户名称"></el-table-column>
+							<el-table-column label="数量">
 								<template slot-scope="scope">
 								<template slot-scope="scope">
-									<cl-avatar shape="square" :size="30" :src="scope.row.cover"></cl-avatar>
+									<el-input v-model="scope.row.num" placeholder="数量" @focus="scope.row.num=''" style="width:80px;"></el-input>
 								</template>
 								</template>
 							</el-table-column>
 							</el-table-column>
-							<el-table-column property="name" label="名称"></el-table-column>
-							<el-table-column property="xhUnitPrice" label="单价"></el-table-column>
-							<el-table-column label="数量">
+							<el-table-column label="单价">
 								<template slot-scope="scope">
 								<template slot-scope="scope">
-									<span style="cursor:pointer;" @click="getStockDetail(scope.row)">
-									<i class="el-icon-s-order" style="color:#409eff;font-size:17px;" slot="reference"></i>
-									{{ scope.row.num?parseFloat(scope.row.num):0 }}
-									</span>
-								</template>								
+									<el-input v-model="scope.row.unitPrice" placeholder="单价" @focus="scope.row.unitPrice=''" style="width:90px;"></el-input>
+								</template>
 							</el-table-column>
 							</el-table-column>
-							<el-table-column property="refundNum" label="已退数"></el-table-column>
-							<el-table-column label="备注">
+							<el-table-column label="合计">
 								<template slot-scope="scope">
 								<template slot-scope="scope">
-									<span @click="modifyItemRemark(scope.row)" style="cursor: pointer;"><i class="el-icon-edit" style="color:#409eff;font-size:17px;cursor:pointer;" slot="reference"></i>{{ scope.row.remark }}</span>
+									¥{{ parseFloat((scope.row.num * scope.row.unitPrice).toFixed(2)) }}
 								</template>
 								</template>
 							</el-table-column>
 							</el-table-column>
 						</el-table>
 						</el-table>
 					</div>
 					</div>
 				</div>
 				</div>
+
+				<div style="margin-left:210px;margin-top:30px;">
+					<el-button @click="closeFn">取消</el-button>
+					<el-popconfirm title="确认保存?" @confirm="savePrice()" @onConfirm="savePrice()" style="margin-left:220px;">
+						<el-button type="primary" slot="reference">保存</el-button>
+					</el-popconfirm>
+				</div>
+
 			</div>
 			</div>
 			<div v-else  v-loading="loading" style="height:800px;"></div>
 			<div v-else  v-loading="loading" style="height:800px;"></div>
 		</el-drawer>
 		</el-drawer>
@@ -56,36 +54,25 @@ export default {
 	data() {
 	data() {
 		return {
 		return {
 			showOrderDetail: false,
 			showOrderDetail: false,
-			data: [],
+			customList: [],
+			info:{},
 			loading:true
 			loading:true
 		};
 		};
 	},
 	},
 	methods: {
 	methods: {
+		addCustom(){
+			this.$emit('addNewCustom',this.orderOperate)
+		},
 		closeTrigger(){
 		closeTrigger(){
 			this.$emit('searchFocus')
 			this.$emit('searchFocus')
 		},
 		},
-		getStockDetail(info){
-			this.$emit('getStockDetail',info)
-		},
-		modifyItemRemark(info){
-			this.$prompt('请输入备注','提示',{confirmButtonText:'确定',cancelButtonText:'取消',inputPattern:/\S/,inputErrorMessage:'请写备注',inputValue:info.remark}).then(({value}) => {
-				this.$service.orderItem.updateItemRemark({ remark: value,id:info.id}).then(data => {
-					info.remark = value
-					this.$message.success('修改成功')
-				})
-			})
-		},
-		modifyRemark(){
-			this.$service.order.modifyRemark({ id: this.orderOperate.id,remark:this.data[0].remark }).then(res => {
-				this.$message.success('修改成功')
-			})
-		},
 		init() {
 		init() {
 			this.data = []
 			this.data = []
 			this.showOrderDetail = true
 			this.showOrderDetail = true
-			this.$service.order.info({ id: this.orderOperate.id }).then(res => {
-				this.data = [res]
-			});
+			this.$service.liveOrder.getDetail({ id: this.orderOperate.id }).then(res => {
+				this.customList = res.customList
+				this.info = res.info
+			})
 		},
 		},
 		closeFn() {
 		closeFn() {
 			this.showOrderDetail = false;
 			this.showOrderDetail = false;

+ 34 - 44
ghs/src/views/order/live-list.vue

@@ -28,17 +28,14 @@
 
 
       <template #slot-column-option="{scope}">
       <template #slot-column-option="{scope}">
 
 
-        <el-button @click.stop="detailShowFn(scope.row)" size="small" type="success" v-if="scope.row.status != 1 && scope.row.status != 5">详情</el-button>
-        <el-button v-else size="small" @click.stop="detailShowFn(scope.row)">详情</el-button>
-        
-        <el-button v-if="scope.row.status != 1 && scope.row.status != 5" @click.stop="printOrder(scope.row)" size="small" type="primary" style="margin-left:30px;">打A4</el-button>
-        <el-button v-else size="small" style="margin-left:30px;">打A4</el-button>
+        <el-button @click.stop="showDetail(scope.row)" size="small" type="success">详情</el-button>
+        <el-button @click.stop="printOrder(scope.row)" size="small" type="primary" style="margin-left:40px;">打A4</el-button>
 
 
       </template>
       </template>
 
 
       <template #slot-search-option="{scope}">
       <template #slot-search-option="{scope}">
         <el-input v-model="searchContent" placeholder="花材名称" size="mini" style="width:140px;" :clearable="true" ref="orderSearchRef" @input="changeSearch()" @focus="searchContent=''"></el-input>
         <el-input v-model="searchContent" placeholder="花材名称" size="mini" style="width:140px;" :clearable="true" ref="orderSearchRef" @input="changeSearch()" @focus="searchContent=''"></el-input>
-				<el-select size="mini" v-model="currentKdStaffName" placeholder="开单人" style="width:110px;margin-left:8px;" @change="getKdStaff" :clearable="true">
+				<el-select size="mini" v-model="currentStaffName" placeholder="开单人" style="width:110px;margin-left:8px;" @change="getStaff" :clearable="true">
 					<el-option v-for="item in staffList" :key="item.id" :label="item.name" :value="item.id"></el-option>
 					<el-option v-for="item in staffList" :key="item.id" :label="item.name" :value="item.id"></el-option>
 				</el-select>
 				</el-select>
         <span style="margin-left:9px;font-size:18px;">创建时间:</span>
         <span style="margin-left:9px;font-size:18px;">创建时间:</span>
@@ -53,17 +50,21 @@
 
 
     </x-crud>
     </x-crud>
 
 
-    <live-detail ref="LiveDetail" :orderOperate="optionData" @getStockDetail="getStockDetail" @searchFocus="searchFocus" />
+    <live-detail ref="liveDetailRef" :orderOperate="optionData" @searchFocus="searchFocus" @addNewCustom="addNewCustom" />
+
+    <live-custom ref="liveCustomRef" :customData="customData" />
 
 
   </div>
   </div>
 </template>
 </template>
 
 
 <script>
 <script>
 import LiveDetail from './components/live-detail';
 import LiveDetail from './components/live-detail';
+import LiveCustom from './components/live-custom';
 import {hiprint, defaultElementTypeProvider} from 'vue-plugin-hiprint'
 import {hiprint, defaultElementTypeProvider} from 'vue-plugin-hiprint'
 export default {
 export default {
   components: {
   components: {
     LiveDetail,
     LiveDetail,
+    LiveCustom
   },
   },
   data() {
   data() {
     return {
     return {
@@ -71,9 +72,9 @@ export default {
       tabIndex: '0',
       tabIndex: '0',
       tabsData: [
       tabsData: [
         {
         {
-          text: '全部订单',
+          text: '全部记录',
           key: '0',
           key: '0',
-          val: -1
+          val: 0
         },
         },
         {
         {
           text: '未转订单',
           text: '未转订单',
@@ -83,16 +84,10 @@ export default {
         {
         {
           text: '已转订单',
           text: '已转订单',
           key: '2',
           key: '2',
-          val: 1
+          val: 0
         }
         }
       ],
       ],
       optionData: {},
       optionData: {},
-      arrivalData:{},
-      costData:{},
-      loanData:{},
-      simpleData:{},
-      staffData:{title:'',changeType:'',obj:null},
-      orderData:'',
       switchOrder:"-1",
       switchOrder:"-1",
       currentDateList:[],
       currentDateList:[],
       pickerOptions: {
       pickerOptions: {
@@ -126,31 +121,38 @@ export default {
       endTime:'',
       endTime:'',
       searchTime:'',
       searchTime:'',
       searchContent:'',
       searchContent:'',
-      currentRefundData:{},
-      refundRecordData:{},
-      currentKdStaffName:'',
-      currentKdStaffId:0,
+      currentStaffName:'',
+      currentStaffId:0,
       staffList:[],
       staffList:[],
       selectedData:[],
       selectedData:[],
-      itemData:{id:0}
+      customData:{}
     };
     };
   },
   },
   created() {
   created() {
-    this.init();
+    this.init()
   },
   },
 	mounted() {
 	mounted() {
 		let that = this;
 		let that = this;
-
     this.$nextTick(() => {
     this.$nextTick(() => {
       this.$refs.orderSearchRef.focus()
       this.$refs.orderSearchRef.focus()
     })
     })
-
     that.$service.shopAdmin.getAllStaff().then(res => {
     that.$service.shopAdmin.getAllStaff().then(res => {
       that.staffList = res.list
       that.staffList = res.list
     })
     })
-
 	},
 	},
   methods: {
   methods: {
+    addNewCustom(data){
+      this.customData = data
+      setTimeout(() => {
+        this.$refs.liveCustomRef.init()
+      })
+    },
+    showDetail(item) {
+      this.optionData = item
+      setTimeout(() => {
+        this.$refs.liveDetailRef.init();
+      })
+    },
     searchFocus(){
     searchFocus(){
       let that = this
       let that = this
       setTimeout(() => {
       setTimeout(() => {
@@ -183,7 +185,7 @@ export default {
       this.refreshData()
       this.refreshData()
     },
     },
     refreshData(){
     refreshData(){
-      this.app.refresh({switchOrder:this.switchOrder,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,searchContent:this.searchContent,staffId:this.currentKdStaffId})
+      this.app.refresh({switchOrder:this.switchOrder,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,searchContent:this.searchContent,staffId:this.currentStaffId})
     },
     },
     init() {
     init() {
       this.$store.dispatch('getUsage');
       this.$store.dispatch('getUsage');
@@ -201,22 +203,10 @@ export default {
         })
         })
 			})
 			})
     },
     },
-    shipDrawFn(item) {
-      this.optionData = item;
-      setTimeout(() => {
-        this.$refs.selOrder.init();
-      });
-    },
-		getKdStaff(e){
-			this.currentKdStaffId = e
+		getStaff(e){
+			this.currentStaffId = e
       this.refreshData()
       this.refreshData()
 		},
 		},
-    detailShowFn(item) {
-      this.optionData = item;
-      setTimeout(() => {
-        this.$refs.LiveDetail.init();
-      })
-    },
     handleClick(tab, e) {
     handleClick(tab, e) {
       if(Number(this.tabIndex) == 0){
       if(Number(this.tabIndex) == 0){
         this.switchOrder = -1
         this.switchOrder = -1
@@ -282,19 +272,19 @@ export default {
                 prop: 'staffName',
                 prop: 'staffName',
                 label: '开单人',
                 label: '开单人',
                 align: 'center',
                 align: 'center',
-                width: '100'
+                width: '120'
               },
               },
               {
               {
                 prop: 'addTime',
                 prop: 'addTime',
                 label: '创建时间',
                 label: '创建时间',
                 align: 'center',
                 align: 'center',
-                width: 160
+                width: 180
               },
               },
               {
               {
                 prop: 'updateTime',
                 prop: 'updateTime',
                 label: '修改时间',
                 label: '修改时间',
                 align: 'center',
                 align: 'center',
-                width: 160
+                width: 180
               },
               },
             ],
             ],
             on: {
             on: {
@@ -313,7 +303,7 @@ export default {
             op: {
             op: {
               visible: true,
               visible: true,
               props: {
               props: {
-                width: 400,
+                width: 450,
                 align: 'center',
                 align: 'center',
                 fixed: 'right',
                 fixed: 'right',
                 label: '操作'
                 label: '操作'