Browse Source

优化页面

master
李磊 3 years ago
parent
commit
b71847a639
  1. 11
      src/api/sedirectory.js
  2. 11
      src/service/sedirectoryService.js
  3. 85
      src/views/ysjl/3000/common/index.vue
  4. 6
      src/views/zjd/zjbg_list.vue
  5. 49
      src/views/zjd/zjd_list.vue

11
src/api/sedirectory.js

@ -0,0 +1,11 @@
import api from '@/utils/api'
export function getList(params) {
return api({
url: '/sedirectory/getList',
method: 'get',
params
})
}
export default { getList }

11
src/service/sedirectoryService.js

@ -0,0 +1,11 @@
import sedirectory from '@/api/sedirectory'
export default {
/**
* 获取设备目录
* @param params
*/
getList(params) {
return sedirectory.getList(params)
}
}

85
src/views/ysjl/3000/common/index.vue

@ -83,31 +83,39 @@
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="9"> <el-col :span="9">
<el-form-item label="设备类别" prop="shebeileibie"> <el-form-item label="设备类别" prop="shebeileibiedaima">
<el-select <el-select
v-model="ysjl.shebeileibie" v-model="ysjl.shebeileibiedaima"
filterable filterable
allow-create
default-first-option default-first-option
style="width: 100%" style="width: 100%"
@change="changXh" @change="changeSblb"
> >
<el-option <el-option
v-for="item in xinghaoList" v-for="(item, index) in sblbList"
:key="item.id" :key="index"
:label="item.xinghao" :label="item.label"
:value="item.xinghao" :value="item.value"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="9"> <el-col :span="9">
<el-form-item label="设备品种" prop="shebeipinzhong"> <el-form-item label="设备品种" prop="shebeipinzhongdaima">
<el-input <el-select
v-model="ysjl.shebeipinzhong" v-model="ysjl.shebeipinzhongdaima"
type="text" filterable
:disabled="edit" default-first-option
/> style="width: 100%"
@change="changeSbpz"
>
<el-option
v-for="(item, index) in sbpzList"
:key="index"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -847,7 +855,8 @@ export default {
ysjlId: this.$route.query.id, ysjlId: this.$route.query.id,
checkedTab: 'first', checkedTab: 'first',
userList: [], userList: [],
xinghaoList: [], sblbList: [],
sbpzList: [],
jybgData: [], jybgData: [],
cols: [ cols: [
{ {
@ -968,21 +977,29 @@ export default {
this.jlbh2 = '(C)' this.jlbh2 = '(C)'
} }
this.getJyxm(1) this.getJyxm(1)
this.getSbList() this.getSbList(undefined, 2)
this.getSbList(this.ysjl.shebeileibiedaima, 3)
this.getMaxBh() this.getMaxBh()
}) })
}, },
getSbList() { getSbList(sblb, level) {
this.api({ return this.sedirectoryService.getList({
url: '/sedirectory/getList', sbzl: '3000',
method: 'get', sblb: sblb,
params: { level: level
sbzl: this.$route.query.sbzldm,
sblb: this.$route.query.sblbdm,
level: 2
}
}).then((data) => { }).then((data) => {
this.xinghaoList = data switch (level) {
case 2:
this.sblbList = data
break
case 3:
this.sbpzList = data
this.ysjl.shebeipinzhong = this.sbpzList[0].label
this.ysjl.shebeipinzhongdaima = this.sbpzList[0].value
break
default:
break
}
}) })
}, },
getJyxmInfoByYsjl() { getJyxmInfoByYsjl() {
@ -1024,6 +1041,8 @@ export default {
this.isRepeat = data this.isRepeat = data
}) })
this.getJyxm(1) this.getJyxm(1)
this.getSbList(undefined, 2)
this.getSbList(this.ysjl.shebeileibiedaima, 3)
}) })
}, },
getParam() { getParam() {
@ -1312,8 +1331,18 @@ export default {
} }
}) })
}, },
changXh: function(val) { changeSblb(val) {
// TODO this.ysjl.shebeileibiedaima = val
this.ysjl.shebeileibie = this.sblbList.filter(row => row.value === val)[0].label
this.getSbList(this.ysjl.shebeileibiedaima, 3)
.then(() => {
this.shebeipinzhongdaima = this.sbpzList[0].value
this.shebeipinzhong = this.sbpzList[0].label
})
},
changeSbpz(val) {
this.ysjl.shebeipinzhongdaima = val
this.ysjl.shebeipinzhong = this.sbpzList.filter(row => row.value === val)[0].label
}, },
loadPhxsImage(data) { loadPhxsImage(data) {
this.pic = data this.pic = data

6
src/views/zjd/zjbg_list.vue

@ -95,9 +95,9 @@
<el-table-column align="center" label="制造单位" prop="zhizaodanwei" width="240" /> <el-table-column align="center" label="制造单位" prop="zhizaodanwei" width="240" />
<el-table-column align="center" label="产品编号/出厂编号" prop="chanpinbianhao" width="140" /> <el-table-column align="center" label="产品编号/出厂编号" prop="chanpinbianhao" width="140" />
<el-table-column align="center" label="单位内编号" prop="danweineibubianhao" width="140" sortable="custom" /> <el-table-column align="center" label="单位内编号" prop="danweineibubianhao" width="140" sortable="custom" />
<el-table-column align="center" label="检验人员" prop="jianyanrenyuan" width="120" /> <el-table-column :formatter="formatter.getChineseName" align="center" label="检验人员" prop="jianyanrenyuan" width="120" />
<el-table-column align="center" label="检验日期" prop="jianyankaishiriqi" width="110" sortable="custom" /> <el-table-column align="center" label="检验开始日期" prop="jianyankaishiriqi" width="130" sortable="custom" />
<el-table-column align="center" label="检结束日期" prop="jianyanjieshuriqi" width="130" sortable="custom" /> <el-table-column align="center" label="检结束日期" prop="jianyanjieshuriqi" width="130" sortable="custom" />
<el-table-column align="center" label="下次检验日期" prop="xiacijianyanriqi" width="130" sortable="custom" /> <el-table-column align="center" label="下次检验日期" prop="xiacijianyanriqi" width="130" sortable="custom" />
<el-table-column align="center" label="检验结论" prop="jianyanjielun" width="80" /> <el-table-column align="center" label="检验结论" prop="jianyanjielun" width="80" />
<!-- <el-table-column fixed="right" align="center" label="操作" min-width="80"> <!-- <el-table-column fixed="right" align="center" label="操作" min-width="80">

49
src/views/zjd/zjd_list.vue

@ -3,18 +3,18 @@
<div class="filter-container"> <div class="filter-container">
<sticky style="margin-bottom: 10px;"> <sticky style="margin-bottom: 10px;">
<div class="sub-navbar"> <div class="sub-navbar">
<el-button type="primary" icon="el-icon-printer" @click="batchPrintZjd">
打印转交单
</el-button>
<el-button v-show="hasPerm('zjd:QRZJ')" type="warning" icon="el-ok" @click="createZjdShow"> <el-button v-show="hasPerm('zjd:QRZJ')" type="warning" icon="el-ok" @click="createZjdShow">
确认转交单 确认转交单
</el-button> </el-button>
<el-button v-show="hasPerm('zjd:CXZJ')" type="danger" icon="el-cancel" @click="revokeZjd"> <el-button v-show="hasPerm('zjd:CXZJ')" type="danger" icon="el-cancel" @click="revokeZjd">
撤回转交单 撤回转交单
</el-button> </el-button>
<el-button type="success" icon="el-icon-printer" @click="viewPrintZjd"> <!-- <el-button type="success" icon="el-icon-printer" @click="viewPrintZjd">
预览转交单 预览转交单
</el-button> </el-button>
<el-button type="primary" icon="el-icon-printer" @click="batchPrintZjd">
打印转交单
</el-button>-->
</div> </div>
</sticky> </sticky>
<el-form> <el-form>
@ -271,10 +271,6 @@ export default {
}) })
}, },
revokeZjd() { revokeZjd() {
if (this.multipleSelection.length !== 1) {
this.$message({ message: '请选中单条数据进行操作。', type: 'warning' })
return false
}
for (let i = 0; i < this.multipleSelection.length; i++) { for (let i = 0; i < this.multipleSelection.length; i++) {
if (this.multipleSelection[i].state) { if (this.multipleSelection[i].state) {
this.$message({ message: '存在已确认的转交单,请勿重新操作。', type: 'warning' }) this.$message({ message: '存在已确认的转交单,请勿重新操作。', type: 'warning' })
@ -283,17 +279,15 @@ export default {
} }
// //
this.api({ this.api({
url: '/zjd/revokeZjd', url: '/zjd/revoke',
method: 'get', method: 'post',
params: { data: {
zjdId: this.multipleSelection[0].id zjdIds: this.multipleSelection.map(row => row.id)
},
paramsSerializer: function(data) {
return require('qs').stringify(data, { indices: false })
} }
}).then(data => { }).then(data => {
if (data.returnCode === undefined) {
this.$message({ message: data, type: 'success' })
} else {
this.$message({ message: data.returnMsg, type: 'warning' })
}
this.getList() this.getList()
}) })
}, },
@ -343,26 +337,15 @@ export default {
this.$message({ message: '请选择至少一条数据进行打印!', type: 'error' }) this.$message({ message: '请选择至少一条数据进行打印!', type: 'error' })
return false return false
} }
this.api({ this.preview({
url: '/zjd/printZjdBatch', url: '/print/generatePdfZjd',
method: 'get', method: 'get',
params: { params: {
zjdIds: this.$refs.list.selection.map(zjd => { zjdId: this.$refs.list.selection[0].id
return zjd.id
}).join(',')
} }
}).then(data => { }).then(data => {
this.preview({ data = data.replace(/\\/g, '/')
url: '/print/generatePdfView', window.open(data)
method: 'post',
data: {
list: data,
viewType: 'ZJD'
}
}).then(data => {
data = data.replace(/\\/g, '/')
window.open(data)
})
}) })
} }
} }

Loading…
Cancel
Save