Browse Source

Controller 改为 Service 意为:业务具体实现处理

master
李磊 3 years ago
parent
commit
8b1088c22f
  1. 6
      src/main.js
  2. 0
      src/service/bjdService.js
  3. 4
      src/service/index.js
  4. 0
      src/service/jyxmService.js
  5. 0
      src/service/renwuService.js
  6. 0
      src/service/templateService.js
  7. 0
      src/service/ysjlService.js
  8. 2
      src/views/bggl/banjie_list.vue
  9. 2
      src/views/bggl/components/original_db_list.vue
  10. 2
      src/views/bjd/dj_input.vue
  11. 2
      src/views/bjd/jj_input.vue
  12. 2
      src/views/bjd/zj_input.vue
  13. 2
      src/views/ysjl/2000/2100/fenxiang/ydjc.vue
  14. 26
      src/views/ysjl/3000/common/index.vue
  15. 10
      src/views/ysjl/8000/jj/edit2.vue

6
src/main.js

@ -25,7 +25,7 @@ import preview from './utils/preview'
import server from './utils/server' import server from './utils/server'
import formatter from './utils/formatter' import formatter from './utils/formatter'
import numToChinese from './utils/numberToChinese' import numToChinese from './utils/numberToChinese'
import controller from './controller' import service from './service'
import permission from './directive/permission' import permission from './directive/permission'
import adaptive from './directive/el-table' import adaptive from './directive/el-table'
import vueqr from 'vue-qr' import vueqr from 'vue-qr'
@ -68,8 +68,8 @@ Object.keys(validate).forEach(key => {
Vue.prototype[key] = validate[key] Vue.prototype[key] = validate[key]
}) })
Object.keys(controller).forEach(key => { Object.keys(service).forEach(key => {
Vue.prototype[key] = controller[key] Vue.prototype[key] = service[key]
}) })
new Vue({ new Vue({

0
src/controller/bjdController.js → src/service/bjdService.js

4
src/controller/index.js → src/service/index.js

@ -2,7 +2,7 @@ const modulesFiles = require.context('.', true, /\.js$/)
// you do not need `import app from './modules/app'` // you do not need `import app from './modules/app'`
// it will auto require all vuex module from modules file // it will auto require all vuex module from modules file
const controller = modulesFiles.keys().reduce((modules, modulePath) => { const service = modulesFiles.keys().reduce((modules, modulePath) => {
// set './app.js' => 'app' // set './app.js' => 'app'
const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, '$1') const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, '$1')
const value = modulesFiles(modulePath) const value = modulesFiles(modulePath)
@ -12,4 +12,4 @@ const controller = modulesFiles.keys().reduce((modules, modulePath) => {
return modules return modules
}, {}) }, {})
export default controller export default service

0
src/controller/jyxmController.js → src/service/jyxmService.js

0
src/controller/renwuController.js → src/service/renwuService.js

0
src/controller/templateController.js → src/service/templateService.js

0
src/controller/ysjlController.js → src/service/ysjlService.js

2
src/views/bggl/banjie_list.vue

@ -867,7 +867,7 @@ export default {
}, },
resetRecord(ysjlId) { resetRecord(ysjlId) {
this.$message.success('弹窗并获取主报告以及所有的无损分项以供用户选择编辑,展示字段为:检验项目、检验人员。' + ysjlId) this.$message.success('弹窗并获取主报告以及所有的无损分项以供用户选择编辑,展示字段为:检验项目、检验人员。' + ysjlId)
this.ysjlController.getResetRecordsList(ysjlId).then(data => { this.ysjlService.getResetRecordsList(ysjlId).then(data => {
this.resetRecordList = data this.resetRecordList = data
}) })
this.dialogResetRecords = true this.dialogResetRecords = true

2
src/views/bggl/components/original_db_list.vue

@ -1429,7 +1429,7 @@ export default {
this.dialogEnclosureVisible = true this.dialogEnclosureVisible = true
}, },
showSfInfo(row) { showSfInfo(row) {
this.ysjlController.getParam(row.id, '1000').then(data => { this.ysjlService.getParam(row.id, '1000').then(data => {
this.sfInfo = { this.sfInfo = {
zaojia: data.zaojia, zaojia: data.zaojia,
bili: data.bili, bili: data.bili,

2
src/views/bjd/dj_input.vue

@ -2444,7 +2444,7 @@ export default {
] ]
] ]
} }
this.bjdController.beforeUpload( this.bjdService.beforeUpload(
this, this,
file, file,
importField, importField,

2
src/views/bjd/jj_input.vue

@ -1458,7 +1458,7 @@ export default {
{ label: '车辆牌号/车辆底盘号', value: 's29' }] { label: '车辆牌号/车辆底盘号', value: 's29' }]
] ]
} }
this.bjdController.beforeUpload(this, file, importField, this.sbzldm, this.bjd.bjType) this.bjdService.beforeUpload(this, file, importField, this.sbzldm, this.bjd.bjType)
return false return false
}, },
beforeHejia() { beforeHejia() {

2
src/views/bjd/zj_input.vue

@ -502,7 +502,7 @@ export default {
{ label: '比例(%)', value: 'ss2' }] { label: '比例(%)', value: 'ss2' }]
] ]
} }
this.bjdController.beforeUpload(this, item.file, importField, this.sbzldm, 'ZJ') this.bjdService.beforeUpload(this, item.file, importField, this.sbzldm, 'ZJ')
}, },
/** /**
* 获得下载上传所需数据模板的设备类别 * 获得下载上传所需数据模板的设备类别

2
src/views/ysjl/2000/2100/fenxiang/ydjc.vue

@ -212,7 +212,7 @@ export default {
}) })
}, },
getJyxm() { getJyxm() {
this.jyxmController.getJyxm(this.ysjl.templateId, this.ysjl.id, 1, this.state).then(data => { this.jyxmService.getJyxm(this.ysjl.templateId, this.ysjl.id, 1, this.state).then(data => {
this.tableData = data || [] this.tableData = data || []
this.$refs.btn.getParentInfo(this.ysjl, this.param, null, this.tableData, this.state, this.$route.query.jyxm, true, false) this.$refs.btn.getParentInfo(this.ysjl, this.param, null, this.tableData, this.state, this.$route.query.jyxm, true, false)
}) })

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

@ -548,21 +548,21 @@
<fieldset> <fieldset>
<legend>检验信息</legend> <legend>检验信息</legend>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="20"> <el-col :span="18">
<el-form-item label="检验依据" prop="jianyanyiju"> <el-form-item label="检验依据" prop="jianyanyiju">
<span>{{ ysjl.jianyanyiju }}</span> <el-input v-model="ysjl.jianyanyiju" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="20"> <el-col :span="18">
<el-form-item label="主要检验仪器和设备" prop="gongjuxianghao"> <el-form-item label="主要检验仪器和设备" prop="gongjuxianghao">
<el-input v-model="param.gongjuxianghao" style="width: 100px" />号检验专用工具箱 <el-input v-model="param.gongjuxianghao" style="width: 100px" />号检验专用工具箱
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="20"> <el-col :span="18">
<el-form-item label="检验结论" prop="jianyanjielun"> <el-form-item label="检验结论" prop="jianyanjielun">
<el-radio-group v-model="ysjl.jianyanjielun"> <el-radio-group v-model="ysjl.jianyanjielun">
<el-radio label="合格"> <el-radio label="合格">
@ -785,7 +785,7 @@ export default {
}, },
methods: { methods: {
initYsjl() { initYsjl() {
this.ysjlController.init(this.$route.query).then((data) => { this.ysjlService.init(this.$route.query).then((data) => {
this.ysjl = data.ysjl this.ysjl = data.ysjl
this.param = data.param ? data.param : {} this.param = data.param ? data.param : {}
this.ysjl.jianyanjieshuriqi = this.formatter.dateFormat('YYYY-MM-dd') this.ysjl.jianyanjieshuriqi = this.formatter.dateFormat('YYYY-MM-dd')
@ -810,7 +810,7 @@ export default {
}) })
}, },
getJyxmInfoByYsjl() { getJyxmInfoByYsjl() {
this.ysjlController.getJyxmInfoByYsjl(this.ysjlId).then((data) => { this.ysjlService.getJyxmInfoByYsjl(this.ysjlId).then((data) => {
if (!data.fbjyxm) { if (!data.fbjyxm) {
return return
} }
@ -833,7 +833,7 @@ export default {
}) })
}, },
getYsjl() { getYsjl() {
this.ysjlController.getYsjl(this.ysjlId).then((data) => { this.ysjlService.getYsjl(this.ysjlId).then((data) => {
this.ysjl = data this.ysjl = data
this.ysjl.imagePath = '' this.ysjl.imagePath = ''
if ( if (
@ -844,7 +844,7 @@ export default {
this.ysjl.jianyanrenyuan this.ysjl.jianyanrenyuan
) )
} }
this.ysjlController this.ysjlService
.judgeRepeat(this.ysjl.jilubianhao, this.ysjl.id) .judgeRepeat(this.ysjl.jilubianhao, this.ysjl.id)
.then((data) => { .then((data) => {
this.isRepeat = data this.isRepeat = data
@ -853,7 +853,7 @@ export default {
}, },
getParam() { getParam() {
const id = this.ysjlId || this.$route.query.templateId const id = this.ysjlId || this.$route.query.templateId
this.ysjlController this.ysjlService
.getParam(id, this.$route.query.sbzldm) .getParam(id, this.$route.query.sbzldm)
.then((data) => { .then((data) => {
this.param = data this.param = data
@ -877,19 +877,19 @@ export default {
}, },
getJyxm(sort) { getJyxm(sort) {
if (this.$route.query.state === 'update') { if (this.$route.query.state === 'update') {
this.jyxmController.getJdCyJyxm(this.ysjlId, this.$route.query.templateId, sort).then((data) => { this.jyxmService.getJdCyJyxm(this.ysjlId, this.$route.query.templateId, sort).then((data) => {
this.bgfyData = data this.bgfyData = data
this.tableJs.getData(this.cols, this.rows, this.bgfyData) this.tableJs.getData(this.cols, this.rows, this.bgfyData)
}) })
} else { } else {
this.jyxmController.getCyJyxm(this.$route.query.templateId, sort).then((data) => { this.jyxmService.getCyJyxm(this.$route.query.templateId, sort).then((data) => {
this.bgfyData = data this.bgfyData = data
this.tableJs.getData(this.cols, this.rows, this.bgfyData) this.tableJs.getData(this.cols, this.rows, this.bgfyData)
}) })
} }
}, },
getDicJyxm(sort) { getDicJyxm(sort) {
this.jyxmController this.jyxmService
.getCyJyxm(this.$route.query.templateId, sort) .getCyJyxm(this.$route.query.templateId, sort)
.then((data) => { .then((data) => {
this.dicGzjz = data.map((row) => { this.dicGzjz = data.map((row) => {
@ -911,7 +911,7 @@ export default {
} }
}).then((data) => { }).then((data) => {
this.jlbh3 = data this.jlbh3 = data
this.ysjlController this.ysjlService
.judgeRepeat(this.ysjl.jilubianhao, this.ysjl.id) .judgeRepeat(this.ysjl.jilubianhao, this.ysjl.id)
.then((data) => { .then((data) => {
this.isRepeat = data this.isRepeat = data

10
src/views/ysjl/8000/jj/edit2.vue

@ -471,7 +471,7 @@ export default {
}, },
methods: { methods: {
initYsjl() { initYsjl() {
this.ysjlController.init(this.$route.query).then(data => { this.ysjlService.init(this.$route.query).then(data => {
this.ysjl = data.ysjl this.ysjl = data.ysjl
this.param = data.param ? data.param : {} this.param = data.param ? data.param : {}
this.ysjl.jianyanjielun = '符合要求' this.ysjl.jianyanjielun = '符合要求'
@ -488,7 +488,7 @@ export default {
}) })
}, },
getYsjl() { getYsjl() {
this.ysjlController.getYsjl(this.$route.query.id).then(data => { this.ysjlService.getYsjl(this.$route.query.id).then(data => {
this.ysjl = data.ysjl this.ysjl = data.ysjl
if (this.ysjl.jianyanrenyuan) { if (this.ysjl.jianyanrenyuan) {
this.jianyanrenyuan = this.common.convertCnName(this.ysjl.jianyanrenyuan) this.jianyanrenyuan = this.common.convertCnName(this.ysjl.jianyanrenyuan)
@ -503,7 +503,7 @@ export default {
}, },
getParam() { getParam() {
// id // id
this.ysjlController.getParam(this.$route.query.id, this.$route.query.sbzldm).then(data => { this.ysjlService.getParam(this.$route.query.id, this.$route.query.sbzldm).then(data => {
this.param = data this.param = data
}) })
}, },
@ -531,7 +531,7 @@ export default {
}, },
// //
getJyxm(sort) { getJyxm(sort) {
this.jyxmController.getJyxm(this.$route.query.templateId, this.$route.query.id, sort, this.state, false).then(data => { this.jyxmService.getJyxm(this.$route.query.templateId, this.$route.query.id, sort, this.state, false).then(data => {
switch (sort) { switch (sort) {
case 1: case 1:
this.jdjyxmData = data this.jdjyxmData = data
@ -745,7 +745,7 @@ export default {
this.similarVisible = false this.similarVisible = false
}, },
judgeRepeat(bianhao, id) { judgeRepeat(bianhao, id) {
this.ysjlController.judgeRepeat(id, bianhao).then(data => { this.ysjlService.judgeRepeat(id, bianhao).then(data => {
this.isRepeat = data this.isRepeat = data
}) })
}, },

Loading…
Cancel
Save