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 <el-cascader
ref="editCascader" ref="editCascader"
v-model="bjd.quhuadaima" v-model="quhuadaimas"
placeholder="请选择" placeholder="请选择"
:options="areaList" :options="areaList"
style="width: 100%;"
@change="quhuaChange" @change="quhuaChange"
/> />
</el-form-item> </el-form-item>
@ -288,8 +289,8 @@
> >
<el-date-picker <el-date-picker
v-model="bjd.baojianriqi" v-model="bjd.baojianriqi"
type="datetime" type="date"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd"
placeholder="选择日期" placeholder="选择日期"
style="width: 98%" style="width: 98%"
/> />
@ -309,16 +310,16 @@
> >
<el-date-picker <el-date-picker
v-model="bjd.shouliriqi" v-model="bjd.shouliriqi"
type="datetime" type="date"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd"
placeholder="选择日期" placeholder="选择日期"
style="width: 95%" style="width: 100%;"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row v-if="!(bjd.shebeizhongleidaima === '1000')" :gutter="20"> <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-form-item label="备注:" prop="beizhu">
<el-input <el-input
v-model="bjd.bjdBeizhu" v-model="bjd.bjdBeizhu"
@ -328,20 +329,20 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<div v-if="formState === 'finish'" style="margin-top: 10px"> <template v-if="formState === 'finish'">
<el-row> <el-row :gutter="20">
<el-col :span="9"> <el-col :span="9">
<el-form-item label="受理人:" prop="shouliren"> <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-form-item>
</el-col> </el-col>
<el-col :span="9"> <el-col :span="9">
<el-form-item label="最后修改人:" prop="updateBy"> <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-form-item>
</el-col> </el-col>
</el-row> </el-row>
</div> </template>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="9"> <el-col :span="9">
<el-form-item <el-form-item
@ -359,6 +360,56 @@
<el-input v-model="bjd.baojiandianhua" type="text" /> <el-input v-model="bjd.baojiandianhua" type="text" />
</el-form-item> </el-form-item>
</el-col> </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> </el-row>
</fieldset> </fieldset>
</el-form> </el-form>
@ -1541,7 +1592,8 @@ export default {
fixedWidth: '', fixedWidth: '',
isShengju: true, isShengju: true,
form: this.$route.params.form, form: this.$route.params.form,
areaList: [] areaList: [],
quhuadaimas: []
} }
}, },
watch: { watch: {
@ -1556,19 +1608,21 @@ export default {
if (this.formState === 'newBuild') { if (this.formState === 'newBuild') {
this.isShengju = false this.isShengju = false
this.tableData = [] this.tableData = []
this.$set(this.bjd, 'shouliriqi', new Date()) const date = this.formatter.dateFormat('YYYY-MM-dd')
this.$set(this.bjd, 'baojianriqi', new Date()) this.$set(this.bjd, 'shouliriqi', date)
this.getSblb() this.$set(this.bjd, 'baojianriqi', date)
} else if (this.formState === 'update' || this.formState === 'finish') { } else if (this.formState === 'update' || this.formState === 'finish') {
// //
this.getBjdInfo() this.getBjdInfo()
//
this.getParamById()
} else if (this.formState === 'create') { } else if (this.formState === 'create') {
// //
this.getSblb()
// //
// this.tableData = this.$route.query.params // this.tableData = this.$route.query.params
this.getParamList(this.$route.query.params, true) this.getParamList(this.$route.query.params, true)
} }
this.getSblb()
if (this.sbzldm === 'F000') { if (this.sbzldm === 'F000') {
this.templateName = '安全阀报检导入模板.xlsx' this.templateName = '安全阀报检导入模板.xlsx'
} }
@ -1583,7 +1637,7 @@ export default {
methods: { methods: {
getArea() { getArea() {
this.api({ this.api({
url: '/area/getAll', url: '/area/all',
method: 'get', method: 'get',
params: {} params: {}
}).then(res => { }).then(res => {
@ -1605,10 +1659,12 @@ export default {
// *** // ***
if (init) { if (init) {
this.bjd = this.tableData[0] // this.bjd = this.tableData[0] //
this.$set(this.bjd, 'shouliriqi', new Date()) const date = this.formatter.dateFormat('YYYY-MM-dd')
this.$set(this.bjd, 'baojianriqi', new Date()) this.$set(this.bjd, 'shouliriqi', date)
this.$set(this.bjd, 'baojianriqi', date)
this.bjd.lingqufangshi = '自取' this.bjd.lingqufangshi = '自取'
} }
this.loadQuhua()
if (this.bjd.shebeizhongleidaima === '3000') { if (this.bjd.shebeizhongleidaima === '3000') {
this.$set(this.bjd, 'baojiandianhua', this.bjd.weibaodanweiDianhua) this.$set(this.bjd, 'baojiandianhua', this.bjd.weibaodanweiDianhua)
} }
@ -1622,33 +1678,38 @@ export default {
}, },
getBjdInfo() { getBjdInfo() {
this.apibjd({ this.apibjd({
url: '/bjd/getBjdById', url: '/bjd',
method: 'get', method: 'get',
params: { params: {
bjdId: this.$route.params.id bjdId: this.$route.params.id
} }
}).then((data) => { }).then((data) => {
this.bjd = data this.bjd = data
if ( if (!this.bjd.baojiandianhua) {
this.bjd.baojiandianhua === undefined ||
this.bjd.baojiandianhua === null
) {
this.bjd.baojiandianhua = this.bjd.weibaodanweiDianhua this.bjd.baojiandianhua = this.bjd.weibaodanweiDianhua
} }
this.getSblb() this.loadQuhua()
//
this.getParamById()
}) })
}, },
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() { getParamById() {
this.apibjd({ this.apibjd({
url: '/renwu/getParamByBjdId', url: '/renwu/getParamByBjdId',
method: 'get', method: 'get',
params: { params: {
bjdId: this.bjd.id bjdId: this.$route.params.id
} }
}).then((data) => { }).then((data) => {
this.tableData = data this.tableData = data
this.$refs.bjBaseList.doLayout()
for (const tableObj of this.tableData) { for (const tableObj of this.tableData) {
const sblbpz = [] const sblbpz = []
// //
@ -1842,8 +1903,9 @@ export default {
} }
}, },
quhuaChange(val) { quhuaChange(val) {
const arr = this.$refs['editCascader'].getCheckedNodes()[0].pathLabels const data = this.$refs.editCascader.getCheckedNodes()[0].data
this.bjd.quhuamingcheng = arr.toString() this.bjd.quhuamingcheng = data.label
this.bjd.quhuadaima = data.value
}, },
tableRowClassName({ row, rowIndex }) { tableRowClassName({ row, rowIndex }) {
row.index = rowIndex row.index = rowIndex
@ -2126,7 +2188,6 @@ export default {
this.selection[i].sblbpz = sblbpz this.selection[i].sblbpz = sblbpz
} }
} }
this.tableData.push()
this.dialogFormParam = false this.dialogFormParam = false
}, },
delRow: function() { 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) { bjdSave(audit) {
this.bjd.baojianriqi = this.formTime(this.bjd.baojianriqi)
this.bjd.shouliriqi = this.formTime(this.bjd.shouliriqi)
this.$refs['bjd'].validate((valid) => { this.$refs['bjd'].validate((valid) => {
if (valid) { if (valid) {
if (this.judgeNull(this.bjd.quhuadaima)) { if (this.judgeNull(this.bjd.quhuadaima)) {
@ -2231,7 +2274,7 @@ export default {
}) })
return false return false
} }
if (this.tableData === null || this.tableData.length === 0) { if (this.tableData.length === 0) {
this.$message({ this.$message({
type: 'error', type: 'error',
message: '报检设备不能为空!' message: '报检设备不能为空!'
@ -2350,12 +2393,15 @@ export default {
} }
}) })
} else { } else {
this.tableData = data.tableData if (data && data.renwus.length) {
for (const tableObj of this.tableData) { this.tableData = data.renwus
const sblbpz = [] this.$refs.bjBaseList.doLayout()
sblbpz.push(tableObj.shebeileibiedaima) for (const tableObj of this.tableData) {
sblbpz.push(tableObj.shebeipinzhongdaima) const sblbpz = []
this.$set(tableObj, 'sblbpz', sblbpz) sblbpz.push(tableObj.shebeileibiedaima)
sblbpz.push(tableObj.shebeipinzhongdaima)
this.$set(tableObj, 'sblbpz', sblbpz)
}
} }
if ( if (
this.formState === 'create' || this.formState === 'create' ||

22
src/views/bjd/dj_list.vue

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

2
src/views/bjd/zj_input.vue

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

Loading…
Cancel
Save