Răsfoiți Sursa

走播优化

shish 1 an în urmă
părinte
comite
0a7e6fe6f2

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

@@ -73,12 +73,14 @@ import clear from '@/service/clear/index';
 import refund from '@/service/refund/index';
 import costChange from '@/service/cost-change/index';
 import liveOrder from '@/service/live-order/index';
+import liveOrderCustom from '@/service/live-order-custom/index';
 
 export function SET_SERVICE({ store }) {
 	// const files = require.context('@/service/', true, /\.js$/);
 	// const ignore = ['./request.js'];
 
 	let modules = {
+		liveOrderCustom,
 		liveOrder,
 		costChange,
 		refund,

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

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

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

@@ -17,5 +17,28 @@ export class LiveOrderService extends BaseService {
 		});
 	}
 
+	delCustom(data) {
+		return this.request({
+			url: '/del-custom',
+			params: data
+		});
+	}
+
+	addCustom(data) {
+		return this.request({
+			url: '/add-custom',
+			method: 'POST',
+			data: data
+		});
+	}
+
+	updateCustom(data) {
+		return this.request({
+			url: '/update-custom',
+			method: 'POST',
+			data: data
+		});
+	}
+
 }
 export default new LiveOrderService();

+ 25 - 1
ghs/src/views/order/add-live.vue

@@ -14,6 +14,13 @@
 			:remote-method="searchCustom" style="width:260px;margin-left:30px;margin-top:15px;">
 				<el-option v-for="item in customList" :key="item.id" :label="`${item.name}(${item.id})`" :value="item"> </el-option>
 			</el-select>
+
+			<el-input v-model="name1" placeholder="客户名称" size="big" style="width:150px;margin-left:30px;"></el-input>
+						<el-input v-model="mobile1" placeholder="手机号" size="big" style="width:150px;margin-left:5px;"></el-input>
+						<el-popconfirm title="确认添加?" @confirm="addCustom()" @onConfirm="addCustom()" style="margin-left:5px;">
+							<el-button size="big" type="primary" slot="reference">添加</el-button>
+						</el-popconfirm>
+
 		</div>
 		<div style="margin-left:30px;margin-top:15px;" class="custom-data">
 			<el-table ref="showItemRef" :data="selectCustomList" highlight-current-row border>
@@ -59,7 +66,9 @@ export default {
 			price:'',
 			currentItemId:0,
 			currentCustomName:'',
-			selectCustomList:[]
+			selectCustomList:[],
+			name1:'',
+			mobile1:''
 		};
 	},
 	computed: {
@@ -73,6 +82,21 @@ export default {
 	},
 	methods: {
 		...mapActions(['getLevel']),
+		addCustom(){
+			if(this.mobile1.length != 11){
+				this.$message.error('手机号错误')
+				return false
+			}
+			if(this.$util.isEmpty(this.name1)){
+				this.$message.error('请填写客户名称')
+				return false
+			}			
+			this.$service.custom.createCustomers({ name1:this.name1,mobile1:this.mobile1,confirmMobile1:this.mobile1}).then(data => {
+				this.name1=''
+				this.mobile1=''
+				this.$notify({ title: '添加成功,15秒后生效', message: 'success', type: 'success'})
+			})
+		},
 		commit(){
 			let that = this
 			if(Number(this.currentItemId)<=0){

+ 51 - 25
ghs/src/views/order/components/live-custom.vue

@@ -8,12 +8,12 @@
                         <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 #table-column-zbPrice="{ scope }">
+                        <el-input v-model="scope.row.zbPrice" placeholder="单价"></el-input>
                     </template>
 
-                    <template #table-column-bigCount="{ scope }">
-                        <el-input v-model="scope.row.bigCount" placeholder="数量"></el-input>
+                    <template #table-column-zbNum="{ scope }">
+                        <el-input v-model="scope.row.zbNum" placeholder="数量"></el-input>
                     </template>
 
                     <template #slot-column-option="{scope}">
@@ -22,6 +22,13 @@
 
                     <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>
+
+						<el-input v-model="name1" placeholder="客户名称" size="big" style="width:150px;margin-left:30px;"></el-input>
+						<el-input v-model="mobile1" placeholder="手机号" size="big" style="width:150px;margin-left:5px;"></el-input>
+						<el-popconfirm title="确认添加?" @confirm="addCustom()" @onConfirm="addCustom()" style="margin-left:5px;">
+							<el-button size="big" type="primary" slot="reference">添加</el-button>
+						</el-popconfirm>
+
                     </template>
                 </x-crud>
 			</div>
@@ -40,10 +47,27 @@ export default {
 	data() {
 		return {
 			showArea: false,
-            search:''
+            search:'',
+			mobile1:'',
+			name1:''
 		};
 	},
 	methods: {
+		addCustom(){
+			if(this.mobile1.length != 11){
+				this.$message.error('手机号错误')
+				return false
+			}
+			if(this.$util.isEmpty(this.name1)){
+				this.$message.error('请填写客户名称')
+				return false
+			}			
+			this.$service.custom.createCustomers({ name1:this.name1,mobile1:this.mobile1,confirmMobile1:this.mobile1}).then(data => {
+				this.name1=''
+				this.mobile1=''
+				this.$notify({ title: '添加成功,15秒后生效', message: 'success', type: 'success'})
+			})
+		},
 		changeSearch(){
             let that = this
             if(this.T != null){
@@ -67,15 +91,17 @@ export default {
 			this.showArea = false;
 		},
         confirmAdd(info){
-			if(Number(info.bigCount)<=0){
+			if(Number(info.zbNum)<=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)
+			if(Number(info.zbPrice)<=0){
+				this.$message.error('请填写价格')
+				return false
+			}
+			this.$service.liveOrder.addCustom({customId:info.id,customName:info.name,num:info.zbNum,price:info.zbPrice,id:this.customData.id}).then(res => {
+				this.$message.success('添加成功')
+				this.$emit('renewAddCustom',this.customData)
 				this.closeFn()
 			})
         },
@@ -90,28 +116,28 @@ export default {
 			.set('table', {
 				columns: [
 					{
-						label: '数量',
-						prop: 'bigCount',
+						label: 'ID',
+						prop: 'id',
 						align: 'center',
-                        width:135
+                        width:100
 					},
 					{
-						label: '单价',
-						prop: 'showUsePrice',
+						label: '名称',
+						prop: 'name',
 						align: 'center',
-                        width:135
+                        width:240
 					},
 					{
-						label: '名称',
-						prop: 'name',
+						label: '数量',
+						prop: 'zbNum',
 						align: 'center',
-                        width:230
+                        width:110
 					},
-                    {
-						label: 'ID',
-						prop: 'id',
+					{
+						label: '单价',
+						prop: 'zbPrice',
 						align: 'center',
-                        width:100
+                        width:110
 					}
 				],
 				op: {
@@ -119,7 +145,7 @@ export default {
 					props: {
 						width: 160,
 						align: 'center',
-						fixed: 'left',
+						fixed: 'right',
 						label: '操作'
 					},
 					layout: ['slot-column-option']

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

@@ -1,7 +1,7 @@
 <template>
 	<div class="order-detail">
 		<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="order-manage-wrap">
 				<div class="card-wrap">
 					<div class="card-tit">
 						预订客户
@@ -26,19 +26,30 @@
 									¥{{ parseFloat((scope.row.num * scope.row.unitPrice).toFixed(2)) }}
 								</template>
 							</el-table-column>
+
+							<el-table-column label="操作">
+								<template slot-scope="scope">
+
+									<el-popconfirm title="确认删除?" @confirm="confirmDel(scope.row)" @onConfirm="confirmDel(scope.row)">
+										<el-button size="small" type="primary" slot="reference">删除</el-button>
+									</el-popconfirm>
+
+								</template>
+							</el-table-column>
+
 						</el-table>
 					</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-popconfirm title="确认保存?" @confirm="updateCustom()" @onConfirm="updateCustom()" style="margin-left:220px;">
 						<el-button type="primary" slot="reference">保存</el-button>
 					</el-popconfirm>
 				</div>
 
 			</div>
-			<div v-else  v-loading="loading" style="height:800px;"></div>
+			
 		</el-drawer>
 	</div>
 </template>
@@ -60,6 +71,21 @@ export default {
 		};
 	},
 	methods: {
+		updateCustom(){
+			if (this.$util.isEmpty(this.customList)){
+				this.$message.error('没有客户需要更新');
+				return false
+			}
+			this.$service.liveOrder.updateCustom({ id: this.orderOperate.id,customList:JSON.stringify(this.customList)}).then(res => {
+				this.$message.success('更新成功');
+				this.init()
+			})
+		},
+		confirmDel(custom){
+			this.$service.liveOrder.delCustom({ id: this.orderOperate.id,customId:custom.customId }).then(res => {
+				this.init()
+			})
+		},
 		addCustom(){
 			this.$emit('addNewCustom',this.orderOperate)
 		},

+ 13 - 4
ghs/src/views/order/live-list.vue

@@ -52,7 +52,7 @@
 
     <live-detail ref="liveDetailRef" :orderOperate="optionData" @searchFocus="searchFocus" @addNewCustom="addNewCustom" />
 
-    <live-custom ref="liveCustomRef" :customData="customData" />
+    <live-custom ref="liveCustomRef" :customData="customData" @renewAddCustom="renewAddCustom" />
 
   </div>
 </template>
@@ -141,6 +141,9 @@ export default {
     })
 	},
   methods: {
+    renewAddCustom(data){
+      this.showDetail(data)
+    },
     addNewCustom(data){
       this.customData = data
       setTimeout(() => {
@@ -263,8 +266,8 @@ export default {
                 width: '100'
               },
               {
-                prop: 'switchOrder',
-                label: '已转订单',
+                prop: 'itemAmount',
+                label: '金额',
                 align: 'center',
                 width: '100'
               },
@@ -274,6 +277,12 @@ export default {
                 align: 'center',
                 width: '120'
               },
+              {
+                prop: 'switchOrder',
+                label: '已转订单',
+                align: 'center',
+                width: '100'
+              },
               {
                 prop: 'addTime',
                 label: '创建时间',
@@ -303,7 +312,7 @@ export default {
             op: {
               visible: true,
               props: {
-                width: 450,
+                width: 350,
                 align: 'center',
                 fixed: 'right',
                 label: '操作'