| | |
| | | <script> |
| | | import { |
| | | showModal, |
| | | showToast, |
| | | } from "@/js/Page.js" |
| | | export default { |
| | | globalData: { |
| | | largeMode: false, |
| | |
| | | bindClasses: false, |
| | | classes: "" |
| | | }, |
| | | data() { |
| | | //获取全局参数:url-服务器地址 |
| | | return { |
| | | |
| | | } |
| | | }, |
| | | onLaunch: function() { |
| | | console.log('App Launch'); |
| | | this.deviceInfo = uni.getSystemInfoSync(); |
| | | this.initscan(); |
| | | }, |
| | | onUnload() { |
| | | |
| | | // // 汉德霍尔 PDA rfid扫码页面卸载时释放资源 |
| | | // const rfidModule = uni.requireNativePlugin('HandheldRFID'); |
| | | // rfidModule.closeModule(); |
| | | }, |
| | | onShow: function() { |
| | | // const args = plus.runtime.arguments || "" |
| | | // if(args) |
| | | // { |
| | | // uni.showModal({ |
| | | // title: "App参数", |
| | | // content: args, |
| | | // showCancel: false, |
| | | // confirmText:"cancel" |
| | | // }); |
| | | // } |
| | | |
| | | console.log('App Show') |
| | | }, |
| | | onHide: function() { |
| | |
| | | methods: { |
| | | initscan() { |
| | | let that = this; |
| | | var main = plus.android.runtimeMainActivity(), //获取activity |
| | | IntentFilter = plus.android.importClass('android.content.IntentFilter'), //引入过滤器 |
| | | console.log("deviceInfo", this.deviceInfo) |
| | | if (this.deviceInfo?.brand.includes('alps')) { // 汉德霍尔设备特征 |
| | | |
| | | // const rfidModule = uni.requireNativePlugin('HandheldRFID'); |
| | | // console.log("rfidModule",rfidModule) |
| | | // rfidModule.initModule((res) => { |
| | | // console.log("rfid initModule", res) |
| | | // }) |
| | | } else { |
| | | var main = plus.android.runtimeMainActivity() //获取activity |
| | | var IntentFilter = plus.android.importClass('android.content.IntentFilter') //引入过滤器 |
| | | // Intent = plus.android.importClass('android.content.Intent'), |
| | | filter = new IntentFilter(), |
| | | receiver = plus.android.implements('io.dcloud.feature.internal.reflect.BroadcastReceiver', { |
| | | var filter = new IntentFilter() |
| | | var receiver = plus.android.implements('io.dcloud.feature.internal.reflect.BroadcastReceiver', { |
| | | onReceive: function(context, intent) { //实现onReceiver回调函数 |
| | | //console.log('onReceive',intent); |
| | | plus.android.importClass(intent); |
| | |
| | | decodesource, |
| | | decodedata: decodedata || data, |
| | | decodelabeltype, |
| | | |
| | | }; |
| | | console.log('onReceive', scanResult); |
| | | uni.$emit("scanresult", scanResult); |
| | | } |
| | | }); |
| | | |
| | | filter.addAction("com.pda.formobox"); //监听扫码广播 |
| | | filter.addAction('com.rfid.scan') // |
| | | main.registerReceiver(receiver, filter); //注册监听 |
| | | filter.addAction("com.pda.formobox"); //监听扫码广播 |
| | | filter.addAction('com.rfid.scan') // |
| | | main.registerReceiver(receiver, filter); //注册监听 |
| | | } |
| | | }, |
| | | onScan(callback) { |
| | | console.log('onScan'); |
| | | uni.$off("scanresult"); |
| | | uni.$on("scanresult", (result) => { |
| | | callback(result); |
| | | }); |
| | | } |
| | | if (this.deviceInfo?.brand.includes('alps')) { // 汉德霍尔设备特征 |
| | | // const rfidModule = uni.requireNativePlugin('HandheldRFID'); |
| | | // rfidModule.startScan((res) => { |
| | | // if (res.code) { |
| | | // console.log(res) |
| | | // let data = res.data || "" |
| | | // if (Array.isArray(data)) { |
| | | // data = data.map((a) => a.epc).join(",") |
| | | // } |
| | | // var scanResult = { |
| | | // decodesource: "epc", |
| | | // decodedata: data, |
| | | // decodelabeltype: "", |
| | | // }; |
| | | // console.log(scanResult) |
| | | // callback(scanResult); |
| | | // } else { |
| | | // console.log("rfid startScan", res) |
| | | // } |
| | | // }) |
| | | } else { |
| | | uni.$off("scanresult"); |
| | | uni.$on("scanresult", (result) => { |
| | | callback(result); |
| | | }); |
| | | } |
| | | |
| | | }, |
| | | |
| | | } |
| | | } |
| | | </script> |
| | |
| | | |
| | | .uni-data-tree { |
| | | font-size: 24px !important; |
| | | |
| | | .input-value { |
| | | height: 45px !important; |
| | | font-size: 24px !important; |
| | | } |
| | | |
| | | .placeholder { |
| | | font-size: 24px !important; |
| | | font-size: 24px !important; |
| | | } |
| | | } |
| | | |
| | | .segmented-control__text { |
| | | font-size: 24px !important; |
| | | height: 45px; |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | </style> |
| | |
| | | } from '@/js/Base64.js'; |
| | | import utils from "@/js/utils.js" |
| | | |
| | | |
| | | /** |
| | | * api/wms/basisver/Get?sessionid=SESSION_ID |
| | | * 数据模型版本 |
| | | * @returns |
| | | */ |
| | | export const basisver_get = () => { |
| | | const app = getApp() |
| | | var url = app.globalData.mobox3ApiUrl.data + 'api/wms/basisver/Get?sessionid=' + app.globalData.sessionId |
| | | return http.request({ |
| | | method: "GET", |
| | | header: {}, |
| | | url, |
| | | }) |
| | | } |
| | | |
| | | |
| | | /** |
| | | * api/class/attr/GetList |
| | | * 得到数据类属性列表 |
| | | * @param |
| | | {class_id, //数据类id |
| | | class_name, //数据类名称 根据id或名称都可 |
| | | {class_id, //数据类id |
| | | class_name, //数据类名称 根据id或名称都可 |
| | | group_name} //分组名称,如果未指定,则返回所有分组属性 |
| | | * @returns |
| | | */ |
| | |
| | | return; |
| | | } |
| | | var styleStr = JSON.stringify($this.detail1_styledef); |
| | | var detailStyle = JSON.parse(styleStr); |
| | | if (detailStyle.form) { |
| | | data.content.forEach(cont => { |
| | | detailStyle = JSON.parse(styleStr); |
| | | data.content.forEach(cont => { |
| | | let detailStyle = JSON.parse(styleStr); |
| | | if (detailStyle.form) { |
| | | |
| | | |
| | | detailStyle.SelBut_Checked = data.checkbox ?? true; |
| | | |
| | | detailStyle.form.objId = cont.id; |
| | |
| | | } else { |
| | | $this.detail1StyleDefList.push(detailStyle); //待分拣 |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | }, |
| | | |
| | |
| | | } |
| | | var styleStr = JSON.stringify($this.detail1_styledef); |
| | | var detailStyle = JSON.parse(styleStr); |
| | | if (detailStyle.form) { |
| | | data.content.forEach(cont => { |
| | | detailStyle = JSON.parse(styleStr); |
| | | |
| | | data.content.forEach(cont => { |
| | | var detailStyle = JSON.parse(styleStr); |
| | | if (detailStyle.form) { |
| | | detailStyle.SelBut_Checked = data.checkbox ?? true; |
| | | |
| | | detailStyle.form.objId = cont.id; |
| | |
| | | } else { |
| | | $this.detail1StyleDefList.push(detailStyle); //待分拣 |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | |
| | | }, |
| | | //点中表单 |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | largeMode: getApp().globalData.largeMode || false, |
| | | largeMode: getApp().globalData.largeMode || false, |
| | | title: this.translateSys('add2'), |
| | | param: {}, |
| | | styledef: {}, |
| | |
| | | return; |
| | | } |
| | | let styleStr = JSON.stringify(this.detail1_styledef); //已码盘 |
| | | let detailStyle = JSON.parse(styleStr); |
| | | |
| | | list.forEach((cont) => { |
| | | let attrs = []; |
| | | let detailStyle = JSON.parse(styleStr); |
| | | Object.keys(cont).forEach((a) => { |
| | | attrs.push({ |
| | | attr: a, |
| | |
| | | async runCustomEvent(dataInfo) { |
| | | try { |
| | | var $this = this; |
| | | |
| | | |
| | | runCustomEvent(dataInfo).then(result => { |
| | | console.log(result); |
| | | |
| | |
| | | }) |
| | | }, |
| | | onButtonClicked(btn) { |
| | | |
| | | |
| | | let enviroment = { |
| | | button: "top", |
| | | button_name: btn.ShowName, |
| | |
| | | } else { |
| | | this.$Message.warning(this.$t("sys.unrealized")); |
| | | } |
| | | |
| | | |
| | | }, |
| | | async onTriggerEvent(btn, enviroment) { |
| | | let data_json = []; |
| | | let jsonlist = []; |
| | | |
| | | |
| | | let detailStyleList = this.detail1StyleDefList; |
| | | detailStyleList.forEach((style) => { |
| | | let detail_attr = {}; |
| | |
| | | </div> |
| | | <div class="dv-panel-button"> |
| | | <checkbox v-if="param.Sub_Page[1].Select_Button==true" :value="ii" |
| | | :checked="style.SelBut_Checked" /> |
| | | :checked="style.SelBut_Checked" /> |
| | | <!-- <text></text> --> |
| | | |
| | | <!-- <button type="primary" @click="savaDataObj(style,ii)" v-if="param.Sub_Page[1].OK_Button==true">保存</Button> --> |
| | |
| | | <script> |
| | | import { |
| | | Base64 |
| | | } from '@/js/Base64.js'; |
| | | } from '@/js/Base64.js'; |
| | | import { |
| | | appGetInfo, |
| | | dictGetInfo |
| | | } from "@/api/mobox.js" |
| | | import { |
| | | basisver_get, |
| | | getUIStyleInfo, |
| | | runCustomEvent, |
| | | dataObjCreate, |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | largeMode: getApp().globalData.largeMode || false, |
| | | largeMode: getApp().globalData.largeMode || false, |
| | | title: this.translateSys("coding_disk"), |
| | | ClsID: 'CG_Detail', |
| | | param: {}, |
| | |
| | | }); |
| | | }); |
| | | }, |
| | | async getBasisVer() { |
| | | try { |
| | | const res = await basisver_get(); |
| | | const basisver = (res.ver || "").toLowerCase(); |
| | | return basisver; |
| | | } catch (ex) { |
| | | return ""; |
| | | } |
| | | }, |
| | | async loadData(paramValue) { |
| | | let clsDetailId = "CG_Detail"; |
| | | const basisver = await this.getBasisVer(); |
| | | if (basisver >= "v16.5") { |
| | | clsDetailId = "INV_Detail"; |
| | | } |
| | | this.ClsID = clsDetailId; |
| | | //获取数据类的自定义表单参数 |
| | | await this.Head_UIStyleGetInfo(this.ClsID, this.param.Input_UI_Style.ID); |
| | | //传入参数值 |
| | |
| | | } |
| | | console.log($this.head_styledef); |
| | | if (data.result) { |
| | | $this.setFormValues( data.result) |
| | | } |
| | | $this.setFormValues(data.result) |
| | | } |
| | | } |
| | | |
| | | }).catch(ex => { |
| | |
| | | attr: a, |
| | | value: obj_attr[a] || "", |
| | | })); |
| | | |
| | | |
| | | var extinfo = enviroment; |
| | | extinfo.edit_dlg = { |
| | | type: 'small', //小窗口 |
| | |
| | | return; |
| | | } |
| | | var styleStr = JSON.stringify(pageData.StyleDef); |
| | | var detailStyle = JSON.parse(styleStr); |
| | | if (detailStyle.form) { |
| | | data.content.forEach(cont => { |
| | | detailStyle = JSON.parse(styleStr); |
| | | |
| | | data.content.forEach(cont => { |
| | | var detailStyle = JSON.parse(styleStr); |
| | | if (detailStyle.form) { |
| | | detailStyle.SelBut_Checked = data.checkbox ?? true; |
| | | |
| | | detailStyle.form.objId = cont.id; |
| | |
| | | } |
| | | // $this.setData({pageDetail:pageD}) |
| | | $this.$set(this.pageDetail, pageIndex, pageData) |
| | | } |
| | | }); |
| | | |
| | | }); |
| | | } |
| | | $this.$set(this.pageDetail, pageIndex, pageData) |
| | | }, |
| | | setFormValues(attrs) { |