Browse Source

上传代码联调

master
jiangyuying 5 years ago
parent
commit
318d1a81b7
  1. 3
      epmet-oper-web/.env.development
  2. 14
      epmet-oper-web/public/index.html
  3. 43
      epmet-oper-web/src/js/ajax.js
  4. 34
      epmet-oper-web/src/js/columns/code/commitCode.js
  5. 11
      epmet-oper-web/src/js/columns/code/temp.js
  6. 22
      epmet-oper-web/src/js/columns/customer/customer.js
  7. 36
      epmet-oper-web/src/views/components/CForm.vue
  8. 4
      epmet-oper-web/src/views/components/CTableNoPage.vue
  9. 117
      epmet-oper-web/src/views/modules/code/CommitForm.vue
  10. 168
      epmet-oper-web/src/views/modules/code/CommitList.vue
  11. 95
      epmet-oper-web/src/views/modules/code/SubmitForm.vue
  12. 34
      epmet-oper-web/src/views/modules/customer-manage/RegisterList.vue

3
epmet-oper-web/.env.development

@ -1,4 +1,5 @@
NODE_ENV=development NODE_ENV=development
VUE_APP_API_SERVER = http://192.168.1.130:8080/api # VUE_APP_API_SERVER = http://192.168.1.130:8080/api
VUE_APP_API_SERVER = http://10.10.10.98:8080/api
# VUE_APP_API_SERVER = https://epmet-dev.elinkservice.cn/api # VUE_APP_API_SERVER = https://epmet-dev.elinkservice.cn/api
VUE_APP_NODE_ENV=dev VUE_APP_NODE_ENV=dev

14
epmet-oper-web/public/index.html

@ -1,5 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge"> <meta http-equiv="X-UA-Compatible" content="ie=edge">
@ -32,23 +33,26 @@
<!-- 开发环境 --> <!-- 开发环境 -->
<% if (process.env.VUE_APP_NODE_ENV === 'dev') { %> <% if (process.env.VUE_APP_NODE_ENV === 'dev') { %>
<script>window.SITE_CONFIG['apiURL'] = 'http://192.168.1.130:8080/api';</script> <script>window.SITE_CONFIG['apiURL'] = 'http://10.10.10.98:8080/api';</script>
<!-- <script>window.SITE_CONFIG['apiURL'] = 'http://localhost:8080/api';</script> --> <!-- <script>window.SITE_CONFIG['apiURL'] = 'http://192.168.1.130:8080/api';</script> -->
<!-- <script>window.SITE_CONFIG['apiURL'] = 'http://localhost:8080/api';</script> -->
<% } %> <% } %>
<!-- 集成测试环境 dev --> <!-- 集成测试环境 dev -->
<% if (process.env.VUE_APP_NODE_ENV === 'prod:sit') { %> <% if (process.env.VUE_APP_NODE_ENV === 'prod:sit') { %>
<script>window.SITE_CONFIG['apiURL'] = 'http://epmet-dev.elinkservice.cn:48080/api';</script> <script>window.SITE_CONFIG['apiURL'] = 'http://epmet-dev.elinkservice.cn:48080/api';</script>
<% } %> <% } %>
<!-- 验收测试环境 aliyun --> <!-- 验收测试环境 aliyun -->
<% if (process.env.VUE_APP_NODE_ENV === 'prod:uat') { %> <% if (process.env.VUE_APP_NODE_ENV === 'prod:uat') { %>
<script>window.SITE_CONFIG['apiURL'] = 'https://epmet-dev.elinkservice.cn/api';</script> <script>window.SITE_CONFIG['apiURL'] = 'https://epmet-dev.elinkservice.cn/api';</script>
<% } %> <% } %>
<!-- 生产环境 --> <!-- 生产环境 -->
<% if (process.env.VUE_APP_NODE_ENV === 'prod') { %> <% if (process.env.VUE_APP_NODE_ENV === 'prod') { %>
<script>window.SITE_CONFIG['apiURL'] = 'https://epmet-cloud.elinkservice.cn/api';</script> <script>window.SITE_CONFIG['apiURL'] = 'https://epmet-cloud.elinkservice.cn/api';</script>
<% } %> <% } %>
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>
</body> </body>
</html> </html>

43
epmet-oper-web/src/js/ajax.js

@ -101,6 +101,38 @@ axios.interceptors.response.use(
} }
) )
const post = (url, params, headers) => {
return new Promise((reslove, reject) => {
axios
.post(processUrl(url), params, headers)
.then((res) => {
resolve(res);
})
.catch((err) => {
reject(err)
})
})
}
export const requestPost = async (url = '', params = {}, headers = {}) => {
const ret = await post(url, params, headers)
console.log(url, ret)
// if (ret.status === 200) {
// var data = res.data
// if (data.code == 0) {
// //业务成功
// if (typeof cb_su === 'function') {
// cb_su(data.data, data.msg)
// }
// } else {
// //业务失败
// if (typeof cb_err === 'function') cb_err(data.msg, data.data)
// }
// } else {
// if (typeof cb_err === 'function') cb_err(res)
// }
}
/* /*
* 1后台请求成功均返回业务上的异常也属于请求成功 res.status=200的响应码 * 1后台请求成功均返回业务上的异常也属于请求成功 res.status=200的响应码
* 2res.data后台自定义的响应体包括 * 2res.data后台自定义的响应体包括
@ -199,6 +231,7 @@ export default {
} }
}) })
}, },
post (url, data, cb_su, cb_err, headers) { post (url, data, cb_su, cb_err, headers) {
var h = {} var h = {}
if (headers && JSON.stringify(headers) != '{}') { if (headers && JSON.stringify(headers) != '{}') {
@ -358,10 +391,10 @@ export default {
if (res.status === 200) { if (res.status === 200) {
var data = res.data //直接返回blob var data = res.data //直接返回blob
if (data) { if (data.code == 0) {
//业务成功 //业务成功
if (typeof cb_su === 'function') { if (typeof cb_su === 'function') {
cb_su(data, '操作成功') cb_su(data.data, data.msg)
} }
} else { } else {
//业务失败 //业务失败
@ -423,9 +456,9 @@ export default {
var errorMsg = '操作失败' var errorMsg = '操作失败'
let requestConfig = { let requestConfig = {
headers: { headers: {
'Content-Type': 'multipart/form-data', 'Content-Type': 'multipart/form-data'
Authorization: auth.loadTokenType() + ' ' + auth.loadAccessToken(), // Authorization: auth.loadTokenType() + ' ' + auth.loadAccessToken(),
}, }
} }
Vue.http Vue.http

34
epmet-oper-web/src/js/columns/code/commitCode.js

@ -196,23 +196,23 @@ export default {
display: ['formA', 'formU', 'model'], display: ['formA', 'formU', 'model'],
block: false, block: false,
width: 120 width: 120
},
{
key: 'extJson',
title: '小程序配置',
type: 'textarea',
rule: [{
required: true,
message: '请输入小程序配置',
trigger: 'blur'
}],
option: {
minRows: 5,
maxRows: 8,
rows: 6
},
display: ['formA', 'formU', 'model'],
block: false
} }
// {
// key: 'extJson',
// title: '小程序配置',
// type: 'textarea',
// rule: [{
// required: true,
// message: '请输入小程序配置',
// trigger: 'blur'
// }],
// option: {
// minRows: 5,
// maxRows: 8,
// rows: 6
// },
// display: ['formA', 'formU', 'model'],
// block: false
// }
] ]
} }

11
epmet-oper-web/src/js/columns/code/temp.js

@ -1,6 +1,6 @@
export default [ export default [
{ {
key: 'templateId', key: 'id',
title: '版本ID', title: '版本ID',
type: 'select', type: 'select',
rule: [{ rule: [{
@ -11,7 +11,7 @@ export default [
display: ['formA', 'formU', 'table', 'model'], display: ['formA', 'formU', 'table', 'model'],
fixed: false, fixed: false,
block: true, block: true,
width: 120 width: 60
}, },
{ {
key: 'userVersion', key: 'userVersion',
@ -25,7 +25,7 @@ export default [
display: ['formA', 'formU', 'table', 'model'], display: ['formA', 'formU', 'table', 'model'],
fixed: false, fixed: false,
block: true, block: true,
width: 120 width: 60
}, },
{ {
key: 'userDesc', key: 'userDesc',
@ -37,7 +37,8 @@ export default [
trigger: 'blur' trigger: 'blur'
}], }],
display: ['formA', 'formU', 'table', 'model'], display: ['formA', 'formU', 'table', 'model'],
block: true block: true,
width: 200
}, },
{ {
key: 'createTime', key: 'createTime',
@ -51,6 +52,6 @@ export default [
display: ['formA', 'formU', 'table', 'model'], display: ['formA', 'formU', 'table', 'model'],
fixed: false, fixed: false,
block: true, block: true,
width: 120 width: 80
} }
] ]

22
epmet-oper-web/src/js/columns/customer/customer.js

@ -13,7 +13,7 @@ export default [
display: ['formA', 'formU', 'table', 'model'], display: ['formA', 'formU', 'table', 'model'],
fixed: false, fixed: false,
block: true, block: true,
width: 120 width: 100
}, },
{ {
key: 'province', key: 'province',
@ -52,7 +52,14 @@ export default [
// }, // },
{ {
key: 'partybranchnum', key: 'partybranchnum',
title: '党支部数量', title: '党支部',
display: ['formA', 'formU', 'table', 'model'],
block: true,
width: 60
},
{
key: 'phone',
title: '注册人电话',
display: ['formA', 'formU', 'table', 'model'], display: ['formA', 'formU', 'table', 'model'],
block: true block: true
}, },
@ -69,7 +76,8 @@ export default [
} else { } else {
return '未知' return '未知'
} }
} },
width: 60
}, },
{ {
key: 'workAuth', key: 'workAuth',
@ -84,11 +92,12 @@ export default [
} else { } else {
return '未知' return '未知'
} }
} },
width: 60
}, },
{ {
key: 'initState', key: 'initState',
title: '初始化状态', title: '初始化',
display: ['formA', 'formU', 'table', 'model'], display: ['formA', 'formU', 'table', 'model'],
block: true, block: true,
format: function (cellValue, index) { format: function (cellValue, index) {
@ -99,6 +108,7 @@ export default [
} else { } else {
return '未知' return '未知'
} }
} },
width: 80
} }
] ]

36
epmet-oper-web/src/views/components/CForm.vue

@ -452,7 +452,7 @@ export default {
}, },
defaultNodeKey () { defaultNodeKey () {
return function (key, index) { return function (key, index) {
var keyid = this.columns[index].keyid// key const keyid = this.columns[index].keyid// key
// alert(this.model[keyid]) // alert(this.model[keyid])
/* if (!this.model[keyid]) { /* if (!this.model[keyid]) {
return 0 return 0
@ -464,7 +464,7 @@ export default {
// //
// imageUrl () { // imageUrl () {
// return function (key) { // return function (key) {
// var picPath = this.model[key] // const picPath = this.model[key]
// } // }
// }, // },
}, },
@ -473,7 +473,7 @@ export default {
}, },
methods: { methods: {
getFile (aaa) { getFile (aaa) {
// var bbb = aaa.target.files[0] // const bbb = aaa.target.files[0]
}, },
assign (currentData) { assign (currentData) {
if (currentData) { if (currentData) {
@ -531,29 +531,29 @@ export default {
}, },
// //
handleClear (data, key, formIndex) { handleClear (data, key, formIndex) {
var keyid = this.columns[formIndex].keyid// key const keyid = this.columns[formIndex].keyid// key
this.model[keyid] = '' this.model[keyid] = ''
this.model[key] = '' this.model[key] = ''
this.$nextTick(() => { this.$nextTick(() => {
var ref = 'tree_' + key const ref = 'tree_' + key
this.$refs[ref][0].loadData(null, 0, [0], false) this.$refs[ref][0].loadData(null, 0, [0], false)
}) })
}, },
multihandleClear (data, key, formIndex) { multihandleClear (data, key, formIndex) {
var keyid = this.columns[formIndex].keyid// 获/* */key const keyid = this.columns[formIndex].keyid// 获/* */key
this.model[keyid] = '' this.model[keyid] = ''
this.model[key] = '' this.model[key] = ''
// var keyid = this.columns[formIndex].keyid// key // const keyid = this.columns[formIndex].keyid// key
// this.model[keyid] = '' // this.model[keyid] = ''
// this.model[key] = '' // this.model[key] = ''
}, },
// / // /
handleOk (data, key, formIndex) { handleOk (data, key, formIndex) {
this.model[key] = data.label// this.model[key] = data.label//
var keyid = this.columns[formIndex].keyid// key const keyid = this.columns[formIndex].keyid// key
var id = data.id const id = data.id
var p = /[a-z]/i const p = /[a-z]/i
if (p.test(data.id.substring(0, 1))) { // if (p.test(data.id.substring(0, 1))) { //
id = data.id.substring(1) id = data.id.substring(1)
} }
@ -571,7 +571,7 @@ export default {
handleName = handleNameArr.join(',') handleName = handleNameArr.join(',')
handleId = handleIdArr.join(',') handleId = handleIdArr.join(',')
this.model[key] = handleName this.model[key] = handleName
var keyid = this.columns[formIndex].keyid const keyid = this.columns[formIndex].keyid
this.model[keyid] = handleId this.model[keyid] = handleId
}, },
handleDel (data, key, formIndex) { handleDel (data, key, formIndex) {
@ -586,7 +586,7 @@ export default {
handleName = handleNameArr.join(',') handleName = handleNameArr.join(',')
handleId = handleIdArr.join(',') handleId = handleIdArr.join(',')
this.model[key] = handleName this.model[key] = handleName
var keyid = this.columns[formIndex].keyid const keyid = this.columns[formIndex].keyid
this.model[keyid] = handleId this.model[keyid] = handleId
}, },
changePass (value) { // true:false: changePass (value) { // true:false:
@ -625,7 +625,7 @@ export default {
// //
changeShow (showKeyArray, showIndexArray, showDefault, hideKeyArray, hideIndexArray) { changeShow (showKeyArray, showIndexArray, showDefault, hideKeyArray, hideIndexArray) {
// debugger // debugger
for (var i = 0; i < showIndexArray.length; i++) { for (const i = 0; i < showIndexArray.length; i++) {
// this.columns[showIndexArray[i]].showFlag = '1' // this.columns[showIndexArray[i]].showFlag = '1'
this.columns[showIndexArray[i]].show = true this.columns[showIndexArray[i]].show = true
if (this.columns[showIndexArray[i]].required) { // if (this.columns[showIndexArray[i]].required) { //
@ -633,7 +633,7 @@ export default {
} }
this.model[showKeyArray[i]] = showDefault[i] this.model[showKeyArray[i]] = showDefault[i]
} }
for (var j = 0; j < hideIndexArray.length; j++) { for (const j = 0; j < hideIndexArray.length; j++) {
// this.columns[showIndexArray[j]].showFlag = '1' // this.columns[showIndexArray[j]].showFlag = '1'
this.columns[hideIndexArray[j]].show = false this.columns[hideIndexArray[j]].show = false
if (this.columns[hideIndexArray[j]].required) { // if (this.columns[hideIndexArray[j]].required) { //
@ -654,13 +654,13 @@ export default {
}, },
// //
setDiyParams (key, index) { setDiyParams (key, index) {
var diyName = this.columns[index].diyParams.name const diyName = this.columns[index].diyParams.name
var diyValue = this.model[this.columns[index].diyParams.value] const diyValue = this.model[this.columns[index].diyParams.value]
if (diyValue === '' || diyValue === null) { if (diyValue === '' || diyValue === null) {
return {} return {}
} }
var paramsStr = '{"' + diyName + '":"' + diyValue + '"}' const paramsStr = '{"' + diyName + '":"' + diyValue + '"}'
var params = JSON.parse(paramsStr) const params = JSON.parse(paramsStr)
// alert(JSON.stringify(params)) // alert(JSON.stringify(params))
return params return params
} }

4
epmet-oper-web/src/views/components/CTableNoPage.vue

@ -112,7 +112,6 @@ export default {
} }
}, },
props: { props: {
keyword: { keyword: {
type: String, type: String,
required: true required: true
@ -178,6 +177,7 @@ export default {
this.loadData() this.loadData()
}, },
loadData () { loadData () {
this.templateRadio = ''
this.loading = true this.loading = true
Object.keys(this.params).forEach(key => { Object.keys(this.params).forEach(key => {
if (this.params[key] instanceof Array) { if (this.params[key] instanceof Array) {
@ -191,7 +191,7 @@ export default {
this.table.params, this.table.params,
(data, rspMsg) => { (data, rspMsg) => {
if (data) { if (data) {
this.tableData = data.list this.tableData = data
} }
this.loading = false this.loading = false
}, },

117
epmet-oper-web/src/views/modules/code/CommitForm.vue

@ -10,22 +10,24 @@
:option-data="optionData"></c-form> :option-data="optionData"></c-form>
<el-form :inline="true" <el-form :inline="true"
:model="dataForm"> :model="extJson"
<el-form-item label="版本功能说明" :style="{margin:'0 auto',width:'100%',textAlign:'left'}">
prop="versionDesc" <el-form-item label="小程序配置"
label-width="150px" prop="json"
label-width="100px"
style="display:block"> style="display:block">
<el-input type="textarea" <el-input type="textarea"
:autosize="{ minRows: 2, maxRows: 4}" :autosize="{ minRows:5, maxRows: 8}"
:rows="3" :rows="6"
resize="none" resize="none"
style="width:300px" style="width:300px"
placeholder='请输入版本功能说明' placeholder='请输入小程序配置'
v-model="dataForm.versionDesc"> v-model="extJson.json">
</el-input> </el-input>
<el-button type="text" <el-button type="primary"
style="margin-left:10px"
size="small" size="small"
@click="submitCode(scope.row.id)">移除</el-button> @click="getExtJson">获取配置</el-button>
</el-form-item> </el-form-item>
@ -39,7 +41,7 @@
:params="tableParams" :params="tableParams"
keyword="Temp" keyword="Temp"
:operations="operations" :operations="operations"
@selTemp="selTemp"> @selectRadioRow="selectRadioRow">
</c-table> </c-table>
</div> </div>
@ -48,6 +50,7 @@
</template> </template>
<script> <script>
/* eslint-disable */
import CTable from '@c/CTableNoPage' import CTable from '@c/CTableNoPage'
import CForm from '@c/CForm' import CForm from '@c/CForm'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
@ -55,8 +58,8 @@ export default {
data () { data () {
return { return {
tempForm: { tempForm: {
// commitUrl:'/third/code/audit', commitUrl: '/third/code/upload',
commitUrl: 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/code/audit', // commitUrl: 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/code/audit',
method: 'A', method: 'A',
dataUrl: [], // //url dataUrl: [], // //url
data: { data: {
@ -72,10 +75,13 @@ export default {
] ]
} }
}, },
extJson: {
json: ''
},
// //
// tableUrl: '/third/code/templatelist', selTempId: '',
tableUrl: 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/code/templatelist', tableUrl: '/third/code/templatelist',
// tableUrl: 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/code/templatelist',
tableParams: { tableParams: {
type: Object, // table type: Object, // table
default () { default () {
@ -84,15 +90,6 @@ export default {
}, },
// //
operations: [ operations: [
// {
// lable: '', //
// size: 'mini',
// style: 'margin: 0 6px;',
// type: 'text',
// slot: '',
// plain: false,
// methodName: 'selTemp' //
// }
], ],
// //
dialog: { dialog: {
@ -105,15 +102,6 @@ export default {
CTable, CForm CTable, CForm
}, },
mounted () { mounted () {
let dataForm = {
customerId: '',
clientType: 'resi'
}
this.$nextTick(() => {
this.$refs['ref_form_temp'].assign(dataForm)
})
this.loadData()
}, },
computed: { computed: {
tableHeight () { tableHeight () {
@ -130,23 +118,78 @@ export default {
} }
}, },
methods: { methods: {
// eslint-disable-next-line
initData (dataForm) {
console.log(this.optionData);
if (!dataForm) {
dataForm = {
customerId: '',
clientType: 'resi'
}
}
console.log(dataForm)
this.$nextTick(() => {
this.$refs['ref_form_temp'].assign(dataForm)
this.loadData()
})
},
// //
loadData () { loadData () {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.table.loadData() // this.$refs.table.loadData() //
}) })
}, },
// //
selTemp () { getExtJson () {
const _data = this.$refs['ref_form_temp'].model
if (_data.customerId === '') {
this.$message.warning('请选择客户')
return false
}
const url = '/third/code/getextjson'
const param = {
customerId: _data.customerId,
clientType: _data.clientType
}
window.app.ajax.post(url, param,
(data, rspMsg) => {
this.extJson.json = data
// this.$message.success('')
// eslint-disable-next-line
},
(rspMsg, data) => {
this.$message.error(rspMsg)
})
},
selectRadioRow (row) {
this.selTempId = row.id
},
resetData () {
this.selTempId = ''
this.extJson.json = ''
this.$refs['ref_form_temp'].resetForm()
},
commitCode () {
this.$refs['ref_form_temp'].validate((valid) => { this.$refs['ref_form_temp'].validate((valid) => {
if (valid) { if (valid) {
if (this.extJson.json === '') {
this.$message.warning('请获取配置')
return
}
if (this.selTempId === '') {
this.$message.warning('请选择模板')
return
}
// //
let _data = this.$refs['ref_form_temp'].model let _data = this.$refs['ref_form_temp'].model
_data.extJson = this.extJson.json
_data.templateId = this.selTempId
console.log(_data) console.log(_data)
window.app.ajax.post(this.tempForm.commitUrl, _data, window.app.ajax.post(this.tempForm.commitUrl, _data,
(data, rspMsg) => { (data, rspMsg) => {
this.$message.success('提交审核成功') this.$message.success('上传成功')
this.$emit('commitConfirm') this.$emit('commitConfirm')
}, },
(rspMsg, data) => { (rspMsg, data) => {

168
epmet-oper-web/src/views/modules/code/CommitList.vue

@ -10,10 +10,10 @@
<el-form-item> <el-form-item>
<el-select v-model="tableParams.customerId" <el-select v-model="tableParams.customerId"
placeholder="客户"> placeholder="客户">
<el-option v-for="item in form.data['client']" <el-option v-for="item in form.data['customerId']"
:key="item.customerId" :key="item.value"
:label="item.customerName" :label="item.label"
:value="item.customerId"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -63,7 +63,7 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" <el-button type="primary"
@click="commitCode()">上传代码</el-button> @click="commitCodeDiaShow('')">上传代码</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -84,25 +84,26 @@
- -
</div> </div>
</el-card> </el-card>
<c-dialog :title="commitDia.title" <c-dialog :title="'上传代码'"
:visible="commitDia.visible" :visible="commitDia.visible"
:showConfirm="false" @ok="commitCode"
@cancel="commitDiaCancel"> @cancel="commitDiaCancel">
<commit-form ref="ref_commit_form" <commit-form ref="ref_commit_form"
:optionData="optionData" :optionData="optionData"
@commitConfirm="commitConfirm"></commit-form> @commitConfirm="commitConfirm"></commit-form>
</c-dialog> </c-dialog>
<c-dialog :title="submitDia.title" <c-dialog :title="'提交审核'"
:visible="submitDia.visible" :visible="submitDia.visible"
:dialogHeight="1.1" :dialogHeight="1.1"
@cancel="submitDiaCancel"> @cancel="submitDiaCancel">
<submit-form ref="ref_submit_form" <submit-form ref="ref_submit_form"
:codeId="selCodeId"
:feedbackShow="feedbackShow"></submit-form> :feedbackShow="feedbackShow"></submit-form>
</c-dialog> </c-dialog>
<c-dialog :showFooter="false" <c-dialog :showFooter="false"
:title="operDia.title" :title="'操作历史'"
:visible="operDia.visible" :visible="operDia.visible"
@cancel="operDiaCancel"> @cancel="operDiaCancel">
<oper-history ref="ref_oper_history"></oper-history> <oper-history ref="ref_oper_history"></oper-history>
@ -110,9 +111,14 @@
<c-dialog :showFooter="false" <c-dialog :showFooter="false"
:title="'二维码'" :title="'二维码'"
:visible="operDia.visible" :width="40"
@cancel="operDiaCancel"> :visible="qrCodeDia.visible"
<oper-history ref="ref_oper_history"></oper-history> @cancel="qrCodeDiaCancel">
<div style="text-align:center">
<el-image style="width: 300px; height: 300px"
:src="src"></el-image>
<div class="el-upload__tip">请用微信扫描二维码</div>
</div>
</c-dialog> </c-dialog>
</div> </div>
</template> </template>
@ -128,6 +134,7 @@ export default {
data () { data () {
return { return {
loading: false, loading: false,
selCodeId: '', // id
// //
tableParams: { tableParams: {
customerId: '', // customerId: '', //
@ -137,8 +144,8 @@ export default {
submitDate: '' // submitDate: '' //
}, },
// //
// tableUrl: '/third/code/uploadlist', tableUrl: '/third/code/uploadlist',
tableUrl: 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/code/uploadlist', // tableUrl: 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/code/uploadlist',
// //
operations: [ operations: [
{ {
@ -239,21 +246,23 @@ export default {
], ],
// //
commitDia: { commitDia: {
title: '',
visible: false visible: false
}, },
optionData: Object, optionData: Object,
// //
feedbackShow: false, feedbackShow: false,
submitDia: { submitDia: {
title: '',
visible: false visible: false
}, },
// //
operDia: { operDia: {
title: '',
visible: false visible: false
}, },
//
qrCodeDia: {
visible: false
},
src: '',
// //
form: { form: {
dataUrl: [], // //url dataUrl: [], // //url
@ -310,26 +319,17 @@ export default {
CDialog, SubmitForm, CommitForm, OperHistory, CTable CDialog, SubmitForm, CommitForm, OperHistory, CTable
}, },
activated () { activated () {
let params = this.$route.params
//
if (params.showCommit) {
this.commitCodeDiaShow(params.customerId)
}
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.table.doLayout() // this.$refs.table.doLayout() //
}) })
}, },
mounted () { mounted () {
let params = this.$route.params
//
if (params.showCommit) {
this.commitDia.title = '上传代码'
this.commitDia.visible = true
let dataForm = {
clientType: '工作端',
client: params.name
}
this.$nextTick(() => {
this.$refs['ref_commit_form'].initData(dataForm)
})
}
this.renderSelData() this.renderSelData()
this.loadData() this.loadData()
}, },
@ -346,24 +346,33 @@ export default {
this.$refs.table.loadData() // this.$refs.table.loadData() //
}) })
}, },
// //
commitCode (id) { commitCodeDiaShow (customerId) {
this.form.data['customerId'] = this.form.data['client'] // this.form.data['customerId'] = this.form.data['client']
this.optionData = this.form.data this.optionData = this.form.data
this.commitDia.title = '上传代码'
this.commitDia.visible = true this.commitDia.visible = true
this.$nextTick(() => {
let dataForm = {
clientType: 'resi',
customerId: customerId
}
this.$refs['ref_commit_form'].initData(dataForm)
})
},
//
async commitCode () {
//
await this.$refs['ref_commit_form'].commitCode()
}, },
// //
submitCode (row) { submitCode (row) {
this.selCodeId = row.id
// if (row.status === 'audit_failed') { // if (row.status === 'audit_failed') {
this.feedbackShow = true this.feedbackShow = true
// } // }
this.submitDia.title = '提交审核'
this.submitDia.visible = true this.submitDia.visible = true
}, },
submitDiaCancel () { submitDiaCancel () {
this.submitDia.title = ''
this.submitDia.visible = false this.submitDia.visible = false
}, },
// //
@ -371,8 +380,23 @@ export default {
}, },
// //
showQRCode (id) { showQRCode (row) {
this.qrCodeDia.visible = true
const url = '/third/code/qrcode'
const param = {
codeId: row.id
}
window.app.ajax.exportFilePost(url, param,
(data, rspMsg) => {
if (data) {
// eslint-disable-next-line
// debugger
this.src = window.URL.createObjectURL(data.qrcode)
}
},
(rspMsg, data) => {
this.$message.error(rspMsg)
}, { headers: { 'Content-Type': 'image/jpeg' } })
}, },
// //
issueCode (id) { issueCode (id) {
@ -384,7 +408,6 @@ export default {
}, },
// //
operHistory (id) { operHistory (id) {
this.operDia.title = '操作历史'
this.operDia.visible = true this.operDia.visible = true
}, },
// //
@ -393,37 +416,50 @@ export default {
this.loadData() this.loadData()
}, },
commitDiaCancel () { commitDiaCancel () {
this.commitDia.title = '' this.$refs['ref_commit_form'].resetData()
this.commitDia.visible = false this.commitDia.visible = false
}, },
operDiaCancel () { operDiaCancel () {
this.operDia.title = ''
this.operDia.visible = false this.operDia.visible = false
}, },
renderSelData () { // // qrCodeDiaCancel () {
this.form.dataUrl = [] this.qrCodeDia.visible = false
this.form.dataUrl.push({ // },
key: 'client', // bean.jskey async renderSelData () { // //
url: '/oper/crm/customer/getvalidcustomerlist', const customerUrl = '/third/pacustomer/registerbyauth'
params: {} // const customerUrl = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/pacustomer/registerbyauth'
}) const param = {
window.app.ajax.all( // initState: 1,
this.form.dataUrl, resiAuth: 1,
data => { workAuth: 1
data.forEach((oneData, index) => { // }
var key = this.form.dataUrl[index].key
this.form.data[key] = oneData
})
this.form.data['client'].forEach((oneData, index) => { // await window.app.ajax.post(customerUrl, param,
oneData.value = oneData.customerId (data, rspMsg) => {
oneData.label = oneData.customerName if (data) {
}) let customerList = []
this.$forceUpdate()
}
)
}
data.forEach(element => {
let oneObj = {
value: element.customerId,
label: element.customerName
}
customerList.push(oneObj)
})
this.form.data.customerId = customerList
this.$forceUpdate()
}
},
(rspMsg, data) => {
this.$message.error(rspMsg)
})
}
} }
} }
</script> </script>
<style>
.el-upload__tip {
color: rgb(155, 155, 155);
}
</style>

95
epmet-oper-web/src/views/modules/code/SubmitForm.vue

@ -165,9 +165,9 @@
align="center" align="center"
width="80"> width="80">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" <!-- <el-button type="text"
size="small" size="small"
@click="submitCode(scope.row.id)">移除</el-button> @click="submitCode(scope.row.id)">移除</el-button> -->
</template> </template>
</el-table-column> </el-table-column>
@ -192,6 +192,7 @@ export default {
data () { data () {
return { return {
loading: false, loading: false,
// codeId: '', // codeId
dataForm: { dataForm: {
versionDesc: '', // versionDesc: '', //
previewInfo: { // previewInfo: { //
@ -271,13 +272,11 @@ export default {
}, },
// //
uploadVedio: function (params) { uploadVedio: function (params) {
// eslint-disable-next-line
debugger
let self = this let self = this
let file = params.file let file = params.file
let fileType = file.type let fileType = file.type
let isVideo = fileType.indexOf('video') !== -1 let isVideo = fileType.indexOf('video') !== -1
let fileUrl = self.$refs.upload.uploadFiles[0].url // let fileUrl = self.$refs.upload.uploadFiles[0].url
let isLt2M = file.size / 1024 / 1024 < 2 let isLt2M = file.size / 1024 / 1024 < 2
if (!isLt2M) { if (!isLt2M) {
@ -306,25 +305,24 @@ export default {
self.$refs.upload.uploadFiles = [] self.$refs.upload.uploadFiles = []
return return
} }
let videoDiv = document.createElement('video') self.upload_name = 'file_video[]'
videoDiv.src = fileUrl self.uploadFile(file, fileType)
// let videoDiv = document.createElement('video')
// videoDiv.src = fileUrl
videoDiv.onloadeddata = function (event) { // videoDiv.onloadeddata = function (event) {
// // //
self.upload_url = '你的视频上传URL' // self.upload_name = 'file_video[]'
self.upload_name = 'file_video[]' // self.uploadFile(file, fileType, isVideo, videoDiv)
self.uploadFile(file, isVideo, videoDiv) // }
}
}, },
// //
uploadPic: function (params) { uploadPic: function (params) {
// eslint-disable-next-line console.log(this.codeId)
debugger
let self = this let self = this
let file = params.file let file = params.file
let fileType = file.type let fileType = file.type
let isImage = fileType.indexOf('image') !== -1 let isImage = fileType.indexOf('image') !== -1
let fileUrl = self.$refs.upload.uploadFiles[0].url
let isLt2M = file.size / 1024 / 1024 < 2 let isLt2M = file.size / 1024 / 1024 < 2
if (!isLt2M) { if (!isLt2M) {
@ -343,43 +341,26 @@ export default {
self.$refs.upload.uploadFiles = [] self.$refs.upload.uploadFiles = []
return return
} }
self.upload_name = 'file_img[]'
let img = new Image() self.uploadFile(file, fileType)
img.src = fileUrl
img.onload = function () {
//
self.upload_url = '你的图片上传URL'
self.upload_name = 'file_img[]'
self.uploadFile(file, '', '')
}
}, },
uploadFile: function (file, isVideo, videoDiv) { uploadFile: function (file, fileType) {
let self = this // const uploadUrl = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/code/mediaupload'
const uploadUrl = '/third/code/mediaupload'
let formData = new FormData() let formData = new FormData()
formData.append(self.upload_name, file) // // eslint-disable-next-line
// debugger
// axios.post(self.upload_url, formData, { headers: { 'Content-Type': 'multipart/form-data' } }) formData.append('type', fileType)
// .then(function (res) { formData.append('media', file)
// if (res.result === '0000') { formData.append('codeId', this.codeId)
// self.ad_url = res.data[0] window.app.ajax.post(uploadUrl, formData,
// // video (data, rspMsg) => {
// if (isVideo) { this.$message.success(rspMsg)
// let liItem = document.getElementsByClassName('el-upload-list__item')[0] this.beforeClose()
// videoDiv.style.width = '278px' },
// videoDiv.style.height = '415px' (rspMsg, data) => {
// liItem.prepend(videoDiv) this.$message.error(rspMsg)
// } }, { headers: { 'Content-Type': 'multipart/form-data' } })
// return
// }
// this.$message({
// message: '',
// type: 'error'
// })
// self.$refs.upload.uploadFiles = []
// })
// .catch(function (err) {
// console.error(err)
// })
}, },
// //
commitCode (id) { commitCode (id) {
@ -390,24 +371,20 @@ export default {
submitCode (id) { submitCode (id) {
}, },
//
submitRecall (id) {
},
//
submitFailReason (id) {
},
handleCancel () { handleCancel () {
this.dialog.title = '' this.dialog.title = ''
this.dialog.visible = false this.dialog.visible = false
} }
}, },
props: { props: {
feedbackShow: { feedbackShow: {
type: Boolean, type: Boolean,
default: false default: false
},
codeId: {
type: String,
required: true
} }
} }
} }

34
epmet-oper-web/src/views/modules/customer-manage/RegisterList.vue

@ -18,14 +18,15 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<c-table column-type="index" <c-table column-type=""
ref="table" ref="table"
:url="tableUrl" :url="tableUrl"
:params="tableParams" :params="tableParams"
keyword="RegisterInfo" keyword="RegisterInfo"
:operations="operations" :operations="operations"
:tableHeight="tableHeight" :tableHeight="tableHeight"
@commitCode="commitCode"> @commitCode="commitCode"
@init="init">
</c-table> </c-table>
</div> </div>
@ -64,7 +65,7 @@ export default {
plain: false, plain: false,
methodName: 'init', // methodName: 'init', //
isShow: function (row) { isShow: function (row) {
if (row.initState === 0) { if (row.initState === 0 && row.resiAuth === 1 && row.workAuth === 1) {
return true return true
} else { } else {
return false return false
@ -80,7 +81,7 @@ export default {
plain: false, plain: false,
methodName: 'commitCode', // methodName: 'commitCode', //
isShow: function (row) { isShow: function (row) {
if (row.resiAuth === 1 && row.workAuth === 1) { if (row.initState === 1) {
return true return true
} else { } else {
return false return false
@ -137,8 +138,10 @@ export default {
resi: '未授权', resi: '未授权',
work: '已授权' work: '已授权'
} }
] ],
//
initUrl: '/oper/crm/customer/init'
} }
}, },
components: { components: {
@ -164,17 +167,28 @@ export default {
this.$refs.table.loadData() this.$refs.table.loadData()
}, },
// //
init (id) { init (row) {
const param = {
customerId: row.customerId
}
window.app.ajax.post(this.initUrl, param,
(data, rspMsg) => {
this.$message.success('初始化成功')
this.loadData()
// eslint-disable-next-line
},
(rspMsg, data) => {
this.$message.error(rspMsg)
})
}, },
// //
commitCode (id) { commitCode (row) {
this.$router.push({ this.$router.push({
'name': 'code-CommitList', 'name': 'code-CommitList',
'params': { 'params': {
showCommit: true, showCommit: true,
id: '1', customerId: row.customerId,
name: '市北区政府' name: row.agencyName
} }
}) })
} }

Loading…
Cancel
Save