按检查区域生成二维码 有选区域就单独生成, 否则生成全部
This commit is contained in:
parent
de280514b7
commit
8b56fdc24e
@ -8,31 +8,28 @@
|
|||||||
<view style="position: absolute;left: -10px;color: #3d4b70;top: -3px;">*</view>
|
<view style="position: absolute;left: -10px;color: #3d4b70;top: -3px;">*</view>
|
||||||
</view>
|
</view>
|
||||||
<view style="font-size: 15px; font-weight: bold;color: #3d4b70;margin-bottom: 10px;">参数信息</view>
|
<view style="font-size: 15px; font-weight: bold;color: #3d4b70;margin-bottom: 10px;">参数信息</view>
|
||||||
|
<u-form-item label="生成方式" prop="DEPARTMENT_NAME" borderBottom ref="item1">
|
||||||
<!-- <u-form-item label="生成类型" prop="typeEnumValue" borderBottom>
|
<u-radio-group v-model="model.createType" placement="row" @change="groupChange">
|
||||||
<u-radio-group v-model="model.typeEnumValue" inputAlign="right" placement="row">
|
<u-radio :customStyle="{marginLeft: '8px'}" v-for="(item, index) in listRadioType"
|
||||||
<u-radio style="margin-left: 20px;" v-for="item in model.typeEnum" :name="item.value"
|
:key="index" :label="item.name" :name="item.value">
|
||||||
:key="item.value" :label="item.name">
|
|
||||||
</u-radio>
|
</u-radio>
|
||||||
</u-radio-group>
|
</u-radio-group>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item v-if="model.typeEnumValue" label="生成类型" prop="downEnumValue" borderBottom>
|
<u-form-item v-if="model.createType==null||model.createType==20" label="班组名称" prop="DEPARTMENT_NAME"
|
||||||
<u-radio-group v-model="model.downEnumValue" inputAlign="right" placement="row">
|
borderBottom ref="item1" @click="handleShowSheet({title: '班组名称',name:'DEPARTMENT_NAME'})">
|
||||||
<u-radio style="margin-left: 20px;" v-for="item in model.downEnum" :name="item.value"
|
<u--input disabled v-model="model.DEPARTMENT_NAME" border="none" suffixIcon="arrow-right"
|
||||||
:key="item.value" :label="item.name">
|
|
||||||
</u-radio>
|
|
||||||
</u-radio-group>
|
|
||||||
</u-form-item> -->
|
|
||||||
|
|
||||||
<u-form-item label="班组名称" prop="DEPARTMENT_NAME" borderBottom ref="item1"
|
|
||||||
@click="handleShowSheet({title: '班组名称',name:'DEPARTMENT_NAME'})">
|
|
||||||
<u--input v-model="model.DEPARTMENT_NAME" border="none" suffixIcon="arrow-right"
|
|
||||||
customStyle="margin:0px;display:flex;padding:3px 9px"
|
customStyle="margin:0px;display:flex;padding:3px 9px"
|
||||||
suffixIconStyle="font-size:12px"></u--input>
|
suffixIconStyle="font-size:12px"></u--input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="岗位名称" prop="POST_NAME" borderBottom ref="item1"
|
<u-form-item v-else label="区域名称" prop="AREA_NAME" borderBottom ref="item1"
|
||||||
@click="handleShowSheet({title: '岗位名称',name:'POST_NAME'})">
|
@click="handleShowSheet({title: '区域名称',name:'AREA_NAME'})">
|
||||||
<u--input v-model="model.POST_NAME" border="none" suffixIcon="arrow-right"
|
<u--input disabled v-model="model.AREA_NAME" border="none" suffixIcon="arrow-right"
|
||||||
|
customStyle="margin:0px;display:flex;padding:3px 9px"
|
||||||
|
suffixIconStyle="font-size:12px"></u--input>
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item label="岗位名称" v-if="model.createType==null||model.createType==20" prop="POST_NAME"
|
||||||
|
borderBottom ref="item1" @click="handleShowSheet({title: '岗位名称',name:'POST_NAME'})">
|
||||||
|
<u--input disabled v-model="model.POST_NAME" border="none" suffixIcon="arrow-right"
|
||||||
customStyle="margin:0px;display:flex;padding:3px 9px"
|
customStyle="margin:0px;display:flex;padding:3px 9px"
|
||||||
suffixIconStyle="font-size:12px"></u--input>
|
suffixIconStyle="font-size:12px"></u--input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
@ -41,6 +38,9 @@
|
|||||||
border="none" fontSize="14px"
|
border="none" fontSize="14px"
|
||||||
customStyle="margin:0px;display:flex;padding:3px 9px"></u--input>
|
customStyle="margin:0px;display:flex;padding:3px 9px"></u--input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
<u-form-item label="说明" prop="url" borderBottom v-if="model.discrib.length>2" ref="item1">
|
||||||
|
<u--input v-model="model.discrib" disabled border="none" disabledColor="#ffffff"></u--input>
|
||||||
|
</u-form-item>
|
||||||
|
|
||||||
<u-form-item style="margin-bottom: 30px;">
|
<u-form-item style="margin-bottom: 30px;">
|
||||||
<u-list key="qb">
|
<u-list key="qb">
|
||||||
@ -54,7 +54,7 @@
|
|||||||
</u-form-item>
|
</u-form-item>
|
||||||
</u-form>
|
</u-form>
|
||||||
<view style="display: flex;flex-direction: row;" class="bottom-button">
|
<view style="display: flex;flex-direction: row;" class="bottom-button">
|
||||||
<u-button type="primary" @click="generateQRCode" color="#3d4b70"
|
<u-button type="primary" @click="generateQRCode()" color="#3d4b70"
|
||||||
style="margin-left: 5px;">生成</u-button>
|
style="margin-left: 5px;">生成</u-button>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@ -76,49 +76,37 @@
|
|||||||
import {
|
import {
|
||||||
DepartmentOrderPaged,
|
DepartmentOrderPaged,
|
||||||
UserPostOrderPaged,
|
UserPostOrderPaged,
|
||||||
DepartmentPostEntities
|
DepartmentPostEntities,
|
||||||
|
AreaEntities
|
||||||
} from '../../services/common'
|
} from '../../services/common'
|
||||||
import {
|
import {
|
||||||
initFilter,
|
initFilter,
|
||||||
extendRule
|
extendRule
|
||||||
} from '../../utils/common'
|
} from '../../utils/common'
|
||||||
|
|
||||||
import config from '../../config/common'
|
import config from '../../config/common'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
qrCodeSrc: '',
|
qrCodeSrc: '',
|
||||||
OrgId: '',
|
OrgId: '',
|
||||||
sourceUrl: config.uni_app_web_source_url,
|
|
||||||
model: {
|
model: {
|
||||||
|
discrib: '',
|
||||||
|
createType: null,
|
||||||
OrgId: '',
|
OrgId: '',
|
||||||
DEPARTMENT_ID: '',
|
DEPARTMENT_ID: '',
|
||||||
POST_ID: '',
|
POST_ID: '',
|
||||||
Nav_Post: {},
|
Nav_Post: {},
|
||||||
Nav_Department: {},
|
Nav_Department: {},
|
||||||
Url:config.uni_app_web_local_api_url,
|
AREA_NAME: '',
|
||||||
|
AREA_ID: '',
|
||||||
|
Nav_Area: {},
|
||||||
|
Url: config.uni_app_web_api_url,
|
||||||
listQrCode: [{
|
listQrCode: [{
|
||||||
TITLE: '',
|
TITLE: '',
|
||||||
qrCode: ''
|
qrCode: ''
|
||||||
}]
|
}]
|
||||||
|
|
||||||
// typeEnum: [{
|
|
||||||
// value: true,
|
|
||||||
// name: '组织'
|
|
||||||
// }, {
|
|
||||||
// value: false,
|
|
||||||
// name: '岗位'
|
|
||||||
// }],
|
|
||||||
// downEnum: [{
|
|
||||||
// value: true,
|
|
||||||
// name: '向下包含'
|
|
||||||
// }, {
|
|
||||||
// value: false,
|
|
||||||
// name: '当前组织'
|
|
||||||
// }],
|
|
||||||
// typeEnumValue: true,
|
|
||||||
// downEnumValue: true,
|
|
||||||
},
|
},
|
||||||
selectorInfo: {
|
selectorInfo: {
|
||||||
showPopup: false,
|
showPopup: false,
|
||||||
@ -132,6 +120,14 @@
|
|||||||
name: '',
|
name: '',
|
||||||
defaultChecked: []
|
defaultChecked: []
|
||||||
},
|
},
|
||||||
|
|
||||||
|
listRadioType: [{
|
||||||
|
name: '区域',
|
||||||
|
value: 10
|
||||||
|
}, {
|
||||||
|
name: '岗位',
|
||||||
|
value: 20
|
||||||
|
}]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
@ -144,7 +140,54 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async generateQRCode() {
|
async generateQRCode() {
|
||||||
try {
|
if (this.model.createType == null)
|
||||||
|
return false
|
||||||
|
var url = this.model.Url + '?OrgId=' + this.OrgId + '&createType=' + this.model.createType
|
||||||
|
this.model.discrib = ''
|
||||||
|
if (this.model.createType == 10) {
|
||||||
|
//区域 如果没有选择区域 全部生成
|
||||||
|
//如果有选择区域 生成单个
|
||||||
|
if (this.model.AREA_ID && this.model.AREA_ID.length > 2) {
|
||||||
|
url += '&AREA_ID=' + this.model.AREA_ID
|
||||||
|
const qrCodeData = await QRCode.toDataURL(url);
|
||||||
|
this.model.listQrCode = []
|
||||||
|
this.model.listQrCode.push({
|
||||||
|
TITle: '区域:' + this.model.Nav_Area.NAME,
|
||||||
|
qrCode: qrCodeData
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
//获取所有区域 逐个生成
|
||||||
|
const json = initFilter(this.OrgId, null, "NAME", 0, 1);
|
||||||
|
json.IgnoreDataRule = true
|
||||||
|
json.Limit = 10000
|
||||||
|
extendRule(json, "STATUS", 1, 0)
|
||||||
|
json.Keyword = this.model.AREA_ID
|
||||||
|
var listResult = await AreaEntities(json).then(res => {
|
||||||
|
// this.selectorInfo.totalCount = res.TotalCount
|
||||||
|
if (res != undefined && res.Data.length > 0) {
|
||||||
|
return res.Data
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '未获取到区域!',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (listResult && listResult.length > 0) {
|
||||||
|
this.model.listQrCode = []
|
||||||
|
this.model.discrib = '区域共计:' + listResult.length + '个'
|
||||||
|
for (let i = 0; i < listResult.length; i++) {
|
||||||
|
var qrCodeData = await QRCode.toDataURL(url + "&AREA_ID=" + listResult[i].ID);
|
||||||
|
this.model.listQrCode.push({
|
||||||
|
TITle: '区域:' + listResult[i].NAME,
|
||||||
|
qrCode: qrCodeData
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (this.model.createType == 20) {
|
||||||
|
//岗位
|
||||||
if (!this.model.DEPARTMENT_ID || this.model.DEPARTMENT_ID.length < 2) {
|
if (!this.model.DEPARTMENT_ID || this.model.DEPARTMENT_ID.length < 2) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请选择班组!',
|
title: '请选择班组!',
|
||||||
@ -152,13 +195,12 @@
|
|||||||
})
|
})
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
var url = this.model.Url + '?OrgId=' + this.OrgId
|
|
||||||
if (this.model.POST_ID && this.model.POST_ID.length > 2) {
|
if (this.model.POST_ID && this.model.POST_ID.length > 2) {
|
||||||
url += '&DEPARTMENT_ID=' + this.model.DEPARTMENT_ID + "&POST_ID=" + this.model.POST_ID
|
url += '&DEPARTMENT_ID=' + this.model.DEPARTMENT_ID + "&POST_ID=" + this.model.POST_ID
|
||||||
const qrCodeData = await QRCode.toDataURL(url);
|
const qrCodeData = await QRCode.toDataURL(url);
|
||||||
this.model.listQrCode = []
|
this.model.listQrCode = []
|
||||||
this.model.listQrCode.push({
|
this.model.listQrCode.push({
|
||||||
TITle: this.model.Nav_Department.NAME + ':' + this.model.Nav_Post.NAME,
|
TITle: '岗位:' + this.model.Nav_Department.NAME + ':' + this.model.Nav_Post.NAME,
|
||||||
qrCode: qrCodeData
|
qrCode: qrCodeData
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
@ -180,6 +222,7 @@
|
|||||||
|
|
||||||
if (listResult && listResult.length > 0) {
|
if (listResult && listResult.length > 0) {
|
||||||
this.model.listQrCode = []
|
this.model.listQrCode = []
|
||||||
|
this.model.discrib = '区域共计:' + listResult.length + '个'
|
||||||
for (let i = 0; i < listResult.length; i++) {
|
for (let i = 0; i < listResult.length; i++) {
|
||||||
var qrCodeData = await QRCode.toDataURL(url + '&DEPARTMENT_ID=' +
|
var qrCodeData = await QRCode.toDataURL(url + '&DEPARTMENT_ID=' +
|
||||||
this.model.DEPARTMENT_ID + "&POST_ID=" + listResult[i].ID);
|
this.model.DEPARTMENT_ID + "&POST_ID=" + listResult[i].ID);
|
||||||
@ -190,11 +233,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
|
||||||
console.error('生成二维码失败:', error);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
closePicker() {
|
closePicker() {
|
||||||
this.comPickerInfo = {
|
this.comPickerInfo = {
|
||||||
showSheet: false,
|
showSheet: false,
|
||||||
@ -204,7 +244,20 @@
|
|||||||
formIndex: undefined
|
formIndex: undefined
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
groupChange(rv) {
|
||||||
|
this.model.createType = rv
|
||||||
|
|
||||||
|
this.model.Nav_Post = {}
|
||||||
|
this.model.Nav_Department = {}
|
||||||
|
this.model.Nav_Area = {}
|
||||||
|
this.model.discrib = ''
|
||||||
|
this.model.DEPARTMENT_NAME = ''
|
||||||
|
this.model.AREA_NAME = ''
|
||||||
|
this.model.POST_NAME = ''
|
||||||
|
this.model.DEPARTMENT_ID = ''
|
||||||
|
this.model.POST_ID = ''
|
||||||
|
this.model.AREA_ID = ''
|
||||||
|
},
|
||||||
//显示组件
|
//显示组件
|
||||||
handleChange() {
|
handleChange() {
|
||||||
this.selectorInfo.showPopup = true
|
this.selectorInfo.showPopup = true
|
||||||
@ -270,6 +323,18 @@
|
|||||||
}
|
}
|
||||||
return res.Data
|
return res.Data
|
||||||
})
|
})
|
||||||
|
} else if (p.name == 'AREA_NAME') {
|
||||||
|
extendRule(json, "STATUS", 1, 0)
|
||||||
|
dataSelect = await AreaEntities(json).then(res => {
|
||||||
|
this.selectorInfo.totalCount = res.TotalCount
|
||||||
|
if (res != undefined && res.Data.length > 0) {
|
||||||
|
for (let i = 0; i < res.Data.length; i++) {
|
||||||
|
res.Data[i].name = res.Data[i].NAME
|
||||||
|
res.Data[i].code = res.Data[i].CODE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return res.Data
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -298,6 +363,11 @@
|
|||||||
this.model.POST_NAME = e.NAME
|
this.model.POST_NAME = e.NAME
|
||||||
this.model.POST_ID = e.ID
|
this.model.POST_ID = e.ID
|
||||||
this.model.Nav_Post = e
|
this.model.Nav_Post = e
|
||||||
|
} else if (this.selectorInfo.name == 'AREA_NAME') {
|
||||||
|
this.model.AREA_NAME = e.NAME
|
||||||
|
this.model.AREA_ID = e.ID
|
||||||
|
this.model.Nav_Area = e
|
||||||
|
this.model.listQrCode = []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,4 +26,13 @@ export const DepartmentPostEntities = (params) => {
|
|||||||
method: 'post',
|
method: 'post',
|
||||||
data: params,
|
data: params,
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
//区域信息
|
||||||
|
export const AreaEntities = (params) => {
|
||||||
|
params.isAll=true
|
||||||
|
return request.send({
|
||||||
|
url: '/BI/H5Controller/AreaEntities',
|
||||||
|
method: 'post',
|
||||||
|
data: params,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user