shish 2 anni fa
parent
commit
b8c91f65bf

+ 2 - 3
ghs/src/views/in/add.vue

@@ -20,7 +20,6 @@
 				<span v-if="scope.row.location == 1">本地</span>
 				<span v-else style="color:blue;font-weight:bold;">上游</span>
 			</template>
-			
 
 			<template #table-column-buyAmount="{scope}">
 				<span>{{ scope.row.buyAmount ? parseFloat(scope.row.buyAmount) : 0 }}</span>
@@ -88,7 +87,7 @@ export default {
 			let query = {}
 			query.ghsId = info.id
 			query.ghsName = info.name
-			this.$router.push({path:'/in/confirm',query})			
+			this.$router.push({path:'/in/confirm',query})
 		},
 		handleClick(tab, e) {
 			this.app.refresh({ type: this.tabIndex,name:this.name });
@@ -105,7 +104,7 @@ export default {
 							prop: 'name',
 							label: '名称',
 							align: 'center',
-							width: 160
+							width: 200
 						},
 						{
 							prop: 'location',

+ 2 - 7
ghs/src/views/in/confirm.vue

@@ -576,13 +576,8 @@ export default {
         that.showCommitPop = true
     },
     comeBack(){
-      this.form.ghsId = 0
-      this.form.ghsName = ''
-      this.customInfoList = []
-      this.desk = 'searchCustom'
-      this.$nextTick(() => {
-        this.$refs.ghsRef.focus()
-      })
+      let query = {}
+      this.$router.push({path:'/in/add', query}) 
     },
     selectGhsFn(e){
       if(e.id && e.name){

+ 50 - 44
ghs/src/views/in/ghs.vue

@@ -12,6 +12,11 @@
 				</el-tabs>
 			</template>
 
+			<template #table-column-location="{scope}">
+				<span v-if="scope.row.location == 1">本地</span>
+				<span v-else style="color:blue;font-weight:bold;">上游</span>
+			</template>
+
 			<template #table-column-avatar="{scope}">
 				<cl-avatar :size="22" :src="scope.row.avatar" :style="{ margin: 'auto' }"></cl-avatar>
 			</template>
@@ -73,8 +78,8 @@
 			</template>
 
 			<template #slot-column-option="{scope}">
-				<el-button size="small" type="primary" @click="goClear">去清账</el-button>
-				<el-button size="small" type="primary" @click="goCg(scope.row)">采购</el-button>
+				<el-button size="small" type="primary" @click="goClear">账</el-button>
+				<el-button size="small" type="primary" @click="goCg(scope.row)">采购</el-button>
 				<el-button size="small" type="primary" @click="modify(scope.row)">修改</el-button>
 				<el-button size="small" type="success" @click="">结账记录</el-button>
 				<el-button size="small" type="success" @click="">采购记录</el-button>
@@ -90,27 +95,25 @@
 		<!-- 详情 -->
 		<detail-draw :show.sync="drapShow" :info="modalData" />
 
-		<el-dialog :title="rechargeTitle" :visible.sync="rechargePop" width="600px" center :close-on-click-modal="false">
+		<el-dialog :title="addGhsTitle" :visible.sync="addGhsPop" width="600px" center :close-on-click-modal="false">
 			<div>
 				<div class="accounts-list">
-					充值金额
-					<el-input style="width: 80%" v-model="rechargeAmount" clearable></el-input>
+					供货商名
+					<el-input style="width: 80%" v-model="addGhsName" 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>
+						<el-button :type="location == 0?'primary':''" @click="location=0" size="small">上游</el-button>
+						<el-button :type="location == 1?'primary':''" @click="location=1" 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>
+						<el-button @click="resetAddGhs()">取消</el-button>
+						<el-button type="primary" @click="confirmAddGhs()" style="margin-left:80px;">确认</el-button>
 					</div>
 				</div>
 			</div>
@@ -132,23 +135,13 @@ export default {
 		return {
 			app: null,
 			tabIndex: '0',
-			tabsData: [
-				{
-					text: '全部',
-					key: '0',
-					val: 0
-				}
-			],
+			tabsData: [ { text: '全部', key: '0', val: 0 } ],
 			modalData: {},
 			drapShow: false,
-			rechargeAmount:'',
-			rechargePayWay:-1,
-			rechargePop:false,
-			rechargeTitle:'充值',
-			rechargeCustom:{},
-			name1:'',
-			mobile1:'',
-			confirmMobile1:'',
+			addGhsName:'',
+			location:0,
+			addGhsPop:false,
+			addGhsTitle:'添加供货商',
 			totalDebtAmount:0,
 			searchContent:''
 		};
@@ -160,20 +153,28 @@ export default {
 		this.getLevel();
 	},
 	mounted() {
-		let that = this;
-		document.onkeydown=function(e) {
-			if(e && e.key == ',' && e.ctrlKey){
-				let query = {}
-				that.$router.push({path:'/order/add',query})
-			}
-			if(e && e.key == '.' && e.ctrlKey){
-				let query = {}
-				that.$router.push({path:'/in/add',query})
-			}
-		}
+
 	},
 	methods: {
 		...mapActions(['getLevel']),
+		resetAddGhs(){
+			this.addGhsPop = false
+			this.location = 0
+			this.addGhsName = ''
+		},
+		confirmAddGhs(){
+			if(this.$util.isEmpty(this.addGhsName) == true){
+				this.$message({message: '请填写名称',type: 'warning'})
+				return false
+			}
+			this.$confirm('确认添加?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => {
+				this.$service.ghs.add({ name: this.addGhsName,location:this.location}).then(data => {
+					this.resetAddGhs()
+					this.$notify({ title: '成功', message: '充值成功', type: 'success'})
+					this.app.refresh({ type: this.tabIndex })
+				})
+			})
+		},
 		goDebtChange(data){
 			let query = {};
 			query.ghsId = data.id
@@ -198,8 +199,7 @@ export default {
 			})
 		},
 		addGhs(){
-			let query = {}
-			this.$router.push({path:'/in/add',query})			
+			this.addGhsPop = true
 		},
 		billing(){
 			let query = {}
@@ -209,7 +209,7 @@ export default {
 			let query = {}
 			query.ghsId = info.id
 			query.ghsName = info.name
-			this.$router.push({path:'/in/add',query})
+			this.$router.push({path:'/in/confirm',query})
 		},
 		handleClick(tab, e) {
 			this.app.refresh({ type: this.tabIndex });
@@ -233,19 +233,19 @@ export default {
 							prop: 'id',
 							label: 'ID',
 							align: 'center',
-							width: 100
+							width: 80
 						},
 						{
 							prop: 'avatar',
 							label: '头像',
 							align: 'center',
-							width: 100
+							width: 90
 						},
 						{
 							prop: 'name',
 							label: '名称',
 							align: 'center',
-							width: 300
+							width: 260
 						},
 						{
 							prop: 'debtAmount',
@@ -259,6 +259,12 @@ export default {
 							align: 'center',
 							width: 90
 						},
+						{
+							prop: 'location',
+							label: '类型',
+							align: 'center',
+							width: 90
+						},
 						{
 							prop: 'updateTime',
 							label: '最近访问',

+ 2 - 2
ghs/src/views/member/list.vue

@@ -76,7 +76,7 @@
 			</template>
 
 			<template #slot-column-option="{scope}">
-				<el-button size="small" type="primary" @click="beginRecharge(scope.row)">充值账</el-button>
+				<el-button size="small" type="primary" @click="beginRecharge(scope.row)">充值账</el-button>
 				<el-button size="small" type="primary" @click="kd(scope.row,0)">开单</el-button>
 				<el-button size="small" type="primary" @click="kd(scope.row,1)">开预订单</el-button>
 			</template>
@@ -314,7 +314,7 @@ export default {
 		},
 		beginRecharge(info){
 			this.rechargePop = true
-			this.rechargeTitle = '【'+info.name+'】充值账'
+			this.rechargeTitle = '【'+info.name+'】充值账'
 			this.rechargeCustom = info
 		},
 		resetRecharge(){