|
@@ -38,7 +38,32 @@
|
|
|
ref="form"
|
|
|
v-model="form"
|
|
|
:option="option"
|
|
|
- />
|
|
|
+ >
|
|
|
+ <template slot="parities">
|
|
|
+ <el-input-number
|
|
|
+ v-model="form.parities"
|
|
|
+ size="small"
|
|
|
+ :controls="false"
|
|
|
+ style="width: 100%"
|
|
|
+ placeholder="请输入 默认汇率"
|
|
|
+ ></el-input-number>
|
|
|
+ </template>
|
|
|
+ <template slot="standardMoney">
|
|
|
+ <el-switch
|
|
|
+ v-model="form.standardMoney"
|
|
|
+ :active-value="1"
|
|
|
+ :inactive-value="0"
|
|
|
+ >
|
|
|
+ </el-switch>
|
|
|
+ </template>
|
|
|
+ <template slot="button">
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ @click="createExRate"
|
|
|
+ >产生汇率项目</el-button>
|
|
|
+ </template>
|
|
|
+ </avue-form>
|
|
|
</basic-container>
|
|
|
<containerTitle title="基础明细"></containerTitle>
|
|
|
<basic-container>
|
|
@@ -59,7 +84,7 @@
|
|
|
<script>
|
|
|
import { getToken } from "@/util/auth";
|
|
|
import { dateFormat } from "@/util/date";
|
|
|
-import { detail, submit, delItem } from "@/api/salaryManagement/primarySchool";
|
|
|
+import { typeSave, dataDetail } from "@/api/basicData/rateManagement";
|
|
|
import { optionList } from "./js/optionList";
|
|
|
import reportDialog from "@/components/report-dialog/main";
|
|
|
export default {
|
|
@@ -80,15 +105,71 @@ export default {
|
|
|
labelWidth: 100,
|
|
|
column: [
|
|
|
{
|
|
|
+ label: "货币代码",
|
|
|
+ prop: "code",
|
|
|
+ span: 6,
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: " ",
|
|
|
+ trigger: "blur"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
label: "货币名称",
|
|
|
- prop: "a",
|
|
|
- span: 6
|
|
|
+ prop: "cname",
|
|
|
+ span: 6,
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: " ",
|
|
|
+ trigger: "blur"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "默认汇率",
|
|
|
+ prop: "parities",
|
|
|
+ span: 6,
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: " ",
|
|
|
+ trigger: "blur"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "本位币",
|
|
|
+ prop: "standardMoney",
|
|
|
+ span: 6,
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: " ",
|
|
|
+ trigger: "blur"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "符号",
|
|
|
+ prop: "symbol",
|
|
|
+ span: 6,
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: false,
|
|
|
+ message: " ",
|
|
|
+ trigger: "blur"
|
|
|
+ }
|
|
|
+ ],
|
|
|
},
|
|
|
{
|
|
|
label: "汇率类型",
|
|
|
- prop: "b",
|
|
|
+ prop: "paritiesType",
|
|
|
type: "select",
|
|
|
filterable: true,
|
|
|
+ clearable:false,
|
|
|
props: {
|
|
|
label: "dictValue",
|
|
|
value: "dictValue"
|
|
@@ -107,18 +188,32 @@ export default {
|
|
|
dictKey: 2
|
|
|
}
|
|
|
],
|
|
|
- span: 6
|
|
|
+ span: 6,
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: " ",
|
|
|
+ trigger: "change"
|
|
|
+ }
|
|
|
+ ],
|
|
|
},
|
|
|
{
|
|
|
label: "汇率年度",
|
|
|
- prop: "c",
|
|
|
+ prop: "annual",
|
|
|
type: "year",
|
|
|
valueFormat: "yyyy",
|
|
|
- span: 6
|
|
|
+ span: 6,
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: " ",
|
|
|
+ trigger: "blur"
|
|
|
+ }
|
|
|
+ ],
|
|
|
},
|
|
|
{
|
|
|
label: "月份",
|
|
|
- prop: "d",
|
|
|
+ prop: "moon",
|
|
|
type: "select",
|
|
|
filterable: true,
|
|
|
dicUrl: "/api/blade-system/dict-biz/dictionary?code=month",
|
|
@@ -127,8 +222,19 @@ export default {
|
|
|
value: "dictKey"
|
|
|
},
|
|
|
span: 6,
|
|
|
- display: false
|
|
|
- }
|
|
|
+ display: false,
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: " ",
|
|
|
+ trigger: "change"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "button",
|
|
|
+ span: 6
|
|
|
+ },
|
|
|
]
|
|
|
},
|
|
|
optionList: optionList
|
|
@@ -143,6 +249,7 @@ export default {
|
|
|
reportDialog
|
|
|
},
|
|
|
created() {
|
|
|
+ this.$set(this.form,'standardMoney', 0);
|
|
|
if (this.detailData.id) {
|
|
|
this.getDetail(this.detailData.id);
|
|
|
}
|
|
@@ -156,15 +263,14 @@ export default {
|
|
|
return "padding:0;height:40px;";
|
|
|
},
|
|
|
getDetail(id) {
|
|
|
- // detail(id)
|
|
|
- // .then(res => {
|
|
|
- // this.form = res.data.data;
|
|
|
- // this.getItemDetail();
|
|
|
- // this.getitemAnnex();
|
|
|
- // })
|
|
|
- // .finally(() => {
|
|
|
- // this.allloading = false;
|
|
|
- // });
|
|
|
+ dataDetail(id)
|
|
|
+ .then(res => {
|
|
|
+ this.form = res.data.data;
|
|
|
+ this.dataList = res.data.data.paritiesItemList? res.data.data.paritiesItemList: [];
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.allloading = false;
|
|
|
+ });
|
|
|
},
|
|
|
rowDel(row) {
|
|
|
this.$confirm("确定删除数据?", {
|
|
@@ -178,7 +284,6 @@ export default {
|
|
|
type: "success",
|
|
|
message: "删除成功!"
|
|
|
});
|
|
|
- this.getItemDetail();
|
|
|
});
|
|
|
} else {
|
|
|
this.$message({
|
|
@@ -195,15 +300,14 @@ export default {
|
|
|
done();
|
|
|
if (valid) {
|
|
|
this.loadingBtn = true;
|
|
|
- submit({
|
|
|
+ typeSave({
|
|
|
...this.form,
|
|
|
- salaryType: "小学部",
|
|
|
- salaryItemList: this.dataList
|
|
|
+ paritiesItemList: this.dataList
|
|
|
})
|
|
|
.then(res => {
|
|
|
this.$message.success("保存成功");
|
|
|
- this.form = res.data.data;
|
|
|
- this.getItemDetail();
|
|
|
+ // this.form = res.data.data;
|
|
|
+ this.getDetail(res.data.data.id)
|
|
|
})
|
|
|
.finally(() => {
|
|
|
this.loadingBtn = false;
|
|
@@ -244,17 +348,75 @@ export default {
|
|
|
}
|
|
|
this.$emit("goBack");
|
|
|
this.leaveDetailsKey(this.$route.name);
|
|
|
- }
|
|
|
+ },
|
|
|
+ // 产生汇率项目
|
|
|
+ createExRate() {
|
|
|
+ this.$refs["form"].validate((valid, done) => {
|
|
|
+ done();
|
|
|
+ if (valid) {
|
|
|
+ this.dataList = [];
|
|
|
+ if (this.form.paritiesType == '年汇率') {
|
|
|
+ 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++) {
|
|
|
+ const data = {
|
|
|
+ annual: this.form.annual,
|
|
|
+ moon: i + '月',
|
|
|
+ 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 == '日汇率') {
|
|
|
+ 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 + '号',
|
|
|
+ receivableParities: this.form.parities,
|
|
|
+ handleParities: this.form.parities,
|
|
|
+ receiptsParities: this.form.parities,
|
|
|
+ actuallyParities: this.form.parities,
|
|
|
+ }
|
|
|
+ this.dataList.push(data)
|
|
|
+ console.log(this.dataList)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 获取一个月的天数
|
|
|
+ getCountDays(curDate, month) {
|
|
|
+ let date = new Date(curDate);
|
|
|
+ date.setMonth(month);
|
|
|
+ date.setDate(0);
|
|
|
+ return date.getDate();
|
|
|
+ },
|
|
|
},
|
|
|
watch: {
|
|
|
- "form.b": function(row) {
|
|
|
- console.log(row);
|
|
|
+ "form.paritiesType": function(row) {
|
|
|
if (row == "日汇率") {
|
|
|
- this.findObject(this.option.column, "d").display = true;
|
|
|
- this.findObject(this.optionList.column, "DAY").hide = false;
|
|
|
+ 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, "d").display = false;
|
|
|
- this.findObject(this.optionList.column, "DAY").hide = true;
|
|
|
+ this.findObject(this.option.column, "moon").display = false;
|
|
|
+ this.findObject(this.optionList.column, "national").hide = true;
|
|
|
+ this.findObject(this.optionList.column, "moon").hide = true;
|
|
|
}
|
|
|
}
|
|
|
}
|