diff --git a/src/main/resources/templates/admin/business/process-completed.ftl b/src/main/resources/templates/admin/business/process-completed.ftl
index 19cb941..b5f7f51 100644
--- a/src/main/resources/templates/admin/business/process-completed.ftl
+++ b/src/main/resources/templates/admin/business/process-completed.ftl
@@ -23,6 +23,10 @@
.el-radio-button__inner, .el-radio-group {
line-height: unset;
}
+
+ [v-cloak] {
+ display: none;
+ }
@@ -32,9 +36,9 @@
已办流程
-
+
-
+
{{processForm.applyDeptLeaderName}}
-
+
@@ -500,8 +501,8 @@
}
// @formatter:on
- const applyDept = process.applyDept.split(',')
- this.initForm({ ...form, ...process, ...contract, applyDept })
+ const applyDeptId = process.applyDept.split(',')
+ this.initForm({ ...form, ...process, ...contract, applyDeptId })
this.projectSelected = true
this.processType = process.processType
this.incomeDetails = incomeDetails.map(detail => ({
@@ -532,26 +533,26 @@
saveDraft() {
this.processForm.status = 'draft'
- this.submit()
+ this.submit(false)
},
submitForm() {
this.processForm.status = 'to_be_audit'
- this.submit()
+ this.submit(true)
},
- submit() {
+ submit(needValid) {
this.$refs["contractProcessForm"].validate((valid) => {
- if (valid) {
+ if (valid || !needValid) {
const fileList = this.fileList
- if (fileList.length === 0) {
+ if (needValid && fileList.length === 0) {
this.$message.error("未上传附件");
return false
}
const processType = this.processType
const processForm = this.processForm
- if (processType === 'procurement_contract') {
+ if (needValid && processType === 'procurement_contract') {
const { procurementMode } = processForm
// specify_purchase("指定采购"),
@@ -562,7 +563,15 @@
if (procurementMode === 'price_comparison'
|| procurementMode === 'competitive_evaluation') {
+ if (isEmpty(this.supplierMaterialsForm)) {
+ this.$message.error("供应商比选材料未填写")
+ return false
+ }
for (const item in this.supplierMaterialsForm) {
+ if (isEmpty(Object.keys(item))) {
+ this.$message.error("供应商比选材料未填写")
+ return false
+ }
for (const [key, value] of Object.entries(item)) {
if (value) {
if (typeof value === 'string') {
@@ -584,19 +593,19 @@
}
}
- if (!processForm.applyDeptId) {
+ if (needValid && !processForm.applyDeptId) {
this.$message.error("申请部门还未选择");
return false
}
const loading = this.$loading({
lock: true,
- text: '正在提交',
+ text: processForm.status === 'draft' ? '正在保存草稿' : "正在提交",
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
- const applyDeptId = processForm.applyDeptId.map(level => level.id).join(',') // (逗号分割)
+ const applyDeptId = processForm.applyDeptId.join(',') // (逗号分割)
const form = {
...this.processForm,
diff --git a/src/main/resources/templates/admin/business/process-new.ftl b/src/main/resources/templates/admin/business/process-new.ftl
index b264d2a..04a819a 100644
--- a/src/main/resources/templates/admin/business/process-new.ftl
+++ b/src/main/resources/templates/admin/business/process-new.ftl
@@ -157,7 +157,8 @@
未选择部门
-
+
@@ -297,7 +298,7 @@
-
+
@@ -313,7 +314,7 @@
-
+
@@ -401,7 +402,7 @@
<#-- 选择 业务采购清单明细 -->
-
+
@@ -623,123 +624,137 @@
this.incomeDetails = []
},
- saveDraft() {
+ async saveDraft() {
this.processForm.status = 'draft'
- this.submit()
+ await this.submit(false)
},
- submitForm() {
+ async submitForm() {
this.processForm.status = 'to_be_audit'
- this.submit()
+ await this.submit(true)
},
- submit() {
- this.$refs["contractProcessForm"].validate((valid) => {
- if (valid) {
- const fileList = this.fileList
- if (fileList.length === 0) {
- this.$message.error("未上传附件");
- return false
- }
+ async submit(needValid) {
+ const processForm = this.processForm
+ const processType = this.processType
+ const fileList = this.fileList
- // 采购合同需要验证 供应商比选材料
- const processType = this.processType
- const processForm = this.processForm
- if (processType === 'procurement_contract') {
- const { procurementMode } = processForm
+ if (!processForm.projectId) {
+ this.$message.error("未选择项目");
+ return false
+ }
+ let validStatus = !needValid
+ if (needValid) {
+ this.$refs["contractProcessForm"].validate((valid) => {
+ if (valid) {
+ if (fileList.length === 0) {
+ this.$message.error("未上传附件");
+ return false
+ }
- // specify_purchase("指定采购"),
- // simple_price_comparison("简单比价"),
- // price_comparison("比价"),
- // competitive_evaluation("竞争性评估");
- // 当“采购模式”为“指定采购”“简单比价”时,本模块为非必填模块,当为“比价”“竞争性评估”时,本模块为必填项(“备注”除外)
- if (procurementMode === 'price_comparison'
- || procurementMode === 'competitive_evaluation') {
+ // 采购合同需要验证 供应商比选材料
+ if (processType === 'procurement_contract') {
+ const { procurementMode } = processForm
- if (isEmpty(this.supplierMaterialsForm)) {
- this.$message.error("供应商比选材料未填写")
- return false
- }
- for (const item in this.supplierMaterialsForm) {
- if (isEmpty(Object.keys(item))) {
+ // specify_purchase("指定采购"),
+ // simple_price_comparison("简单比价"),
+ // price_comparison("比价"),
+ // competitive_evaluation("竞争性评估");
+ // 当“采购模式”为“指定采购”“简单比价”时,本模块为非必填模块,当为“比价”“竞争性评估”时,本模块为必填项(“备注”除外)
+ if (procurementMode === 'price_comparison'
+ || procurementMode === 'competitive_evaluation') {
+
+ if (isEmpty(this.supplierMaterialsForm)) {
this.$message.error("供应商比选材料未填写")
return false
}
- for (const [key, value] of Object.entries(item)) {
- if (value) {
- if (typeof value === 'string') {
- if (isBlank(value)) {
+ for (const item in this.supplierMaterialsForm) {
+ if (isEmpty(Object.keys(item))) {
+ this.$message.error("供应商比选材料未填写")
+ return false
+ }
+ for (const [key, value] of Object.entries(item)) {
+ if (value) {
+ if (typeof value === 'string') {
+ if (isBlank(value)) {
+ this.$message.error("有未填写的表单,请检查表单");
+ return false
+ }
+ }
+ }
+ else {
+ // 没有值
+ if (key !== 'remark') {
this.$message.error("有未填写的表单,请检查表单");
- return false
}
}
}
- else {
- // 没有值
- if (key !== 'remark') {
- this.$message.error("有未填写的表单,请检查表单");
- }
- }
- }
+ }
}
}
- }
- if (!processForm.applyDeptId) {
- this.$message.error("申请部门还未选择");
+ if (!processForm.applyDeptId) {
+ this.$message.error("申请部门还未选择");
+ return false
+ }
+ validStatus = true
+ return true;
+ }
+ else {
return false
}
+ })
- // 提交
- const loading = this.$loading({
- lock: true,
- text: '正在提交',
- spinner: 'el-icon-loading',
- background: 'rgba(0, 0, 0, 0.7)'
+ }
+
+ if (!validStatus) {
+ return false
+ }
+ // 提交
+ const loading = this.$loading({
+ lock: true,
+ text: processForm.status === 'draft' ? '正在保存草稿' : "正在提交",
+ spinner: 'el-icon-loading',
+ background: 'rgba(0, 0, 0, 0.7)'
+ })
+
+ const applyDeptId = processForm.applyDeptId?.join(',') // (逗号分割)
+ const form = {
+ ...processForm,
+ processType,
+ applyDeptId,
+ projectTitle: this.projectTitle,
+ attachments: fileList.map(file => ({
+ uri: file.response.data.url,
+ name: file.response.data.originName
+ })),
+ supplierMaterials: this.supplierMaterialsForm,
+ incomeDetails: this.incomeDetails.map(detail => ({
+ id: detail.id, expirationDate: detail.expirationDate
+ }))
+ }
+
+ fetch("${base}/process", {
+ method: 'POST', // or 'PUT'
+ headers: {
+ 'Content-Type': 'application/json',
+ },
+ body: JSON.stringify(form),
+ }).then(response => {
+ if (response.ok) {
+ this.$message({
+ showClose: true,
+ message: '提交成功',
+ type: 'success'
})
-
- const applyDeptId = processForm.applyDeptId.map(level => level.id).join(',') // (逗号分割)
- const form = {
- ...processForm,
- processType,
- applyDeptId,
- projectTitle: this.projectTitle,
- attachments: fileList.map(file => ({
- uri: file.response.data.url,
- name: file.response.data.originName
- })),
- supplierMaterials: this.supplierMaterialsForm,
- incomeDetails: this.incomeDetails.map(detail => ({
- id: detail.id, expirationDate: detail.expirationDate
- }))
- }
-
- fetch("${base}/process", {
- method: 'POST', // or 'PUT'
- headers: {
- 'Content-Type': 'application/json',
- },
- body: JSON.stringify(form),
- }).then(response => {
- if (response.ok) {
- this.$message({
- showClose: true,
- message: '提交成功',
- type: 'success'
- })
- }
- else {
- return Promise.reject("失败")
- }
- }).catch(err => {
- this.$message.error("项目提交失败");
- }).finally(() => loading.close())
}
else {
- return false;
+ return Promise.reject("失败")
}
- })
+ }).catch(err => {
+ this.$message.error("项目提交失败");
+ }).finally(() => loading.close())
},
submitToSaleContractProcess() {
@@ -822,7 +837,7 @@
projectTitle() {
const { projectNo, projectName, applyPersonName, applyDate } = this.processForm
if (projectNo && projectName) {
- return projectNo.trim() + "-" + projectName.trim() + "-" + applyPersonName + "-" + applyDate
+ return projectNo.trim() + "-" + projectName.trim() + "-" + applyPersonName + "-" + applyDate.split('-').join('')
}
return ""
},
diff --git a/src/main/resources/templates/admin/business/process-review.ftl b/src/main/resources/templates/admin/business/process-review.ftl
index 1a1a019..e7b1876 100644
--- a/src/main/resources/templates/admin/business/process-review.ftl
+++ b/src/main/resources/templates/admin/business/process-review.ftl
@@ -23,6 +23,10 @@
.el-radio-button__inner, .el-radio-group {
line-height: unset;
}
+
+ [v-cloak] {
+ display: none;
+ }
@@ -32,9 +36,9 @@
待我审核
-
+
-
+
@@ -277,7 +281,10 @@
this.page.current = val
this.queryTable()
},
-
+ resetPageParams() {
+ // 表单条件变了,如果分页参数不变,可能查询不到数据
+ this.page.current = 1
+ }
}
new Vue({