|
|
@@ -19,9 +19,9 @@
|
|
|
<headerTitle title="基本信息" size="16px"></headerTitle>
|
|
|
<el-row :gutter="20">
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="预付日期:" prop="paymentDate">
|
|
|
+ <el-form-item label="预付日期:" prop="prepayDate">
|
|
|
<el-date-picker
|
|
|
- v-model="form.paymentDate"
|
|
|
+ v-model="form.prepayDate"
|
|
|
type="date"
|
|
|
placeholder="请选择"
|
|
|
value-format="yyyy-MM-dd"
|
|
|
@@ -31,9 +31,9 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="预付金额:" prop="amount">
|
|
|
+ <el-form-item label="预付金额:" prop="prepayTotalPrice">
|
|
|
<el-input
|
|
|
- v-model="form.amount"
|
|
|
+ v-model="form.prepayTotalPrice"
|
|
|
placeholder="请输入"
|
|
|
:disabled="isDetail"
|
|
|
>
|
|
|
@@ -42,24 +42,29 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="会计科目:" prop="accountSubject">
|
|
|
- <el-select
|
|
|
- v-model="form.accountSubject"
|
|
|
- placeholder="请选择"
|
|
|
- style="width: 100%"
|
|
|
+ <el-form-item label="会计科目:" prop="accountingSubjectId">
|
|
|
+ <ele-tree-select
|
|
|
+ clearable
|
|
|
:disabled="isDetail"
|
|
|
- >
|
|
|
- <el-option label="预付款项" value="预付款项"></el-option>
|
|
|
- </el-select>
|
|
|
+ filterable
|
|
|
+ ref="treeSelect"
|
|
|
+ :data="accountingSubjectList"
|
|
|
+ v-model="form.accountingSubjectId"
|
|
|
+ valueKey="id"
|
|
|
+ labelKey="name"
|
|
|
+ placeholder="请选择"
|
|
|
+ @change="changeSubjectInfo"
|
|
|
+ default-expand-all
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
|
|
|
<el-row :gutter="20">
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="供应商名称:" prop="supplierName">
|
|
|
+ <el-form-item label="供应商名称:" prop="contactName">
|
|
|
<el-select
|
|
|
- v-model="form.supplierName"
|
|
|
+ v-model="form.contactName"
|
|
|
placeholder="请选择"
|
|
|
style="width: 100%"
|
|
|
:disabled="isDetail"
|
|
|
@@ -82,7 +87,8 @@
|
|
|
style="width: 100%"
|
|
|
:disabled="isDetail"
|
|
|
>
|
|
|
- <el-option label="采购订单" value="采购订单"></el-option>
|
|
|
+ <el-option label="采购订单" :value="3"></el-option>
|
|
|
+ <el-option label="合同" :value="2"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
@@ -109,20 +115,19 @@
|
|
|
<el-row :gutter="20">
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="款项类型:" prop="fundType">
|
|
|
- <el-select
|
|
|
+ <DictSelection
|
|
|
+ dictName="预收款款项类型"
|
|
|
+ clearable
|
|
|
v-model="form.fundType"
|
|
|
- placeholder="请选择"
|
|
|
- style="width: 100%"
|
|
|
:disabled="isDetail"
|
|
|
>
|
|
|
- <el-option label="预付款" value="预付款"></el-option>
|
|
|
- </el-select>
|
|
|
+ </DictSelection>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="付款条件:" prop="paymentTerms">
|
|
|
+ <el-form-item label="付款条件:" prop="paymentConditionName">
|
|
|
<el-select
|
|
|
- v-model="form.paymentTerms"
|
|
|
+ v-model="form.paymentConditionName"
|
|
|
placeholder="请选择"
|
|
|
style="width: 100%"
|
|
|
:disabled="isDetail"
|
|
|
@@ -149,8 +154,8 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="附件:" prop="attachment">
|
|
|
- <fileMain v-model="form.attachment" :disabled="isDetail"></fileMain>
|
|
|
+ <el-form-item label="附件:" prop="files">
|
|
|
+ <fileMain v-model="form.files" :disabled="isDetail"></fileMain>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
@@ -185,6 +190,7 @@
|
|
|
import inventoryTableDetails from '@/BIZComponents/inventoryTableDetails.vue';
|
|
|
import fileMain from '@/components/addDoc/index.vue';
|
|
|
import { addPrepayment, updatePrepayment } from '@/api/financialManage/prepayment';
|
|
|
+ import { getTreeByPid } from '@/api/classifyManage';
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
|
@@ -201,25 +207,30 @@
|
|
|
supplierOptions: [],
|
|
|
sourceCodeOptions: [],
|
|
|
paymentTermsOptions: [],
|
|
|
+ accountingSubjectList: [],
|
|
|
form: {
|
|
|
id: null,
|
|
|
code: '',
|
|
|
- paymentDate: '',
|
|
|
- amount: '',
|
|
|
- accountSubject: '预付款项',
|
|
|
- supplierName: '',
|
|
|
- sourceType: '采购订单',
|
|
|
+ prepayDate: '',
|
|
|
+ prepayTotalPrice: '',
|
|
|
+ accountingSubjectId: '1779719367139791007',
|
|
|
+ accountingSubjectCode: '1123',
|
|
|
+ contactName: '',
|
|
|
+ contactId: '',
|
|
|
+ sourceType: 3,
|
|
|
sourceCode: '',
|
|
|
- fundType: '预付款',
|
|
|
- paymentTerms: '',
|
|
|
+ sourceId: '',
|
|
|
+ fundType: 1,
|
|
|
+ paymentConditionName: '',
|
|
|
+ paymentConditionId: '',
|
|
|
remark: '',
|
|
|
- attachment: []
|
|
|
+ files: []
|
|
|
},
|
|
|
rules: {
|
|
|
- paymentDate: [{ required: true, message: '请选择预付日期', trigger: 'change' }],
|
|
|
- amount: [{ required: true, message: '请输入预付金额', trigger: 'blur' }],
|
|
|
- accountSubject: [{ required: true, message: '请选择会计科目', trigger: 'change' }],
|
|
|
- supplierName: [{ required: true, message: '请选择供应商名称', trigger: 'change' }],
|
|
|
+ prepayDate: [{ required: true, message: '请选择预付日期', trigger: 'change' }],
|
|
|
+ prepayTotalPrice: [{ required: true, message: '请输入预付金额', trigger: 'blur' }],
|
|
|
+ accountingSubjectId: [{ required: true, message: '请选择会计科目', trigger: 'change' }],
|
|
|
+ contactName: [{ required: true, message: '请选择供应商名称', trigger: 'change' }],
|
|
|
sourceType: [{ required: true, message: '请选择来源类型', trigger: 'change' }],
|
|
|
sourceCode: [{ required: true, message: '请选择来源编码', trigger: 'change' }],
|
|
|
fundType: [{ required: true, message: '请选择款项类型', trigger: 'change' }]
|
|
|
@@ -236,8 +247,9 @@
|
|
|
this.form.code = `YFK${year}${month}${day}${random}`;
|
|
|
},
|
|
|
|
|
|
- open(type, row) {
|
|
|
+ async open(type, row) {
|
|
|
this.visible = true;
|
|
|
+ await this.getClassifyList(24, 'accountingSubjectList');
|
|
|
this.isUpdate = type === 'edit';
|
|
|
this.isDetail = type === 'detail';
|
|
|
if ((this.isUpdate || this.isDetail) && row) {
|
|
|
@@ -248,31 +260,48 @@
|
|
|
});
|
|
|
} else {
|
|
|
this.resetForm();
|
|
|
- this.generateCode();
|
|
|
+ // this.generateCode();
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.inventoryTableDetailsRef &&
|
|
|
this.$refs.inventoryTableDetailsRef.putTableValue([]);
|
|
|
});
|
|
|
+ this.form.accountingSubjectId = '1779719367139792005';
|
|
|
+ this.form.accountingSubjectCode = '2203';
|
|
|
}
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.form && this.$refs.form.clearValidate();
|
|
|
});
|
|
|
},
|
|
|
|
|
|
+ //获取分类管理中的数据
|
|
|
+ async getClassifyList(id, listName) {
|
|
|
+ let res = await getTreeByPid(id);
|
|
|
+ this[listName] = res.data;
|
|
|
+ },
|
|
|
+
|
|
|
+ changeSubjectInfo(val) {
|
|
|
+ const { code } = this.$refs.treeSelect.getNodeByValue(val);
|
|
|
+ this.form.accountingSubjectCode = code;
|
|
|
+ },
|
|
|
+
|
|
|
resetForm() {
|
|
|
this.form = {
|
|
|
id: null,
|
|
|
code: '',
|
|
|
- paymentDate: '',
|
|
|
- amount: '',
|
|
|
- accountSubject: '预付款项',
|
|
|
- supplierName: '',
|
|
|
- sourceType: '采购订单',
|
|
|
+ prepayDate: '',
|
|
|
+ prepayTotalPrice: '',
|
|
|
+ accountingSubjectId: '1779719367139791007',
|
|
|
+ accountingSubjectCode: '1123',
|
|
|
+ contactName: '',
|
|
|
+ contactId: '',
|
|
|
+ sourceType: 3,
|
|
|
sourceCode: '',
|
|
|
- fundType: '预付款',
|
|
|
- paymentTerms: '',
|
|
|
+ sourceId: '',
|
|
|
+ fundType: 1,
|
|
|
+ paymentConditionName: '',
|
|
|
+ paymentConditionId: '',
|
|
|
remark: '',
|
|
|
- attachment: []
|
|
|
+ files: []
|
|
|
};
|
|
|
},
|
|
|
|