| | |
| | | "name" : "智云LMES", |
| | | "appid" : "__UNI__B002F49", |
| | | "description" : "", |
| | | "versionName" : "2.0.66", |
| | | "versionCode" : 266, |
| | | "versionName" : "2.0.68", |
| | | "versionCode" : 268, |
| | | "transformPx" : false, |
| | | /* 5+App特有相关 */ |
| | | "app-plus" : { |
| | |
| | | { |
| | | "navigationBarTitleText" : "特批单" |
| | | } |
| | | }, |
| | | { |
| | | "path" : "pages/ZLGL/Kf_SellOutBill_CusBar/Kf_SellOutBill_CusBar_APP", |
| | | "style" : |
| | | { |
| | | "navigationBarTitleText" : "销售出库单(验证)" |
| | | } |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | <template> |
| | | <view> |
| | | <!-- 基本信息 --> |
| | | |
| | | <view class="tabs horizon_tabs" id="tabs"> |
| | | <view :class="tabs == 0 ? 'on':''" @tap="tabs = 0">选择源单</view> |
| | | <view :class="tabs == 1 ? 'on':''" @tap="tabs = 1">表头信息</view> |
| | | <view :class="tabs == 2 ? 'on':''" @tap="tabs = 2">物料信息</view> |
| | | <view :class="tabs == 3 ? 'on':''" @tap="tabs = 3">器具信息</view> |
| | | <view :class="tabs == 4 ? 'on':''" @tap="tabs = 4">条码信息</view> |
| | | <view :class="tabs == 5 ? 'on':''" @tap="tabs = 5">下架信息</view> |
| | | </view> |
| | | <!-- 选择源单 --> |
| | | <template v-if="tabs == 0"> |
| | | <view class="form" :style="{ |
| | | height: containerHeight + 'px', |
| | | overflow: 'auto' |
| | | }"> |
| | | </view> |
| | | </template> |
| | | |
| | | <!-- 表头信息 --> |
| | | <template v-if="tabs == 1"> |
| | | <view class="form" :style="{ |
| | | height: containerHeight + 'px', |
| | | overflow: 'auto' |
| | | }"> |
| | | </view> |
| | | </template> |
| | | |
| | | <!-- 物料信息 --> |
| | | <template v-if="tabs == 2"> |
| | | <view class="form" :style="{ |
| | | height: containerHeight + 'px', |
| | | overflow: 'auto' |
| | | }"> |
| | | |
| | | </view> |
| | | </template> |
| | | |
| | | <!-- 器具信息 --> |
| | | <template v-if="tabs == 3"> |
| | | <view class="form" :style="{ |
| | | height: containerHeight + 'px', |
| | | overflow: 'auto' |
| | | }"> |
| | | </view> |
| | | </template> |
| | | |
| | | <!-- 条码信息 --> |
| | | <template v-if="tabs == 4"> |
| | | <view class="form" :style="{ |
| | | height: containerHeight + 'px', |
| | | overflow: 'auto' |
| | | }"> |
| | | </view> |
| | | </template> |
| | | |
| | | <!-- 下架信息 --> |
| | | <template v-if="tabs == 5"> |
| | | <view class="form" :style="{ |
| | | height: containerHeight + 'px', |
| | | overflow: 'auto' |
| | | }"> |
| | | </view> |
| | | </template> |
| | | <!-- 操作按钮 --> |
| | | <view class="buttons" id="buttons"> |
| | | <button class="btn-a" size="mini" @tap="submit">提交</button> |
| | | <view style="flex: 1;"></view> |
| | | <button class="btn-a" v-if="operationType!=4" size="mini" @tap="addNew">新增</button> |
| | | <button class="btn-c" size="mini" @tap="goBack">退出</button> |
| | | </view> |
| | | |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import dayjs from "dayjs"; |
| | | import { |
| | | CommonUtils |
| | | } from "@/utils/common"; |
| | | import { |
| | | MpaasScan |
| | | } from "@/utils/mpaasScan.js" |
| | | import { |
| | | getUserInfo |
| | | } from "../../../utils/auth"; |
| | | |
| | | export default { |
| | | // 销售出库单(验证) |
| | | name: 'Kf_SellOutBill_CusBar_APP', |
| | | data() { |
| | | return { |
| | | tabs: 0, |
| | | |
| | | btnTop: 0, |
| | | tabsBottom: 0, |
| | | HModName: "Sb_EqpMaintenanceBill", |
| | | HBillType: '3910', |
| | | operationType: 1, |
| | | uploadOptions: {}, |
| | | enableEdit: true, |
| | | enableSourceBillEdit: true, |
| | | |
| | | // 源单类型相关 |
| | | HMainSourceBillType: "设备维修登记单", // 用于显示的源单类型 |
| | | arrayHMainSourceBillType: ['设备维修登记单', '手工录入', '设备维修派工单'], |
| | | arrayHMainSourceBillTypeID: ['设备维修登记单', '手工录入', '设备维修派工单'], // 对应的单据类型ID |
| | | showHMainSourceBillType: true, |
| | | |
| | | HDeptList: [], |
| | | HRepairCheckList: [], |
| | | HEmpList: [], |
| | | HRepairList: [], |
| | | |
| | | hform: { |
| | | HBillType: '3910', |
| | | HStockOrgID: uni.getStorageSync("OrganizationID"), |
| | | HBarCode: "", |
| | | HBarCode: '', |
| | | HRepairBeginDate: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"), |
| | | HRepairEndDate: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"), |
| | | HRepairContent: '', |
| | | HBillNo: '', |
| | | HInterID: 0, |
| | | HDate: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"), |
| | | HDeptName: getUserInfo().HDeptName, |
| | | HDeptID: getUserInfo().HDeptID, |
| | | HEmpName: getUserInfo().HEmpName, |
| | | HEmpID: getUserInfo().HEmpID, |
| | | HRepair: '', |
| | | HRepairID: 0, |
| | | HExplanation: '', |
| | | HMainSourceBillType: '设备维修登记单', // 默认为设备维修登记单 |
| | | HMainSourceBillNo: '', |
| | | HMainSourceInterID: 0, |
| | | HMainSourceEntryID: 0, |
| | | HManagerName: getUserInfo().HManagerName, |
| | | HManagerID: getUserInfo().HManagerID, |
| | | HTimes: 0, |
| | | HCycleUnit: '小时', |
| | | HBarName: '', |
| | | HNumber: '', |
| | | HEquipID: 0, |
| | | HBarSpec: '', |
| | | HBarModel: '', |
| | | HMaker: getUserInfo()["Czymc"], |
| | | HChecker: '', |
| | | HCloseMan: '', |
| | | HUpDater: '', |
| | | HMakeDate: dayjs(new Date()).format("YYYY-MM-DD"), |
| | | HCheckDate: '', |
| | | HCloseDate: '', |
| | | HUpDateDate: '', |
| | | HDeleteMan: '', |
| | | HDeleteDate: '' |
| | | }, |
| | | HDetailList: [{ |
| | | "HRepairID": 0, |
| | | "HRepairCode": "", |
| | | "HRepairName": "", |
| | | "HManagerID": 0, |
| | | "HManagerCode": "", |
| | | "HManagerName": "", |
| | | "HRepairExplanation": '', |
| | | "HRemark": "", |
| | | "HEmpID": '', |
| | | "HSourceInterID": 0, |
| | | "HSourceEntryID": 0, |
| | | "HSourceBillNo": '' |
| | | }] |
| | | }; |
| | | }, |
| | | computed: { |
| | | containerHeight: { |
| | | get() { |
| | | return this.btnTop - this.tabsBottom - 5 |
| | | } |
| | | }, |
| | | }, |
| | | methods: { |
| | | // 显示源单单据列表弹窗 |
| | | showBillList() { |
| | | this.$refs.billList.showPopup() |
| | | }, |
| | | |
| | | // 选择源单类型 |
| | | HMainSourceBillTypeChange(e) { |
| | | if (e.detail.value == -1 || e.detail.value == NaN) { |
| | | this.HMainSourceBillType = '手工录入' |
| | | this.hform.HMainSourceBillType = '手工录入' |
| | | return |
| | | } |
| | | |
| | | this.HMainSourceBillType = this.arrayHMainSourceBillType[e.detail.value] |
| | | this.hform.HMainSourceBillType = this.arrayHMainSourceBillTypeID[e.detail.value] |
| | | |
| | | // 缓存当前页面选择 |
| | | const pages = getCurrentPages() |
| | | const currentPage = pages[pages.length - 1] |
| | | uni.setStorageSync(`${currentPage.route.split("/").pop()}_HSourceBillTypeCache`, { |
| | | HSourceBillTypeName: this.HMainSourceBillType, |
| | | HSourceBillType: this.hform.HMainSourceBillType |
| | | }) |
| | | }, |
| | | |
| | | // 读取缓存 |
| | | loadCache() { |
| | | const pages = getCurrentPages() |
| | | const currentPage = pages[pages.length - 1] |
| | | let HBillTypeCache = uni.getStorageSync(`${currentPage.route.split("/").pop()}_HSourceBillTypeCache`) |
| | | if (HBillTypeCache) { |
| | | this.HMainSourceBillType = HBillTypeCache.HSourceBillTypeName |
| | | this.hform.HMainSourceBillType = HBillTypeCache.HSourceBillType |
| | | } |
| | | }, |
| | | |
| | | // 维修项目 |
| | | async getRepairList() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: '/Gy_Repair/GetRepairList', |
| | | data: { |
| | | sWhere: '', |
| | | user: getUserInfo()["Czymc"] |
| | | } |
| | | }) |
| | | |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | this.HRepairList = data |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: `获取维修项目失败: ${Message}` |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: `获取维修项目失败: ${err}` |
| | | }) |
| | | } |
| | | }, |
| | | // 删除明细 |
| | | delDetail(item) { |
| | | |
| | | }, |
| | | // 提交数据有效性校验 |
| | | ValidCheck() { |
| | | if (this.hform.HEquipID == 0) { |
| | | return { |
| | | Message: "未录入设备信息,请先录入设备信息!", |
| | | state: false |
| | | } |
| | | } |
| | | if (this.hform.HDeptID == 0) { |
| | | return { |
| | | Message: "部门不得为空!", |
| | | state: false |
| | | } |
| | | } |
| | | if (this.hform.HEmpID == 0) { |
| | | return { |
| | | Message: "验收人不得为空!", |
| | | state: false |
| | | } |
| | | } |
| | | if (this.hform.HRepairCheckMainID == 0) { |
| | | return { |
| | | Message: "维修项目不得为空!", |
| | | state: false |
| | | } |
| | | } |
| | | if (this.hform.HManagerID == 0) { |
| | | return { |
| | | Message: "负责人不得为空!", |
| | | state: false |
| | | } |
| | | } |
| | | if (this.hform.HMainSourceBillType !== '手工录入') { |
| | | if (!this.hform.HMainSourceBillNo || this.hform.HMainSourceBillNo.trim() === '') { |
| | | CommonUtils.showTips({ |
| | | message: '源单类型非手工录入,必须选择源单!' |
| | | }) |
| | | return |
| | | } |
| | | } |
| | | return { |
| | | Message: "", |
| | | state: true |
| | | } |
| | | }, |
| | | addNew() { |
| | | uni.redirectTo({ |
| | | url: './Sb_EquipRepairSendWorkBill?operationType=1' |
| | | }) |
| | | }, |
| | | goBack() { |
| | | uni.navigateBack() |
| | | }, |
| | | checkBoxChangeHandler(index, e) { |
| | | let cr = e.detail.value |
| | | if (cr.length == 0) { |
| | | this.HCheckFileList[index]["HDotCheckResult"] = false |
| | | } else { |
| | | this.HCheckFileList[index]["HDotCheckResult"] = true |
| | | } |
| | | }, |
| | | uploadFile(index) { |
| | | console.log('filePath: ', this.attachmentInfo[index].filePath); |
| | | // 通过临时路径读取文件 |
| | | uni.uploadFile({ |
| | | url: CommonUtils.getServerUrl() + "/Sb_EquipDotCheckBill/UploadFile", |
| | | filePath: this.attachmentInfo[index].filePath, |
| | | name: 'file', |
| | | formData: { |
| | | HBillNo: this.hform.HBillNo, |
| | | HRemark: "", |
| | | HUserName: getUserInfo()["Czymc"] |
| | | }, |
| | | success: (uploadRes) => { |
| | | CommonUtils.showTips({ |
| | | message: "上传成功" |
| | | }) |
| | | this.attachmentInfo[index].status = "上传成功" |
| | | }, |
| | | fail: (err) => { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: `上传失败: ${err}` |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | delFile(index) { |
| | | console.log('attachmentInfo: ', this.attachmentInfo[index]); |
| | | uni.showModal({ |
| | | title: '提示', |
| | | content: '确认要删除 " ' + this.attachmentInfo[index].fileName + ' " 删除后将不可恢复!', |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | this.attachmentInfo.splice(index, 1) |
| | | } |
| | | }, |
| | | }) |
| | | |
| | | }, |
| | | handleUploadCallback(res) { // 文件上传回调 |
| | | console.log('file: ', res); |
| | | let fileInfo = res.data[0] |
| | | this.attachmentInfo.push({ |
| | | fileName: fileInfo.name, |
| | | size: fileInfo.size, |
| | | status: '等待上传', |
| | | filePath: fileInfo.tempFilePath |
| | | }) |
| | | }, |
| | | // 上传文件 |
| | | fileUpload() { |
| | | this.$refs.XeUpload.upload('file', {}); |
| | | }, |
| | | //获取班次数据 |
| | | async getShiftList() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: '/Web/GetGy_ShiftsList_Json', |
| | | data: { |
| | | Shifts: "", |
| | | } |
| | | }) |
| | | |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | this.HShiftsList = data |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: Message |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: err |
| | | }) |
| | | } |
| | | }, |
| | | //获取使用部门数据 |
| | | async getHDeptList() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: '/Gy_Department/list', |
| | | data: { |
| | | sWhere: ` and HUSEORGID = ${uni.getStorageSync('OrganizationID')} `, |
| | | user: uni.getStorageSync('HUserName'), |
| | | Organization: uni.getStorageSync('Organization') |
| | | } |
| | | }) |
| | | |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | this.HDeptList = data |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: Message |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: err |
| | | }) |
| | | } |
| | | }, |
| | | // 获取职员数据 |
| | | async getEmpList() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: '/PublicPageMethod/UserList', |
| | | data: { |
| | | sWhere: " where 1=1", |
| | | } |
| | | }) |
| | | |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | this.HEmpList = data |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: Message |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: err |
| | | }) |
| | | } |
| | | }, |
| | | // 获取验证项目数据 |
| | | async getCheckProjList() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: '/Gy_RepairCheck/GetRepairCheckList', |
| | | data: { |
| | | sWhere: "", |
| | | user: uni.getStorageSync('HUserName'), |
| | | } |
| | | }) |
| | | |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | this.HRepairCheckList = data |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: Message |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: err |
| | | }) |
| | | } |
| | | }, |
| | | toScanCode() { |
| | | MpaasScan.scanCode(cb => { |
| | | this.hform.HBarCode = cb |
| | | this.GetMessageByBarCode(cb) |
| | | }) |
| | | }, |
| | | toScanHMainSourceBillNo() { |
| | | MpaasScan.scanCode(cb => { |
| | | this.hfrom.HMainSourceBillNo = cb |
| | | this.GetMessageByHMainSourceBillNo(cb) |
| | | }) |
| | | }, |
| | | async GetMessageByHMainSourceBillNo(HSouceBillNo) { |
| | | try { |
| | | // 根据源单类型选择不同的接口 |
| | | if (this.hform.HMainSourceBillType === '设备维修登记单') { |
| | | url = "/Sb_EqpRepairWorkBill/GetEqpConkBookBillListPage"; |
| | | dataField = { |
| | | sWhere: ` and 单据号 = '${HSouceBillNo}'`, |
| | | user: getUserInfo()["Czymc"], |
| | | page: 1, |
| | | size: 1, |
| | | }; |
| | | } else if (this.hform.HMainSourceBillType === '设备维修派工单') { |
| | | url = "/Sb_EquipRepairSendWorkBill/GetEquipRepairSendWorkBillListPage"; |
| | | dataField = { |
| | | sWhere: ` and 单据号 = '${HSouceBillNo}'`, |
| | | user: getUserInfo()["Czymc"], |
| | | page: 1, |
| | | size: 1, |
| | | }; |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: `暂不支持该源单类型:${this.hform.HMainSourceBillType}` |
| | | }) |
| | | return; |
| | | } |
| | | |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: url, |
| | | data: dataField |
| | | }) |
| | | |
| | | let { count, Message, data } = res.data |
| | | if (count == 1) { |
| | | this.hform.HMainSourceBillNo = data[0]["单据号"] |
| | | this.hform.HMainSourceInterID = data[0]["hmainid"] |
| | | this.hform.HMainSourceEntryID = data[0]["hsubid"] |
| | | |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: `获取源单单号失败: ${Message}` |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: `获取源单单号失败: ${err}` |
| | | }) |
| | | } |
| | | }, |
| | | async GetMessageByBarCode(HBarCode) { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Sync({ |
| | | url: "/Sb_PDA_EquipDotCheckBill/txtHBarCode_KeyDown_List", |
| | | data: { |
| | | HBarCode: HBarCode, |
| | | }, |
| | | }) |
| | | |
| | | |
| | | if (!res) { |
| | | return |
| | | } |
| | | |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | |
| | | if (count == 1) { |
| | | console.log('data: ', data); |
| | | this.hform.HEquipID = data[0].hmainid |
| | | this.hform.HBarName = data[0].设备名称 |
| | | this.hform.HBarSpec = data[0].设备规格 |
| | | this.hform.HBarModel = data[0].设备型号 |
| | | this.hform.HQty = 1 |
| | | |
| | | this.enableEdit = false |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: Message |
| | | }) |
| | | } |
| | | |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: err |
| | | }) |
| | | } |
| | | }, |
| | | radioChange({ |
| | | detail: { |
| | | value |
| | | } |
| | | }) { |
| | | this.hform.HCheckResult = value |
| | | }, |
| | | async getMaxNum() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: "/Web/GetMAXNum", |
| | | data: { |
| | | "HBillType": this.HBillType |
| | | } |
| | | }) |
| | | let { |
| | | count, |
| | | data, |
| | | Message |
| | | } = res.data |
| | | this.hform.HInterID = 0 |
| | | this.hform.HBillNo = data[0]["HBillNo"] |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: "获取单据信息异常: " + err |
| | | }) |
| | | } |
| | | }, |
| | | async submit() { |
| | | let valid = this.ValidCheck() |
| | | if (!valid.state) { |
| | | CommonUtils.showTips({ |
| | | message: valid.Message |
| | | }) |
| | | return |
| | | } |
| | | |
| | | try { |
| | | let oMain = JSON.stringify(this.hform); |
| | | this.HDetailList[0].HManagerID = this.hform.HManagerID |
| | | this.HDetailList[0].HRepairID = this.hform.HRepairID |
| | | this.HDetailList[0].HRepairExplanation = this.hform.HExplanation |
| | | this.HDetailList[0].HEmpID = this.hform.HEmpID |
| | | this.HDetailList[0].HSourceInterID = this.hform.HMainSourceInterID |
| | | this.HDetailList[0].HSourceEntryID = this.hform.HMainSourceEntryID |
| | | this.HDetailList[0].HSourceBillNo = this.hform.HMainSourceBillNo |
| | | |
| | | let sSubStr = JSON.stringify(this.HDetailList); |
| | | let sMainSub = oMain + ';' + sSubStr; |
| | | console.log('sMainSub: ',sMainSub); |
| | | let res = await CommonUtils.doRequest2Sync({ |
| | | url: "/Sb_PDA_EqpRepairWorkBill/SaveGetEqpRepairWorkBillList", |
| | | data: { |
| | | "msg": sMainSub |
| | | }, |
| | | method: "POST" |
| | | }) |
| | | |
| | | if (!res) { |
| | | return |
| | | } |
| | | |
| | | let { |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | if (this.operationType == 4) { |
| | | uni.showModal({ |
| | | title: '提示', |
| | | content: res.data.Message + '。即将返回上级页面', |
| | | showCancel: false, |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | console.log('用户点击确定'); |
| | | setTimeout(() => { |
| | | uni.navigateBack(); |
| | | }, 50) |
| | | // uni.redirectTo({ |
| | | // url: './Sb_EquipRepairSendWorkBill?operationType=1' |
| | | // }) |
| | | } else if (res.cancel) { |
| | | console.log('用户点击取消'); |
| | | setTimeout(() => { |
| | | uni.navigateBack(); |
| | | }, 50) |
| | | } |
| | | } |
| | | }); |
| | | return |
| | | } |
| | | uni.showModal({ |
| | | title: '提示', |
| | | content: res.data.Message + '。是否继续新增?(点击取消返回上级页面)', |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | console.log('用户点击确定'); |
| | | uni.redirectTo({ |
| | | url: './Sb_EquipRepairSendWorkBill?operationType=1' |
| | | }) |
| | | } else if (res.cancel) { |
| | | console.log('用户点击取消'); |
| | | setTimeout(() => { |
| | | uni.navigateBack(); |
| | | }, 50) |
| | | } |
| | | } |
| | | }); |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: "提交单据失败: " + Message |
| | | }) |
| | | } |
| | | |
| | | |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: "提交单据失败: " + err |
| | | }) |
| | | } |
| | | }, |
| | | async getEquipFileMain(HInterID) { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Sync({ |
| | | url: "/Sb_PDA_EquipDotCheckBill/txtHBarCode_KeyDown_ListByHEquipID", |
| | | data: { |
| | | HEquipID: HInterID, |
| | | }, |
| | | }) |
| | | |
| | | |
| | | if (!res) { |
| | | return |
| | | } |
| | | |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | |
| | | if (count == 1) { |
| | | console.log('data: ', data); |
| | | this.hform.HEquipID = data[0].hmainid |
| | | this.hform.HBarName = data[0].设备名称 |
| | | this.hform.HBarSpec = data[0].设备规格 |
| | | this.hform.HBarModel = data[0].设备型号 |
| | | this.hform.HQty = 1 |
| | | |
| | | this.enableEdit = false |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: Message |
| | | }) |
| | | } |
| | | |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: err |
| | | }) |
| | | } |
| | | }, |
| | | async getSourceBillInfo(HSourceBillType, HInterID, HBillNo) { |
| | | // 下推单据类型为设备故障登记单 |
| | | if(HSourceBillType == 3907) { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: "/Sb_EqpRepairWorkBill/Sb_EqpConkBookBillListCheckDetai", |
| | | data: { |
| | | HID: HInterID |
| | | } |
| | | }) |
| | | |
| | | let {data,code, count, Message} = res.data |
| | | |
| | | if(code == 1) { |
| | | console.log('data: ',data.h_v_Sb_EquipConkBookBillList_Edit); |
| | | let data1 = data.h_v_Sb_EquipConkBookBillList_Edit[0] |
| | | this.hform.HMainSourceBillType = HSourceBillType |
| | | this.HMainSourceBillType = '设备故障登记单' |
| | | this.hform.HMainSourceBillNo = data1.单据号 |
| | | this.hform.HMainSourceInterID = data1.hmainid |
| | | this.hform.HMainSourceEntryID = data1.hsubid |
| | | this.hform.HEquipID = data1.HEquipID |
| | | this.hform.HManagerName = data1.负责人 |
| | | this.hform.HManagerID = data1.HManagerID |
| | | this.hform.HBarName = data1.设备名称 |
| | | this.hform.HBarModel = data1.设备型号 |
| | | this.hform.HBarSpec = data1.设备规格 |
| | | } |
| | | else { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: `获取源单失败: ${Message}` |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | onLoad(e) { |
| | | console.log('e: ', e); |
| | | if (!e.operationType) { |
| | | this.operationType = 1 |
| | | } else { |
| | | this.operationType = e.operationType |
| | | } |
| | | |
| | | if (this.operationType == 1) { |
| | | // 新增 |
| | | this.getMaxNum() |
| | | } else if (this.operationType == 2) { |
| | | // 复制 |
| | | } else if (this.operationType == 3) { |
| | | // 编辑 |
| | | |
| | | } else if (this.operationType == 4) { |
| | | // 由报工平台打开 |
| | | let HEquipID = e.HEquipID |
| | | this.getMaxNum() |
| | | this.getEquipFileMain(HEquipID) |
| | | } else if(this.operationType == 5) { |
| | | let {HSourceBillType, HInterID, HBillNo} = e |
| | | // 下推 |
| | | this.getMaxNum() |
| | | this.getSourceBillInfo(HSourceBillType, HInterID, HBillNo) |
| | | } |
| | | |
| | | this.getHDeptList() |
| | | this.getEmpList() |
| | | this.getRepairList() |
| | | this.loadCache() |
| | | |
| | | // 监听单据选择完成事件 |
| | | uni.$on('BillSelectComplete', (e) => { |
| | | console.log("接收到的消息: ", e) |
| | | this.hform.HMainSourceInterID = e.HInterID |
| | | this.hform.HMainSourceBillNo = e.HBillNo |
| | | this.hform.HMainSourceEntryID = e.HEntryID |
| | | this.hform.HEquipID = e.HEquipID |
| | | this.hform.HBarName = e.HEquipName |
| | | this.hform.HBarSpec = e.HEquipSpec |
| | | this.hform.HBarModel = e.HEquipModel |
| | | this.$refs.billList.exit() |
| | | }) |
| | | }, |
| | | onUnload() { |
| | | uni.$off('BillSelectComplete') |
| | | }, |
| | | onReady() { |
| | | const query = uni.createSelectorQuery().in(this) |
| | | query.select("#buttons") |
| | | .boundingClientRect() |
| | | .select("#tabs") |
| | | .boundingClientRect() |
| | | .exec(res => { |
| | | this.btnTop = Math.floor(res[0].top) |
| | | this.tabsBottom = Math.ceil(res[1].bottom) |
| | | }) |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | @import "../style/MJBillStyle.scss"; |
| | | |
| | | .picker-overlay { |
| | | position: absolute; |
| | | top: 0; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | z-index: 1; |
| | | } |
| | | |
| | | .horizon_tabs { |
| | | width: 100%; |
| | | overflow-x: auto; |
| | | } |
| | | </style> |
| | |
| | | for (var i = 0; i < res.data.data.length; i++) { |
| | | this.arrayHWHName[i] = res.data.data[i].仓库名称 |
| | | } |
| | | this.HWHNameChange(getUserInfo()["HWhName"]) |
| | | } else { |
| | | uni.showToast({ |
| | | title: '仓库数据请求失败', |
| | |
| | | for (var i = 0; i < res.data.data.length; i++) { |
| | | this.arrayHWHName[i] = res.data.data[i].仓库名称 |
| | | } |
| | | this.HWHNameChange(getUserInfo()["HWhName"]) |
| | | } else { |
| | | uni.showToast({ |
| | | title: '仓库数据请求失败', |
| | |
| | | HTMQty_B: '', |
| | | HWHName_B: '', |
| | | HSPName_B: '', |
| | | |
| | | HSourceFlag: false, |
| | | } |
| | | } |
| | | }, |
| | |
| | | this.getHBaseList() |
| | | } |
| | | }, |
| | | // 调入仓库修改 |
| | | // 调入仓位修改 |
| | | HStockPlaceInNameChange(e) { |
| | | for (var i = 0; i < this.HStockPlaceNameList.length; i++) { |
| | | if (this.HStockPlaceNameList[i].仓位名称 == e) { |
| | | this.hform.HStockPlaceName = this.HStockPlaceNameList[i].仓位名称 |
| | | this.hform.HStockPlaceID = this.HStockPlaceNameList[i].HMainID |
| | | console.log('仓位e: ',e); |
| | | for (var i = 0; i < this.HStockPlaceInNameList.length; i++) { |
| | | if (this.HStockPlaceInNameList[i].仓位名称 == e) { |
| | | this.hform.HStockPlaceName = this.HStockPlaceInNameList[i].仓位名称 |
| | | this.hform.HStockPlaceID = this.HStockPlaceInNameList[i].HMainID |
| | | } |
| | | } |
| | | }, |
| | |
| | | } |
| | | }, |
| | | HOutStockPlaceNameChange(e) { |
| | | for (var i = 0; i < this.HStockPlaceInNameList.length; i++) { |
| | | if (this.HStockPlaceInNameList[i].仓位名称 == e) { |
| | | this.hform.HOutStockPlaceName = this.HStockPlaceInNameList[i].仓位名称 |
| | | this.hform.HOutStockPlaceID = this.HStockPlaceInNameList[i].HMainID |
| | | for (var i = 0; i < this.HStockPlaceNameList.length; i++) { |
| | | if (this.HStockPlaceNameList[i].仓位名称 == e) { |
| | | this.hform.HOutStockPlaceName = this.HStockPlaceNameList[i].仓位名称 |
| | | this.hform.HOutStockPlaceID = this.HStockPlaceNameList[i].HMainID |
| | | } |
| | | } |
| | | }, |
| | |
| | | }, |
| | | success: (res) => { |
| | | if (res.data.count == 1) { |
| | | this.hform.HSourceFlag = true |
| | | var data = res.data.data |
| | | console.log(2, data); |
| | | this.hform.HSupName = data.hSupNameField |
| | |
| | | var sHQty = this.hform.HQty |
| | | var sSourceBillNo = this.hform.HSourceBillNo |
| | | var sSourceBillType = this.hform.HMainSourceBillType |
| | | var HSourceFlag = this.hform.HSourceBillNo == '' ? false : true |
| | | var HSourceFlag = this.hform.HSourceFlag |
| | | console.log(this.hform.HSourceBillNo, HSourceFlag) |
| | | if (HDeleteFlag == "*") { |
| | | if (sBarCode == "") { |
| | |
| | | this.hform.HBarCode = '' |
| | | if (res.data.count == 1) { |
| | | CommonUtils.playSound(1) |
| | | this.hform.HSourceFlag = true |
| | | var data = res.data.data |
| | | if (data.hBarTypeField == '仓库条码') { |
| | | this.hform.HWHName = data.hWhNameField |
| | |
| | | this.hform.HSCSPName_B = data.BarCodeDetailslist[0].HSCSPName |
| | | } |
| | | } else { |
| | | this.Materlist = [] |
| | | uni.showToast({ |
| | | title: res.data.Message, |
| | | icon: 'none' |
| | |
| | | this.hform.HStockOutOrgName = this.arrayHOrgName[HStockOutOrgIndex] |
| | | } |
| | | this.tabs = 2 |
| | | this.hform.HSourceFlag = true |
| | | this.DisBillEntryList() |
| | | } else { |
| | | uni.showToast({ |
| | |
| | | }, |
| | | addNew() { |
| | | uni.redirectTo({ |
| | | url: '/pages/zhijiediaobo/MoveStockBill?OperationType=1' |
| | | url: '/pages/fenbushidiaochudan/form_out?OperationType=1' |
| | | }) |
| | | }, |
| | | async submit() { |
| | |
| | | <view v-if="tabs == 2"> |
| | | <view class="list" v-for="(item,index) in Materlist" :key="index"> |
| | | <uni-card :title="item.物料名称" :extra="item.物料代码" style="margin: 10px;" |
| | | @tap="showMaterialDetail(item)"> |
| | | @tap="delMater(item)"> |
| | | <view class="card-detail"> |
| | | <view class="detail"> |
| | | <text>源单单号:</text>{{item.源单单号}} |
| | |
| | | HSPName_B: '', |
| | | HSCWHName_B: '', |
| | | HSCSPName_B: '', |
| | | |
| | | HSourceFlag: false, |
| | | } |
| | | } |
| | | }, |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | //删除物料码 |
| | | delMater(item) { |
| | | uni.showModal({ |
| | | title: '提示', |
| | | content: '确认要删除 " ' + item.物料名称 + ' " 所有扫码记录?删除后将不可恢复!', |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | uni.request({ |
| | | url: this.serverUrl + |
| | | '/WEBSController/set_DelPonderationBillMain_Temp_InterIDAndSource_Json', |
| | | data: { |
| | | HInterID: this.hform.HInterID, |
| | | HMaterID: item.HMaterID, |
| | | HAuxPropID: item.HAuxPropID, |
| | | HMTONo: item.HMTONo, |
| | | HSourceInterID: item.HSourceInterID, |
| | | HSourceEntryID: item.HSourceEntryID, |
| | | HBillType: this.hform.HBillType |
| | | }, |
| | | success: (res) => { |
| | | if (res.data.count == 1) { |
| | | this.DisBillEntryList() |
| | | } else { |
| | | uni.showToast({ |
| | | title: res.data.Message, |
| | | icon: 'none' |
| | | }) |
| | | } |
| | | }, |
| | | fail: (res) => { |
| | | console.log(res); |
| | | uni.showToast({ |
| | | title: '接口请求失败', |
| | | icon: 'none' |
| | | }) |
| | | }, |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | // 用户模块权限判断 |
| | | async checkModRight() { |
| | | try { |
| | |
| | | if (!this.hform.HOutStockPlaceName) this.hform.HOutStockPlaceID = 0 |
| | | |
| | | const sHQty = this.hform.HQty || 0 |
| | | const HSourceFlag = !!this.hform.HSourceBillNo |
| | | const HSourceFlag = this.hform.HSourceFlag |
| | | |
| | | try { |
| | | console.log('开始处理条码:', sBarCode, sHQty, HSourceFlag, this.hform); |
| | |
| | | |
| | | // 设置源单信息 |
| | | async setSourceBillInfo(data) { |
| | | this.hform.HSourceFlag = true |
| | | return |
| | | if (data.hDeptIDField != 0) { |
| | | this.hform.HDeptID = data.hDeptIDField |
| | | this.hform.HDeptName = data.hDeptNameField |
| | |
| | | // 更新组织显示 |
| | | const inOrgIndex = this.arrayHOrgValue.findIndex(e => e == data.hStockInOrgIDField) |
| | | const outOrgIndex = this.arrayHOrgValue.findIndex(e => e == data.hStockOutOrgIDField) |
| | | |
| | | if (inOrgIndex !== -1) { |
| | | this.hform.HStockInOrgName = this.arrayHOrgName[inOrgIndex] |
| | | } |
| | | if (outOrgIndex !== -1) { |
| | | this.hform.HStockOutOrgName = this.arrayHOrgName[outOrgIndex] |
| | | } |
| | | |
| | | console.log('HStockInOrgName: ',this.hform.HStockInOrgName); |
| | | console.log('HStockOutOrgName: ',this.hform.HStockOutOrgName); |
| | | |
| | | // 如果组织发生变化,清空仓库仓位 |
| | | if (this.hform.HStockInOrgID != uni.getStorageSync('OrganizationID')) { |
| | |
| | | }) |
| | | |
| | | if (res.data.count == 1) { |
| | | this.hform.HSourceFlag = true |
| | | CommonUtils.playSound(1) |
| | | await this.setSourceBillInfo(res.data.data) |
| | | this.tabs = 2 |
| | |
| | | } |
| | | |
| | | this.tabs = 2 |
| | | this.hform.HSourceFlag = true |
| | | this.DisBillEntryList() |
| | | } |
| | | } |
| | |
| | | // 新增单据 |
| | | addNew() { |
| | | uni.redirectTo({ |
| | | url: '/pages/fenbushidiaoru/form?OperationType=1' |
| | | url: '/pages/fenbushidiaorudan/form_test?OperationType=1' |
| | | }) |
| | | }, |
| | | |
| | |
| | | border: 1px solid #acacac; |
| | | position: relative; |
| | | display: flex; |
| | | |
| | | .uni-combox { |
| | | width: 100%; |
| | | } |
| | | } |
| | | |
| | | .righton { |
| | |
| | | "杭州凯贝奈特": 'http://192.168.50.253:8080/API/', |
| | | "杭州凯贝奈特外网": 'http://erp.hzcabinet.cn:9090/API/', |
| | | "翁涛涛本地测试": 'http://localhost:81/API/', |
| | | "陈镐哲本地测试": 'http://192.168.0.121:81/API/', |
| | | "陈镐哲本地测试": 'http://192.168.0.102:81/API/', |
| | | "陈镐哲本地测试2": 'http://192.168.88.82:81/API/', |
| | | "张瑞广本地测试": 'http://localhost:8082/API/', |
| | | "余思杰本地测试": 'http://localhost:8082/LuBaoAPI/', |
| | |
| | | "id": 22, |
| | | "hidden": false |
| | | }, |
| | | // { |
| | | // "img": "../../static/icon/icon15.png", |
| | | // "text": "销售出库单验证", |
| | | // "url": "/pages/ZLGL/Kf_SellOutBill_CusBar/Kf_SellOutBill_CusBar_APP", |
| | | // "id": 23, |
| | | // "hidden": false |
| | | // }, |
| | | ] |
| | | } |
| | | }, |
| | |
| | | for (var i = 0; i < res.data.data.length; i++) { |
| | | this.arrayHWHName[i] = res.data.data[i].仓库名称 |
| | | } |
| | | this.HWHNameChange(getUserInfo()["HWhName"]) |
| | | } else { |
| | | uni.showToast({ |
| | | title: '仓库数据请求失败', |
| | |
| | | for (var i = 0; i < res.data.data.length; i++) { |
| | | this.arrayHWHName[i] = res.data.data[i].仓库名称 |
| | | } |
| | | |
| | | this.HWHNameChange(getUserInfo()['HWhName']) |
| | | } else { |
| | | uni.showToast({ |
| | | title: '仓库数据请求失败', |
| | |
| | | for (var i = 0; i < res.data.data.length; i++) { |
| | | this.arrayHWHName[i] = res.data.data[i].仓库名称 |
| | | } |
| | | this.HWHNameChange(getUserInfo()["HWhName"]) |
| | | } else { |
| | | uni.showToast({ |
| | | title: '仓库数据请求失败', |
| | |
| | | for (var i = 0; i < res.data.data.length; i++) { |
| | | this.arrayHWHName[i] = res.data.data[i].仓库名称 |
| | | } |
| | | this.HWHNameChange(getUserInfo()["HWhName"]) |
| | | } else { |
| | | uni.showToast({ |
| | | title: '仓库数据请求失败', |
| | |
| | | for (var i = 0; i < res.data.data.length; i++) { |
| | | this.arrayHWHName[i] = res.data.data[i].仓库名称 |
| | | } |
| | | this.HWHNameChange(getUserInfo()["HWhName"]) |
| | | } else { |
| | | uni.showToast({ |
| | | title: '仓库数据请求失败', |
| | |
| | | this.getHSupList() |
| | | this.getHEmpList() |
| | | this.getHDeptList() |
| | | |
| | | this.getRelationStore() |
| | | |
| | | await this.getRelationStore() |
| | | |
| | | uni.$on('BillSelectComplete', (e) => { |
| | | console.log("接收到的消息: ", e.HBillNo) |
| | | this.getHBarCodeData(e.HBillNo) |
| | |
| | | this.getHBaseList({ |
| | | sWhere: sWhere |
| | | }) |
| | | |
| | | |
| | | } else { |
| | | this.getHBaseList() |
| | | } |
| | |
| | | for (var i = 0; i < res.data.data.length; i++) { |
| | | this.arrayHWHName[i] = res.data.data[i].仓库名称 |
| | | } |
| | | // 本地有存储仓库 则更新为本地仓库的值 |
| | | if (getUserInfo()["HWhID"] != 0) { |
| | | this.HWHNameChange(getUserInfo()["HWhName"]) |
| | | } |
| | | } else { |
| | | uni.showToast({ |
| | | title: '仓库数据请求失败', |
| | |
| | | }, |
| | | //选择仓库 |
| | | HWHNameChange(e) { |
| | | console.log('e: ',e); |
| | | // var name = e.split("(") |
| | | for (var i = 0; i < this.HWHNameList.length; i++) { |
| | | if (this.HWHNameList[i].仓库名称 == e) { |
| | |
| | | for (var i = 0; i < res.data.data.length; i++) { |
| | | this.arrayHWHName[i] = res.data.data[i].仓库名称 |
| | | } |
| | | |
| | | this.HWHNameChange(getUserInfo()["HWhName"]) |
| | | // this.HStockPlaceNameChange(res.data.data[0].仓库名称) |
| | | } else { |
| | | uni.showToast({ |
| | |
| | | for (var i = 0; i < res.data.data.length; i++) { |
| | | this.arrayHWHName[i] = res.data.data[i].仓库名称 |
| | | } |
| | | |
| | | this.HWHNameChange(getUserInfo()["HWhName"]) |
| | | } else { |
| | | uni.showToast({ |
| | | title: '仓库数据请求失败', |
| | |
| | | for (var i = 0; i < res.data.data.length; i++) { |
| | | this.arrayHWHInName[i] = res.data.data[i].仓库名称 |
| | | } |
| | | |
| | | this.HWHInNameChange(getUserInfo()["HSCWHName"]) |
| | | } else { |
| | | uni.showToast({ |
| | | title: '仓库数据请求失败', |
| | |
| | | this.arrayHWHName[i] = res.data.data[i].仓库名称 |
| | | this.arrayHWHInName[i] = res.data.data[i].仓库名称 |
| | | } |
| | | // 调出仓库 |
| | | this.HSCWHNameChange(getUserInfo()["HWhName"]) |
| | | } else { |
| | | uni.showToast({ |
| | | title: '仓库数据请求失败', |