shish hai 1 ano
pai
achega
a7a95b612a
Modificáronse 2 ficheiros con 228 adicións e 6 borrados
  1. 208 0
      ghs/src/views/in/components/begin-refund.vue
  2. 20 6
      ghs/src/views/in/list.vue

+ 208 - 0
ghs/src/views/in/components/begin-refund.vue

@@ -0,0 +1,208 @@
+<template>
+	<div class="order-detail">
+		<el-drawer :visible.sync="showDtail" size="750px" :before-close="closeFn" custom-class="order-draw-wrap" direction="ltr">
+			<div class="order-manage-wrap" v-if="!$util.isEmpty(detailInfo)">
+				<div class="card-wrap">
+					<div class="card-tit">
+						花材信息 (按 Esc 关闭窗口)
+					</div>
+					<div class="card-body">
+						<el-table :data="detailInfo.product">
+							<el-table-column label="图片">
+								<template slot-scope="scope">
+									<el-popover placement="right" width="200" trigger="hover">
+										<div style="width:200px;height:200px;">
+											<img style="width:100%;height:100%;object-fit: cover;" :src="scope.row.bigCover" />
+										</div>
+										<div style="width:30px;" slot="reference">
+											<img style="width:100%;height:100%;object-fit: cover;border-radius:5px;" :src="scope.row.cover" />
+										</div>
+									</el-popover>
+								</template>
+							</el-table-column>
+							<el-table-column property="name" label="名称"></el-table-column>
+							<el-table-column property="cost" label="成本"></el-table-column>
+							<el-table-column property="stock" label="剩余"></el-table-column>
+							<el-table-column label="单价">
+								<template slot-scope="scope">
+									<el-input v-model="scope.row.currentHdPrice" @focus="scope.row.currentHdPrice=''" placeholder="数量" style="width:50px;margin-right:2px;" 
+									:class="[Number(scope.row.cost)>Number(scope.row.currentHdPrice) ? 'cost-blue' : '']">
+									</el-input>元
+								</template>
+							</el-table-column>
+							<el-table-column label="数量">
+								<template slot-scope="scope">
+									<el-input v-model="scope.row.xhNum" placeholder="数量" @focus="scope.row.xhNum=''" style="width:50px;" 
+									:class="[Number(scope.row.xhNum)>Number(scope.row.stock) ? 'stock-red' : '']"></el-input>
+								</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>
+					<div class="accounts-list">
+						客户名称
+						<div class="accounts-center" style="font-weight:bold;color:black;">{{ detailInfo.customName||'' }}</div>
+					</div>
+					<div class="accounts-list">
+						商品金额
+						<div class="accounts-center" style="font-weight:bold;color:black;">¥{{itemPrice}}</div>
+					</div>
+					<div class="accounts-list">
+						总计
+						<div class="accounts-center" style="font-weight:bold;color:black;">¥{{allPrice}}</div>
+					</div>
+					<div class="accounts-list">
+						预付金额
+						<div class="accounts-center" style="font-weight:bold;color:black;">¥{{ detailInfo.bookPrice ? parseFloat(detailInfo.bookPrice) : 0}}</div>
+					</div>
+					<div class="accounts-list">
+						结账
+						<div class="accounts-center" style="font-weight:bold;color:green;;" v-if="settlePrice > 0">退 ¥{{settlePrice}},确认后自动退款</div>
+						<div class="accounts-center" style="font-weight:bold;color:red;" v-else-if="settlePrice < 0">欠 ¥{{Math.abs(settlePrice)}},确认后变成欠款单</div>
+						<div class="accounts-center" style="font-weight:bold;color:black;" v-else>0</div>
+					</div>
+					<div class="accounts-list">
+						允许低于成本
+						<div class="accounts-center" style="">
+							<el-switch v-model="lessCostCould" active-value="1" inactive-value="0"></el-switch>
+						</div>
+					</div>
+	      		</div>
+				<div style="margin-left:80px;margin-top:20px;">
+					<el-button @click="closeFn">取消</el-button>
+
+					<el-popconfirm title="确认保存?" @confirm="savePrice()" @onConfirm="savePrice()" style="margin-left:80px;">
+						<el-button slot="reference">保存</el-button>
+					</el-popconfirm>
+
+					<el-popconfirm title="确认要提交?" @confirm="commitItem()" @onConfirm="commitItem()" style="margin-left:80px;">
+						<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>
+<script>
+export default {
+	name: 'begin-refund',
+	props: {
+		currentRefundData: {
+			type: Object,
+			default: () => {}
+		}
+	},
+	data() {
+		return {
+			showDtail: false,
+			detailInfo: {},
+			loading:true
+		};
+	},
+	computed: {
+
+	},
+	methods: {
+		init() {
+			this.data = []
+			this.showDtail = true
+			this.$service.purchaseOrder.detail({orderSn:this.currentRefundData.orderSn}).then(res => {
+				this.detailInfo = res
+			})
+		},
+		closeFn() {
+			this.showDtail = false;
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+.order-draw-wrap {
+	.el-drawer__header {
+		margin-bottom: 2px;
+	}
+	.el-table__header-wrapper {
+		.el-table__header tr,
+		.el-table__header th {
+			background-color: #f7f7f7;
+		}
+	}
+}
+</style>
+<style lang="scss" scoped>
+.order-draw-wrap {
+	.title-status-wrap {
+		@include disFlex(center, flex-start);
+		.title-text {
+			margin-right: 200px;
+		}
+		.title-status {
+			color: red;
+			&.success {
+				color: green;
+			}
+		}
+	}
+}
+.order-manage-wrap {
+	height: calc(100vh - 64px);
+	overflow-y: auto;
+	padding-bottom: 20px;
+
+	.accounts-list{
+		width: 80%;
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+		margin: 0 auto;
+		padding-bottom: 20px;
+		.accounts-center{
+		width: 80%;
+		}
+	}
+
+}
+.card-wrap {
+	margin: 20px;
+	.card-tit {
+		font-size: 16px;
+		margin-bottom: 8px;
+	}
+	.card-body {
+		border: 1px solid $borderColor;
+	}
+}
+::v-deep .el-input__inner {
+  padding:0;
+  text-align:center;
+}
+.stock-red{
+	color:red;
+	font-weight:bold;
+	::v-deep .el-input__inner {
+		border:2px solid red;
+	}
+}
+.cost-blue{
+	color:blue;
+	font-weight:bold;
+	::v-deep .el-input__inner {
+		border:2px solid blue;
+	}
+}
+</style>

+ 20 - 6
ghs/src/views/in/list.vue

@@ -85,11 +85,14 @@
 
 
       <template #slot-column-option="{scope}">
       <template #slot-column-option="{scope}">
 
 
+        <el-button @click.stop="detailShowFn(scope.row)" size="small" type="success">详情</el-button>
+
         <el-button size="small" v-if="scope.row.status == 5">改价入库</el-button>
         <el-button size="small" v-if="scope.row.status == 5">改价入库</el-button>
-        <el-button @click.stop="changePrice(scope.row)" size="small" type="success" v-else-if="scope.row.status == 4">修改售价</el-button>
+        <el-button @click.stop="changePrice(scope.row)" size="small" type="primary" v-else-if="scope.row.status == 4">修改售价</el-button>
         <el-button @click.stop="changePrice(scope.row)" size="small" type="primary" v-else>改价入库</el-button>
         <el-button @click.stop="changePrice(scope.row)" size="small" type="primary" v-else>改价入库</el-button>
 
 
-        <el-button @click.stop="detailShowFn(scope.row)" size="small" type="success">详情</el-button>
+        <el-button size="small" type="primary" @click="goRefund(scope.row)" v-if="scope.row.status == 4">发起售后</el-button>
+        <el-button size="small" v-else>发起售后</el-button>
 
 
         <el-button size="small" v-if="scope.row.status == 5 || scope.row.status == 1">打多联({{ scope.row.printNum }})</el-button>
         <el-button size="small" v-if="scope.row.status == 5 || scope.row.status == 1">打多联({{ scope.row.printNum }})</el-button>
         <el-button @click.stop="printPaper(scope.row)" size="small" type="primary" v-else>打多联({{ scope.row.printNum }})</el-button>
         <el-button @click.stop="printPaper(scope.row)" size="small" type="primary" v-else>打多联({{ scope.row.printNum }})</el-button>
@@ -99,6 +102,7 @@
 
 
         <el-button @click.stop="cancelOrder(scope.row)" size="small" type="primary" v-if="scope.row.status == 3 || scope.row.status == 2 || scope.row.status == 1">取消</el-button>
         <el-button @click.stop="cancelOrder(scope.row)" size="small" type="primary" v-if="scope.row.status == 3 || scope.row.status == 2 || scope.row.status == 1">取消</el-button>
         <el-button size="small" v-else>取消</el-button>
         <el-button size="small" v-else>取消</el-button>
+
       </template>
       </template>
 
 
       <template #slot-new-cg>
       <template #slot-new-cg>
@@ -125,16 +129,19 @@
     </x-crud>
     </x-crud>
 
 
     <order-detail ref="orderDetail" :orderOperate="optionData" />
     <order-detail ref="orderDetail" :orderOperate="optionData" />
+    <begin-refund ref="beginRefundRef" :currentRefundData="currentRefundData" />
 
 
   </div>
   </div>
 </template>
 </template>
 
 
 <script>
 <script>
 import OrderDetail from './components/order-detail';
 import OrderDetail from './components/order-detail';
+import beginRefund from './components/begin-refund';
 import {hiprint, defaultElementTypeProvider} from 'vue-plugin-hiprint'
 import {hiprint, defaultElementTypeProvider} from 'vue-plugin-hiprint'
 export default {
 export default {
   components: {
   components: {
-    OrderDetail
+    OrderDetail,
+    beginRefund
   },
   },
   data() {
   data() {
     return {
     return {
@@ -163,6 +170,7 @@ export default {
         }
         }
       ],
       ],
       optionData: {},
       optionData: {},
+      currentRefundData:{},
       orderData:'',
       orderData:'',
       addPop:false,
       addPop:false,
       location:0,
       location:0,
@@ -230,6 +238,12 @@ export default {
 
 
 	},
 	},
   methods: {
   methods: {
+    goRefund(data){
+      this.currentRefundData = data
+      setTimeout(() => {
+        this.$refs.beginRefundRef.init()
+      })
+    },
 		getCgStaff(e){
 		getCgStaff(e){
 			this.currentCgStaffId = e
 			this.currentCgStaffId = e
 			this.app.refresh({ status: this.tabIndex,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,search:this.searchContent,cgStaffId:this.currentCgStaffId})
 			this.app.refresh({ status: this.tabIndex,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,search:this.searchContent,cgStaffId:this.currentCgStaffId})
@@ -349,8 +363,8 @@ export default {
     detailShowFn(item) {
     detailShowFn(item) {
       this.optionData = item;
       this.optionData = item;
       setTimeout(() => {
       setTimeout(() => {
-        this.$refs.orderDetail.init();
-      });
+        this.$refs.orderDetail.init()
+      })
     },
     },
     changeTab(tab, e) {
     changeTab(tab, e) {
       this.app.refresh({ status: this.tabIndex,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,search:this.searchContent,cgStaffId:this.currentCgStaffId});
       this.app.refresh({ status: this.tabIndex,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,search:this.searchContent,cgStaffId:this.currentCgStaffId});
@@ -503,7 +517,7 @@ export default {
             op: {
             op: {
               visible: true,
               visible: true,
               props: {
               props: {
-                width: 440,
+                width: 520,
                 align: 'center',
                 align: 'center',
                 fixed: 'right',
                 fixed: 'right',
                 label: '操作'
                 label: '操作'