whx hai 2 meses
pai
achega
dba821f483

+ 24 - 0
virgo.wzfrontend/workark/src/api/serve.js

@@ -126,4 +126,28 @@ export function getOrederDetail(id) {
 		url: `/api/workarkOrderInfo/${id}`,
 		method: 'get'
 	})
+}
+/* 
+ * 修改订单金额
+ * 
+ * 
+ */
+export function changeOrderPrice(data) {
+	return request({
+		url: `/api/workarkOrderInfo/price`,
+		method: 'post',
+		data: data
+	})
+}
+/* 
+ * 修改订单状态
+ * 
+ * 
+ */
+export function changeOrderStatus(data) {
+	return request({
+		url: `/api/workarkOrderInfo/status`,
+		method: 'post',
+		data: data
+	})
 }

+ 2 - 2
virgo.wzfrontend/workark/src/api/system.js

@@ -136,9 +136,9 @@ export function getServeProductList(id) {
  * 
  * 
  */
-export function getProcessSetData(productCouponModelId) {
+export function getProcessSetData(productModelId) {
 	return request({
-		url: `/api/workarkProceModel/list/${productCouponModelId}`,
+		url: `/api/workarkProceModel/list/${productModelId}`,
 		method: 'get'
 	})
 }

+ 33 - 0
virgo.wzfrontend/workark/src/assets/css/common.scss

@@ -289,6 +289,39 @@
 	color: $--color-danger;
 }
 
+.hui-state {
+	display: flex;
+	align-items: center;
+	
+	.hui-state-label{
+		font-size: 13px;
+		color: $--color-text-secondary;
+	}
+	
+	.hui-state-bage {
+		width: 8px;
+		height: 8px;
+		border-radius: 50%;
+		margin-right: 6px;
+	}
+
+	.hui-state-success {
+		background: $--color-success;
+	}
+
+	.hui-state-danger {
+		background: $--color-danger;
+	}
+
+	.hui-state-info {
+		background: $--color-info;
+	}
+
+	.hui-state-primary {
+		background: $--color-primary;
+	}
+}
+
 .yui-tree-box {
 	display: flex;
 	width: 100%;

+ 84 - 23
virgo.wzfrontend/workark/src/components/work/serve/list/detail.vue

@@ -29,11 +29,24 @@
 								</span>
 							</div>
 						</div>
+						<div class="hui-detail-item">
+							<div class="hui-detail-label">订单状态</div>
+							<div class="hui-detail-value">
+								<div class="hui-state" v-if="!part.status">
+									<div class="hui-state-bage hui-state-info"></div>
+									<div class="hui-state-label">待确认</div>
+								</div>
+								<div class="hui-state" v-else-if="part.status === 1">
+									<div class="hui-state-bage hui-state-success"></div>
+									<div class="hui-state-label">已确认</div>
+								</div>
+							</div>
+						</div>
 					</div>
 				</div>
 				<div class="hui-detail-box">
 					<div class="hui-detail-title">订单过程</div>
-					<div class="hui-detail-content" style="min-height: 300px;padding:0;">
+					<div class="hui-detail-content" style="padding:0;">
 						<process-set v-if="part.id" :part="part" type="product" :key="reloadKey"></process-set>
 					</div>
 				</div>
@@ -58,7 +71,9 @@
 
 <script>
 	import {
-		getOrederDetail
+		getOrederDetail,
+		changeOrderPrice,
+		changeOrderStatus
 	} from '@/api/serve'
 	const processSet = () => import('@/components/work/system/serveSet/processSet');
 	const payOrder = () => import('@/components/website/payOrder');
@@ -88,43 +103,89 @@
 				getOrederDetail(this.detailId).then(res => {
 					if (res.state) {
 						this.part = res.data;
-						if (this.type === 2) { //服务商
-							this.activeList = [{
-								id: 1,
-								type: 'warning',
-								name: '修改过程'
-							}, {
-								id: 2,
-								type: 'primary',
-								name: '确认过程'
-							}]
-						}
-						if (this.type === 1) { //客户
-							if (this.part.orderStatus === '未支付') {
-								this.activeList = [{
-									id: 3,
-									type: 'primary',
-									name: '立即支付'
-								}]
-							}
-						}
+						this.type === 1 ? this.initCustomerRole() : this.initFacilitatorRole();
 					}
 				})
 			},
+			initFacilitatorRole() {
+				//服务商
+				if (this.part.orderStatus === '未支付') this.activeList.push({
+					id: 1,
+					type: 'primary',
+					name: '修改金额'
+				});
+				if (!this.part.status) this.activeList.push({
+					id: 2,
+					type: 'warning',
+					name: '修改过程'
+				});
+				if (this.part.orderStatus === '支付成功' && !this.part.status) this.activeList.push({
+					id: 3,
+					type: 'primary',
+					name: '确认订单'
+				});
+			},
+			initCustomerRole() {
+				//客户
+				if (this.part.orderStatus === '未支付') this.activeList.push({
+					id: 4,
+					type: 'primary',
+					name: '立即支付'
+				})
+			},
 			action(item) {
 				switch (item.id) {
 					case 1:
-						this.visible = true;
+						this.changePrice();
 						break;
 					case 2:
+						this.visible = true;
 						break;
 					case 3:
+						this.$confirm('是否确定订单,确认订单后将不能再修改', () => {
+							changeOrderStatus({
+								orderNo: this.part.orderNo,
+								status: 1
+							}).then(this.updateOrderSuccessFunc);
+						})
+						break;
+					case 4:
 						this.dialogVisible = true;
 						break;
 					default:
 						break;
 				}
 			},
+			changePrice() {
+				let _self = this;
+				this.$prompt('请输入订单金额', 'WORKARK提示', {
+					confirmButtonText: '确定',
+					cancelButtonText: '取消',
+					inputPlaceholder: '请输入金额',
+					beforeClose: (action, instance, done) => {
+						if (action === 'confirm') {
+							let match = /^(?:[0-9]\d*(?:\.\d{1,2})?|0\.(?:[1-9]\d?|\d[1-9]))$/;
+							let value = instance.inputValue;
+							if (!match.test(value)) return this.$message.warning('请输入正确的金额');
+							changeOrderPrice({
+								orderNo: this.part.orderNo,
+								totalFee: value
+							}).then(res => this.updateOrderSuccessFunc(res, done))
+						} else {
+							done();
+						}
+					},
+					callback: () => {}
+				})
+			},
+			updateOrderSuccessFunc(res, done) {
+				if (res.state) {
+					this.$message.success('修改成功');
+					this.init();
+					this.$emit('callback', 'init');
+				}
+				if (done) done();
+			},
 			callback(type) {
 				this.visible = false;
 				if (type === 'init') this.init();

+ 11 - 4
virgo.wzfrontend/workark/src/components/work/system/serveSet/processSet.vue

@@ -1,5 +1,5 @@
 <template>
-	<div class="process-set" v-loading="loading">
+	<div :class="'process-set '+type" v-loading="loading">
 		<process-set-item :list="list" :type="operationType"></process-set-item>
 		<el-dialog :close-on-click-modal="false" :title="isUpdate?'编辑':'新增'" :visible.sync="visible" width="900px"
 			:append-to-body="true">
@@ -110,11 +110,18 @@
 
 <style lang="scss">
 	.process-set {
-		width: 100%;
-		height: 100%;
-		overflow-y: auto;
 		padding: 15px;
 
+		&.model {
+			width: 100%;
+			height: 100%;
+			overflow-y: auto;
+		}
+
+		&.product {
+			min-height: 300px;
+		}
+
 		.process-set-item {
 			padding-left: 40px;
 			position: relative;

+ 20 - 1
virgo.wzfrontend/workark/src/views/work/serve/list.vue

@@ -25,6 +25,18 @@
 							</span>
 						</template>
 					</el-table-column>
+					<el-table-column label="支付状态">
+						<template slot-scope="scope">
+							<div class="hui-state" v-if="!scope.row.status">
+								<div class="hui-state-bage hui-state-info"></div>
+								<div class="hui-state-label">待确认</div>
+							</div>
+							<div class="hui-state" v-else-if="scope.row.status === 1">
+								<div class="hui-state-bage hui-state-success"></div>
+								<div class="hui-state-label">已确认</div>
+							</div>
+						</template>
+					</el-table-column>
 					<el-table-column label="操作" width="150">
 						<template slot-scope="scope">
 							<div class="hui-table-operation">
@@ -41,7 +53,8 @@
 				</el-table>
 			</div>
 			<div class="hui-content-pagination">
-				<el-pagination :pager-count="9" layout="prev, pager, next" :page-size="pageSize" :total="totalCount"
+				<el-pagination :pager-count="9" :page-sizes="[10, 15, 20]" layout="total,sizes, prev, pager, next"
+					:page-size="pageSize" :current-page="currPage" :total="totalCount" @size-change="sizeChange"
 					@current-change="currentChange" background>
 				</el-pagination>
 			</div>
@@ -118,6 +131,12 @@
 			changeTitle(item) {
 				if (this.nowTitle.id === item.id) return;
 				this.nowTitle = item;
+				this.pageSize = 10;
+				this.currPage = 1;
+				this.init();
+			},
+			sizeChange(size) {
+				this.pageSize = size;
 				this.currPage = 1;
 				this.init();
 			},

+ 1 - 1
virgo.wzfrontend/workark/src/views/work/system/serveSet.vue

@@ -43,7 +43,7 @@
 				:visible.sync="visible" width="900px" :append-to-body="true">
 				<depart-form v-if="visible&&type==='form'" @callback="callback" :isUpdate="isUpdate" :part="part">
 				</depart-form>
-				<process-set v-if="visible&&type==='process'" @callback="callback"  :part="part">
+				<process-set v-if="visible&&type==='process'" @callback="callback"  :part="part" type="model" operationType="edit">
 				</process-set>
 			</el-dialog>
 		</div>