|
|
@@ -2,7 +2,7 @@
|
|
|
<el-dialog
|
|
|
:visible.sync="showDialog"
|
|
|
:title="title"
|
|
|
- width="90%"
|
|
|
+ width="85%"
|
|
|
:modal-append-to-body="true"
|
|
|
style="text-align:left;"
|
|
|
@close="closeDialog"
|
|
|
@@ -17,35 +17,40 @@
|
|
|
<el-form-item label="收款方:" prop="payee">
|
|
|
<el-input v-model="formModel.payee" placeholder="请输入收款方" class="input-form-main"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="缴费单位:" prop="companyId">
|
|
|
- <el-select v-model="formModel.companyId" filterable class="input-form-main" @change="handChange">
|
|
|
- <el-option
|
|
|
- v-for="company in companyList"
|
|
|
- :key="company.id"
|
|
|
- :label="company.name"
|
|
|
- :value="company.id"
|
|
|
- ></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
<el-form-item label="收款账户:" prop="collectionAccountId">
|
|
|
- <el-select v-model="formModel.collectionAccountId" class="input-form-main" >
|
|
|
+ <el-input v-model="formModel.collectionAccountId" style="display:none"></el-input>
|
|
|
+ <el-input v-model="formModel.collectionAccountName" placeholder="请输入收款方" class="input-form-main" readonly="readonly"></el-input>
|
|
|
+ <!-- <el-select v-model="formModel.collectionAccountId" class="input-form-main" >
|
|
|
<el-option
|
|
|
v-for="collectionAccount in collectionAccountList"
|
|
|
:key="collectionAccount.id"
|
|
|
:label="collectionAccount.name"
|
|
|
:value="collectionAccount.id"
|
|
|
></el-option>
|
|
|
- </el-select>
|
|
|
+ </el-select> -->
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="推送用户:" prop="personId" >
|
|
|
- <el-select v-model="formModel.personId" class="input-form-main" filterable>
|
|
|
+ <el-form-item label="缴费单位:" prop="companyId">
|
|
|
+ <el-select v-model="formModel.companyId" filterable class="input-form-main" @change="handleCompanyChange">
|
|
|
+ <el-option
|
|
|
+ v-for="company in companyList"
|
|
|
+ :key="company.companyId"
|
|
|
+ :label="company.companyName"
|
|
|
+ :value="company.companyId"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item> <el-form-item label="推送用户:" prop="personId" >
|
|
|
+ <!--
|
|
|
+ <el-input v-model="formModel.personId" style="display:none"></el-input>
|
|
|
+ -->
|
|
|
+ <el-input v-model="formModel.personName" class="input-form-main"></el-input>
|
|
|
+ <!-- <el-select v-model="formModel.personId" class="input-form-main" filterable>
|
|
|
<el-option
|
|
|
v-for="person in personList"
|
|
|
:key="person.id"
|
|
|
:label="person.name"
|
|
|
:value="person.id"
|
|
|
></el-option>
|
|
|
- </el-select>
|
|
|
+ </el-select> -->
|
|
|
</el-form-item>
|
|
|
<el-form-item label="备注:" prop="bak">
|
|
|
<el-input type="textarea" v-model="formModel.bak" placeholder="请输入备注" class="input-form-main"></el-input>
|
|
|
@@ -54,14 +59,15 @@
|
|
|
<h3>账单信息</h3>
|
|
|
<el-table :data="formModel.billPushGoodsList" show-summary :summary-method="getSummaries">
|
|
|
<el-table-column type="index" label="序号" width="50"></el-table-column>
|
|
|
- <el-table-column prop="goodsId" label="收费项目">
|
|
|
- <template slot-scope="{row}">
|
|
|
+ <el-table-column prop="goodsId" label="收费项目" width="150">
|
|
|
+ <template slot-scope="scope">
|
|
|
<el-form-item>
|
|
|
- <el-select v-model="row.goodsId" placeholder="请选择" style="width:150px;">
|
|
|
+ <el-input v-model="scope.row.goodTypeId" style="display:none"></el-input>
|
|
|
+ <el-select v-model="scope.row.goodsId" placeholder="请选择" style="width:150px;" @change="handGoodsChange(scope)">
|
|
|
<el-option
|
|
|
v-for="result in goodsList"
|
|
|
:key="result.id"
|
|
|
- :label="result.name"
|
|
|
+ :label="result.goodsName"
|
|
|
:value="result.id"
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
@@ -87,23 +93,31 @@
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="numStr" label="数量" width="120">
|
|
|
+ <el-table-column prop="numStr" label="数量" width="360">
|
|
|
<template slot-scope="scope">
|
|
|
<el-form-item
|
|
|
:prop="'billPushGoodsList.' + scope.$index + '.numStr'"
|
|
|
:rules="ruleValidate['numStr']"
|
|
|
>
|
|
|
- <el-input placeholder="数量" v-model="scope.row.numStr"></el-input>
|
|
|
+ <template v-if="scope.row.goodTypeId=='7'">
|
|
|
+ <el-input style="width:100px" placeholder="起码" v-model.number="scope.row.numStr" @change="handStartChange(scope)"></el-input>
|
|
|
+ -<el-input style="width:100px" placeholder="止码" v-model.number="scope.row.numStr2" @change="handStartChange(scope)"></el-input>
|
|
|
+ =<el-input style="width:100px" v-model.number="scope.row.numStr3" @change="handNumChange(scope)"></el-input>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <el-input placeholder="数量" v-model.number="scope.row.numStr" @change="handNumChange(scope)"></el-input>
|
|
|
+ </template>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="standard" label="收费标准">
|
|
|
+ <el-table-column prop="standard" label="收费标准" width="150">
|
|
|
<template slot-scope="scope">
|
|
|
<el-form-item
|
|
|
:prop="'billPushGoodsList.' + scope.$index + '.standard'"
|
|
|
:rules="ruleValidate['standard']"
|
|
|
>
|
|
|
- <el-input placeholder="收费标准" v-model="scope.row.standard"></el-input>
|
|
|
+ <el-input v-model="scope.row.unit" style="display:none"></el-input>
|
|
|
+ <el-input placeholder="收费标准" v-model="scope.row.standard" ></el-input>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
@@ -113,12 +127,12 @@
|
|
|
:prop="'billPushGoodsList.' + scope.$index + '.totalFee'"
|
|
|
:rules="ruleValidate['totalFee']"
|
|
|
>
|
|
|
- <el-input placeholder="合计金额" v-model="scope.row.totalFee"></el-input>
|
|
|
+ <el-input placeholder="合计金额" v-model="scope.row.totalFee" readonly="readonly"></el-input>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column label="操作" width="200">
|
|
|
+ <el-table-column label="操作" width="200" fixed="right">
|
|
|
<template slot-scope="{row}">
|
|
|
<el-form-item>
|
|
|
<i class="el-icon-delete my-font" @click="handleDelete(row)"></i>
|
|
|
@@ -159,10 +173,9 @@ export default {
|
|
|
return {
|
|
|
ruleValidate: {
|
|
|
name: [{ required: true, message: "账单名称不能为空", trigger: "blur" }],
|
|
|
- payee: [{ required: true, message: "收款方不能为空", trigger: "blur" }],
|
|
|
- companyId: [{ required: true, message: "公司不能为空", trigger: "blur" }],
|
|
|
- collectionAccountId: [{ required: true, message: "请选择收款账户", trigger: "blur" }],
|
|
|
- payService: [{ required: true, message: "收费项目不能为空", trigger: "blur" }]
|
|
|
+ companyId: [{ required: true, message: "缴费单位不能为空", trigger: "blur" }],
|
|
|
+ payService: [{ required: true, message: "收费项目不能为空", trigger: "blur" }],
|
|
|
+ // personId: [{ required: true, message: "推送用户不能为空", trigger: "blur" }]
|
|
|
},
|
|
|
formModel: {
|
|
|
name:"",
|
|
|
@@ -170,10 +183,12 @@ export default {
|
|
|
companyId:"",
|
|
|
payService:"",
|
|
|
collectionAccountId:"",
|
|
|
+ collectionAccountName:"",
|
|
|
bak:"",
|
|
|
billPushGoodsList:[],
|
|
|
removeBillPushGoodsList:[],
|
|
|
-
|
|
|
+ personId:0,
|
|
|
+ personName:""
|
|
|
},
|
|
|
beginEndTime:"",
|
|
|
personList:[],
|
|
|
@@ -185,10 +200,24 @@ export default {
|
|
|
showDialog: true,
|
|
|
loading: false,
|
|
|
submitting: false,
|
|
|
+ props: {
|
|
|
+ // 配置项(必选)
|
|
|
+ value: "id",
|
|
|
+ label: "name",
|
|
|
+ children: "children"
|
|
|
+ },
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch:{
|
|
|
+ "formModel.companyId":function(newVal,oldVal){
|
|
|
+ console.log(newVal + "->" + oldVal);
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
- companyInfoApi.list().then((response)=>{
|
|
|
+
|
|
|
+ companyPaymentApi.getCompanyList().then((response)=>{
|
|
|
var jsonData = response.data;
|
|
|
this.companyList = jsonData.data;
|
|
|
});
|
|
|
@@ -202,23 +231,22 @@ export default {
|
|
|
closeDialog() {
|
|
|
this.$emit("close", false);
|
|
|
},
|
|
|
- handChange(selVal){
|
|
|
+ handleCompanyChange(newVal){
|
|
|
+ setTimeout(()=>{
|
|
|
+ var formData = new FormData();
|
|
|
+ formData.append("companyId", newVal);
|
|
|
|
|
|
- this.formModel.payService = "";
|
|
|
-
|
|
|
- var formData = new FormData();
|
|
|
- formData.append("companyId", selVal);
|
|
|
-
|
|
|
- companyGoodsInfoApi.findByCompanyId(formData).then((response)=>{
|
|
|
- var jsonData = response.data;
|
|
|
- this.goodsList = jsonData.data;
|
|
|
- });
|
|
|
-
|
|
|
- personInfoApi.findByCompanyId(formData).then((response)=>{
|
|
|
- var jsonData = response.data;
|
|
|
- this.personList = jsonData.data;
|
|
|
- });
|
|
|
+ companyGoodsInfoApi.findByCompanyId(formData).then((response)=>{
|
|
|
+ var jsonData = response.data;
|
|
|
+ this.goodsList = jsonData.data;
|
|
|
+ });
|
|
|
|
|
|
+ companyPaymentApi.findByCheckInId(formData).then((response)=>{
|
|
|
+ var jsonData = response.data;
|
|
|
+ this.formModel.personId = jsonData.data.id;
|
|
|
+ this.formModel.personName = jsonData.data.name;
|
|
|
+ });
|
|
|
+ },100);
|
|
|
},
|
|
|
handleSubmit() {
|
|
|
var self = this;
|
|
|
@@ -279,7 +307,11 @@ export default {
|
|
|
goodsId: "",
|
|
|
beginEndTime: "",
|
|
|
numStr: "",
|
|
|
+ numStr2: "",
|
|
|
+ numStr3: "",
|
|
|
totalFee: "",
|
|
|
+ standard: "",
|
|
|
+ unit: ""
|
|
|
});
|
|
|
},
|
|
|
handleInsert(row) {
|
|
|
@@ -289,10 +321,14 @@ export default {
|
|
|
if(index>=0){
|
|
|
billPushGoodsList.splice(index+1,0,{
|
|
|
sortNo: index + 2,
|
|
|
- name: "",
|
|
|
+ goodsId: "",
|
|
|
beginEndTime: "",
|
|
|
numStr: "",
|
|
|
+ numStr2: "",
|
|
|
+ numStr3: "",
|
|
|
totalFee: "",
|
|
|
+ standard: "",
|
|
|
+ unit: ""
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
@@ -328,6 +364,56 @@ export default {
|
|
|
});
|
|
|
|
|
|
return sums;
|
|
|
+ },
|
|
|
+ handGoodsChange(scope){
|
|
|
+ var row = scope.row;
|
|
|
+
|
|
|
+ setTimeout(()=>{
|
|
|
+ var formData = new FormData();
|
|
|
+ formData.append("id", row.goodsId);
|
|
|
+
|
|
|
+ companyPaymentApi.loadDetails(formData).then((response)=>{
|
|
|
+ var jsonData = response.data;
|
|
|
+
|
|
|
+ if(jsonData.result){
|
|
|
+ var data = jsonData.data;
|
|
|
+
|
|
|
+ row.standard = data.unitPriceStr;
|
|
|
+ row.unit = data.unitPrice;
|
|
|
+ row.goodTypeId = data.goodType;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },100);
|
|
|
+ },
|
|
|
+ handNumChange(scope){
|
|
|
+ var row = scope.row;
|
|
|
+
|
|
|
+ var num = row.numStr;
|
|
|
+ var unit = row.unit;
|
|
|
+
|
|
|
+ var totalFee = num*1*unit*1;
|
|
|
+
|
|
|
+ this.formModel.billPushGoodsList[scope.$index].totalFee = totalFee;
|
|
|
+ },
|
|
|
+ handStartChange(scope){
|
|
|
+ var row = scope.row;
|
|
|
+
|
|
|
+ var num1=row.numStr;
|
|
|
+ var num2=row.numStr2;
|
|
|
+ var unit = row.unit;
|
|
|
+
|
|
|
+
|
|
|
+ setTimeout(()=>{
|
|
|
+ if(num1!=null&&num2!=null){
|
|
|
+ var num3 = num2-num1;
|
|
|
+
|
|
|
+ this.formModel.billPushGoodsList[scope.$index].numStr3 = num3;
|
|
|
+
|
|
|
+ var totalFee = num3*1*unit*1;
|
|
|
+
|
|
|
+ this.formModel.billPushGoodsList[scope.$index].totalFee = totalFee;
|
|
|
+ }
|
|
|
+ },100);
|
|
|
}
|
|
|
},
|
|
|
mounted: function() {
|
|
|
@@ -370,16 +456,22 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
-<style>
|
|
|
+<style scoped>
|
|
|
.input-form-main{
|
|
|
width: 500px;
|
|
|
}
|
|
|
.link-span{
|
|
|
margin-right: 20px;
|
|
|
}
|
|
|
+.el-form-item{
|
|
|
+ margin-bottom: 25px;
|
|
|
+}
|
|
|
.my-font {
|
|
|
font-size: 20px;
|
|
|
cursor: pointer;
|
|
|
margin-right: 10px;
|
|
|
}
|
|
|
+.user-panel {
|
|
|
+ margin: 10px auto;
|
|
|
+}
|
|
|
</style>
|