|
@@ -25,14 +25,14 @@
|
|
|
<span v-if="!isPrintPage" style="color: red; padding-right: 3px; font-size: 16px;">*</span>研发项目名称
|
|
<span v-if="!isPrintPage" style="color: red; padding-right: 3px; font-size: 16px;">*</span>研发项目名称
|
|
|
</td>
|
|
</td>
|
|
|
<td class="doc-input">
|
|
<td class="doc-input">
|
|
|
- <el-input v-if="!isPrintPage" v-model="formData.xmmc" placeholder="请输入项目名称" :disabled="isEdit" />
|
|
|
|
|
|
|
+ <el-input v-if="!isPrintPage" v-model="formData.xmmc" placeholder="请输入项目名称" :disabled="isDisabled" />
|
|
|
<span v-else style="display: inline-block; padding: 12px 6px;">{{ formData.xmmc }}</span>
|
|
<span v-else style="display: inline-block; padding: 12px 6px;">{{ formData.xmmc }}</span>
|
|
|
</td>
|
|
</td>
|
|
|
<td class="doc-label">
|
|
<td class="doc-label">
|
|
|
<span v-if="!isPrintPage" style="color: red; padding-right: 3px; font-size: 16px;">*</span>项目编号
|
|
<span v-if="!isPrintPage" style="color: red; padding-right: 3px; font-size: 16px;">*</span>项目编号
|
|
|
</td>
|
|
</td>
|
|
|
<td class="doc-input">
|
|
<td class="doc-input">
|
|
|
- <el-input v-if="!isPrintPage" v-model="formData.xmbh" placeholder="请输入项目编号" :disabled="isEdit" />
|
|
|
|
|
|
|
+ <el-input v-if="!isPrintPage" v-model="formData.xmbh" placeholder="请输入项目编号" :disabled="isDisabled" />
|
|
|
<span v-else style="display: inline-block; padding: 12px 6px;">{{ formData.xmbh }}</span>
|
|
<span v-else style="display: inline-block; padding: 12px 6px;">{{ formData.xmbh }}</span>
|
|
|
</td>
|
|
</td>
|
|
|
</tr>
|
|
</tr>
|
|
@@ -49,7 +49,7 @@
|
|
|
value-format="yyyy-MM-dd"
|
|
value-format="yyyy-MM-dd"
|
|
|
placeholder="请选择日期"
|
|
placeholder="请选择日期"
|
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
|
- :disabled="isEdit"
|
|
|
|
|
|
|
+ :disabled="isDisabled"
|
|
|
></el-date-picker>
|
|
></el-date-picker>
|
|
|
<span v-else style="display: inline-block; padding: 12px 6px;">{{ formData.xmkssj }}</span>
|
|
<span v-else style="display: inline-block; padding: 12px 6px;">{{ formData.xmkssj }}</span>
|
|
|
</td>
|
|
</td>
|
|
@@ -64,7 +64,7 @@
|
|
|
value-format="yyyy-MM-dd"
|
|
value-format="yyyy-MM-dd"
|
|
|
placeholder="请选择日期"
|
|
placeholder="请选择日期"
|
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
|
- :disabled="isEdit"
|
|
|
|
|
|
|
+ :disabled="isDisabled"
|
|
|
></el-date-picker>
|
|
></el-date-picker>
|
|
|
<span v-else style="display: inline-block; padding: 12px 6px;">{{ formData.xmjssj }}</span>
|
|
<span v-else style="display: inline-block; padding: 12px 6px;">{{ formData.xmjssj }}</span>
|
|
|
</td>
|
|
</td>
|
|
@@ -81,7 +81,7 @@
|
|
|
v-model="formData.xmsqdwid"
|
|
v-model="formData.xmsqdwid"
|
|
|
:yearAndMonth="yearAndMonth"
|
|
:yearAndMonth="yearAndMonth"
|
|
|
style="width: 100%;"
|
|
style="width: 100%;"
|
|
|
- :disabled="isEdit"
|
|
|
|
|
|
|
+ :disabled="isDisabled"
|
|
|
@change="handleSecondUnitChange"
|
|
@change="handleSecondUnitChange"
|
|
|
>
|
|
>
|
|
|
</second-unit-cascader>
|
|
</second-unit-cascader>
|
|
@@ -94,7 +94,7 @@
|
|
|
<span v-if="!isPrintPage" style="color: red; padding-right: 3px; font-size: 16px;">*</span>项目负责人
|
|
<span v-if="!isPrintPage" style="color: red; padding-right: 3px; font-size: 16px;">*</span>项目负责人
|
|
|
</td>
|
|
</td>
|
|
|
<td class="doc-input">
|
|
<td class="doc-input">
|
|
|
- <person-select v-show="!isPrintPage" v-model="formData.xmfzr" :yearAndMonth="xmStartDateYearAndMonth" valueKey="id" :disabled="isEdit" style="width: 100%" />
|
|
|
|
|
|
|
+ <person-select v-show="!isPrintPage" v-model="formData.xmfzr" :yearAndMonth="xmStartDateYearAndMonth" valueKey="id" :disabled="isDisabled" style="width: 100%" />
|
|
|
<span v-show="isPrintPage" style="display: inline-block; padding: 12px 6px;">{{ getXmfzrName }}</span>
|
|
<span v-show="isPrintPage" style="display: inline-block; padding: 12px 6px;">{{ getXmfzrName }}</span>
|
|
|
</td>
|
|
</td>
|
|
|
<td class="doc-label">
|
|
<td class="doc-label">
|
|
@@ -182,7 +182,7 @@
|
|
|
<span v-if="!isPrintPage" style="color: red; padding-right: 3px; font-size: 16px;">*</span>项目预算总额(万元)
|
|
<span v-if="!isPrintPage" style="color: red; padding-right: 3px; font-size: 16px;">*</span>项目预算总额(万元)
|
|
|
</td>
|
|
</td>
|
|
|
<td class="doc-input">
|
|
<td class="doc-input">
|
|
|
- <!-- <el-input-number v-model="formData.xmysze" type="number" :min="0" controls-position="right" :disabled="isEdit" /> -->
|
|
|
|
|
|
|
+ <!-- <el-input-number v-model="formData.xmysze" type="number" :min="0" controls-position="right" :disabled="isDisabled" /> -->
|
|
|
{{ getXmysze }}
|
|
{{ getXmysze }}
|
|
|
</td>
|
|
</td>
|
|
|
<td class="doc-label">
|
|
<td class="doc-label">
|
|
@@ -193,7 +193,7 @@
|
|
|
<div class="year-list-item" v-for="year of yearList" :key="year" :style="{ height: yearList.length == 1 ? '51px' : '32px', lineHeight: yearList.length == 1 ? '51px' : '32px' }">
|
|
<div class="year-list-item" v-for="year of yearList" :key="year" :style="{ height: yearList.length == 1 ? '51px' : '32px', lineHeight: yearList.length == 1 ? '51px' : '32px' }">
|
|
|
<div class="year" >{{ year }}</div>
|
|
<div class="year" >{{ year }}</div>
|
|
|
<div class="year-input">
|
|
<div class="year-input">
|
|
|
- <input v-if="!isPrintPage" v-model="formData[year]" type="number" @input="handleYearInput" style="padding: 0 6px;" :disabled="isEdit" />
|
|
|
|
|
|
|
+ <input v-if="!isPrintPage" v-model="formData[year]" type="number" @input="handleYearInput" style="padding: 0 6px;" :disabled="isDisabled" />
|
|
|
<span v-else style="padding-left: 12px;">{{ formData[year] }}万元</span>
|
|
<span v-else style="padding-left: 12px;">{{ formData[year] }}万元</span>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -240,7 +240,11 @@
|
|
|
<p v-if="!isPrintPage" class="tip">注:可一次上传多个相关文件(文档、表格、图片等)。 支持格式:DOC, PDF, Excel, PNG, JPG, PPT 等。 请确保文件内容清晰有效。</p>
|
|
<p v-if="!isPrintPage" class="tip">注:可一次上传多个相关文件(文档、表格、图片等)。 支持格式:DOC, PDF, Excel, PNG, JPG, PPT 等。 请确保文件内容清晰有效。</p>
|
|
|
|
|
|
|
|
<div class="btn-wrap printHide" style="text-align: center;">
|
|
<div class="btn-wrap printHide" style="text-align: center;">
|
|
|
- <el-button type="primary" style="width: 160px;" @click="handleSaveBtn">保存</el-button>
|
|
|
|
|
|
|
+ <template v-if="operateType == 'add' || projectId && formData.status == 0">
|
|
|
|
|
+ <el-button type="primary" style="width: 160px;" @click="handleSaveBtn(0)">暂存</el-button>
|
|
|
|
|
+ <el-button type="primary" style="width: 160px;" @click="handleSaveBtn(1)">确定立项</el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <el-button v-else-if="projectId && formData.status != 0" type="primary" style="width: 160px;" @click="handleSaveBtn()">保存</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -250,7 +254,7 @@
|
|
|
import secondUnitCascader from "@/components/second-unit-cascader";
|
|
import secondUnitCascader from "@/components/second-unit-cascader";
|
|
|
import personSelect from "@/components/person-select";
|
|
import personSelect from "@/components/person-select";
|
|
|
import { getDictionary } from "@/api/system/dictbiz";
|
|
import { getDictionary } from "@/api/system/dictbiz";
|
|
|
-import { add, update, getApprove } from "@/api/projectManage/projectList";
|
|
|
|
|
|
|
+import { save, update, getApprove } from "@/api/projectManage/projectList";
|
|
|
import moment from "moment";
|
|
import moment from "moment";
|
|
|
import { deepClone } from "@/util/util";
|
|
import { deepClone } from "@/util/util";
|
|
|
import Decimal from "decimal.js";
|
|
import Decimal from "decimal.js";
|
|
@@ -340,8 +344,8 @@ export default {
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
|
...mapGetters(["userInfo"]),
|
|
...mapGetters(["userInfo"]),
|
|
|
- isEdit() {
|
|
|
|
|
- return this.operateType == 'edit';
|
|
|
|
|
|
|
+ isDisabled() {
|
|
|
|
|
+ return this.operateType == 'edit' && this.formData.status != 0;
|
|
|
},
|
|
},
|
|
|
// 获取项目预算总额
|
|
// 获取项目预算总额
|
|
|
getXmysze() {
|
|
getXmysze() {
|
|
@@ -364,7 +368,7 @@ export default {
|
|
|
type: "upload",
|
|
type: "upload",
|
|
|
multiple: true,
|
|
multiple: true,
|
|
|
span: 24,
|
|
span: 24,
|
|
|
- // disabled: this.isEdit,
|
|
|
|
|
|
|
+ // disabled: this.isDisabled,
|
|
|
dataType: "object",
|
|
dataType: "object",
|
|
|
propsHttp: {
|
|
propsHttp: {
|
|
|
url: "link",
|
|
url: "link",
|
|
@@ -394,7 +398,7 @@ export default {
|
|
|
res: "data",
|
|
res: "data",
|
|
|
},
|
|
},
|
|
|
action: '/api/kd-resource/oss/endpoint/put-file',
|
|
action: '/api/kd-resource/oss/endpoint/put-file',
|
|
|
- // disabled: this.isEdit,
|
|
|
|
|
|
|
+ // disabled: this.isDisabled,
|
|
|
uploadPreview: (file, column, done) => {
|
|
uploadPreview: (file, column, done) => {
|
|
|
downloadFileByUrl(file.url, file.name);
|
|
downloadFileByUrl(file.url, file.name);
|
|
|
return;
|
|
return;
|
|
@@ -411,7 +415,7 @@ export default {
|
|
|
multiple: true,
|
|
multiple: true,
|
|
|
span: 24,
|
|
span: 24,
|
|
|
action: '/api/kd-resource/oss/endpoint/put-file',
|
|
action: '/api/kd-resource/oss/endpoint/put-file',
|
|
|
- // disabled: this.isEdit,
|
|
|
|
|
|
|
+ // disabled: this.isDisabled,
|
|
|
uploadPreview: (file, column, done) => {
|
|
uploadPreview: (file, column, done) => {
|
|
|
downloadFileByUrl(file.url, file.name);
|
|
downloadFileByUrl(file.url, file.name);
|
|
|
return;
|
|
return;
|
|
@@ -602,8 +606,8 @@ export default {
|
|
|
this.yearList = [];
|
|
this.yearList = [];
|
|
|
this.$refs.secondUnitCascader.cascaderVal = [];
|
|
this.$refs.secondUnitCascader.cascaderVal = [];
|
|
|
},
|
|
},
|
|
|
- handleSaveBtn() {
|
|
|
|
|
- if (!this.operateType || this.operateType === 'add') {
|
|
|
|
|
|
|
+ handleSaveBtn(status) {
|
|
|
|
|
+ if (!this.operateType || this.operateType === 'add' || this.formData.status == 0) {
|
|
|
let errorText = this.validForm();
|
|
let errorText = this.validForm();
|
|
|
if (errorText) {
|
|
if (errorText) {
|
|
|
this.$message.error(errorText+'!');
|
|
this.$message.error(errorText+'!');
|
|
@@ -624,8 +628,9 @@ export default {
|
|
|
});
|
|
});
|
|
|
params.xmyszemx = JSON.stringify(yearAmountList);
|
|
params.xmyszemx = JSON.stringify(yearAmountList);
|
|
|
params.xmysze = this.getXmysze;
|
|
params.xmysze = this.getXmysze;
|
|
|
|
|
+ params.status = status;
|
|
|
|
|
|
|
|
- this.addOrUpdate(params);
|
|
|
|
|
|
|
+ this.saveData(params);
|
|
|
} else if (this.operateType === 'edit') {
|
|
} else if (this.operateType === 'edit') {
|
|
|
let errorText = this.validForm();
|
|
let errorText = this.validForm();
|
|
|
if (errorText) {
|
|
if (errorText) {
|
|
@@ -643,15 +648,28 @@ export default {
|
|
|
params.lxbg = JSON.stringify(this.formData.lxbg);
|
|
params.lxbg = JSON.stringify(this.formData.lxbg);
|
|
|
params.lxpw = JSON.stringify(this.formData.lxpw);
|
|
params.lxpw = JSON.stringify(this.formData.lxpw);
|
|
|
params.qtzl = JSON.stringify(this.formData.qtzl);
|
|
params.qtzl = JSON.stringify(this.formData.qtzl);
|
|
|
- console.log(params)
|
|
|
|
|
|
|
+
|
|
|
this.addOrUpdate(params);
|
|
this.addOrUpdate(params);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
+ saveData(params) {
|
|
|
|
|
+ this.loading = true;
|
|
|
|
|
+ save(params).then(({ data }) => {
|
|
|
|
|
+ this.loading = false;
|
|
|
|
|
+ if (data.code == 200) {
|
|
|
|
|
+ this.handleResetBtn();
|
|
|
|
|
+ this.$emit('success', data.data);
|
|
|
|
|
+ this.$message.success(params.status == 0 ? '保存成功' : '立项成功');
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch(err => {
|
|
|
|
|
+ this.loading = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
addOrUpdate(params) {
|
|
addOrUpdate(params) {
|
|
|
- let func = this.operateType === 'edit' ? update : add;
|
|
|
|
|
|
|
+ // let func = this.operateType === 'edit' ? update : add;
|
|
|
this.loading = true;
|
|
this.loading = true;
|
|
|
- func(params).then(({ data }) => {
|
|
|
|
|
|
|
+ update(params).then(({ data }) => {
|
|
|
this.loading = false;
|
|
this.loading = false;
|
|
|
if (data.code == 200) {
|
|
if (data.code == 200) {
|
|
|
this.handleResetBtn();
|
|
this.handleResetBtn();
|