|
|
@ -239,9 +239,10 @@ |
|
|
|
> |
|
|
|
<el-cascader |
|
|
|
ref="editCascader" |
|
|
|
v-model="bjd.quhuadaima" |
|
|
|
v-model="quhuadaimas" |
|
|
|
placeholder="请选择" |
|
|
|
:options="areaList" |
|
|
|
style="width: 100%;" |
|
|
|
@change="quhuaChange" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
@ -288,8 +289,8 @@ |
|
|
|
> |
|
|
|
<el-date-picker |
|
|
|
v-model="bjd.baojianriqi" |
|
|
|
type="datetime" |
|
|
|
value-format="yyyy-MM-dd HH:mm:ss" |
|
|
|
type="date" |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
placeholder="选择日期" |
|
|
|
style="width: 98%" |
|
|
|
/> |
|
|
@ -309,16 +310,16 @@ |
|
|
|
> |
|
|
|
<el-date-picker |
|
|
|
v-model="bjd.shouliriqi" |
|
|
|
type="datetime" |
|
|
|
value-format="yyyy-MM-dd HH:mm:ss" |
|
|
|
type="date" |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
placeholder="选择日期" |
|
|
|
style="width: 95%" |
|
|
|
style="width: 100%;" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row v-if="!(bjd.shebeizhongleidaima === '1000')" :gutter="20"> |
|
|
|
<el-col :span="18"> |
|
|
|
<el-col :span="18" style="height: auto;"> |
|
|
|
<el-form-item label="备注:" prop="beizhu"> |
|
|
|
<el-input |
|
|
|
v-model="bjd.bjdBeizhu" |
|
|
@ -328,20 +329,20 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<div v-if="formState === 'finish'" style="margin-top: 10px"> |
|
|
|
<el-row> |
|
|
|
<template v-if="formState === 'finish'"> |
|
|
|
<el-row :gutter="20"> |
|
|
|
<el-col :span="9"> |
|
|
|
<el-form-item label="受理人:" prop="shouliren"> |
|
|
|
<el-input v-model="bjd.shouliren" type="text" /> |
|
|
|
<el-input :model="formatter.getChineseName(null, null, bjd.shouliren)" type="text" disabled /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="9"> |
|
|
|
<el-form-item label="最后修改人:" prop="updateBy"> |
|
|
|
<el-input v-model="bjd.updateBy" type="text" /> |
|
|
|
<el-input :model="formatter.getChineseName(null, null, bjd.updateBy)" type="text" disabled /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<el-row :gutter="20"> |
|
|
|
<el-col :span="9"> |
|
|
|
<el-form-item |
|
|
@ -359,6 +360,56 @@ |
|
|
|
<el-input v-model="bjd.baojiandianhua" type="text" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="9"> |
|
|
|
<el-form-item |
|
|
|
:rules="[ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: |
|
|
|
'检验科室电话不能为空', |
|
|
|
trigger: 'change', |
|
|
|
}, |
|
|
|
]" |
|
|
|
label="检验科室电话:" |
|
|
|
prop="departmentDianhua" |
|
|
|
> |
|
|
|
<el-input v-model="bjd.departmentDianhua" type="text" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row :gutter="20"> |
|
|
|
<el-col :span="9"> |
|
|
|
<el-form-item |
|
|
|
:rules="[ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: |
|
|
|
'报告查询电话不能为空', |
|
|
|
trigger: 'change', |
|
|
|
}, |
|
|
|
]" |
|
|
|
label="报告查询电话:" |
|
|
|
prop="reportQueryDianhua" |
|
|
|
> |
|
|
|
<el-input v-model="bjd.reportQueryDianhua" type="text" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="9"> |
|
|
|
<el-form-item |
|
|
|
:rules="[ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: |
|
|
|
'报检受理电话不能为空', |
|
|
|
trigger: 'change', |
|
|
|
}, |
|
|
|
]" |
|
|
|
label="报检受理电话:" |
|
|
|
prop="inspectionAcceptanceDianhua" |
|
|
|
> |
|
|
|
<el-input v-model="bjd.inspectionAcceptanceDianhua" type="text" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</fieldset> |
|
|
|
</el-form> |
|
|
@ -1541,7 +1592,8 @@ export default { |
|
|
|
fixedWidth: '', |
|
|
|
isShengju: true, |
|
|
|
form: this.$route.params.form, |
|
|
|
areaList: [] |
|
|
|
areaList: [], |
|
|
|
quhuadaimas: [] |
|
|
|
} |
|
|
|
}, |
|
|
|
watch: { |
|
|
@ -1556,19 +1608,21 @@ export default { |
|
|
|
if (this.formState === 'newBuild') { |
|
|
|
this.isShengju = false |
|
|
|
this.tableData = [] |
|
|
|
this.$set(this.bjd, 'shouliriqi', new Date()) |
|
|
|
this.$set(this.bjd, 'baojianriqi', new Date()) |
|
|
|
this.getSblb() |
|
|
|
const date = this.formatter.dateFormat('YYYY-MM-dd') |
|
|
|
this.$set(this.bjd, 'shouliriqi', date) |
|
|
|
this.$set(this.bjd, 'baojianriqi', date) |
|
|
|
} else if (this.formState === 'update' || this.formState === 'finish') { |
|
|
|
// 查询报检信息 |
|
|
|
this.getBjdInfo() |
|
|
|
// 查询报检参数信息 |
|
|
|
this.getParamById() |
|
|
|
} else if (this.formState === 'create') { |
|
|
|
// 直接起草过来的数据 |
|
|
|
this.getSblb() |
|
|
|
// 先加载当前的数据 |
|
|
|
// this.tableData = this.$route.query.params |
|
|
|
this.getParamList(this.$route.query.params, true) |
|
|
|
} |
|
|
|
this.getSblb() |
|
|
|
if (this.sbzldm === 'F000') { |
|
|
|
this.templateName = '安全阀报检导入模板.xlsx' |
|
|
|
} |
|
|
@ -1583,7 +1637,7 @@ export default { |
|
|
|
methods: { |
|
|
|
getArea() { |
|
|
|
this.api({ |
|
|
|
url: '/area/getAll', |
|
|
|
url: '/area/all', |
|
|
|
method: 'get', |
|
|
|
params: {} |
|
|
|
}).then(res => { |
|
|
@ -1605,10 +1659,12 @@ export default { |
|
|
|
// ***第一次起草 |
|
|
|
if (init) { |
|
|
|
this.bjd = this.tableData[0] // 将第一条数据给报检单基本信息赋值 |
|
|
|
this.$set(this.bjd, 'shouliriqi', new Date()) |
|
|
|
this.$set(this.bjd, 'baojianriqi', new Date()) |
|
|
|
const date = this.formatter.dateFormat('YYYY-MM-dd') |
|
|
|
this.$set(this.bjd, 'shouliriqi', date) |
|
|
|
this.$set(this.bjd, 'baojianriqi', date) |
|
|
|
this.bjd.lingqufangshi = '自取' |
|
|
|
} |
|
|
|
this.loadQuhua() |
|
|
|
if (this.bjd.shebeizhongleidaima === '3000') { |
|
|
|
this.$set(this.bjd, 'baojiandianhua', this.bjd.weibaodanweiDianhua) |
|
|
|
} |
|
|
@ -1622,33 +1678,38 @@ export default { |
|
|
|
}, |
|
|
|
getBjdInfo() { |
|
|
|
this.apibjd({ |
|
|
|
url: '/bjd/getBjdById', |
|
|
|
url: '/bjd', |
|
|
|
method: 'get', |
|
|
|
params: { |
|
|
|
bjdId: this.$route.params.id |
|
|
|
} |
|
|
|
}).then((data) => { |
|
|
|
this.bjd = data |
|
|
|
if ( |
|
|
|
this.bjd.baojiandianhua === undefined || |
|
|
|
this.bjd.baojiandianhua === null |
|
|
|
) { |
|
|
|
if (!this.bjd.baojiandianhua) { |
|
|
|
this.bjd.baojiandianhua = this.bjd.weibaodanweiDianhua |
|
|
|
} |
|
|
|
this.getSblb() |
|
|
|
// 查询报检参数信息 |
|
|
|
this.getParamById() |
|
|
|
this.loadQuhua() |
|
|
|
}) |
|
|
|
}, |
|
|
|
loadQuhua() { |
|
|
|
if (!this.bjd || !this.bjd.quhuadaima) { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
const qhdm = this.bjd.quhuadaima |
|
|
|
this.quhuadaimas = [qhdm.substr(0, 2).padEnd(6, '0'), qhdm.substr(0, 4).padEnd(6, '0'), qhdm] |
|
|
|
console.log(this.quhuadaimas) |
|
|
|
}, |
|
|
|
getParamById() { |
|
|
|
this.apibjd({ |
|
|
|
url: '/renwu/getParamByBjdId', |
|
|
|
method: 'get', |
|
|
|
params: { |
|
|
|
bjdId: this.bjd.id |
|
|
|
bjdId: this.$route.params.id |
|
|
|
} |
|
|
|
}).then((data) => { |
|
|
|
this.tableData = data |
|
|
|
this.$refs.bjBaseList.doLayout() |
|
|
|
for (const tableObj of this.tableData) { |
|
|
|
const sblbpz = [] |
|
|
|
// 如果设备类别代码不存在,或者设备类别代码是设备种类代码时 |
|
|
@ -1842,8 +1903,9 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
quhuaChange(val) { |
|
|
|
const arr = this.$refs['editCascader'].getCheckedNodes()[0].pathLabels |
|
|
|
this.bjd.quhuamingcheng = arr.toString() |
|
|
|
const data = this.$refs.editCascader.getCheckedNodes()[0].data |
|
|
|
this.bjd.quhuamingcheng = data.label |
|
|
|
this.bjd.quhuadaima = data.value |
|
|
|
}, |
|
|
|
tableRowClassName({ row, rowIndex }) { |
|
|
|
row.index = rowIndex |
|
|
@ -2126,7 +2188,6 @@ export default { |
|
|
|
this.selection[i].sblbpz = sblbpz |
|
|
|
} |
|
|
|
} |
|
|
|
this.tableData.push() |
|
|
|
this.dialogFormParam = false |
|
|
|
}, |
|
|
|
delRow: function() { |
|
|
@ -2202,26 +2263,8 @@ export default { |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
formTime(v) { |
|
|
|
const date = new Date(v) |
|
|
|
const y = date.getFullYear() |
|
|
|
let m = date.getMonth() + 1 |
|
|
|
m = m < 10 ? '0' + m : m |
|
|
|
let d = date.getDate() |
|
|
|
d = d < 10 ? '0' + d : d |
|
|
|
const h = date.getHours() |
|
|
|
let minute = date.getMinutes() |
|
|
|
minute = minute < 10 ? '0' + minute : minute |
|
|
|
const seconds = |
|
|
|
date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds() |
|
|
|
const time = |
|
|
|
y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + seconds |
|
|
|
return time |
|
|
|
}, |
|
|
|
// 报检单保存 |
|
|
|
bjdSave(audit) { |
|
|
|
this.bjd.baojianriqi = this.formTime(this.bjd.baojianriqi) |
|
|
|
this.bjd.shouliriqi = this.formTime(this.bjd.shouliriqi) |
|
|
|
this.$refs['bjd'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
if (this.judgeNull(this.bjd.quhuadaima)) { |
|
|
@ -2231,7 +2274,7 @@ export default { |
|
|
|
}) |
|
|
|
return false |
|
|
|
} |
|
|
|
if (this.tableData === null || this.tableData.length === 0) { |
|
|
|
if (this.tableData.length === 0) { |
|
|
|
this.$message({ |
|
|
|
type: 'error', |
|
|
|
message: '报检设备不能为空!' |
|
|
@ -2350,12 +2393,15 @@ export default { |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.tableData = data.tableData |
|
|
|
for (const tableObj of this.tableData) { |
|
|
|
const sblbpz = [] |
|
|
|
sblbpz.push(tableObj.shebeileibiedaima) |
|
|
|
sblbpz.push(tableObj.shebeipinzhongdaima) |
|
|
|
this.$set(tableObj, 'sblbpz', sblbpz) |
|
|
|
if (data && data.renwus.length) { |
|
|
|
this.tableData = data.renwus |
|
|
|
this.$refs.bjBaseList.doLayout() |
|
|
|
for (const tableObj of this.tableData) { |
|
|
|
const sblbpz = [] |
|
|
|
sblbpz.push(tableObj.shebeileibiedaima) |
|
|
|
sblbpz.push(tableObj.shebeipinzhongdaima) |
|
|
|
this.$set(tableObj, 'sblbpz', sblbpz) |
|
|
|
} |
|
|
|
} |
|
|
|
if ( |
|
|
|
this.formState === 'create' || |
|
|
|