shish 2 lat temu
rodzic
commit
3fab6357f5

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

@@ -2,11 +2,35 @@ import { BaseService, Service } from '@/cool';
 
 
 @Service('custom')
 @Service('custom')
 export class CustomService extends BaseService {
 export class CustomService extends BaseService {
+
+	recharge(data) {
+		return this.request({
+			url: '/recharge',
+			params: data
+		});
+	}
+
+	updateDebtLimit(data) {
+		return this.request({
+			url: '/update-debt-limit',
+			params: data
+		});
+	}
+
+	changeDebt(data) {
+		return this.request({
+			url: '/debt',
+			params: data
+		});
+	}
+
 	shopListAll(data) {//姜枫 2021.04.26
 	shopListAll(data) {//姜枫 2021.04.26
 		return this.request({
 		return this.request({
 			url: '/list',
 			url: '/list',
+			params: data
 		});
 		});
 	}
 	}
+
 	clientInfo(data) {//姜枫 2021.05.05
 	clientInfo(data) {//姜枫 2021.05.05
 		return this.request({
 		return this.request({
 			url: '/detail',
 			url: '/detail',

+ 16 - 4
ghs/src/views/item/list.vue

@@ -41,7 +41,7 @@
       </template>
       </template>
       <template #table-header-price>
       <template #table-header-price>
         <div class="set-sort">
         <div class="set-sort">
-          <span style="color:blue;">价</span>
+          <span style="color:blue;">批发价</span>
         </div>
         </div>
       </template>
       </template>
 
 
@@ -560,17 +560,29 @@ export default {
               align: 'center',
               align: 'center',
               'min-width': 90
               'min-width': 90
             },
             },
+            {
+              prop: 'hjPrice',
+              label: '大客价',
+              align: 'center',
+              minWidth:90
+            },
             {
             {
               prop: 'price',
               prop: 'price',
-              label: '价格',
+              label: '批发价',
+              align: 'center',
+              minWidth:90
+            },
+            {
+              prop: 'skPrice',
+              label: '零售价',
               align: 'center',
               align: 'center',
-              minWidth:95
+              minWidth:90
             },
             },
             {
             {
               prop: 'stockWarning',
               prop: 'stockWarning',
               label: '库存预警',
               label: '库存预警',
               align: 'center',
               align: 'center',
-              'min-width':80
+              'min-width':70
             },
             },
             {
             {
               prop: 'className',
               prop: 'className',

+ 132 - 24
ghs/src/views/member/list.vue

@@ -30,25 +30,37 @@
 			</template>
 			</template>
 
 
 			<template #table-column-debtAmount="{scope}">
 			<template #table-column-debtAmount="{scope}">
-				<span v-if="scope.row.debtAmount > 0" style="color:red;font-weight:bold;">{{ scope.row.debtAmount?parseFloat(scope.row.debtAmount):0 }}</span>
+				<span v-if="scope.row.debtAmount > 0" style="color:red;">{{ scope.row.debtAmount?parseFloat(scope.row.debtAmount):0 }}</span>
 				<span v-else>0</span>
 				<span v-else>0</span>
 			</template>
 			</template>
-						
-			<template #table-column-debt="{scope}">
-				
-				<i class="el-icon-success" v-if="scope.row.debt == 1" style="color:green;font-size:18px;"></i>
-				
-				<span v-else>
-					<i class="el-icon-open" style="font-size:16px;"></i>
+
+			<template #table-column-balance="{scope}">
+				<span>{{ scope.row.balance }}</span>
+			</template>
+
+			<template #table-header-actDebt>
+				<div class="set-sort">
+				<span style="color:blue;">待结欠款</span>
+				</div>
+			</template>
+			<template #table-column-actDebt="{scope}">
+				<span v-if="Number(scope.row.debtAmount) > Number(scope.row.balance)" style="color:blue;font-weight:bold;">
+					{{ parseFloat((Number(scope.row.debtAmount)-Number(scope.row.balance)).toFixed(2)) }}
 				</span>
 				</span>
+				<span v-else>-</span>
+			</template>
+
+			<template #table-column-debt="{scope}">
+				<i class="el-icon-success" v-if="scope.row.debt == 1" style="color:green;font-size:18px;cursor: pointer;" @click="modifyDebt(scope.row,0)"></i>
+				<i class="el-icon-open" v-else style="font-size:16px;cursor: pointer;" @click="modifyDebt(scope.row,1)"></i>
 			</template>
 			</template>
 
 
 			<template #table-column-debtLimit="{scope}">
 			<template #table-column-debtLimit="{scope}">
-				<span v-if="scope.row.debt == 1" style="font-weight:bold;color:green;">
+				<span v-if="scope.row.debt == 1" style="font-weight:bold;color:green;cursor: pointer;" @click="changeDebtAmount(scope.row)">
 					{{ scope.row.debtLimit ? parseFloat(scope.row.debtLimit) : 0 }}
 					{{ scope.row.debtLimit ? parseFloat(scope.row.debtLimit) : 0 }}
 				</span>
 				</span>
 				<span v-else>
 				<span v-else>
-					<i class="el-icon-edit"></i>
+					<i class="el-icon-edit" style="font-size:15px;cursor: pointer;" @click="pleaseOpen()"></i>
 				</span>
 				</span>
 			</template>
 			</template>
 
 
@@ -65,19 +77,41 @@
 				>{{ scope.row.name }}</el-link>
 				>{{ scope.row.name }}</el-link>
 			</template>
 			</template>
 
 
-			<template #table-column-balance="{scope}">
-				<span>{{ scope.row.balance }}</span>
-			</template>
-
 			<template #slot-column-option="{scope}">
 			<template #slot-column-option="{scope}">
-				<el-button size="small" type="primary">充值</el-button>
-				<el-button size="small" type="primary">授信</el-button>
+				<el-button size="small" type="primary" @click="beginRecharge(scope.row)">充值清账</el-button>
 			</template>
 			</template>
 
 
 		</x-crud>
 		</x-crud>
 
 
 		<!-- 详情 -->
 		<!-- 详情 -->
 		<detail-draw :show.sync="drapShow" :info="modalData" />
 		<detail-draw :show.sync="drapShow" :info="modalData" />
+
+		<el-dialog :title="rechargeTitle" v-if="rechargePop" :visible.sync="rechargePop" width="600px" center :close-on-click-modal="false">
+			<div>
+				<div class="accounts-list">
+					充值金额
+					<el-input style="width: 80%" v-model="rechargeAmount" clearable></el-input>
+				</div>
+				<div class="accounts-list">
+					转账方式
+					<div class="accounts-center">
+						<el-button :type="rechargePayWay == 0?'primary':''" @click="rechargePayWay=0" size="small">微信</el-button>
+						<el-button :type="rechargePayWay == 1?'primary':''" @click="rechargePayWay=1" size="small">支付宝</el-button>
+						<el-button :type="rechargePayWay == 4?'primary':''" @click="rechargePayWay=4" size="small">现金</el-button>
+						<el-button :type="rechargePayWay == 5?'primary':''" @click="rechargePayWay=5" size="small">银行卡</el-button>
+					</div>
+				</div>
+
+				<div class="accounts-list" style="margin-top:20px;">
+					<span></span>
+					<div class="accounts-center">
+						<el-button @click="resetRecharge()">取消</el-button>
+						<el-button type="primary" @click="confirmRecharge()" style="margin-left:80px;">确认</el-button>
+					</div>
+				</div>
+			</div>
+    	</el-dialog>
+
 	</div>
 	</div>
 </template>
 </template>
 
 
@@ -102,12 +136,17 @@ export default {
 				},
 				},
 				{
 				{
 					text: '赊账',
 					text: '赊账',
-					key: '1',
+					key: '2',
 					val: 0
 					val: 0
 				}
 				}
 			],
 			],
 			modalData: {},
 			modalData: {},
-			drapShow: false
+			drapShow: false,
+			rechargeAmount:'',
+			rechargePayWay:-1,
+			rechargePop:false,
+			rechargeTitle:'充值',
+			rechargeCustom:{}
 		};
 		};
 	},
 	},
 	computed: {
 	computed: {
@@ -119,8 +158,60 @@ export default {
 	mounted() {},
 	mounted() {},
 	methods: {
 	methods: {
 		...mapActions(['getLevel']),
 		...mapActions(['getLevel']),
+		beginRecharge(info){
+			this.rechargePop = true
+			this.rechargeTitle = '【'+info.name+'】充值清账'
+			this.rechargeCustom = info
+		},
+		resetRecharge(){
+			this.rechargePop = false
+			this.rechargePayWay = -1
+			this.rechargeAmount = ''
+			this.rechargeCustom = {}
+		},
+		confirmRecharge(){
+			if(this.rechargePayWay == -1){
+				this.$message({message: '请选择转账方式',type: 'warning'})
+				return false
+			}
+			if(this.$util.isMoney(this.rechargeAmount) == false){
+				this.$message({message: '请填写金额',type: 'warning'})
+				return false
+			}
+			if(Number(this.rechargeAmount)<=0){
+				this.$message({message: '金额要大于0',type: 'warning'})
+				return false
+			}
+			this.$confirm('确认充值?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => {
+				this.$service.custom.recharge({ customId: this.rechargeCustom.id,payWay:this.rechargePayWay,amount:this.rechargeAmount}).then(data => {
+					this.resetRecharge()
+					this.$notify({ title: '成功', message: '充值成功', type: 'success'})
+					this.app.refresh({ type: this.tabIndex })
+				})
+			})
+		},
+		changeDebtAmount(info){
+			this.$prompt('请输入金额','提示',{confirmButtonText:'确定',cancelButtonText:'取消',inputPattern:/^\d+(\.\d{1,2})?$/,inputErrorMessage:'金额错误'}).then(({value}) => {
+				this.$service.custom.updateDebtLimit({ debtLimit: value,id:info.id}).then(data => {
+					this.$notify({ title: '成功', message: '操作成功', type: 'success'})
+					this.app.refresh({ type: this.tabIndex })
+				})
+			})
+		},
+		pleaseOpen(){
+			this.$message({message: '请先开启线上赊账',type: 'warning'})
+		},
+		modifyDebt(info,debt){
+			let customName = info.name
+			let name = debt == 0 ? '确认禁止【'+customName+'】线上赊账?' : '确认允许【'+customName+'】线上赊账?'
+			this.$confirm(name, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => {
+				this.$service.custom.changeDebt({ customId: info.id,debt:debt}).then(data => {
+					this.$notify({ title: '成功', message: '操作成功', type: 'success'})
+					this.app.refresh({ type: this.tabIndex })
+				})
+			})
+		},
 		handleClick(tab, e) {
 		handleClick(tab, e) {
-			console.log(tab, e);
 			this.app.refresh({ type: this.tabIndex });
 			this.app.refresh({ type: this.tabIndex });
 		},
 		},
 		// 详情
 		// 详情
@@ -162,31 +253,37 @@ export default {
 							prop: 'mobile',
 							prop: 'mobile',
 							label: '手机号',
 							label: '手机号',
 							align: 'center',
 							align: 'center',
-							width: 160
+							width: 130
 						},
 						},
 						{
 						{
 							prop: 'debtAmount',
 							prop: 'debtAmount',
 							label: '欠款金额',
 							label: '欠款金额',
 							align: 'center',
 							align: 'center',
-							width: 130
+							width: 100
 						},
 						},
 						{
 						{
 							prop: 'balance',
 							prop: 'balance',
 							label: '余额',
 							label: '余额',
 							align: 'center',
 							align: 'center',
-							width: 110
+							width: 90
+						},
+						{
+							prop: 'actDebt',
+							label: '待结欠款',
+							align: 'center',
+							width: 100
 						},
 						},
 						{
 						{
 							prop: 'debt',
 							prop: 'debt',
 							label: '线上赊账',
 							label: '线上赊账',
 							align: 'center',
 							align: 'center',
-							width: 100
+							width: 90
 						},
 						},
 						{
 						{
 							prop: 'debtLimit',
 							prop: 'debtLimit',
 							label: '信用额度',
 							label: '信用额度',
 							align: 'center',
 							align: 'center',
-							width: 110
+							width: 90
 						},
 						},
 						{
 						{
 							prop: 'buyNum',
 							prop: 'buyNum',
@@ -274,4 +371,15 @@ export default {
 		color: #999;
 		color: #999;
 	}
 	}
 }
 }
+.accounts-list{
+    width: 80%;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    margin: 0 auto;
+    padding-bottom: 20px;
+    .accounts-center{
+      width: 80%;
+    }
+  }
 </style>
 </style>

+ 1 - 0
ghs/src/views/order/add.vue

@@ -219,6 +219,7 @@
         </div>
         </div>
       </div>
       </div>
     </el-dialog>
     </el-dialog>
+
   </div>
   </div>
 </template>
 </template>
 <script>
 <script>