Browse Source

优化报检单相关操作

master
李磊 3 years ago
parent
commit
9731a80cb1
  1. 160
      src/views/bjd/dj_input.vue
  2. 22
      src/views/bjd/dj_list.vue
  3. 2
      src/views/bjd/jj_input.vue
  4. 2
      src/views/bjd/zj_input.vue

160
src/views/bjd/dj_input.vue

@ -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' ||

22
src/views/bjd/dj_list.vue

@ -86,7 +86,7 @@
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span class="radio-group-label">受理科室</span>
<el-radio-group v-model="listQuery.shoulikeshi" @change="handleFilter">
<el-radio :label="this.$store.getters.departmentId">
<el-radio :label="$store.getters.departmentId">
本科室
</el-radio>
<el-radio :label="undefined">
@ -96,7 +96,7 @@
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span class="radio-group-label">受理人员</span>
<el-radio-group v-model="listQuery.shouliren" @change="handleFilter">
<el-radio :label="this.$store.getters.nickname">
<el-radio :label="$store.getters.userId">
只看自己
</el-radio>
<el-radio :label="undefined">
@ -116,7 +116,6 @@
border
fit
highlight-current-row
:row-class-name="laiwuRowClass"
stripe
@row-click="onRowClick"
@selection-change="handleSelectionChange"
@ -157,7 +156,7 @@
</template>
</el-table-column>
<el-table-column align="center" label="设备台数" prop="totalNum" min-width="50" />
<el-table-column align="center" label="受理人员" prop="shouliren" min-width="50" />
<el-table-column :formatter="formatter.getChineseName" align="center" label="受理人员" prop="shouliren" min-width="50" />
<el-table-column align="center" label="报检渠道" prop="dataSource" min-width="50">
<template slot-scope="scope">
<el-tag v-if="scope.row.dataSource===0" type="info">
@ -189,7 +188,6 @@
<script>
import Sticky from '@/components/Sticky'
import Pagination from '@/components/Pagination'
import store from '../../store'
import router from '@/router'
import Vue from 'vue'
// import router from '../../router'
@ -206,14 +204,14 @@ export default {
orderBy: 'id desc',
zfState: false,
jianyanleibie: 'DJ',
shoulikeshi: store.getters.departmentId,
shouliren: store.getters.nickname,
shoulikeshi: this.hasRole('ADMIN') ? undefined : this.$store.getters.departmentId,
shouliren: this.hasRole('ADMIN') ? undefined : this.$store.getters.userId,
bjState: undefined
},
sbzlList: [],
ids: [],
multipleSelection: [],
departmentId: store.getters.departmentId,
departmentId: this.$store.getters.departmentId,
selection: [],
printbutton: ''
}
@ -446,7 +444,7 @@ export default {
}
}).then(data => {
data = data.replace(/\\/g, '/')
// router.push({ path: '/preview/1/1/urlPath?src=' + store.getters.prodName + '/static/web/viewer.html?file=' + encodeURIComponent(data) + '&v=' + Math.random() })
// router.push({ path: '/preview/1/1/urlPath?src=' + this.$store.getters.prodName + '/static/web/viewer.html?file=' + encodeURIComponent(data) + '&v=' + Math.random() })
window.open(data)
})
})
@ -512,12 +510,6 @@ export default {
})
})
},
laiwuRowClass({ row, rowIndex }) {
if (row.shouliren === '亓向芬' && row.shebeizhongleidaima === '2000') {
return 'laiwurongqi-row'
}
return ''
},
handleCommand() {
this.$router.push({ path: '/bjd/bjd-dj-input/null/F000/安全附件/newBuild' })
}

2
src/views/bjd/jj_input.vue

@ -895,7 +895,7 @@ export default {
},
getBjdInfo() {
this.apibjd({
url: '/bjd/getBjdById',
url: '/bjd',
method: 'get',
params: {
bjdId: this.$route.params.id

2
src/views/bjd/zj_input.vue

@ -556,7 +556,7 @@ export default {
},
getBjdInfo() {
this.apibjd({
url: '/bjd/getBjdById',
url: '/bjd',
method: 'get',
params: {
bjdId: this.$route.params.id

Loading…
Cancel
Save