未符合项新增

This commit is contained in:
shenyanpei
2021-11-25 14:49:09 +08:00
parent 841c17731e
commit 577d506c34
2 changed files with 102 additions and 45 deletions
+24 -2
View File
@@ -55,10 +55,32 @@ export function meetingByMonth (params) {
})
}
export function addUn (params) {
export function addUn (closeState, standId,standName,standSerialNumber, itemsNum,itemsName, productType, productLine,
productName, reason, responsibleUnit, dutyEngineer, authEngineer, qaEngineer, qaEngineerName,
authEngineerName, dutyEngineerName, planCloseTime) {
const data = {
closeState,
standSerialNumber, //标准号
standName, //标准名称
standId,
itemsNum, //条款号
itemsName, //条款名称
productType,
productLine, //产品线
productName, //项目名称
reason, //不合规项目
responsibleUnit, //责任部门
dutyEngineer, //责任工程师
authEngineer, //认证工程师
qaEngineer, //质量工程师
qaEngineerName,
authEngineerName,
dutyEngineerName,
planCloseTime, //计划关闭时间
}
return axios({
url: 'api/sarStandUnqualified/sar-stand-unqualified/addOne',
method: 'post',
data: params
data
})
}
@@ -571,9 +571,9 @@
<el-row :gutter="24">
<el-col :span="24">
<el-form :model="addForm" inline class="label-input-form" :rules="formRules" label-width="180px" ref="addForm">
<el-form-item prop="standNumber" label="标准号" style="width: 100%; margin-right:10px" class="add-form-item">
<el-form-item prop="standSerialNumber" label="标准号" style="width: 100%; margin-right:10px" class="add-form-item">
<el-input
v-model="addForm.standNumber"
v-model="addForm.standSerialNumber"
placeholder="请输入标准号"
:maxlength="500"/>
</el-form-item>
@@ -603,9 +603,9 @@
placeholder="请输入条款名称"
:maxlength="500"/>
</el-form-item>
<el-form-item prop="projectPlatfor" label="产品类型" style="width: 100%; margin-right:10px" class="add-form-item" >
<el-form-item prop="productType" label="产品类型" style="width: 100%; margin-right:10px" class="add-form-item" >
<el-input
v-model="addForm.projectPlatfor"
v-model="addForm.productType"
placeholder="请输入产品类型"
:maxlength="500"/>
</el-form-item>
@@ -621,9 +621,9 @@
placeholder="请输入项目名称"
:maxlength="500"/>
</el-form-item>
<el-form-item prop="researchNonCompliance" label="不合规项目" style="width: 100%; margin-right:10px" class="add-form-item" >
<el-form-item prop="reason" label="不合规项目" style="width: 100%; margin-right:10px" class="add-form-item" >
<el-input
v-model="addForm.researchNonCompliance"
v-model="addForm.reason"
placeholder="请输入不合规项目"
:maxlength="500"/>
</el-form-item>
@@ -633,21 +633,21 @@
placeholder="请输入责任部门"
:maxlength="500"/>
</el-form-item>
<el-form-item prop="responsibleEngineer" label="责任工程师" style="width: 100%; margin-right:10px" class="add-form-item" >
<el-form-item prop="dutyEngineerName" label="责任工程师" style="width: 100%; margin-right:10px" class="add-form-item" >
<el-input
v-model="addForm.responsibleEngineer"
v-model="addForm.dutyEngineerName"
placeholder="请输入责任工程师"
:maxlength="500"/>
</el-form-item>
<el-form-item prop="certifiedEngineerName" label="认证工程师" style="width: 100%; margin-right:10px" class="add-form-item" >
<el-form-item prop="authEngineer" label="认证工程师" style="width: 100%; margin-right:10px" class="add-form-item" >
<el-input
v-model="addForm.certifiedEngineerName"
v-model="addForm.authEngineer"
placeholder="请输入认证工程师"
:maxlength="500"/>
</el-form-item>
<el-form-item prop="qualityEngineerName" label="质量工程师" style="width: 100%; margin-right:10px" class="add-form-item" >
<el-form-item prop="qaEngineerName" label="质量工程师" style="width: 100%; margin-right:10px" class="add-form-item" >
<el-input
v-model="addForm.qualityEngineerName"
v-model="addForm.qaEngineerName"
placeholder="请输入质量工程师"
:maxlength="500"/>
</el-form-item>
@@ -730,7 +730,6 @@
<script>
import { interfaceUrl } from "@/sysConfig";
import { addUn } from '@/api/unqualProcess'
export default {
name: "rectificationDatabase",
data () {
@@ -766,22 +765,23 @@ export default {
//存放被勾选的项目的数据
selectList: [],
addForm:{
standNumber: '', //标准号
standSerialNumber: '', //标准号
standName: '', //标准名称
standId: '',
itemsNum: '', //条款号
itemsName: '', //条款名称
projectPlatfor: '', //产品类型
productType: '',
productLine: '', //产品线
projectName: '', //项目名称
researchNonCompliance: '', //不合规项目
reason: '', //不合规项目
responsibleUnit: '', //责任部门
responsibleEngineer: '', //责任工程师
certifiedEngineerName: '', //认证工程师
qualityEngineerName: '', //质量工程师
dutyEngineerName: '', //责任工程师
authEngineer: '', //认证工程师
qaEngineerName: '', //质量工程师
planCloseTime: '', //计划关闭时间
}, //表单数据
formRules: {
standNumber: [
standSerialNumber: [
{required: true, message: '请输入标准号', trigger: 'blur'},
],
standName: [
@@ -793,7 +793,7 @@ export default {
itemsName: [
{required: true, message: '请输入条款名称', trigger: 'blur'},
],
projectPlatfor: [
productType: [
{required: true, message: '请输入产品类型', trigger: 'blur'},
],
productLine: [
@@ -802,13 +802,13 @@ export default {
projectName: [
{required: true, message: '请输入项目名称', trigger: 'change'},
],
researchNonCompliance: [
reason: [
{required: true, message: '请输入不合规项目', trigger: 'blur'},
],
responsibleUnit: [
{required: true, message: '请输入责任部门', trigger: 'blur'},
],
responsibleEngineer: [
dutyEngineerName: [
{required: true, message: '请输入责任工程师', trigger: 'blur'},
],
planCloseTime: [
@@ -1032,33 +1032,66 @@ export default {
},
//提交
submit(){
let jsonArr = []
const json = JSON.stringify(this.addForm);
const arr = JSON.parse(json)
jsonArr.push(arr)
// let jsonArr = []
// const json = JSON.stringify(this.addForm);
// const arr = JSON.parse(json)
// jsonArr.push(arr)
// for (const item in arr) {
// jsonArr.push(item +':' + arr[item])
// }
console.log(jsonArr);
// console.log(jsonArr);
let sarStandUnqualified = {
closeState: 1,
standSerialNumber: '321', //标准号
standName: '321', //标准名称
standId: '312',
itemsNum: '312', //条款号
itemsName: '321', //条款名称
productType: '312',
productLine: '321', //产品线
productName: '321', //项目名称
reason: '321', //不合规项目
responsibleUnit: '321', //责任部门
dutyEngineer: '312', //责任工程师
authEngineer: '312', //认证工程师
qaEngineer: '321', //质量工程师
qaEngineerName: '2132',
authEngineerName: '3213',
dutyEngineerName: '3123',
planCloseTime: '321', //计划关闭时间
}
const closeState = sarStandUnqualified.closeState
const standId = sarStandUnqualified.standId
const standName = sarStandUnqualified.standName
const standSerialNumber = sarStandUnqualified.standSerialNumber
const itemsNum = sarStandUnqualified.itemsNum
const itemsName = sarStandUnqualified.itemsName
const productType = sarStandUnqualified.productType
const productLine = sarStandUnqualified.productLine
const productName = sarStandUnqualified.productName
const reason = sarStandUnqualified.reason
const responsibleUnit = sarStandUnqualified.responsibleUnit
// const dutyEngineer = sarStandUnqualified.dutyEngineer
// const authEngineer = sarStandUnqualified.authEngineer
// const qaEngineer = sarStandUnqualified.qaEngineer
const qaEngineerName = sarStandUnqualified.qaEngineerName
const authEngineerName = sarStandUnqualified.authEngineerName
const dutyEngineerName = sarStandUnqualified.dutyEngineerName
const planCloseTime = sarStandUnqualified.planCloseTime
this.$refs["addForm"].validate((valid) => {
if(valid){
addUn(jsonArr).then(res=>{
addUn(closeState, standId,standName,standSerialNumber, itemsNum,itemsName, productType, productLine,
productName, reason, responsibleUnit, qaEngineerName,
authEngineerName, dutyEngineerName, planCloseTime).then(res=>{
if(res.ok){
this.$message.success('新增成功')
this.drawerTable = false
this.getTableByPage()
}
})
/* this.$http.postData('sarStandUnqualified/sar-stand-unqualified/add', {
jsonArr,
}, {
_this: this
}, res => {
if(res.ok){
this.$message.success('新增成功')
this.getTableByPage()
}
})*/
}else{
}else {
this.$message.warning('请完善基础信息')
}
})
@@ -1093,8 +1126,9 @@ export default {
}else{
this.breakId = this.standList[0].standId
this.addForm.standName = this.standList[0].standName
this.addForm.standNumber = this.standList[0].standSort + '-' + this.standList[0].standNumber + '-' + this.standList[0].standYear || this.standList[0].standSort + '-' + this.standList[0].standNumber
this.addForm.standSerialNumber = this.standList[0].standSort + '-' + this.standList[0].standNumber + '-' + this.standList[0].standYear || this.standList[0].standSort + '-' + this.standList[0].standNumber
this.addForm.responsibleUnit = this.standList[0].zrbm || '--'
this.addForm.standId = this.standList[0].standId
this.drawerTitle = '新增';
this.drawerTable = true;
this.listModel = false;
@@ -1131,7 +1165,7 @@ export default {
} else {
this.projectId = this.selectList[0].id;
this.addForm.productLine = this.selectList[0].productLine
this.addForm.projectPlatfor = this.selectList[0].projectPlatfor
this.addForm.productType = this.selectList[0].projectPlatfor
this.addForm.projectName = this.selectList[0].projectName
this.getStandData();
this.projectModel = false;
@@ -1211,7 +1245,8 @@ export default {
},
//新增事件
addModel(){
this.projectModel = true
this.drawerTable = true
// this.projectModel = true
},
//编辑事件
projectEdit(row){