|
@@ -1,5 +1,6 @@
|
|
|
<script>
|
|
|
import { Columns, TabColumns } from "../column";
|
|
|
+import { REFER } from "@/components/popover-select/api";
|
|
|
import { ADD, CODE } from "@/api/business/purchase/contract";
|
|
|
import { initDicts, initRules, initParams } from "@/utils/init";
|
|
|
|
|
@@ -75,12 +76,35 @@ export default {
|
|
|
const code = await CODE();
|
|
|
this.params.code = code;
|
|
|
} catch (err) {
|
|
|
- //
|
|
|
+ // catch
|
|
|
} finally {
|
|
|
+ // finally
|
|
|
this.loading = false;
|
|
|
}
|
|
|
},
|
|
|
//
|
|
|
+ async fetchRefer(prop, type, source) {
|
|
|
+ const { rateCode } = prop;
|
|
|
+ if (type === "MATERIAL_PARAM") {
|
|
|
+ try {
|
|
|
+ this.loading = true;
|
|
|
+ const { code, rows } = await REFER({
|
|
|
+ search: rateCode,
|
|
|
+ type: "TAX_RATE_PARAM",
|
|
|
+ });
|
|
|
+ if (code === 200) {
|
|
|
+ const [{ ntaxrate }] = rows;
|
|
|
+ source.tax = ntaxrate;
|
|
|
+ }
|
|
|
+ } catch (err) {
|
|
|
+ // catch
|
|
|
+ } finally {
|
|
|
+ // finally
|
|
|
+ this.loading = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //
|
|
|
rowAdd(prop) {
|
|
|
const tab = this.tabColumns.find((element) => element.key === prop);
|
|
|
this.params[prop].push(initParams(tab.tableColumns));
|
|
@@ -90,10 +114,6 @@ export default {
|
|
|
prop.splice(index, 1);
|
|
|
},
|
|
|
//
|
|
|
- sava() {
|
|
|
- this.visible = false;
|
|
|
- },
|
|
|
- //
|
|
|
submit(prop) {
|
|
|
this.$refs[prop].validate(async (valid) => {
|
|
|
if (valid) {
|
|
@@ -244,6 +264,7 @@ export default {
|
|
|
:prop="cColumn.key"
|
|
|
:label="cColumn.title"
|
|
|
:width="cColumn.width"
|
|
|
+ show-overflow-tooltip
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
<el-input
|
|
@@ -256,7 +277,7 @@ export default {
|
|
|
style="width: 100%"
|
|
|
></el-input>
|
|
|
<dr-computed-input
|
|
|
- v-if="cColumn.inputType === 'ComputedInput'"
|
|
|
+ v-else-if="cColumn.inputType === 'ComputedInput'"
|
|
|
v-model="scope.row[cColumn.key]"
|
|
|
:source="scope.row"
|
|
|
:computed="cColumn.computed"
|
|
@@ -275,6 +296,7 @@ export default {
|
|
|
:clearable="cColumn.clearable"
|
|
|
:placeholder="cColumn.placeholder"
|
|
|
:data-mapping="cColumn.dataMapping"
|
|
|
+ @change="fetchRefer"
|
|
|
>
|
|
|
</dr-popover-select>
|
|
|
<el-input-number
|
|
@@ -334,7 +356,6 @@ export default {
|
|
|
</el-form-item>
|
|
|
<el-form-item label-width="0" style="text-align: right">
|
|
|
<el-button :size="size" @click="hide">取 消</el-button>
|
|
|
- <el-button :size="size" @click="sava">保 存</el-button>
|
|
|
<el-button :size="size" @click="submit('ruleForm')"> 新 增 </el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|