未符合项新增编辑责任部门选择

This commit is contained in:
shenyanpei
2021-12-01 14:06:06 +08:00
parent 79ac8a5e9c
commit 90e00f157c
@@ -137,10 +137,6 @@
prop="productType" prop="productType"
width="100" width="100"
label="产品类型"> label="产品类型">
<!-- <template slot-scope="scope">
<div v-if="scope.row.productType === 'research'">在研</div>
<div v-if="scope.row.productType === 'product'">在产</div>
</template>-->
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="productLine" prop="productLine"
@@ -161,6 +157,7 @@
<el-table-column <el-table-column
prop="responsibleUnit" prop="responsibleUnit"
width="180" width="180"
show-overflow-tooltip
label="责任部门"> label="责任部门">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@@ -486,9 +483,9 @@
<el-form-item prop="responsibleUnit" label="责任部门" style="width: 100%; margin-right:10px" <el-form-item prop="responsibleUnit" label="责任部门" style="width: 100%; margin-right:10px"
class="add-form-item"> class="add-form-item">
<el-input <el-input
:disabled="true"
v-model="addForm.responsibleUnit" v-model="addForm.responsibleUnit"
placeholder="请输入责任部门" placeholder="请输入责任部门"
@click.native="choiceZRBM"
/> />
</el-form-item> </el-form-item>
<el-form-item prop="reason" label="不合规项目" style="width: 100%; margin-right:10px" <el-form-item prop="reason" label="不合规项目" style="width: 100%; margin-right:10px"
@@ -543,6 +540,7 @@
class="common-button-primary" class="common-button-primary"
icon="el-icon-check" icon="el-icon-check"
type="primary" type="primary"
:loading="submiting"
@click="submit">提交 @click="submit">提交
</el-button> </el-button>
<el-button <el-button
@@ -566,6 +564,12 @@
:nodeList="nodeListMore" :nodeList="nodeListMore"
@checkedRole="drawerMore" @checkedRole="drawerMore"
/> />
<MechanismTree
is-title="选择部门信息"
:is-visible.sync="modalshowflagZRBM"
:nodeList="nodeListZRBM"
@checkedRole="drawerCheckZRBM"
/>
</div> </div>
</template> </template>
@@ -671,12 +675,19 @@ export default {
// 新增编辑框的disabled // 新增编辑框的disabled
serialNumber: true, serialNumber: true,
// 提交按钮loading
submiting: false,
// 选择人(单选)
roleShowflag: false, roleShowflag: false,
nodeList: [], nodeList: [],
// 选择人(多选)
titleMore: '', titleMore: '',
nodeListMore: [], nodeListMore: [],
roleShowMore: false, roleShowMore: false,
// 选择责任部门
nodeListZRBM: [],
modalshowflagZRBM: false
}; };
}, },
methods: { methods: {
@@ -886,6 +897,7 @@ export default {
if (this.drawerTitle === "新增") { if (this.drawerTitle === "新增") {
this.$refs["addForm"].validate((valid) => { this.$refs["addForm"].validate((valid) => {
if (valid) { if (valid) {
this.submiting = true
addUn( addUn(
closeState, standId, standSerialNumber, closeState, standId, standSerialNumber,
standName, itemsNum, itemsName, productType, standName, itemsNum, itemsName, productType,
@@ -893,6 +905,7 @@ export default {
responsibleUnit, dutyEngineer, responsibleUnit, dutyEngineer,
authEngineer, qaEngineer, planCloseTime).then(res => { authEngineer, qaEngineer, planCloseTime).then(res => {
if (res.ok) { if (res.ok) {
this.submiting = false
this.$message.success("新增成功"); this.$message.success("新增成功");
this.drawerTable = false; this.drawerTable = false;
this.getTableByPage(); this.getTableByPage();
@@ -900,11 +913,13 @@ export default {
}); });
} else { } else {
this.$message.warning("请完善基础信息"); this.$message.warning("请完善基础信息");
this.submiting = false
} }
}); });
} else { } else {
this.$refs["addForm"].validate((valid) => { this.$refs["addForm"].validate((valid) => {
if (valid) { if (valid) {
this.submiting = true
editUn( editUn(
closeState, standId, standSerialNumber, closeState, standId, standSerialNumber,
standName, itemsNum, itemsName, productType, standName, itemsNum, itemsName, productType,
@@ -912,6 +927,7 @@ export default {
dutyEngineer, authEngineer, qaEngineer, dutyEngineer, authEngineer, qaEngineer,
planCloseTime, id).then(res => { planCloseTime, id).then(res => {
if (res.ok) { if (res.ok) {
this.submiting = false
this.$message.success("编辑成功"); this.$message.success("编辑成功");
this.drawerTable = false; this.drawerTable = false;
this.getTableByPage(); this.getTableByPage();
@@ -919,6 +935,7 @@ export default {
}); });
} else { } else {
this.$message.warning("请完善基础信息"); this.$message.warning("请完善基础信息");
this.submiting = false
} }
}); });
} }
@@ -954,7 +971,7 @@ export default {
} }
}); });
this.dataList = res.data.records; this.dataList = res.data.records;
this.dataList.forEach(item => { /*this.dataList.forEach(item => {
// 责任部门转换 // 责任部门转换
if (item.zrbm !== null || item.zrbm !== "") { if (item.zrbm !== null || item.zrbm !== "") {
let k = (item.zrbm || "").split(","); let k = (item.zrbm || "").split(",");
@@ -967,7 +984,7 @@ export default {
} }
} }
} }
}); });*/
}); });
}, },
//新增事件 //新增事件
@@ -1066,7 +1083,6 @@ export default {
if (this.drawerTitle === '编辑') { if (this.drawerTitle === '编辑') {
this.addForm.standName = '' this.addForm.standName = ''
this.addForm.standSerialNumber = '' this.addForm.standSerialNumber = ''
this.addForm.responsibleUnit = ''
} }
this.addForm.productId = val.id this.addForm.productId = val.id
this.addForm.productLine = val.productLine this.addForm.productLine = val.productLine
@@ -1080,7 +1096,6 @@ export default {
standChange(item) { standChange(item) {
this.addForm.standName = item.standName this.addForm.standName = item.standName
this.addForm.standSerialNumber = item.standSort + '-' + item.standNumber + '-' + item.standYear this.addForm.standSerialNumber = item.standSort + '-' + item.standNumber + '-' + item.standYear
this.addForm.responsibleUnit = item.zrbm || "--";
}, },
/** 责任工程师选择 */ /** 责任工程师选择 */
choiceZRR(type, title, id) { choiceZRR(type, title, id) {
@@ -1120,6 +1135,27 @@ export default {
this.roleShowMore = true this.roleShowMore = true
}, },
/** 选择责任部门 */
choiceZRBM(type, title, id) {
this.nodeListZRBM = []
this.nodeListZRBM.push(id)
this.modalshowflagZRBM = true
},
drawerCheckZRBM(data) {
let idList = ''
let nameList = ''
data.forEach(item => {
if (nameList.length > 0) {
nameList += ','
idList += ','
}
idList += item.id
nameList += item.name
})
this.addForm.responsibleUnit = nameList;
},
}, },
mounted() { mounted() {
//查询已维护的项目 //查询已维护的项目