|
@@ -64,7 +64,8 @@
|
|
|
type="primary"
|
|
|
@click="createExRate"
|
|
|
:disabled="detailData.status == 1"
|
|
|
- >产生汇率项目</el-button>
|
|
|
+ >产生汇率项目</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
</avue-form>
|
|
|
</basic-container>
|
|
@@ -87,7 +88,7 @@
|
|
|
<script>
|
|
|
import { getToken } from "@/util/auth";
|
|
|
import { dateFormat } from "@/util/date";
|
|
|
-import { typeSave, dataDetail } from "@/api/basicData/rateManagement";
|
|
|
+import { typeSave, dataDetail, delItem } from "@/api/basicData/rateManagement";
|
|
|
import { optionList } from "./js/optionList";
|
|
|
import reportDialog from "@/components/report-dialog/main";
|
|
|
export default {
|
|
@@ -108,7 +109,7 @@ export default {
|
|
|
labelWidth: 100,
|
|
|
column: [
|
|
|
{
|
|
|
- label: "货币代码",
|
|
|
+ label: "货币币别",
|
|
|
prop: "code",
|
|
|
span: 6,
|
|
|
rules: [
|
|
@@ -117,7 +118,7 @@ export default {
|
|
|
message: " ",
|
|
|
trigger: "blur"
|
|
|
}
|
|
|
- ],
|
|
|
+ ]
|
|
|
},
|
|
|
{
|
|
|
label: "货币名称",
|
|
@@ -129,7 +130,7 @@ export default {
|
|
|
message: " ",
|
|
|
trigger: "blur"
|
|
|
}
|
|
|
- ],
|
|
|
+ ]
|
|
|
},
|
|
|
{
|
|
|
label: "默认汇率",
|
|
@@ -141,7 +142,7 @@ export default {
|
|
|
message: " ",
|
|
|
trigger: "blur"
|
|
|
}
|
|
|
- ],
|
|
|
+ ]
|
|
|
},
|
|
|
{
|
|
|
label: "本位币",
|
|
@@ -153,7 +154,7 @@ export default {
|
|
|
message: " ",
|
|
|
trigger: "blur"
|
|
|
}
|
|
|
- ],
|
|
|
+ ]
|
|
|
},
|
|
|
{
|
|
|
label: "符号",
|
|
@@ -165,14 +166,14 @@ export default {
|
|
|
message: " ",
|
|
|
trigger: "blur"
|
|
|
}
|
|
|
- ],
|
|
|
+ ]
|
|
|
},
|
|
|
{
|
|
|
label: "汇率类型",
|
|
|
prop: "paritiesType",
|
|
|
type: "select",
|
|
|
filterable: true,
|
|
|
- clearable:false,
|
|
|
+ clearable: false,
|
|
|
props: {
|
|
|
label: "dictValue",
|
|
|
value: "dictValue"
|
|
@@ -198,7 +199,7 @@ export default {
|
|
|
message: " ",
|
|
|
trigger: "change"
|
|
|
}
|
|
|
- ],
|
|
|
+ ]
|
|
|
},
|
|
|
{
|
|
|
label: "汇率年度",
|
|
@@ -212,7 +213,7 @@ export default {
|
|
|
message: " ",
|
|
|
trigger: "blur"
|
|
|
}
|
|
|
- ],
|
|
|
+ ]
|
|
|
},
|
|
|
{
|
|
|
label: "月份",
|
|
@@ -232,12 +233,12 @@ export default {
|
|
|
message: " ",
|
|
|
trigger: "change"
|
|
|
}
|
|
|
- ],
|
|
|
+ ]
|
|
|
},
|
|
|
{
|
|
|
prop: "button",
|
|
|
span: 6
|
|
|
- },
|
|
|
+ }
|
|
|
]
|
|
|
},
|
|
|
optionList: optionList
|
|
@@ -252,7 +253,7 @@ export default {
|
|
|
reportDialog
|
|
|
},
|
|
|
created() {
|
|
|
- this.$set(this.form,'standardMoney', 0);
|
|
|
+ this.$set(this.form, "standardMoney", 0);
|
|
|
if (this.detailData.id) {
|
|
|
this.getDetail(this.detailData.id);
|
|
|
}
|
|
@@ -269,52 +270,37 @@ export default {
|
|
|
dataDetail(id)
|
|
|
.then(res => {
|
|
|
this.form = res.data.data;
|
|
|
- this.dataList = res.data.data.paritiesItemList? res.data.data.paritiesItemList: [];
|
|
|
+ this.dataList = res.data.data.paritiesItemList
|
|
|
+ ? res.data.data.paritiesItemList
|
|
|
+ : [];
|
|
|
})
|
|
|
.finally(() => {
|
|
|
this.allloading = false;
|
|
|
});
|
|
|
},
|
|
|
- rowDel(row) {
|
|
|
- this.$confirm("确定删除数据?", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(() => {
|
|
|
- if (row.id) {
|
|
|
- delItem(row.id).then(res => {
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "删除成功!"
|
|
|
- });
|
|
|
- });
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "删除成功!"
|
|
|
- });
|
|
|
- this.dataList.splice(row.$index, 1);
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
//修改提交触发
|
|
|
editCustomer() {
|
|
|
this.$refs["form"].validate((valid, done) => {
|
|
|
done();
|
|
|
if (valid) {
|
|
|
this.loadingBtn = true;
|
|
|
- typeSave({
|
|
|
- ...this.form,
|
|
|
- paritiesItemList: this.dataList
|
|
|
- })
|
|
|
- .then(res => {
|
|
|
- this.$message.success("保存成功");
|
|
|
- // this.form = res.data.data;
|
|
|
- this.getDetail(res.data.data.id)
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- this.loadingBtn = false;
|
|
|
+ if (this.form.id) {
|
|
|
+ delItem({ id: this.form.id }).then(res => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ typeSave({
|
|
|
+ ...this.form,
|
|
|
+ paritiesItemList: this.dataList
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ this.getDetail(res.data.data.id);
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.loadingBtn = false;
|
|
|
+ });
|
|
|
+ }
|
|
|
});
|
|
|
+ }
|
|
|
} else {
|
|
|
return false;
|
|
|
}
|
|
@@ -357,46 +343,47 @@ export default {
|
|
|
this.$refs["form"].validate((valid, done) => {
|
|
|
done();
|
|
|
if (valid) {
|
|
|
+ this.toggleForm();
|
|
|
this.dataList = [];
|
|
|
- if (this.form.paritiesType == '年汇率') {
|
|
|
+ if (this.form.paritiesType == "年汇率") {
|
|
|
+ delete this.form.moon;
|
|
|
const data = {
|
|
|
annual: this.form.annual,
|
|
|
receivableParities: this.form.parities,
|
|
|
handleParities: this.form.parities,
|
|
|
receiptsParities: this.form.parities,
|
|
|
- actuallyParities: this.form.parities,
|
|
|
- }
|
|
|
- this.dataList.push(data)
|
|
|
- } else if (this.form.paritiesType == '月汇率') {
|
|
|
- for (let i = 1;i <= 12;i++) {
|
|
|
+ actuallyParities: this.form.parities
|
|
|
+ };
|
|
|
+ this.dataList.push(data);
|
|
|
+ } else if (this.form.paritiesType == "月汇率") {
|
|
|
+ for (let i = 1; i <= 12; i++) {
|
|
|
const data = {
|
|
|
annual: this.form.annual,
|
|
|
- moon: i + '月',
|
|
|
+ moon: i + "月",
|
|
|
receivableParities: this.form.parities,
|
|
|
handleParities: this.form.parities,
|
|
|
receiptsParities: this.form.parities,
|
|
|
- actuallyParities: this.form.parities,
|
|
|
- }
|
|
|
- this.dataList.push(data)
|
|
|
+ actuallyParities: this.form.parities
|
|
|
+ };
|
|
|
+ this.dataList.push(data);
|
|
|
}
|
|
|
- } else if (this.form.paritiesType == '日汇率') {
|
|
|
- const days = this.getCountDays(this.form.annual, this.form.moon)
|
|
|
- for (let i = 1;i <= days;i++) {
|
|
|
+ } else if (this.form.paritiesType == "日汇率") {
|
|
|
+ const days = this.getCountDays(this.form.annual, this.form.moon);
|
|
|
+ for (let i = 1; i <= days; i++) {
|
|
|
const data = {
|
|
|
annual: this.form.annual,
|
|
|
- moon: this.form.moon + '月',
|
|
|
- national: i + '号',
|
|
|
+ moon: this.form.moon + "月",
|
|
|
+ national: i + "号",
|
|
|
receivableParities: this.form.parities,
|
|
|
handleParities: this.form.parities,
|
|
|
receiptsParities: this.form.parities,
|
|
|
- actuallyParities: this.form.parities,
|
|
|
- }
|
|
|
- this.dataList.push(data)
|
|
|
- console.log(this.dataList)
|
|
|
+ actuallyParities: this.form.parities
|
|
|
+ };
|
|
|
+ this.dataList.push(data);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
// 获取一个月的天数
|
|
|
getCountDays(curDate, month) {
|
|
@@ -405,21 +392,27 @@ export default {
|
|
|
date.setDate(0);
|
|
|
return date.getDate();
|
|
|
},
|
|
|
+ toggleForm() {
|
|
|
+ if (this.form.paritiesType == "日汇率") {
|
|
|
+ this.findObject(this.optionList.column, "national").hide = false;
|
|
|
+ this.findObject(this.optionList.column, "moon").hide = false;
|
|
|
+ } else if (this.form.paritiesType == "月汇率") {
|
|
|
+ this.findObject(this.optionList.column, "national").hide = true;
|
|
|
+ this.findObject(this.optionList.column, "moon").hide = false;
|
|
|
+ } else {
|
|
|
+ this.findObject(this.optionList.column, "national").hide = true;
|
|
|
+ this.findObject(this.optionList.column, "moon").hide = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
watch: {
|
|
|
"form.paritiesType": function(row) {
|
|
|
if (row == "日汇率") {
|
|
|
this.findObject(this.option.column, "moon").display = true;
|
|
|
- this.findObject(this.optionList.column, "national").hide = false;
|
|
|
- this.findObject(this.optionList.column, "moon").hide = false;
|
|
|
} else if (row == "月汇率") {
|
|
|
this.findObject(this.option.column, "moon").display = false;
|
|
|
- this.findObject(this.optionList.column, "national").hide = true;
|
|
|
- this.findObject(this.optionList.column, "moon").hide = false;
|
|
|
} else {
|
|
|
this.findObject(this.option.column, "moon").display = false;
|
|
|
- this.findObject(this.optionList.column, "national").hide = true;
|
|
|
- this.findObject(this.optionList.column, "moon").hide = true;
|
|
|
}
|
|
|
}
|
|
|
}
|