-
+
-
+
+
+
+
+
+
-
+
- {{projectTitle}}
+ {{processForm.projectTitle}}
未选择项目
@@ -180,7 +231,6 @@
-
{{processForm.contractAmount}}元
未选择项目
@@ -485,16 +535,38 @@
fileList: [],
// 销售合同收入明细
incomeDetails: [],
+ procurementDetails: [],
processType: "",
+ procurementProjectSelectorVisible: false,
+ procurementDetailSelectorVisible: false
}
}
const methods = {
+ isEmpty,
+ isBlank,
+ hasText,
changeMode(mode) {
this.mode = mode
},
newProcurementContractClick() {
+ // 先选择 项目 (打开对话框)
+ this.procurementProjectSelectorVisible = true
+ },
+ selectProcurementDetail() {
+ if (this.processForm.projectId) {
+ // 预算采购明细表 (打开对话框)
+ this.procurementProjectSelectorVisible = false
+ this.procurementDetailSelectorVisible = true
+ }
+ else {
+ this.$message.warning("项目还未选择")
+ }
+ },
+
+ saveProcurementDetail() {
+ this.procurementDetailSelectorVisible = false
this.changeMode(procurementContractProcess)
this.processType = 'procurement_contract'
},
@@ -526,8 +598,10 @@
this.changeMode(saleContractProcess)
this.processType = 'sale_contract'
},
+
goToProcurementContract() {
- this.changeMode(saleContractProcess)
+ this.changeMode(procurementContractProcess)
+ this.processType = 'procurement_contract'
},
goToContractDetail() {
@@ -549,22 +623,28 @@
render(obj) {
console.log(obj)
},
-
+ computeProjectTitle(processForm) {
+ const { projectNo, projectName, applyPersonName, applyDate } = processForm
+ if (projectNo && projectName) {
+ return projectNo.trim() + "-" + projectName.trim() + "-" + applyPersonName + "-" + applyDate.split('-').join('')
+ }
+ return ""
+ },
initForm(form) {
- this.processForm = { ...form, sealTypes: [] }
+ this.processForm = { ...form, sealTypes: [], projectTitle: this.computeProjectTitle(form) }
},
queryProject(q, callback) {
if (isBlank(q)) {
+ callback([])
return
}
fetch("${base}/process/projects?q=" + q)
.then(res => res.json())
.then(data => {
if (data.length === 0) {
- callback([{
- name: '未搜索到结果'
- }])
+ callback([])
+ this.$message.info('未搜索到结果');
}
else {
callback(data)
@@ -577,7 +657,7 @@
handleSelectProject(selected) {
const { id, name } = selected
if (!id) {
- this.initForm({})
+ this.initForm(this.processForm)
return
}
const loading = this.$loading({
@@ -590,7 +670,7 @@
fetch("${base}/process/projects/" + id)
.then(res => res.json())
.then(data => {
- const { incomeDetails, ...form } = data
+ const { incomeDetails, procurementDetails, ...form } = data
// 转换数据
// @formatter:off
const computeType = (type) => {
@@ -601,7 +681,17 @@
default: return '未知'
}
}
- // @formatter:on
+
+ const computeFeeType = (type) => {
+ switch (type) {
+ case 1: return '设备'
+ case 2: return '施工'
+ case 3: return '服务'
+ case 4: return '其他'
+ default: return '未知'
+ }
+ }
+ // @formatter:on
this.initForm(form)
this.projectSelected = true
@@ -609,6 +699,11 @@
...detail, type: computeType(detail.type)
}))
+ this.procurementDetails = procurementDetails.map(detail => ({
+ ...detail, feeType: computeFeeType(detail.type),
+ isUnderwritten: detail.isUnderwritten === 1 ? "是" : "否"
+ }))
+
if (!form.projectNo || !form.projectName) {
this.$message.warning("当前选择的项目没有编号或者名称");
}
@@ -622,6 +717,7 @@
this.projectSelected = false
this.initForm({})
this.incomeDetails = []
+ this.procurementDetails = []
},
async saveDraft() {
@@ -724,7 +820,6 @@
...processForm,
processType,
applyDeptId,
- projectTitle: this.projectTitle,
attachments: fileList.map(file => ({
uri: file.response.data.url,
name: file.response.data.originName
@@ -834,13 +929,6 @@
el: '#app',
data,
computed: {
- projectTitle() {
- const { projectNo, projectName, applyPersonName, applyDate } = this.processForm
- if (projectNo && projectName) {
- return projectNo.trim() + "-" + projectName.trim() + "-" + applyPersonName + "-" + applyDate.split('-').join('')
- }
- return ""
- },
isButtonMode() {
return this.mode === BUTTON
},
@@ -873,6 +961,7 @@
methods,
mounted() {
+ this.handleSelectProject({ id: 135 })
this.applyDeptSectorOptions = JSON.parse('${applyDeptSectorOptions}')
},
})