pengyh 1 год назад
Родитель
Сommit
89b72edbb4

+ 37 - 0
src/api/auxiliaryFittings/salesWithdraw.js

@@ -0,0 +1,37 @@
+import request, { postBlob, getBlob, handleImport } from '@/utils/request'
+
+// 获取列表
+export function listPageV2(data) {
+  return request({
+    url: `/withdrawal/list/pageV2?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+//导出
+export function pageExport(data, name) {
+  return postBlob({
+    url: '/withdrawal/pageExport',
+    data,
+    name
+  })
+}
+
+// 详情
+export function getDetail(params) {
+  return request({
+    url: `/withdrawal/detail`,
+    method: 'post',
+    params
+  })
+}
+
+// 设为已发
+export function update(params) {
+  return request({
+    url: `/withdrawal/update`,
+    method: 'post',
+    params
+  })
+}

+ 9 - 0
src/api/auxiliaryFittings/settleAccountManagement.js → src/api/auxiliaryFittings/settleAccount.js

@@ -25,4 +25,13 @@ export function getDetail(params) {
     method: 'post',
     params
   })
+}
+
+// 结算
+export function refund(params) {
+  return request({
+    url: `/settlementOrder/refund`,
+    method: 'post',
+    params
+  })
 }

+ 251 - 0
src/views/auxiliaryFittings/settleAccountManagement/salesWithdraw/index.vue

@@ -0,0 +1,251 @@
+<template>
+	<template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="110"
+	  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
+	  :operation="operation" :exportList="exportList">
+	  
+	  <div slot="moreSearch">
+	    <el-radio-group v-model="status" size="mini" @change="changeType">
+	    	<el-radio-button label="">全部</el-radio-button>
+	    	<el-radio-button :label="0">待发放</el-radio-button>
+	    	<el-radio-button :label="1">已发放</el-radio-button>
+	    </el-radio-group>
+	    <br><br>
+	  </div>
+		<el-dialog title="详情" width="80%" :modal="true" :visible.sync="formDialog" :show-close="true" :close-on-click-modal="false" :modal-append-to-body="false" @close="formDialog = false;formData = {}">
+			<el-card class="box-card">
+				<div slot="header" class="clearfix">
+					<span>提现信息</span>
+				</div>
+				<table border="1" style="border-color: #fff;" width="100%" align="center" cellspacing="0" cellpadding="10">
+					<tr>
+						<td class="bold" align="center">提现类型</td>
+						<td>{{formData.type == 1?'销售提现':'服务提现'}}</td>
+						<td class="bold" align="center">单据编号</td>
+						<td>{{formData.id}}</td>
+						<td class="bold" align="center">所属商户</td>
+						<td>{{formData.companyWechatName}}</td>
+					</tr>
+					<tr>
+						<td class="bold" align="center">网点名称</td>
+						<td colspan="3">{{formData.websitName}}</td>
+						<td class="bold" align="center">师傅姓名</td>
+						<td>{{formData.workerName}}</td>
+					</tr>
+					<tr>
+						<td class="bold" align="center">师傅身份证号</td>
+						<td>{{formData.identity}}</td>
+						<td class="bold" align="center">师傅联系电话</td>
+						<td>{{formData.workerMobile}}</td>
+						<td class="bold" align="center">申请时间</td>
+						<td>{{formData.createTime}}</td>
+					</tr>
+					<tr>
+						<td class="bold" align="center">账户类型</td>
+						<td>{{formData.accountType}}</td>
+						<td class="bold" align="center">开户银行</td>
+						<td>{{formData.bank}}</td>
+						<td class="bold" align="center">开户支行</td>
+						<td>{{formData.bankRow}}</td>
+					</tr>
+					<tr>
+						<td class="bold" align="center">持卡人</td>
+						<td>{{formData.bankUserName}}</td>
+						<td class="bold" align="center">银行卡号</td>
+						<td>{{formData.bankNo}}</td>
+						<td class="bold" align="center">提现金额</td>
+						<td>¥{{formData.amount}}</td>
+					</tr>
+					<tr>
+						<td class="bold" align="center">备注</td>
+						<td colspan="5">{{formData.remark}}</td>
+					</tr>
+					<tr>
+						<td class="bold" align="center">转账凭证</td>
+						<td colspan="5">
+							<el-image style="width: 80px;height: 80px" :preview-src-list="[formData.certImg]" :src="formData.certImg" fit="fit"></el-image>
+						</td>
+					</tr>
+				</table>
+			</el-card>
+			<el-card class="box-card">
+				<div slot="header" class="clearfix">
+					<span>订单信息</span>
+				</div>
+				<table border="1" style="border-color: #fff;" width="100%" align="center" cellspacing="0" cellpadding="10">
+					<thead>
+						<tr>
+							<th class="bold" align="center">订单单号</th>
+							<th class="bold" align="center">订单类型</th>
+							<th class="bold" align="center">收费类型</th>
+							<th class="bold" align="center">数量</th>
+							<th class="bold" align="center">单价</th>
+							<th class="bold" align="center">订单金额</th>
+							<th class="bold" align="center">销售类型</th>
+							<th class="bold" align="center">师傅分账金额</th>
+							<th class="bold" align="center">网点分账金额</th>
+						</tr>
+					</thead>
+					<tbody>
+						<tr v-for="(item,index) in formData.withdrawalOrderItems" :key="index">
+							<td align="center">{{item.id}}</td>
+							<td align="center">{{item.goodsType == 'M'?'辅材':'配件'}}</td>
+							<td align="center">{{item.chargeType=='ACC'?'配件物料':item.chargeType=='SERV'?'服务收费':''}}</td>
+							<td align="center">{{item.num}}</td>
+							<td align="center">{{item.goodsAmount}}</td>
+							<td align="center">{{item.totalAmount}}</td>
+							<td align="center">{{item.settlementType == 'OWN'?'自由':item.settlementType == 'OUT'?'外购':''}}</td>
+							<td align="center">{{item.workerAmount}}</td>
+							<td align="center">{{item.websitAmount}}</td>
+						</tr>
+						<tr>
+							<td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td>
+						</tr>
+						<tr>
+							<td align="center">总计</td><td></td><td></td><td></td></td><td>
+							<td align="center">{{totalAmount || 0}}</td><td></td>
+							<td align="center">{{workerAmount || 0}}</td>
+							<td align="center">{{websitAmount || 0}}</td>
+						</tr>
+					</tbody>
+				</table>
+			</el-card>
+		  <div slot="footer" class="dialog-footer">
+			<el-button size="mini" @click="formDialog = false;formData = {}">取 消</el-button>
+			<el-button size="mini" v-if="formData.status == 0" type="primary" @click="update(formData.id)">设为已发</el-button>
+		  </div>
+		</el-dialog>
+	</template-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import ImageUpload from '@/components/file-upload'
+import { downloadFiles } from '@/utils/util'
+import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
+import { listPageV2,pageExport, getDetail, update } from "@/api/auxiliaryFittings/salesWithdraw";
+export default {
+  components: { TemplatePage, ImageUpload },
+  mixins: [import_mixin],
+  data() {
+    return {
+		// 事件组合
+		optionsEvensGroup: [],
+		// 表格属性
+		tableAttributes: {
+			// 启用勾选列
+			selectColumn: true
+		},
+		// 表格事件
+		tableEvents: {
+			'selection-change': this.selectionChange
+		},
+		// 勾选选中行
+		recordSelected: [],
+		formDialogType: 0,
+		formDialogTitles: ["新增","编辑", "详情"],
+		formDialog: false,
+		formData: {},
+		status: '',
+		totalAmount: 0,
+		workerAmount: 0,
+		websitAmount: 0,
+    }
+  },
+  computed: {
+    // 更多参数
+    moreParameters() {
+      return []
+    }
+  },
+  methods: {
+	// 切换状态
+	changeType(val) {
+	  this.$refs.pageRef.refreshList()
+	},
+    // 列表请求函数
+	getList(p) {
+	  try {
+	    var pam = JSON.parse(JSON.stringify(p))
+	    if (this.status) {
+	      pam.params.push({ "param": "a.status", "compare": "=", "value": this.status })
+	    }
+	    return listPageV2(pam)
+	  } catch (error) {
+	    console.log(error)
+	  }
+	},
+    // 列表导出函数
+    exportList: pageExport,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+		return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+		openForm() {
+		  this.formDialog = true;
+		},
+		formCancel() {
+		  this.$refs.formRef.$refs.inlineForm.clearValidate()
+		  this.$data.formData = this.$options.data().formData
+		  this.formDialog = false
+		},
+    // 表格操作列
+    operation(h, { row, index, column }) {
+      return (
+        <div class='operation-btns'>
+		  <el-button type="text" onClick={() => {
+			this.totalAmount = 0
+			this.workerAmount = 0
+			this.websitAmount = 0
+		    getDetail({ id: row.id }).then(res => {
+		      Object.assign(this.formData, res.data)
+			  res.data.withdrawalOrderItems.forEach(item=>{
+			  	this.totalAmount += item.totalAmount
+			  	this.workerAmount += item.workerAmount
+			  	this.websitAmount += item.websitAmount
+			  })
+		      this.formDialogType = 1
+		      this.openForm()
+		    })
+		  }}>查看</el-button>
+		  {row.status == 0? <el-button type="text" onClick={() => {
+		  	this.update(row.id)
+		  }}>设为已发</el-button>:null}
+		  
+        </div>
+      )
+    },
+	update(id){
+		this.$confirm('请确认是否设为已发放, 是否继续?', '提示', {
+			confirmButtonText: '确定',
+			cancelButtonText: '取消',
+			type: 'warning'
+		}).then(() => {
+			refund({ id }).then(res => {
+			  if (res.code == 200) {
+			  	this.$message({ type: 'success', message: '设为已发放成功!' })
+			  	this.$refs.pageRef.refreshList()
+			  } else {
+			  	this.$message.error(res.msg);
+			  }
+			})
+		});
+	},
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+	.tab{
+		padding: 20px 20px 0 20px;
+	}
+	.bold{
+		width: 160px;
+		font-weight: bold;
+		background-color: #f0f0f0;
+	}
+</style>

+ 20 - 3
src/views/auxiliaryFittings/settleAccountManagement/index.vue → src/views/auxiliaryFittings/settleAccountManagement/settleAccount/index.vue

@@ -1,5 +1,5 @@
 <template>
-	<template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="50"
+	<template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="80"
 	  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
 	  :operation="operation" :exportList="exportList">
 	  
@@ -152,7 +152,7 @@ import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { downloadFiles } from '@/utils/util'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
-import { listPageV2,pageExport, getDetail } from "@/api/auxiliaryFittings/settleAccountManagement";
+import { listPageV2,pageExport, getDetail, refund } from "@/api/auxiliaryFittings/settleAccount";
 export default {
   components: { TemplatePage, ImageUpload },
   mixins: [import_mixin],
@@ -196,7 +196,7 @@ export default {
 	getList(p) {
 	  try {
 	    var pam = JSON.parse(JSON.stringify(p))
-	    if (this.examineStatus) {
+	    if (this.status) {
 	      pam.params.push({ "param": "a.status", "compare": "=", "value": this.status })
 	    }
 	    return listPageV2(pam)
@@ -241,6 +241,23 @@ export default {
 		      this.openForm()
 		    })
 		  }}>查看</el-button>
+		  {row.totalAmount > 0? <el-button type="text" onClick={() => {
+		  	this.$confirm('请确认是否退款, 是否继续?', '提示', {
+		  		confirmButtonText: '确定',
+		  		cancelButtonText: '取消',
+		  		type: 'warning'
+		  	}).then(() => {
+		  		refund({ id: row.settlementOrderId }).then(res => {
+		  		  if (res.code == 200) {
+		  		  	this.$message({ type: 'success', message: '退款成功!' })
+		  		  	this.$refs.pageRef.refreshList()
+		  		  } else {
+		  		  	this.$message.error(res.msg);
+		  		  }
+		  		})
+		  	});
+		  }}>退款</el-button>:null}
+		  
         </div>
       )
     }

+ 57 - 2
src/views/setting/organizationManagement/tenantDetails/index.vue

@@ -5,6 +5,7 @@
       <el-tab-pane label="商户信息" name="first"></el-tab-pane>
       <el-tab-pane label="商城配置信息" name="second"></el-tab-pane>
       <el-tab-pane label="微信配置信息" name="third"></el-tab-pane>
+	  <el-tab-pane label="结算配置信息" name="four"></el-tab-pane>
     </el-tabs>
 
     <div v-show="step == 'first'">
@@ -186,10 +187,26 @@
       </el-form>
     </div>
 
-    <div class="page-footer">
+    <div v-show="step == 'four'">
+      <el-form ref="step4Form" :model="step4Form" :rules="step4FormRules" label-width="100px" label-position="right">
+		<h4>说明:将按照T+N天自动把销售订单“待结算”状态转为“可提现”状态,T为订单支付成功的日期。</h4>
+		<h5>自动结算频率</h5>
+        <el-form-item label="N等于" prop="dayNum">
+          <el-input v-model="step4Form.dayNum" style="width: 220px;margin-right: 20px;" autocomplete="off" placeholder="请输入天数" type="number"></el-input>
+		  天<span style="color: #EA8000;margin-left: 30px;">将在订单支付成功后T+0天下午17:00 执行一次</span>
+        </el-form-item>
+			<el-form-item label="执行时间" prop="hourTime">
+				<el-time-picker v-model="step4Form.hourTime" value-format="HH:mm:ss" placeholder="选择执行时间">
+				  </el-time-picker>
+			</el-form-item>
+      </el-form>
+    </div>
+		
+		<div class="page-footer">
       <div class="footer" :class="classObj">
         <el-button type="primary" @click="submitStep2Form" :loading="formLoading" v-if="step == 'second'">{{ formLoading ? '保存中 ...' : '保 存' }}</el-button>
         <el-button type="primary" @click="submitStep3Form" :loading="formLoading" v-if="step == 'third'">{{ formLoading ? '保存中 ...' : '保 存' }}</el-button>
+		<el-button type="primary" @click="submitStep4Form" :loading="formLoading" v-if="step == 'four'">{{ formLoading ? '保存中 ...' : '保 存' }}</el-button>
         <el-popconfirm
           title="确定关闭吗?"
           @confirm="goBack"
@@ -328,6 +345,18 @@ export default {
           // { required: true, message: '请输入小程序(Secret)', trigger: 'blur' }
         ],
       },
+	  step4Form: {
+		  dayNum: '',
+		  hourTime: ''
+	  },
+	  step4FormRules: {
+		  dayNum: [
+		    { required: true, message: '请输入天数', trigger: 'blur' }
+		  ],
+		  hourTime: [
+		    { required: true, message: '请选择执行时间', trigger: 'change' }
+		  ],
+	  },
 
       formLoading: false,
     }
@@ -390,6 +419,9 @@ export default {
         this.step3Form.childMerchantId = res.data.subMchId;
         this.step3Form.templateId = res.data.template;
         this.companyWechatId = res.data.companyWechatId;
+		
+		this.step4Form.dayNum = res.data.dayNum
+		this.step4Form.hourTime = res.data.hourTime
       })
     },
 
@@ -532,7 +564,30 @@ export default {
           })
         }
       })
-    }
+    },
+	
+	submitStep4Form(){
+		this.$refs.step4Form.validate((valid) => {
+		  if (valid) {
+		    this.formLoading = true;
+		
+		    let params = {
+		      adminUserId: this.id,
+			  companyWechatId: this.companyWechatId,
+		      dayNum: this.step4Form.dayNum,
+		      hourTime: this.step4Form.hourTime,
+		    }
+		    editAccount(params).then(res => {
+		      this.$successMsg('保存成功');
+		      setTimeout(() => {
+		        this.goBack();
+		      }, 1500)
+		    }).finally(res => {
+		      this.formLoading = false;
+		    })
+		  }
+		})
+	},
   }
 }
 </script>