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

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

@@ -5,6 +5,13 @@ import { baseUrl } from '@/config/env';
 @Service('order-item')
 export class OrderItemService extends BaseService {
 
+	updateItemRemark(data) {
+		return this.request({
+		  url: '/update-item-remark',
+		  params: data
+		});
+	}
+
 	addItem(data) {
 		return this.request({
 			url: '/add-item',

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

@@ -5,7 +5,7 @@
 				<div class="card-wrap" style="margin-top:0px;">
 					<div class="card-tit">备注</div>
 					<div class="card-body">
-						<el-input type="textarea" :rows="1" placeholder="请输入内容" v-model="data[0].remark"></el-input>
+						<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>
@@ -24,7 +24,11 @@
 							<el-table-column property="xhUnitPrice" label="单价"></el-table-column>
 							<el-table-column property="num" label="数量"></el-table-column>
 							<el-table-column property="refundNum" label="已退数"></el-table-column>
-							<el-table-column property="remark" label="备注"></el-table-column>
+							<el-table-column label="备注">
+								<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>
+								</template>
+							</el-table-column>
 						</el-table>
 					</div>
 				</div>
@@ -50,9 +54,17 @@ export default {
 		};
 	},
 	methods: {
+		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.$notify({ title: '修改成功', message: 'SUCCESS', type: 'success'})
+				this.$message.success('修改成功')
 			})
 		},
 		init() {