|
|
@@ -62,12 +62,17 @@
|
|
|
:data="formModel.billPushGoodsList"
|
|
|
show-summary :summary-method="getSummaries">
|
|
|
<el-table-column prop="sort" type="index" label="序号" width="50"></el-table-column>
|
|
|
-
|
|
|
<el-table-column prop="goodsId" label="收费项目" width="150">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-form-item>
|
|
|
- <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)" size="mini">
|
|
|
+ <el-form-item
|
|
|
+ :prop="'billPushGoodsList.' + scope.$index + '.goodsId'"
|
|
|
+ :rules="ruleValidate['goodsId']"
|
|
|
+ >
|
|
|
+ <el-select
|
|
|
+ v-model="scope.row.goodsId"
|
|
|
+ placeholder="请选择"
|
|
|
+ style="width:150px;"
|
|
|
+ @change="handGoodsChange(scope)" size="mini">
|
|
|
<el-option
|
|
|
v-for="result in goodsList"
|
|
|
:key="result.id"
|
|
|
@@ -101,8 +106,8 @@
|
|
|
<el-table-column prop="numStr" label="数量" width="320">
|
|
|
<template slot-scope="scope">
|
|
|
<el-form-item
|
|
|
- :prop="'billPushGoodsList.' + scope.$index + '.numStr'"
|
|
|
- :rules="ruleValidate['numStr']"
|
|
|
+ :prop="'billPushGoodsList.' + scope.$index + '.numStr3'"
|
|
|
+ :rules="ruleValidate['numStr3']"
|
|
|
>
|
|
|
<template v-if="scope.row.goodTypeId=='7'">
|
|
|
<el-input style="width:85px" placeholder="起码" v-model.number="scope.row.numStr" @change="handStartChange(scope)" size="mini"></el-input>
|
|
|
@@ -132,7 +137,7 @@
|
|
|
:prop="'billPushGoodsList.' + scope.$index + '.totalFee'"
|
|
|
:rules="ruleValidate['totalFee']"
|
|
|
>
|
|
|
- <el-input placeholder="合计金额" :value="fmtMoney(scope.row.totalFee)" readonly="readonly" size="mini"></el-input>
|
|
|
+ <el-input placeholder="合计金额" :value="scope.row.totalFee" readonly="readonly" size="mini"></el-input>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
@@ -181,6 +186,9 @@ export default {
|
|
|
companyId: [{ required: true, message: "缴费单位不能为空", trigger: "blur" }],
|
|
|
payService: [{ required: true, message: "收费项目不能为空", trigger: "blur" }],
|
|
|
// personId: [{ required: true, message: "推送用户不能为空", trigger: "blur" }]
|
|
|
+ beginEndTime:[{ required: true, message: "起止时间不能为空", trigger: "blur" }],
|
|
|
+ numStr3:[{ required: true, message: "数量不能为空", trigger: "blur" }],
|
|
|
+ goodsId:[{ required: true, message: "收费项目未选择", trigger: "blur" }]
|
|
|
},
|
|
|
formModel: {
|
|
|
name:"",
|
|
|
@@ -253,56 +261,61 @@ export default {
|
|
|
handleSubmit() {
|
|
|
var self = this;
|
|
|
|
|
|
- //增加转型,避免直接修改formModel
|
|
|
- var requestData = JSON.parse(JSON.stringify(self.formModel));
|
|
|
+ this.$refs["form"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ //增加转型,避免直接修改formModel
|
|
|
+ var requestData = JSON.parse(JSON.stringify(self.formModel));
|
|
|
|
|
|
- var billPushGoodsList = requestData.billPushGoodsList;
|
|
|
+ var billPushGoodsList = requestData.billPushGoodsList;
|
|
|
|
|
|
- for(var i=0;i<billPushGoodsList.length;i++){
|
|
|
- billPushGoodsList[i].sortNo = i+1;
|
|
|
- billPushGoodsList[i].beginDate = billPushGoodsList[i].beginEndTime[0];
|
|
|
- billPushGoodsList[i].endDate = billPushGoodsList[i].beginEndTime[1]
|
|
|
- billPushGoodsList[i].beginEndTime=null;
|
|
|
- }
|
|
|
+ if(billPushGoodsList.length==0) {
|
|
|
+ this.$message.warning("收费项目不能为空!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- var removeBillPushGoodsList = requestData.removeBillPushGoodsList;
|
|
|
+ for(var i=0;i<billPushGoodsList.length;i++){
|
|
|
+ billPushGoodsList[i].sortNo = i+1;
|
|
|
+ billPushGoodsList[i].beginDate = billPushGoodsList[i].beginEndTime[0];
|
|
|
+ billPushGoodsList[i].endDate = billPushGoodsList[i].beginEndTime[1]
|
|
|
+ billPushGoodsList[i].beginEndTime=null;
|
|
|
+ }
|
|
|
|
|
|
- for(var j=0;j<removeBillPushGoodsList.length;j++){
|
|
|
- removeBillPushGoodsList[j].sortNo = j+1;
|
|
|
- removeBillPushGoodsList[j].beginDate = removeBillPushGoodsList[j].beginEndTime[0];
|
|
|
- removeBillPushGoodsList[j].endDate = removeBillPushGoodsList[j].beginEndTime[1]
|
|
|
- removeBillPushGoodsList[j].beginEndTime=null;
|
|
|
- }
|
|
|
+ var removeBillPushGoodsList = requestData.removeBillPushGoodsList;
|
|
|
|
|
|
- this.$refs["form"].validate(valid => {
|
|
|
- if (valid) {
|
|
|
- (function() {
|
|
|
- var id = requestData.id;
|
|
|
-
|
|
|
- if (id == null || id.length == 0) {
|
|
|
- return billPushApi.add(requestData);
|
|
|
- } else {
|
|
|
- return billPushApi.update(requestData);
|
|
|
+ for(var j=0;j<removeBillPushGoodsList.length;j++){
|
|
|
+ removeBillPushGoodsList[j].sortNo = j+1;
|
|
|
+ removeBillPushGoodsList[j].beginDate = removeBillPushGoodsList[j].beginEndTime[0];
|
|
|
+ removeBillPushGoodsList[j].endDate = removeBillPushGoodsList[j].beginEndTime[1]
|
|
|
+ removeBillPushGoodsList[j].beginEndTime=null;
|
|
|
}
|
|
|
- })().then(function(response) {
|
|
|
- var jsonData = response.data;
|
|
|
-
|
|
|
- if (jsonData.result) {
|
|
|
- self.$message({
|
|
|
- message: "保存成功!",
|
|
|
- type: "success"
|
|
|
- });
|
|
|
-
|
|
|
- self.$emit("close", true);
|
|
|
- } else {
|
|
|
- self.$message({
|
|
|
- message: jsonData.message + "",
|
|
|
- type: "warning"
|
|
|
- });
|
|
|
-
|
|
|
- self.$emit("close", false);
|
|
|
- }
|
|
|
- });
|
|
|
+
|
|
|
+ (function() {
|
|
|
+ var id = requestData.id;
|
|
|
+
|
|
|
+ if (id == null || id.length == 0) {
|
|
|
+ return billPushApi.add(requestData);
|
|
|
+ } else {
|
|
|
+ return billPushApi.update(requestData);
|
|
|
+ }
|
|
|
+ })().then(function(response) {
|
|
|
+ var jsonData = response.data;
|
|
|
+
|
|
|
+ if (jsonData.result) {
|
|
|
+ self.$message({
|
|
|
+ message: "保存成功!",
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
+
|
|
|
+ self.$emit("close", true);
|
|
|
+ } else {
|
|
|
+ self.$message({
|
|
|
+ message: jsonData.message + "",
|
|
|
+ type: "warning"
|
|
|
+ });
|
|
|
+
|
|
|
+ self.$emit("close", false);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
@@ -416,7 +429,9 @@ export default {
|
|
|
|
|
|
var totalFee = num*1*unit*1;
|
|
|
|
|
|
- this.formModel.billPushGoodsList[scope.$index].totalFee = totalFee;
|
|
|
+ if(totalFee!=null){
|
|
|
+ this.formModel.billPushGoodsList[scope.$index].totalFee = totalFee.toFixed(2);
|
|
|
+ }
|
|
|
},
|
|
|
handStartChange(scope){
|
|
|
var row = scope.row;
|
|
|
@@ -434,7 +449,9 @@ export default {
|
|
|
|
|
|
var totalFee = num3*1*unit*1;
|
|
|
|
|
|
- this.formModel.billPushGoodsList[scope.$index].totalFee = totalFee;
|
|
|
+ if(totalFee!=null){
|
|
|
+ this.formModel.billPushGoodsList[scope.$index].totalFee = totalFee.toFixed(2);
|
|
|
+ }
|
|
|
}
|
|
|
},100);
|
|
|
}
|