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 formatter from './utils/formatter'
import numToChinese from './utils/numberToChinese'
import controller from './controller'
import service from './service'
import permission from './directive/permission'
import adaptive from './directive/el-table'
import vueqr from 'vue-qr'
@ -68,8 +68,8 @@ Object.keys(validate).forEach(key => {
Vue.prototype[key] = validate[key]
})
Object.keys(controller).forEach(key => {
Vue.prototype[key] = controller[key]
Object.keys(service).forEach(key => {
Vue.prototype[key] = service[key]
})
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'`
// 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'
const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, '$1')
const value = modulesFiles(modulePath)
@ -12,4 +12,4 @@ const controller = modulesFiles.keys().reduce((modules, modulePath) => {
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) {
this.$message.success('弹窗并获取主报告以及所有的无损分项以供用户选择编辑,展示字段为:检验项目、检验人员。' + ysjlId)
this.ysjlController.getResetRecordsList(ysjlId).then(data => {
this.ysjlService.getResetRecordsList(ysjlId).then(data => {
this.resetRecordList = data
})
this.dialogResetRecords = true

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

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

2
src/views/bjd/dj_input.vue

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

2
src/views/bjd/jj_input.vue

@ -1458,7 +1458,7 @@ export default {
{ 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
},
beforeHejia() {

2
src/views/bjd/zj_input.vue

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

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

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

Loading…
Cancel
Save