| | |
| | | <view> |
| | | <view class="form"> |
| | | <view class="form-item"> |
| | | <view class="title">条码:</view> |
| | | <!-- <view class="title">条码:</view> --> |
| | | <view class="title">{{ $t(`Gy.HBarCode`) == "Gy.HBarCode"?"条码": $t(`Gy.HBarCode`) }}:</view> |
| | | <view class="right" style="width: 380rpx;"> |
| | | <input :focus="barCodeFocus" v-model="hform.HBarCode" placeholder="请扫描(或输入)条码" |
| | | @confirm="getCode(hform.HBarCode)" /> |
| | |
| | | size="20" @click="toScanCode"></uni-icons> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">数量:</view> |
| | | <view class="title">{{ $t(`Gy.HQty`) == "Gy.HQty"?"数量": $t(`Gy.HQty`) }}:</view> |
| | | <view class="right"> |
| | | <input v-model="hform.HQty" placeholder="请输入数量" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">仓库:</view> |
| | | <view class="title">{{ $t(`Gy.HWHName`) == "Gy.HWHName"?"仓库": $t(`Gy.HWHName`) }}:</view> |
| | | <view class="right"> |
| | | <uni-combox :candidates="arrayHWHName" placeholder="请输入(或扫描)仓库" v-model="hform.HWHName" |
| | | @input="HWHNameChange" @confirm="HWHNameScan"></uni-combox> |
| | | <uni-combox :candidates="arrayHWHName" placeholder="请选择仓库" v-model="hform.HWHName" |
| | | @input="HWHNameChange"></uni-combox> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">仓位:</view> |
| | | <view class="right" v-show="showHStockPlaceName"> |
| | | <view class="title"> |
| | | {{ $t(`Gy.HStockPlaceName`) == "Gy.HStockPlaceName"?"仓位": $t(`Gy.HStockPlaceName`) }}: |
| | | </view> |
| | | <view class="right" v-show="true"> |
| | | <uni-combox :candidates="arrayHStockPlaceNameComputed" placeholder="请输入(或扫描)仓位" |
| | | v-model="hform.HStockPlaceName" @input="HStockPlaceNameChange" |
| | | @confirm="HStockPlaceNameScan"></uni-combox> |
| | | </view> |
| | | <view class="righton" v-show="!showHStockPlaceName"><input v-model="hform.HStockPlaceName" |
| | | placeholder="不可操作" :disabled="!showHStockPlaceName" /></view> |
| | | <view class="righton" v-show="false"><input v-model="hform.HStockPlaceName" placeholder="不可操作" |
| | | :disabled="!showHStockPlaceName" /></view> |
| | | </view> |
| | | |
| | | <view class="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 == 0 ? 'on':''" @tap="tabs = 0"> |
| | | {{ $t(`Gy.SourceBillSelect`) == "Gy.SourceBillSelect"?"选择源单": $t(`Gy.SourceBillSelect`) }} |
| | | </view> |
| | | <view :class="tabs == 1 ? 'on':''" @tap="tabs = 1"> |
| | | {{ $t(`Gy.TableHeaderInfo`) == "Gy.TableHeaderInfo"?"表头信息": $t(`Gy.TableHeaderInfo`) }} |
| | | </view> |
| | | <view :class="tabs == 2 ? 'on':''" @tap="tabs = 2"> |
| | | {{ $t(`Gy.MaterInfo`) == "Gy.MaterInfo"?"物料信息": $t(`Gy.MaterInfo`) }} |
| | | </view> |
| | | <view :class="tabs == 3 ? 'on':''" @tap="tabs = 3"> |
| | | {{ $t(`Gy.BarCodeInfo`) == "Gy.BarCodeInfo"?"条码信息": $t(`Gy.BarCodeInfo`) }} |
| | | </view> |
| | | </view> |
| | | |
| | | <view v-if="tabs == 0"> |
| | | <view class="form-item"> |
| | | <view class="title">源单类型:</view> |
| | | <view class="title"> |
| | | {{ $t(`Gy.HMainSourceBillType`) == "Gy.HMainSourceBillType"?"源单类型": $t(`Gy.HMainSourceBillType`) }}: |
| | | </view> |
| | | <view class="right" v-show="showHMainSourceBillType"> |
| | | <picker :range="arrayHMainSourceBillType" v-model="HMainSourceBillType" |
| | | @change="HMainSourceBillTypeChange"> |
| | |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">源单单号:</view> |
| | | <view class="title"> |
| | | {{$t(`Gy.HMainSourceBillNo`) == "Gy.HMainSourceBillNo"?"源单单号": $t(`Gy.HMainSourceBillNo`) }}: |
| | | </view> |
| | | <view class="right" v-show="showHSourceBillNo"> |
| | | <!-- <uni-combox v-if="reHSourceBillNo" :candidates="arrayHSourceBillNo" placeholder="请输入源单单号" |
| | | v-model="hform.HSourceBillNo" @input="HSourceBillNoChange"></uni-combox> --> |
| | |
| | | </view> --> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">日期:</view> |
| | | <view class="title">{{ $t(`Gy.HDate`) == "Gy.HDate"?"日期": $t(`Gy.HDate`) }}:</view> |
| | | <view class="right"> |
| | | <picker mode="date" v-model="hform.HDate" @change="HDateChange"> |
| | | <input disabled v-model="hform.HDate" placeholder="请选择日期" /> |
| | |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">制单人:</view> |
| | | <view class="title">{{ $t(`Gy.HMaker`) == "Gy.HMaker"?"制单人": $t(`Gy.HMaker`) }}:</view> |
| | | <view class="righton"> |
| | | <input name="HMaker" disabled v-model="hform.HMaker" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">单据号:</view> |
| | | <view class="title">{{ $t(`Gy.HBillNo`) == "Gy.HBillNo"?"单据号": $t(`Gy.HBillNo`) }}:</view> |
| | | <view class="righton"> |
| | | <input name="HBillNo" disabled v-model="hform.HBillNo" /> |
| | | </view> |
| | |
| | | |
| | | <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="delMater(item)"> |
| | | <uni-card :title="item.物料名称" style="margin: 10px;" @tap="delMater(item, $event)"> |
| | | <!-- 物料代码作为可点击链接 --> |
| | | <view class="card-header" @tap.stop="gotoInventoryQuery(item.物料代码)"> |
| | | <text class="link-text">物料代码:{{item.物料代码}}</text> |
| | | </view> |
| | | |
| | | <view class="card-detail"> |
| | | <view class="detail"> |
| | | <text>源单单号:</text>{{item.源单单号}} |
| | |
| | | <view class="detail" v-if="item.单价"> |
| | | <text>单价:</text>{{item.单价}} |
| | | </view> |
| | | <view class="detail" v-if="materMeta[0].HWHName && /兴达/.test(hform.HStockOrgName |
| | | )"> |
| | | <view class="detail" v-if="materMeta[0].HWHName && /兴达/.test(hform.HStockOrgName)"> |
| | | <text>仓库:</text>{{materMeta[0].HWHName}} |
| | | </view> |
| | | </view> |
| | |
| | | HBillNo: '', |
| | | HInterID: '', |
| | | |
| | | HKeeperName: getUserInfo().HKeeper, |
| | | HKeeperName: getUserInfo().HKeeperName, |
| | | HKeeperID: getUserInfo().HKeeperID, |
| | | HSecManagerName: getUserInfo().HSecManager, |
| | | HSecManagerName: getUserInfo().HSecManagerName, |
| | | HSecManagerID: getUserInfo().HSecManagerID, |
| | | HDeptName: getUserInfo().HDept, |
| | | HDeptName: getUserInfo().HDeptName, |
| | | HDeptID: getUserInfo().HDeptID, |
| | | HSupName: '', |
| | | HSupID: '', |
| | |
| | | }, |
| | | methods: { |
| | | async HWHNameScan(e) { |
| | | return |
| | | // 扫描仓库码 |
| | | console.log('仓库码: ', e); |
| | | let index = this.HWHNameList.findIndex(elem => elem['条码编号'] == e) |
| | |
| | | }, |
| | | async HStockPlaceNameScan(e) { |
| | | // 扫描仓位码 |
| | | console.log('仓位码: ', e); |
| | | let index = this.HStockPlaceNameList.findIndex(elem => elem['条码编号'] == e) |
| | | console.log('index: ', index); |
| | | console.log('Code: ', e); |
| | | // 不先置空的话,数据再次扫描相同的仓位码 不会触发组件内的刷新 |
| | | this.hform.HStockPlaceID = 0 |
| | | this.hform.HStockPlaceName = '' |
| | | await this.$nextTick() |
| | | if (index == -1) { |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: '扫描仓位条码对应的仓位不存在...' |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: '/Gy_StockPlace/list', |
| | | data: { |
| | | sWhere: ` and 条码编号 = '${e}'`, |
| | | user: uni.getStorageSync('HUserName'), |
| | | Organization: uni.getStorageSync('Organization') |
| | | }, |
| | | }) |
| | | } else { |
| | | this.HStockPlaceNameChange(this.HStockPlaceNameList[index]['仓位名称']) |
| | | |
| | | if (res.data.count == 1) { |
| | | |
| | | this.hform.HStockPlaceID = res.data.data[0].HMainID |
| | | this.hform.HStockPlaceName = res.data.data[0].仓位名称 |
| | | this.hform.HWHID = res.data.data[0].HWHID |
| | | this.hform.HWHName = res.data.data[0].所属仓库 |
| | | } else { |
| | | uni.showToast({ |
| | | title: '仓位数据请求失败', |
| | | icon: 'none' |
| | | }) |
| | | } |
| | | |
| | | } catch (err) { |
| | | uni.showToast({ |
| | | title: '仓位数据请求失败', |
| | | icon: 'none' |
| | | }) |
| | | } |
| | | }, |
| | | async qrCodeDisplay() { |
| | |
| | | this.hform.HBarCode = "" |
| | | }) |
| | | }, |
| | | playSound(e) { |
| | | const innerAudioContext = uni.createInnerAudioContext(); |
| | | if (e == 1) { |
| | | innerAudioContext.src = '/static/success.wav'; |
| | | } else { |
| | | innerAudioContext.src = '/static/jingbao.wav'; |
| | | } |
| | | innerAudioContext.play(); // 播放音频 |
| | | }, |
| | | |
| | | //扫码 |
| | | toScanCode() { |
| | | var mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module") |
| | |
| | | }, |
| | | async onSourceBillBlurHandler() { |
| | | if (this.hform.HMainSourceBillType == -1) { |
| | | this.playSound(1) |
| | | CommonUtils.playSound(1) |
| | | this.barCodeFocus = true |
| | | return |
| | | } |
| | |
| | | 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: '仓库数据请求失败', |
| | |
| | | if (this.HWHNameList[i].仓库名称 == e) { |
| | | this.hform.HWHName = this.HWHNameList[i].仓库名称 |
| | | this.hform.HWHID = this.HWHNameList[i].HItemID |
| | | |
| | | this.HStockPlaceNameChange(null) |
| | | this.showHStockPlaceName = false |
| | | if (this.HWHNameList[i]['启用仓位'] == 'Y') { |
| | | this.showHStockPlaceName = true |
| | | this.getStockPlaceRemote(this.HWHNameList[i]["HSPGroupID"]) |
| | | } else { |
| | | this.hform.HStockPlaceName = '' |
| | | this.showHStockPlaceName = false |
| | | } |
| | | } |
| | | } |
| | |
| | | url: this.serverUrl + '/Web/GetEmployeeList_Json', |
| | | data: { |
| | | Employee: '', |
| | | HGroupID: 0 |
| | | HGroupID: 0, |
| | | HDeptID: uni.getStorageSync("HDeptID") |
| | | }, |
| | | success: (res) => { |
| | | if (res.data.count == 1) { |
| | |
| | | this.tabs = 2 |
| | | this.showHSupName = false |
| | | this.barCodeFocus = true |
| | | this.playSound(1) |
| | | CommonUtils.playSound(1) |
| | | this.DisBillEntryList() |
| | | } else { |
| | | console.log('res.data.Message: ', res.data.Message); |
| | | this.refreshHSourceBillState() |
| | | this.playSound(0) |
| | | CommonUtils.playSound(0) |
| | | uni.showToast({ |
| | | title: res.data.Message, |
| | | icon: 'none' |
| | |
| | | }, |
| | | fail: (res) => { |
| | | this.refreshHSourceBillState() |
| | | this.playSound(0) |
| | | CommonUtils.playSound(0) |
| | | console.log(res); |
| | | uni.showToast({ |
| | | title: '接口请求失败', |
| | |
| | | console.log(this.hform.HSourceBillNo, HSourceFlag) |
| | | if (HDeleteFlag == "*") { |
| | | if (sBarCode == "") { |
| | | this.playSound(0) |
| | | CommonUtils.playSound(0) |
| | | this.refreshBarCodeState() |
| | | uni.showToast({ |
| | | title: '请输入要删除的条码', |
| | |
| | | console.log('删除条码', res.data); |
| | | this.hform.HBarCode = '' |
| | | if (res.data.count == 1) { |
| | | this.playSound(1) |
| | | CommonUtils.playSound(1) |
| | | this.hform.HQty = '' |
| | | this.DisBillEntryList() |
| | | } else { |
| | | this.playSound(0) |
| | | CommonUtils.playSound(0) |
| | | this.refreshBarCodeState() |
| | | uni.showToast({ |
| | | title: res.data.Message, |
| | |
| | | } |
| | | } catch (err) { |
| | | this.refreshBarCodeState() |
| | | this.playSound(0) |
| | | CommonUtils.playSound(0) |
| | | uni.showToast({ |
| | | title: '接口请求失败: ' + err, |
| | | icon: 'none' |
| | |
| | | // console.log('删除条码', res.data); |
| | | // this.hform.HBarCode = '' |
| | | // if (res.data.count == 1) { |
| | | // this.playSound(1) |
| | | // CommonUtils.playSound(1) |
| | | // this.hform.HQty = '' |
| | | // this.DisBillEntryList() |
| | | // } else { |
| | | // this.playSound(0) |
| | | // CommonUtils.playSound(0) |
| | | // this.refreshBarCodeState() |
| | | // uni.showToast({ |
| | | // title: res.data.Message, |
| | |
| | | // fail: (res) => { |
| | | // console.log(res); |
| | | // this.refreshBarCodeState() |
| | | // this.playSound(0) |
| | | // CommonUtils.playSound(0) |
| | | // uni.showToast({ |
| | | // title: '接口请求失败', |
| | | // icon: 'none' |
| | |
| | | console.log('扫码返回', res.data); |
| | | this.hform.HBarCode = '' |
| | | if (res.data.count == 1) { |
| | | this.playSound(1) |
| | | CommonUtils.playSound(1) |
| | | var data = res.data.data |
| | | if (data.hBarTypeField == '仓库条码') { |
| | | this.hform.HWHName = data.hWhNameField |
| | |
| | | //光标对准条码 |
| | | this.refreshBarCodeState() |
| | | } else { |
| | | this.playSound(0) |
| | | CommonUtils.playSound(0) |
| | | this.refreshBarCodeState() |
| | | uni.showToast({ |
| | | title: res.data.Message, |
| | |
| | | } |
| | | |
| | | } catch (err) { |
| | | this.playSound(0) |
| | | CommonUtils.playSound(0) |
| | | this.refreshBarCodeState() |
| | | console.log(res); |
| | | uni.showToast({ |
| | |
| | | // console.log('扫码返回', res.data); |
| | | // this.hform.HBarCode = '' |
| | | // if (res.data.count == 1) { |
| | | // this.playSound(1) |
| | | // CommonUtils.playSound(1) |
| | | // var data = res.data.data |
| | | // if (data.hBarTypeField == '仓库条码') { |
| | | // this.hform.HWHName = data.hWhNameField |
| | |
| | | // //光标对准条码 |
| | | // this.refreshBarCodeState() |
| | | // } else { |
| | | // this.playSound(0) |
| | | // CommonUtils.playSound(0) |
| | | // this.refreshBarCodeState() |
| | | // uni.showToast({ |
| | | // title: res.data.Message, |
| | |
| | | // } |
| | | // }, |
| | | // fail: (res) => { |
| | | // this.playSound(0) |
| | | // CommonUtils.playSound(0) |
| | | // this.refreshBarCodeState() |
| | | // console.log(res); |
| | | // uni.showToast({ |
| | |
| | | }, |
| | | }); |
| | | }, |
| | | gotoInventoryQuery(HMaterNumber) { |
| | | console.log('跳转到库存查询,物料代码:', HMaterNumber); |
| | | |
| | | // 使用uni.navigateTo跳转到新页面 |
| | | uni.navigateTo({ |
| | | url: `/pages/jishikucunchaxun/table?OperationType=2&HMaterNumber=${HMaterNumber}`, |
| | | success: (res) => { |
| | | console.log('跳转成功'); |
| | | }, |
| | | fail: (err) => { |
| | | console.error('跳转失败:', err); |
| | | // 如果页面不存在,可以跳转到默认页面 |
| | | uni.showToast({ |
| | | title: '功能正在开发中', |
| | | icon: 'none' |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | delMater(item) { |
| | | if (event && event.target.classList && event.target.classList.contains('link-text')) { |
| | | return; // 如果是链接点击,不执行删除 |
| | | } |
| | | |
| | | uni.showModal({ |
| | | title: '提示', |
| | | content: '确认要删除 "' + item.物料名称 + '" 所有扫码记录?删除后将不可恢复!', |
| | |
| | | } |
| | | } |
| | | |
| | | /* 添加链接样式 */ |
| | | .link-text { |
| | | color: #3a78ff; |
| | | /* 蓝色,类似超链接 */ |
| | | } |
| | | |
| | | .list { |
| | | width: 100%; |
| | | |
| | |
| | | color: #999; |
| | | font-size: 26rpx; |
| | | } |
| | | |
| | | } |
| | | } |
| | | |