| | |
| | | }) |
| | | } |
| | | |
| | | export function WmsOperationTaskSetNG(data){ |
| | | return request({ |
| | | url: `/api/WmsOperationTask/SetNG`, |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | export function WmsOperationTaskCancelNG(data){ |
| | | return request({ |
| | | url: `/api/WmsOperationTask/CancelNG`, |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | |
| | | <template> |
| | | <view style="padding-bottom:150px" class="boxTip"> |
| | | <cu-custom bgColor="bg-white" :isBack="true"> |
| | | <block slot="backText"> |
| | | </block> |
| | | <block slot="content">组盘</block> |
| | | </cu-custom> |
| | | <!-- <view class="flex justify-end align-center padding_right30rpx padding_top12rpx"> |
| | | <text class="fontSize12rpx"> 操作人:{{operator}} </text> |
| | | </view> --> |
| | | <u-form labelPosition="left" label-width="180rpx" :model="warehouse" ref="warehouseRef"> |
| | | <view class="overflow" style="padding-bottom: 150rpx"> |
| | | <cu-custom bgColor="bg-white" :isBack="true"> |
| | | <block slot="backText"> </block> |
| | | <block slot="content">板件查看</block> |
| | | </cu-custom> |
| | | <u-form |
| | | labelPosition="left" |
| | | label-width="180rpx" |
| | | :model="warehouse" |
| | | ref="warehouseRef" |
| | | > |
| | | <!-- <u-row |
| | | class="border_bottom margin_top10rpx padding_left25rpx" |
| | | style="background-color: #fff" |
| | | > |
| | | <u-col span="12"> |
| | | <u-form-item |
| | | label="包装号:" |
| | | prop="packageCode" |
| | | required |
| | | class="uFormItem" |
| | | > |
| | | <u-input |
| | | v-model.trim="warehouse.packageCode" |
| | | @confirm="getContainerData(1)" |
| | | placeholder="请录入或扫码" |
| | | class="width" |
| | | :focus="curFoucus" |
| | | > |
| | | </u-input> |
| | | </u-form-item> |
| | | </u-col> |
| | | </u-row> --> |
| | | <u-row |
| | | class="border_bottom margin_top10rpx padding_left25rpx" |
| | | style="background-color: #fff" |
| | | > |
| | | <u-col span="12"> |
| | | <u-form-item label="部件条码:" class="uFormItem"> |
| | | <u-input |
| | | v-model="warehouse.upi" |
| | | ref="materialRef" |
| | | placeholder="请扫码录入" |
| | | @focus="warehouse.upi = ''" |
| | | @confirm="getContainerData" |
| | | style="font-weight: bolder; margin-left: 15rpx" |
| | | class="width padding_left25rpx" |
| | | > |
| | | </u-input> |
| | | </u-form-item> |
| | | </u-col> |
| | | </u-row> |
| | | </u-form> |
| | | <!-- 列表 --> |
| | | <view class="margin_top10rpx"> |
| | | <u-swipe-action |
| | | :show="item.show" |
| | | :index="eindex" |
| | | v-for="(item, eindex) in singlist" |
| | | :key="eindex" |
| | | :options="options" |
| | | @click="longpress" |
| | | @open="open" |
| | | @close="close" |
| | | class="margin_bottom10rpx" |
| | | > |
| | | <view class="item u-border-bottom"> |
| | | <!-- 此层wrap在此为必写的,否则可能会出现标题定位错误 --> |
| | | <view class="title-wrap"> |
| | | <view |
| | | :class="item.checked ? 'bg_item' : ''" |
| | | class="fontSize32rpx width margin_auto background_fff padding10 relative box_sizing transition" |
| | | > |
| | | <!-- 部件名称 upi、材料、尺寸,位置、板件状态 --> |
| | | <u-row> |
| | | <u-col span="12" class="flex align-center"> |
| | | <!-- <u-checkbox v-model="item.checked" size="50rpx"></u-checkbox> --> |
| | | <view |
| | | class="flex justify-center align-center" |
| | | style=" |
| | | background-color: #f18202; |
| | | color: #fff; |
| | | border-radius: 50vh; |
| | | width: 40rpx; |
| | | height: 40rpx; |
| | | " |
| | | > |
| | | {{ eindex + 1 }} |
| | | </view> |
| | | <text class="color_f18202 padding_left10rpx"> |
| | | {{ item.upi }} |
| | | </text> |
| | | </u-col> |
| | | </u-row> |
| | | <u-row> |
| | | <u-col span="8"> |
| | | <text class="color_80 padding_left25rpx"> |
| | | 部件名称: {{ item.detailName }} |
| | | </text> |
| | | </u-col> |
| | | <u-col span="4"> |
| | | <text class="color_80"> 位置:{{ item.location }} </text> |
| | | </u-col> |
| | | </u-row> |
| | | <u-row> |
| | | <u-col span="8"> |
| | | <text class="color_80 padding_left25rpx"> |
| | | 材料:{{ item.info18 }} |
| | | </text> |
| | | </u-col> |
| | | <u-col span="4"> |
| | | <text class="color_80"> 尺寸:{{ item.info16 }} </text> |
| | | </u-col> |
| | | </u-row> |
| | | <u-row> |
| | | <u-col span="8"> |
| | | <text class="color_80 padding_left25rpx"> |
| | | 板件状态:{{ getEnumName(item.upiStatus) }} |
| | | </text> |
| | | </u-col> |
| | | <u-col span="4"> |
| | | <text class="color_80"> 次序:{{ item.shelf }} </text> |
| | | </u-col> |
| | | </u-row> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </u-swipe-action> |
| | | </view> |
| | | <modal-code :rescode="rescode" :resmessage="resmessage" ref="resmodal" /> |
| | | |
| | | <u-row class="border_bottom margin_top10rpx padding_left25rpx" style="background-color: #fff;"> |
| | | <u-col span="12"> |
| | | <u-form-item label="容器编号:" prop="containerCode" required class="uFormItem"> |
| | | <u-input :focus="curFoucus" v-model.trim="warehouse.containerCode" @confirm="getMaterialDetails(1)" |
| | | placeholder="请扫码录入" :disabled="kwbhAllowed" style="font-weight: bolder;margin-left: 15rpx;" |
| | | class="width padding_left25rpx"> |
| | | </u-input> |
| | | </u-form-item> |
| | | </u-col> |
| | | </u-row> |
| | | |
| | | <u-row v-if="warehouse.containerCode" class="border_bottom margin_top10rpx padding_left25rpx" |
| | | style="background-color: #fff;"> |
| | | <u-col span="12"> |
| | | <u-form-item label="物料跟踪码:" class="uFormItem"> |
| | | <u-input v-model="warehouse.snCode" ref="materialRef" placeholder="请扫码录入" |
| | | @focus="warehouse.snCode = ''" @confirm="getMaterialDetails" |
| | | style="font-weight: bolder;margin-left: 15rpx;" class="width padding_left25rpx"> |
| | | </u-input> |
| | | </u-form-item> |
| | | </u-col> |
| | | </u-row> |
| | | <u-row class="border_bottom margin_top10rpx background_fff padding_left25rpx"> |
| | | <u-col span="12"> |
| | | <u-form-item label="目标库区:" prop="tray" class="uFormItem"> |
| | | <input v-model="warehouse.areaCode" type="select" placeholder="请选择目标库区" @focus="containerFocus" |
| | | class="width"></input> |
| | | <u-action-sheet :list="wolist" v-model="modalshow" @click="confirmXl"></u-action-sheet> |
| | | <!-- <u-select v-model="modalshow" :list="wolist" @confirm="confirm" value-name="id" label-name="name"></u-select> --> |
| | | </u-form-item> |
| | | </u-col> |
| | | </u-row> |
| | | <u-row class="border_bottom margin_top10rpx padding_left25rpx" style="background-color: #fff;"> |
| | | <u-col span="10"> |
| | | <u-form-item label="目标库位:" class="uFormItem"> |
| | | <u-input v-model="warehouse.placeCode" placeholder="请扫码录入" |
| | | style="font-weight: bolder;margin-left: 15rpx;" class="width padding_left25rpx"> |
| | | </u-input> |
| | | </u-form-item> |
| | | </u-col> |
| | | <u-col span="2" @tap="containerFocus2"> |
| | | <span class="fontSize15rpx">推荐</span> |
| | | <u-icon name="arrow-right" size="14" class="fontSize15rpx"></u-icon> |
| | | </u-col> |
| | | |
| | | <view class="boxList" v-show="modalshow2" @click="modalshow2 = false" @touchmove.stop> |
| | | <view class="innerWrap"> |
| | | <ul v-for="(item, eindex) in containerList" :key="eindex"> |
| | | <li @click="confirm2(eindex)"> {{ item.text }}</li> |
| | | </ul> |
| | | </view> |
| | | </view> |
| | | |
| | | </u-row> |
| | | </u-form> |
| | | <modal-code :rescode='rescode' :resmessage='resmessage' ref="resmodal" /> |
| | | <view style="margin-bottom: 200rpx;" class="margin_top10rpx"> |
| | | <view v-for="(item, eindex) in singlist" :key="eindex" class="margin_bottom10rpx"> |
| | | <u-swipe-action :show="item.show" :index="eindex" @click="longpress" @open="open" @close='close' |
| | | :options="options" style="width: 100vw;"> |
| | | <view class="fontSize32rpx background_fff padding10" :class="item.enAbled == 0 ? 'bg_item' : ''"> |
| | | <u-row> |
| | | <u-col span="12" class="flex"> |
| | | <text class="flex justify-center align-center circkle06">{{ eindex + 1 }}</text> |
| | | <text class="color_f18202 padding_left10rpx"> |
| | | {{ item.materialCode }}-{{ item.materialName }} |
| | | </text> |
| | | <!-- <u-icon name="plus-circle" v-if="item.enAbled!=1"></u-icon> --> |
| | | </u-col> |
| | | </u-row> |
| | | <u-row> |
| | | <u-col span="12"> |
| | | <text class="color_80 padding_left25rpx"> |
| | | 质检状态:{{ item.qcStatusName }} |
| | | </text> |
| | | </u-col> |
| | | </u-row> |
| | | <u-row> |
| | | <u-col span="12"> |
| | | <view class="color_80 padding_left25rpx"> |
| | | <text style="display: inline-block">批次:{{ item.batch }}</text> |
| | | </view> |
| | | </u-col> |
| | | </u-row> |
| | | <u-row> |
| | | <u-col span="12"> |
| | | <text class="color_80 padding_left25rpx"> |
| | | 跟踪码:{{ item.snCode }} |
| | | </text> |
| | | </u-col> |
| | | </u-row> |
| | | <u-row> |
| | | <u-col span="8"> |
| | | <text class="color_80 padding_left25rpx"> |
| | | |
| | | </text> |
| | | </u-col> |
| | | <u-col span="4"> |
| | | <text class="color_f18202 "> |
| | | 数量:{{ item.quantity }} |
| | | </text> |
| | | </u-col> |
| | | </u-row> |
| | | <!-- <u-row> |
| | | <u-col span="7"> |
| | | </u-col> |
| | | <u-col span="5" class="flex"> |
| | | <view class="color_80"> |
| | | 数量: |
| | | </view> |
| | | <input :class="item.enAbled ? '' : 'border_bottom_f18202 inputGray'" |
| | | class="text-left color_f18202 fontSize32rpx inputGray2" v-model="item.quantity" |
| | | type="number" :disabled="item.enAbled == 1" @blur="changeNum(item)" @click="clicki(item)" |
| | | placeholder="0" /> |
| | | </u-col> |
| | | </u-row> --> |
| | | </view> |
| | | </u-swipe-action> |
| | | </view> |
| | | </view> |
| | | <button-modal :issueShow='true' issueTitle="重置" subTitle='组盘' restTiltle='组盘上架' @reset='goWarhouse' @submit='submit' |
| | | @issue="reset" /> |
| | | |
| | | </view> |
| | | <button-modal |
| | | :subShow="true" |
| | | garmenTitle="重置" |
| | | @submit="rest" |
| | | @reset="rest" |
| | | /> |
| | | </view> |
| | | </template> |
| | | <script> |
| | | import ButtonModal from '../../components/buttonModal.vue' |
| | | import ModalCode from '../../components/ModalCode.vue' |
| | | import ButtonModal from "../../components/buttonModal.vue"; |
| | | import ModalCode from "../../components/ModalCode.vue"; |
| | | import { |
| | | getOrderNo, |
| | | addGroupDisk, |
| | | onlyUpdateDutyCycle, |
| | | getareaTypesList, |
| | | getContainDetail, |
| | | getContainerRecord, |
| | | getBhbMaterialList, |
| | | PdaBindListForSNCode, |
| | | getRecommendList |
| | | } from '../../api/putIn/artificial.js' |
| | | import { |
| | | getDate |
| | | } from '../../utils/dateTime.js' |
| | | import { |
| | | getAttrValue |
| | | } from '../../utils/tool.js' |
| | | import { |
| | | bindputawayConfirm |
| | | } from '../../api/putaway/putaway.js' |
| | | |
| | | getBhbMaterialList, |
| | | getenumDataList, |
| | | } from "../../api/putIn/artificial.js"; |
| | | export default { |
| | | data() { |
| | | return { |
| | | containerList: [], |
| | | curFoucus: true, |
| | | rescode: 0, |
| | | resmessage: "", |
| | | putCode: '', //容器二维码 |
| | | detailshow: false, |
| | | operator: '', |
| | | focu: false, //清空按钮隐显 |
| | | focuM: false, //物料隐显按钮 |
| | | Datetime: getDate(), |
| | | singlist: [], //物料详情 |
| | | wolist: [], |
| | | options: [ |
| | | // { |
| | | // text: '详情', |
| | | // style: { |
| | | // backgroundColor: '#fc9f35' |
| | | // } |
| | | // } |
| | | { |
| | | text: '删除', |
| | | style: { |
| | | backgroundColor: '#fc4b4b' |
| | | } |
| | | } |
| | | ], |
| | | materlist: {}, |
| | | warehouse: { |
| | | containerCode: '', |
| | | materialCode: '', |
| | | storehouseCode: "", |
| | | snCode: "", |
| | | // gridNumber: 1, |
| | | // useNumber: 0, |
| | | // exitNumber: 0, |
| | | // dutyCycle:1 |
| | | }, |
| | | modalshow: false, |
| | | modalshow2: false, |
| | | gridable: true, |
| | | gridFocus: false, |
| | | detailable: false, |
| | | detailableZb: false, |
| | | batchNo: '', //扫码到的当前物料的批次 |
| | | warehouseRules: { |
| | | containerCode: [{ |
| | | required: true, |
| | | message: '容器编号不能为空', |
| | | trigger: 'blur' |
| | | }], |
| | | materialCode: [{ |
| | | required: true, |
| | | message: '物料编号不能为空', |
| | | trigger: 'blur' |
| | | }] |
| | | }, |
| | | orderType: 1, |
| | | warhouseTph: '', |
| | | timerPrint: null, |
| | | kwbhAllowed: false, //是否禁用库位编号 |
| | | arrD: [], |
| | | statusTp: { |
| | | 'tpStatus': '' |
| | | } |
| | | }; |
| | | }, |
| | | components: { |
| | | ButtonModal, |
| | | ModalCode |
| | | }, |
| | | onLoad(option) { |
| | | if (option.orderType) { |
| | | this.orderType = option.orderType |
| | | } |
| | | }, |
| | | onReady() { |
| | | this.$refs.warehouseRef.setRules(this.warehouseRules) |
| | | }, |
| | | mounted() { |
| | | this.operator = JSON.parse(uni.getStorageSync('userInfo')).name |
| | | this.getVehicleType() |
| | | }, |
| | | computed: { |
| | | containerCode() { |
| | | return this.warehouse.containerCode |
| | | } |
| | | }, |
| | | watch: { |
| | | containerCode(val) { |
| | | if (!val) { |
| | | this.detailable = false; |
| | | this.detailableZb = false; |
| | | this.warehouse.exitNumber = 0 |
| | | } |
| | | }, |
| | | singlist(val) { |
| | | this.warehouse.exitNumber = val.length |
| | | } |
| | | }, |
| | | methods: { |
| | | //容器类型聚焦事件 |
| | | containerFocus() { |
| | | uni.hideKeyboard() |
| | | this.modalshow = true |
| | | }, |
| | | gridBtnClick() { |
| | | this.gridable = !this.gridable |
| | | if (!this.gridable) { |
| | | this.$nextTick(() => { |
| | | this.gridFocus = true; |
| | | }) |
| | | } else { |
| | | this.$nextTick(() => { |
| | | this.gridFocus = false; |
| | | }) |
| | | } |
| | | }, |
| | | //容器编号点击 |
| | | containerClick() { |
| | | uni.scanCode({ |
| | | scanType: ['barCode', 'qrCode'], |
| | | autoDecodeCharset: true, |
| | | success: (res) => { |
| | | this.warehouse.containerCode = res.result |
| | | this.containerBlur() |
| | | }, |
| | | fail: (err) => { |
| | | this.rescode = 400 |
| | | this.resmessage = `扫描失败${err}` |
| | | this.$refs.resmodal.show = true |
| | | } |
| | | }) |
| | | }, |
| | | //容器失焦事件 |
| | | containerBlur() { |
| | | Promise.all([this.getContainerRecord(), this.getContainerData()]) |
| | | }, |
| | | //获取当前容器下组盘记录 |
| | | getContainerRecord() { |
| | | this.kwbhAllowed = false |
| | | //每次查询置空材料列表 |
| | | this.singlist = []; |
| | | if (this.warehouse.containerCode == '') { |
| | | return |
| | | } |
| | | getContainerRecord({ |
| | | containerCode: this.warehouse.containerCode |
| | | }).then(res => { |
| | | if (res.code == 200) { |
| | | this.kwbhAllowed = true |
| | | if (Array.isArray(res.data) && res.data.length > 0) { |
| | | if (res.data[0].orderNo) { |
| | | this.putCode = res.data[0].orderNo; |
| | | } |
| | | this.warehouse.dutyCycle = res.data[0].dutyCycle; //库存占比 【Editby shaocx,2023-05-22】 |
| | | const recordArr = res.data.reduce((curr, item) => { |
| | | curr.push({ |
| | | code: item.materialCode, |
| | | batchNo: item.batchNo, |
| | | quantityNow: item.quantity, |
| | | quantity: item.quantity, |
| | | materialName: item.materialName, |
| | | materialTypeName: item.materialTypeName, |
| | | specificationModel: item.specificationModel, |
| | | id: '', |
| | | unionCode: item.unionCode, |
| | | replaceMaterialCode: item.replaceMaterialCode, |
| | | stockFlagStatus: item.stockFlagStatus, |
| | | show: false, |
| | | enAbled: 1 //控制数量是否可以输入 |
| | | }) |
| | | return curr |
| | | }, []) |
| | | this.singlist.push(...recordArr) |
| | | } |
| | | } else { |
| | | this.kwbhAllowed = false |
| | | } |
| | | data() { |
| | | return { |
| | | operator: "", |
| | | warehouse: { |
| | | packageCode: "", |
| | | upi: "", |
| | | }, |
| | | singlist: [], //详情列表 |
| | | ordersId: 0, //当前容器绑定的上架单 |
| | | rescode: 0, |
| | | resmessage: "", |
| | | options: [ |
| | | { |
| | | text: "打印", |
| | | style: { |
| | | backgroundColor: "#fc9f35", |
| | | }, |
| | | }, |
| | | ], |
| | | detailshow: false, |
| | | materlist: {}, |
| | | curFoucus: true, |
| | | timer: null, |
| | | timerSm: null, |
| | | detailableZb: false, |
| | | detailable: false, |
| | | gridFocus: false, |
| | | gridable: true, |
| | | kwbhAllowed: false, |
| | | enumList: [], |
| | | }; |
| | | }, |
| | | components: { |
| | | ButtonModal, |
| | | ModalCode, |
| | | }, |
| | | created() { |
| | | getenumDataList({ |
| | | EnumName: "UpiStatusEnum", |
| | | }).then((res) => { |
| | | this.enumList = res.result || []; |
| | | }); |
| | | }, |
| | | onLoad() { |
| | | this.operator = JSON.parse(uni.getStorageSync("userInfo")).name; |
| | | }, |
| | | mounted() {}, |
| | | |
| | | }) |
| | | methods: { |
| | | getEnumName(value) { |
| | | const name = this.enumList.find((item) => item.value === value); |
| | | return name ? name.name : ""; |
| | | }, |
| | | // 如果打开一个的时候,不需要关闭其他,则无需实现本方法 |
| | | open(index) { |
| | | // 先将正在被操作的swipeAction标记为打开状态,否则由于props的特性限制, |
| | | // 原本为'false',再次设置为'false'会无效 |
| | | this.singlist[index].show = true; |
| | | this.singlist.map((val, idx) => { |
| | | if (index != idx) this.singlist[idx].show = false; |
| | | }); |
| | | }, |
| | | close(index) { |
| | | this.singlist[index].show = false; |
| | | }, |
| | | //物料详情 |
| | | longpress(index, eindex) { |
| | | this.materlist = this.singlist[index]; |
| | | this.detailshow = true; |
| | | }, |
| | | |
| | | }, |
| | | //获取容器的信息 |
| | | getContainerData() { |
| | | getContainDetail(this.warehouse.containerCode).then(res => { |
| | | const result = res.data.rows; |
| | | if (Array.isArray(result) && result.length == 1) { |
| | | // 虚拟3个都不显示;料箱:显示栅格;钢托:不显示空间占比 |
| | | if (res.data.rows[0].isVirtual == 0) { //实物 |
| | | if (res.data.rows[0].wareContainerType == '299120688255045' || res.data.rows[0] |
| | | .wareContainerType == '293486279884869') { // 钢制容器 塑料容器 -显示占比 |
| | | this.detailableZb = true; |
| | | this.detailable = false; |
| | | } else { //料箱 - 显示栅格数 |
| | | this.detailableZb = false; |
| | | this.detailable = true; |
| | | } |
| | | } else { |
| | | this.detailable = false; |
| | | this.detailableZb = false; |
| | | } |
| | | this.warehouse.gridNumber = res.data.rows[0].gridNumber; |
| | | this.warehouse.useNumber = res.data.rows[0].useNumber; |
| | | } else { |
| | | uni.showToast({ |
| | | title: '库位不存在', |
| | | icon: 'none', |
| | | duration: 2000 |
| | | }); |
| | | this.kwbhAllowed = false |
| | | } |
| | | rest() { |
| | | this.warehouse.upi = ""; |
| | | this.singlist = []; |
| | | }, |
| | | |
| | | }) |
| | | }, |
| | | |
| | | |
| | | //物料编码点击 |
| | | materialClick() { |
| | | uni.scanCode({ |
| | | scanType: ['barCode', 'qrCode'], |
| | | autoDecodeCharset: true, |
| | | success: (res) => { |
| | | this.warehouse.materialCode = getAttrValue(res.result, 'PARTSNUMBER') |
| | | this.batchNo = getAttrValue(res.result, 'LOTNO') |
| | | this.getMaterialDetails() |
| | | }, |
| | | fail: (err) => { |
| | | this.rescode = 400 |
| | | this.resmessage = `扫描失败${err}` |
| | | this.$refs.resmodal.show = true |
| | | } |
| | | }) |
| | | }, |
| | | //物料查询 |
| | | getMaterialDetails(pram) { |
| | | if (!this.warehouse.containerCode) { |
| | | uni.showToast({ |
| | | title: '容器编号不能为空', |
| | | icon: 'none', |
| | | duration: 2000 |
| | | }) |
| | | return |
| | | } |
| | | //扫容器编号 加载所有物料 |
| | | if (pram == 1) { |
| | | this.singlist = []; |
| | | getBhbMaterialList({ |
| | | 'containerCode': this.warehouse.containerCode, |
| | | 'SNCode': this.warehouse.snCode |
| | | }).then((res) => { |
| | | if (res.code == 200) { |
| | | if (res.result == null) { |
| | | this.rescode = 400 |
| | | this.resmessage = '查无数据' |
| | | this.$refs.resmodal.show = true |
| | | return |
| | | } else { |
| | | if (res.result.length == 0) { |
| | | console.log("空托") |
| | | this.singlist = []; |
| | | return |
| | | } else { |
| | | console.log("有料") |
| | | res.result.forEach((item, index) => { |
| | | item.notDelete = 1 //已组盘的物料 不许删除 要去解绑页面解绑 |
| | | }) |
| | | this.singlist = res.result; |
| | | } |
| | | } |
| | | } else { |
| | | this.resmessage = res.message |
| | | this.rescode = res.code |
| | | this.$refs.resmodal.show = true |
| | | //获取容器的信息 |
| | | getContainerData(param) { |
| | | if (!this.warehouse.upi) { |
| | | uni.showToast({ |
| | | title: "请扫部件条码", |
| | | icon: "none", |
| | | duration: 2000, |
| | | }); |
| | | return; |
| | | } |
| | | getBhbMaterialList({ |
| | | packageCode: this.warehouse.packageCode, |
| | | upi: this.warehouse.upi, |
| | | }).then((res) => { |
| | | const result = res.result; |
| | | if (Array.isArray(result) && result.length == 0) { |
| | | uni.showToast({ |
| | | title: "数据不存在", |
| | | icon: "none", |
| | | duration: 2000, |
| | | }); |
| | | return; |
| | | } |
| | | this.singlist = res.result; |
| | | }); |
| | | }, |
| | | |
| | | } |
| | | }) |
| | | |
| | | } else { |
| | | |
| | | //物料查询 |
| | | PdaBindListForSNCode({ |
| | | 'containerCode': this.warehouse.containerCode, |
| | | 'SNCode': this.warehouse.snCode |
| | | }).then((res) => { |
| | | if (res.code == 200) { |
| | | if (res.result == null || !res.result.stockQuanOutput) { |
| | | this.rescode = 400 |
| | | this.resmessage = '查无数据' |
| | | this.$refs.resmodal.show = true |
| | | return |
| | | } else { |
| | | // 根据id 判断物料是否存在 |
| | | var item = res.result.stockQuanOutput; |
| | | //debugger |
| | | let index = this.singlist.findIndex(v => v.snCode == item.snCode); |
| | | if (index == -1) { |
| | | if (!res.result.validateResult && res.result.validateFailReason) { |
| | | uni.showModal({ |
| | | title: '提示', |
| | | content: res.result.validateFailReason, |
| | | showCancel: true, |
| | | cancelColor: '#333333', |
| | | success: (res => { |
| | | if (res.confirm) { |
| | | this.singlist.unshift({ |
| | | ...item |
| | | }) |
| | | } else if (res.cancel) { |
| | | |
| | | } |
| | | }) |
| | | }); |
| | | } else { |
| | | this.singlist.unshift({ |
| | | ...item |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | this.resmessage = res.message |
| | | this.rescode = res.code |
| | | this.$refs.resmodal.show = true |
| | | } |
| | | }) |
| | | |
| | | } |
| | | |
| | | }, |
| | | //删除详情 |
| | | longpress(index, eindex) { |
| | | uni.showModal({ |
| | | title: '提示', |
| | | content: '是否确认删除?', |
| | | showCancel: true, |
| | | cancelColor: '#333333', |
| | | success: (res => { |
| | | if (res.confirm) { |
| | | this.singlist[index].cardNum = true |
| | | if (eindex == 0) { //删除 |
| | | if(this.singlist[index].notDelete==1){ |
| | | uni.showToast({ |
| | | title: '已组盘的物料 不许删除 要去解绑页面解绑', |
| | | icon: 'none', |
| | | duration: 2000 |
| | | }); |
| | | return |
| | | } |
| | | this.singlist.splice(index, 1) |
| | | } else { |
| | | this.materlist = this.singlist[index] |
| | | this.detailshow = true |
| | | } |
| | | } else if (res.cancel) { |
| | | |
| | | } |
| | | }) |
| | | }); |
| | | }, |
| | | //编辑状态样式 |
| | | dc(e) { |
| | | e.cardNum = true |
| | | this.$forceUpdate() |
| | | }, |
| | | //卡片选中 |
| | | clicki(e) { |
| | | e.cardNum = true |
| | | this.$forceUpdate() |
| | | }, |
| | | // 如果打开一个的时候,不需要关闭其他,则无需实现本方法 |
| | | open(index) { |
| | | // 先将正在被操作的swipeAction标记为打开状态,否则由于props的特性限制, |
| | | // 原本为'false',再次设置为'false'会无效 |
| | | this.singlist[index].cardNum = true; |
| | | this.$forceUpdate() |
| | | this.singlist[index].show = true; |
| | | this.singlist.map((val, idx) => { |
| | | if (index != idx) this.singlist[idx].show = false; |
| | | }) |
| | | }, |
| | | close(index) { |
| | | this.singlist[index].show = false; |
| | | this.singlist[index].cardNum = false; |
| | | this.$forceUpdate() |
| | | }, |
| | | //改变组盘数量 |
| | | changeNum(val) { |
| | | val.cardNum = false |
| | | if (!val.quantity) { |
| | | uni.showModal({ |
| | | title: '提示', |
| | | content: '组盘数量不能为空', |
| | | showCancel: false |
| | | }) |
| | | } |
| | | if (val.quantity < 0) { |
| | | uni.showModal({ |
| | | title: '提示', |
| | | content: '组盘数量必须大于0', |
| | | showCancel: false |
| | | }) |
| | | } |
| | | |
| | | }, |
| | | //全部取消 |
| | | reset() { |
| | | this.singlist = []; |
| | | this.warehouse.containerCode = '' |
| | | this.warehouse.snCode = '' |
| | | this.warehouse.areaCode = '' |
| | | this.warehouse.placeCode = '' |
| | | this.$refs.warehouseRef.resetFields(); |
| | | this.$forceUpdate() |
| | | this.kwbhAllowed = false |
| | | }, |
| | | //重置页面信息 |
| | | rest() { |
| | | this.reset() |
| | | }, |
| | | //确认 |
| | | submit() { |
| | | this.$refs.warehouseRef.setRules(this.warehouseRules) |
| | | this.$refs.warehouseRef.validate(valid => { |
| | | if (valid) { |
| | | |
| | | let arrN1 = this.singlist.findIndex((v) => v.quantity == '' || v.quantity <= 0) |
| | | if (arrN1 > -1) { |
| | | uni.showToast({ |
| | | title: '物料数量需要大于0', |
| | | icon: 'none', |
| | | duration: 2000 |
| | | }); |
| | | return |
| | | } |
| | | |
| | | //物料详情 |
| | | let matatilDetails = this.singlist; |
| | | |
| | | let arrSub = matatilDetails.filter((v) => v.enAbled != 1) |
| | | //请求参数 |
| | | /// 标记 |
| | | /// 1:物料组盘 |
| | | /// 2:容器组盘 |
| | | /// 3:物料解绑 |
| | | /// 4:容器解绑 |
| | | let params = { |
| | | Flag: 1, |
| | | ContainerCode: this.warehouse.containerCode, |
| | | orderDetails: arrSub |
| | | } |
| | | uni.showModal({ |
| | | title: '提示', |
| | | content: '是否确认组盘?', |
| | | showCancel: true, |
| | | cancelColor: '#333333', |
| | | success: (res => { |
| | | if (res.confirm) { |
| | | addGroupDisk(params).then(res => { |
| | | this.warhouseTph = this.warehouse.containerCode; |
| | | this.rescode = res.code; |
| | | this.resmessage = res.message || '组盘成功!'; |
| | | this.$refs.resmodal.show = true; |
| | | this.rest(); |
| | | }) |
| | | } else if (res.cancel) { |
| | | |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // 租盘上架 |
| | | goWarhouse() { |
| | | //物料详情 |
| | | let matatilDetails = this.singlist; |
| | | |
| | | let arrSub = matatilDetails.filter((v) => v.enAbled != 1) |
| | | |
| | | bindputawayConfirm({ |
| | | flag:1, // |
| | | "ActionType": 3004, //组盘上架 |
| | | "ContainerCode": this.warehouse.containerCode, |
| | | "StorehouseCode": this.warehouse.storehouseCode, |
| | | "areaCode": this.warehouse.areaCode || '', |
| | | "placeCode": this.warehouse.placeCode || '', |
| | | "orderDetails": arrSub |
| | | }).then(res => { |
| | | this.rescode = res.code; |
| | | this.resmessage = res.message || '组盘上架成功!'; |
| | | this.$refs.resmodal.show = true; |
| | | this.reset(); |
| | | }) |
| | | // if(this.warehouse.areaCode==''&&this.warehouse.placeCode){ |
| | | // uni.showToast({ |
| | | // title: '请填写目标库区或目标库位!', |
| | | // icon: 'none', |
| | | // duration: 2000 |
| | | // }) |
| | | // return; |
| | | // } |
| | | // if (this.warhouseTph == '') { |
| | | // uni.showToast({ |
| | | // title: '组盘成功后,可入库!', |
| | | // icon: 'none', |
| | | // duration: 2000 |
| | | // }) |
| | | // return |
| | | // } |
| | | // uni.navigateTo({ |
| | | // url: '/pages/putIn/three/three?type=入库单&containerCode=' + this.warhouseTph |
| | | // }) |
| | | }, |
| | | getVehicleType() { |
| | | getareaTypesList().then((res) => { |
| | | // if (res.data.rows.length == 0) { |
| | | // this.rescode = 400 |
| | | // this.resmessage = '暂无数据' |
| | | // this.$refs.resmodal.show = true |
| | | // return |
| | | // } |
| | | var arr = res.result.items; |
| | | arr.map(item => { |
| | | item.text = item.areaCode; |
| | | return item; |
| | | }) |
| | | this.wolist = arr |
| | | }) |
| | | }, |
| | | confirmXl(index) { |
| | | this.warehouse.areaCode = this.wolist[index].areaCode; |
| | | // this.warehouse.ContainerTypeCode = this.wolist[index].id; |
| | | }, |
| | | filterMark(stockFlagStatus) { |
| | | let str = '' |
| | | let arr4 = this.arrD.filter(v => v.value == stockFlagStatus) |
| | | if (arr4.length > 0) { |
| | | str = arr4[0].title |
| | | } |
| | | return str |
| | | }, |
| | | //------获取推荐 |
| | | containerFocus2() { |
| | | // //debugger |
| | | if (!this.warehouse.areaCode) { |
| | | uni.showToast({ |
| | | title: '请选择目标库区!', |
| | | icon: 'none', |
| | | duration: 2000 |
| | | }); |
| | | return |
| | | } |
| | | getRecommendList({ |
| | | 'containerCode': this.warehouse.containerCode, |
| | | 'areaCode': this.warehouse.areaCode |
| | | }).then(res => { |
| | | this.modalshow2 = true; |
| | | |
| | | this.containerList = res.result.reduce((curr, item) => { |
| | | curr.push({ |
| | | text: item.placeCode, |
| | | }) |
| | | return curr; |
| | | }, []) |
| | | }) |
| | | }, |
| | | //------获取推荐类型选择 |
| | | confirm2(index) { |
| | | this.warehouse.placeCode = this.containerList[index].text; |
| | | }, |
| | | } |
| | | } |
| | | //全部取消 |
| | | back() { |
| | | this.ordersId = 0; |
| | | this.singlist = []; |
| | | this.$refs.warehouseRef.resetFields(); |
| | | this.warehouse.packageCode = ""; |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | <style lang="scss"> |
| | | .content { |
| | | height: 500rpx; |
| | | overflow-y: scroll; |
| | | width: 100%; |
| | | padding: 15rpx; |
| | | box-sizing: border-box; |
| | | |
| | | .content-item { |
| | | padding: 15rpx; |
| | | background-color: #fff; |
| | | margin-bottom: 15rpx; |
| | | border-radius: 8rpx; |
| | | font-size: 32rpx; |
| | | } |
| | | } |
| | | |
| | | .bg_item { |
| | | background: #FFEBCD !important; |
| | | background: #ffebcd !important; |
| | | } |
| | | |
| | | .inputGray2 { |
| | | line-height: 30px; |
| | | border-top: 10rpx solid transparent; |
| | | } |
| | | |
| | | .inputGray { |
| | | border-top: 0rpx solid transparent; |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | .boxList { |
| | | transition: all ease 2s; |
| | | position: fixed; |
| | | bottom: 0; |
| | | left: 0; |
| | | top: 0; |
| | | right: 0; |
| | | width: 100%; |
| | | height: 100%; |
| | | z-index: 999; |
| | | background: rgba(0, 0, 0, 0.6); |
| | | |
| | | .innerWrap { |
| | | max-height: 50%; |
| | | overflow-y: auto; |
| | | background: white; |
| | | position: absolute; |
| | | bottom: 0; |
| | | left: 0; |
| | | width: 100%; |
| | | |
| | | ul { |
| | | padding: 0; |
| | | margin: 0; |
| | | |
| | | li { |
| | | padding: 0; |
| | | margin: 0; |
| | | border-bottom: 1px solid #e4e7ed; |
| | | list-style-type: none; |
| | | display: flex; |
| | | flex-direction: row; |
| | | line-height: 1; |
| | | justify-content: center; |
| | | align-items: center; |
| | | font-size: 13px; |
| | | padding: 14px 0; |
| | | flex-direction: column; |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | // 只需配置这里 |
| | | cleanoutlistForUrl: [ |
| | | { |
| | | name: '标准收货', |
| | | name: 'NG处理', |
| | | icon: 'icon-shouhuoguanli', |
| | | src: '../../static/index/takeMaterial.png', |
| | | pages: '../takeMaterial/orderpiece/orderpiece' |
| | |
| | | <template> |
| | | <view class="overflow" style="padding-bottom: 100px"> |
| | | <!-- 顶部 --> |
| | | <view class="overflow" style="padding-bottom: 150rpx"> |
| | | <cu-custom bgColor="bg-white" :isBack="true"> |
| | | <block slot="backText"></block> |
| | | <block slot="content">标准收货</block> |
| | | <block slot="backText"> </block> |
| | | <block slot="content">NG处理</block> |
| | | </cu-custom> |
| | | <!-- 遮挡层 --> |
| | | <modal-code |
| | | ref="resmodal" |
| | | :rescode="rescode" |
| | | :resmessage="resmessage" |
| | | :showBtn="showBtn" |
| | | @goYuKu="goYuKu" |
| | | /> |
| | | <!-- 收货 --> |
| | | <view class="" v-if="renameFocus"> |
| | | <u-form |
| | | labelPosition="left" |
| | | label-width="180rpx" |
| | | :model="warehouse" |
| | | ref="warehouseRef" |
| | | > |
| | | <u-row |
| | | class="margin_top10rpx margin_bottom10rpx padding_left25rpx" |
| | | style="background-color: #fff" |
| | | > |
| | | <u-col span="12"> |
| | | <u-form-item required label="物料跟踪码:" class="uFormItem"> |
| | | <u-input |
| | | v-model.trim="warehouse.barcodeMy" |
| | | placeholder="请录入或扫码" |
| | | @focus="warehouse.barcodeMy = ''" |
| | | class="width padding_left25rpx" |
| | | :focus="true" |
| | | @confirm="materialBlur(1)" |
| | | > |
| | | </u-input> |
| | | </u-form-item> |
| | | </u-col> |
| | | </u-row> |
| | | </u-form> |
| | | <view style="margin-bottom: 180rpx" v-show="singlist.length > 0"> |
| | | <checkbox-group @change="checkboxChange"> |
| | | <view |
| | | v-for="(item, eindex) in singlist" |
| | | :key="eindex" |
| | | class="margin_top10rpx" |
| | | > |
| | | <u-swipe-action |
| | | :show="item.show" |
| | | :index="eindex" |
| | | @click="longpredel" |
| | | @open="open" |
| | | @close="close" |
| | | :options="options" |
| | | > |
| | | <view |
| | | class="fontSize32rpx background_fff padding10" |
| | | :class="item.isYueku == '是' ? 'bg_item' : ''" |
| | | style="width: 100vw" |
| | | > |
| | | <u-row> |
| | | <u-col span="12"> |
| | | <label class="flex align-center"> |
| | | <text |
| | | class="flex justify-center align-center circkle06" |
| | | >{{ eindex + 1 }}</text |
| | | > |
| | | <view |
| | | class="color_f18202 padding_left10rpx" |
| | | style="flex: 1; word-break: break-all" |
| | | > |
| | | {{ item.materialCode }}-{{ item.materialName }} |
| | | </view> |
| | | </label> |
| | | </u-col> |
| | | </u-row> |
| | | <u-row> |
| | | <u-col span="12"> |
| | | <view class="padding_left25rpx" style="color: #808080"> |
| | | ASN:{{ item.asnNo }} |
| | | </view> |
| | | </u-col> |
| | | </u-row> |
| | | <u-row> |
| | | <u-col span="12"> |
| | | <view class="padding_left25rpx" style="color: #808080"> |
| | | 供应商批次:{{ item.supplierBatch }} |
| | | </view> |
| | | </u-col> |
| | | </u-row> |
| | | <u-row> |
| | | <u-col span="7"> |
| | | <view class="padding_left25rpx" style="color: #808080"> |
| | | 最高库存数:{{ Number(item.maxImumqty).toFixed(3) }} |
| | | </view> |
| | | </u-col> |
| | | <u-col span="5"> |
| | | <view class="" style="color: #808080"> |
| | | 库存数:{{ Number(item.stockQty).toFixed(3) }} |
| | | </view> |
| | | </u-col> |
| | | </u-row> |
| | | <u-row> |
| | | <u-col span="7"> |
| | | <view class="padding_left25rpx" style="color: #808080"> |
| | | 行号:{{ item.asnLineNumber }} |
| | | </view> |
| | | </u-col> |
| | | <u-col span="5"> |
| | | <view class="" style="color: #808080"> |
| | | 转换率:{{ item.translateRate }} |
| | | </view> |
| | | </u-col> |
| | | </u-row> |
| | | |
| | | <u-row> |
| | | <u-col span="7"> |
| | | <view class="padding_left25rpx" style="color: #808080"> |
| | | 采购单位:{{ item.poUnit }} |
| | | </view> |
| | | </u-col> |
| | | <u-col span="5"> |
| | | <view class="" style="color: #808080"> |
| | | 库存单位:{{ item.materialUnit }} |
| | | </view> |
| | | </u-col> |
| | | </u-row> |
| | | |
| | | <u-row> |
| | | <u-col span="7"> |
| | | <view class="padding_left25rpx" style="color: #808080"> |
| | | 采购数量:{{ Number(item.poQuantity).toFixed(3) }} |
| | | </view> |
| | | </u-col> |
| | | <u-col span="5"> |
| | | <view class="" style="color: #f18202"> |
| | | 收货数量:{{ Number(item.quantity).toFixed(3) }} |
| | | </view> |
| | | </u-col> |
| | | </u-row> |
| | | </view> |
| | | </u-swipe-action> |
| | | </view> |
| | | </checkbox-group> |
| | | </view> |
| | | <u-popup |
| | | v-model="detailshow" |
| | | border-radius="14" |
| | | @close="detailshow = false" |
| | | mode="bottom" |
| | | > |
| | | <h2 class="text_align_center padding_bottom18 padding15">物料信息</h2> |
| | | <!-- <view class="line flex justify-between"> |
| | | <text class="text-gray">打印张数</text> |
| | | <text> |
| | | <u-input |
| | | v-model.trim="contLabel" |
| | | placeholder="请输入打印张数" |
| | | class="width" |
| | | @focus="contLabel = ''" |
| | | style="font-size: 36rpx; text-align: right" |
| | | > |
| | | </u-input> |
| | | </text> |
| | | </view> --> |
| | | <!-- <view class="line flex justify-between"> |
| | | <text class="text-gray">打印收货数量</text> |
| | | <text> |
| | | <u-input |
| | | v-model.trim="ermNum" |
| | | placeholder="请输入打印收货数量" |
| | | class="width" |
| | | @focus="ermNum = ''" |
| | | style="font-size: 36rpx; text-align: right" |
| | | > |
| | | </u-input> |
| | | </text> |
| | | </view> --> |
| | | |
| | | <view class="line flex justify-between"> |
| | | <text class="text-gray">物料编号</text> |
| | | <text>{{ materlist.materialCode }}</text> |
| | | </view> |
| | | <view class="line flex justify-between"> |
| | | <text class="text-gray">物料名称</text> |
| | | <text>{{ materlist.materialName }}</text> |
| | | </view> |
| | | <view class="line flex justify-between"> |
| | | <text class="text-gray">收货数量</text> |
| | | <text>{{ materlist.quantity }}</text> |
| | | </view> |
| | | <view class="line flex justify-between"> |
| | | <text class="text-gray">库存单位</text> |
| | | <text>{{ materlist.materialUnit }}</text> |
| | | </view> |
| | | <view class="line flex justify-between"> |
| | | <text class="text-gray">采购单位</text> |
| | | <text>{{ materlist.poUnit }}</text> |
| | | </view> |
| | | <view class="line flex justify-between"> |
| | | <text class="text-gray">行号</text> |
| | | <text>{{ materlist.asnLineNumber }}</text> |
| | | </view> |
| | | <!-- <view class="margin_top140rpx"> |
| | | <button-modal :subShow='true' garmenTitle='打印' @submit='init' @reset='rest' /> |
| | | <button-modal :cleaningShow='true' allTitle='蓝牙打印' cleaningTitle='斑马打印' @allsubmit="init(1)" |
| | | @submit='init(2)' /> |
| | | </view> --> |
| | | </u-popup> |
| | | <button-modal |
| | | :empTytowerShow="true" |
| | | cleaningTitle="重置" |
| | | garmenTitle="下一步" |
| | | @submit="next" |
| | | @reset="resthandle" |
| | | /> |
| | | <!-- <button-modal :issueShow='true' issueTitle="越库" subTitle='下一步' restTiltle='重置' @reset='rest' |
| | | @submit='next' @issue="goYuKu"/> --> |
| | | </view> |
| | | <!-- 确认收货 --> |
| | | <view class="" v-else> |
| | | <u-tabs-swiper |
| | | ref="tabs" |
| | | :current="current" |
| | | @change="tabsChange" |
| | | bar-width="75" |
| | | :list="lists" |
| | | :is-scroll="false" |
| | | class="margin_bottom10rpx" |
| | | active-color="#f18202" |
| | | inactive-color="#f18202" |
| | | > |
| | | </u-tabs-swiper> |
| | | <scroll-view scroll-y="true" style="height: 45vh"> |
| | | <!-- <view class="margin_top10rpx overflow_auto" style="height:calc(100% - 20rpx)"> --> |
| | | <view |
| | | v-if="current == 0" |
| | | v-for="(item, eindex) in lastlist" |
| | | :key="eindex" |
| | | style="background-color: #fff" |
| | | class="padding10" |
| | | > |
| | | <u-row class="padding10"> |
| | | <u-col span="12" class="flex" style="align-items: flex-start"> |
| | | <view |
| | | style=" |
| | | background-color: #f18202; |
| | | color: #fff; |
| | | border-radius: 50%; |
| | | width: 20px; |
| | | height: 20px; |
| | | line-height: 20px; |
| | | text-align: center; |
| | | " |
| | | > |
| | | {{ eindex + 1 }} |
| | | </view> |
| | | <view |
| | | class="color_f18202 padding_left10rpx" |
| | | style="flex: 1; word-break: break-all" |
| | | > |
| | | {{ item.materialCode }}-{{ item.materialName }} |
| | | </view> |
| | | </u-col> |
| | | </u-row> |
| | | <u-row> |
| | | <u-col span="12" class="text06"> |
| | | <view class="padding_left25rpx"> 单号:{{ item.asnNo }} </view> |
| | | </u-col> |
| | | </u-row> |
| | | <u-row> |
| | | <u-col span="7" class="text06"> |
| | | <view class="padding_left25rpx"> |
| | | 库存单位:{{ item.materialUnit }} |
| | | </view> |
| | | </u-col> |
| | | <u-col span="5" class="text06"> |
| | | <view class="" style="color: #808080"> |
| | | 采购单位:{{ item.poUnit }} |
| | | </view> |
| | | </u-col> |
| | | </u-row> |
| | | <u-row> |
| | | <u-col span="7" class="text06"> |
| | | <view class="padding_left25rpx"> |
| | | 转换率:{{ item.translateRate }} |
| | | </view> |
| | | </u-col> |
| | | <u-col span="5" class="text06"> |
| | | 采购数量:{{ Number(item.poQuantity).toFixed(3) }} |
| | | </u-col> |
| | | </u-row> |
| | | <u-row class=""> |
| | | <u-col span="7" class="text06"> |
| | | <view class="padding_left25rpx"> |
| | | |
| | | </view> |
| | | </u-col> |
| | | <u-col span="5" class="color_f18202"> |
| | | |
| | | 收货数量:{{ Number(item.quantity).toFixed(3) }} |
| | | </u-col> |
| | | </u-row> |
| | | </view> |
| | | <view |
| | | v-if="current == 1" |
| | | v-for="(item, eindex) in lacklist" |
| | | :key="eindex" |
| | | style="background-color: #fff; margin-top: 6rpx" |
| | | > |
| | | <u-row class="padding10"> |
| | | <u-col span="12" class="flex" style="align-items: flex-start"> |
| | | <view |
| | | style=" |
| | | background-color: #f18202; |
| | | color: #fff; |
| | | border-radius: 50%; |
| | | width: 20px; |
| | | height: 20px; |
| | | line-height: 20px; |
| | | text-align: center; |
| | | " |
| | | > |
| | | {{ eindex + 1 }} |
| | | </view> |
| | | <view |
| | | class="color_f18202 padding_left10rpx" |
| | | style="flex: 1; word-break: break-all" |
| | | > |
| | | {{ item.wareMaterialCode }} |
| | | </view> |
| | | </u-col> |
| | | </u-row> |
| | | <u-row> |
| | | <u-col span="8" class="text06"> 批次:{{ item.barNo }} </u-col> |
| | | <u-col span="4" class="text06 text-right"> |
| | | 采购数:{{ item.deliveryQuantity }} |
| | | </u-col> |
| | | </u-row> |
| | | <u-row class=""> |
| | | <u-col span="4" class="text06"> |
| | | 已收货数:{{ item.goodsQuantity }} |
| | | </u-col> |
| | | <u-col span="4" class="text06"> |
| | | 本次收货数:{{ item.uncollectedQuantity }} |
| | | </u-col> |
| | | |
| | | </u-row> |
| | | </view> |
| | | </scroll-view> |
| | | <view class="fontSize32rpx"> |
| | | <!-- <u-row class="padding15 background_fff" style="margin-bottom: 6rpx"> |
| | | <u-col span="6" class="text-gray"> |
| | | 采购数: {{ QuantityTotal }} |
| | | </u-col> |
| | | <u-col span="6" class="font_weight_bold" style="text-align: right"> |
| | | 已收货数: {{ collectedTotal }} |
| | | </u-col> |
| | | </u-row> --> |
| | | <u-row class="padding15 background_fff" style="margin-bottom: 6rpx"> |
| | | <u-col span="6" class="text-gray"> </u-col> |
| | | <u-col |
| | | span="6" |
| | | class="font_weight_bold color_f18202" |
| | | style="text-align: right" |
| | | > |
| | | 本次收货数: {{ uncollectedTotal }} |
| | | <!-- 缺料总数: {{ lackTotal }} --> |
| | | </u-col> |
| | | </u-row> |
| | | </view> |
| | | |
| | | <!-- 批量图片上传 --> |
| | | <view |
| | | class="width fixed bottom140 margin_auto background_fff padding15 border_radius margin_bottom10rpx relative box_sizing transition boxImgWrap" |
| | | > |
| | | <view |
| | | class="ImgListBox" |
| | | v-for="(item, eindex) in fileListImgSrc" |
| | | :key="eindex" |
| | | > |
| | | <image |
| | | class="imgUp" |
| | | :src="item.bendiSrc" |
| | | mode="" |
| | | @click="imgClick(eindex)" |
| | | ></image> |
| | | <u-icon |
| | | @click="delimage(item.resSrc, eindex)" |
| | | name="close-circle-fill" |
| | | color="red" |
| | | size="60" |
| | | class="closeIcon" |
| | | ></u-icon> |
| | | </view> |
| | | <view class="addImgBox"> |
| | | <u-icon name="plus" @click="upload" size="48"></u-icon> |
| | | <text class="fontSize32rpx">选择图片</text> |
| | | </view> |
| | | </view> |
| | | |
| | | <button-modal |
| | | :empTytowerShow="true" |
| | | cleaningTitle="上一步" |
| | | garmenTitle="收货完成" |
| | | @submit="submit" |
| | | @reset="reset(1)" |
| | | /> |
| | | </view> |
| | | <u-action-sheet |
| | | :list="wolist2" |
| | | v-model="modalshow2" |
| | | @click="confirm2" |
| | | ></u-action-sheet> |
| | | |
| | | <!-- 添加批次 --> |
| | | <u-popup |
| | | v-model="detailshowPc" |
| | | border-radius="14" |
| | | @close="detailshowPc = false" |
| | | mode="bottom" |
| | | <u-form |
| | | labelPosition="left" |
| | | label-width="180rpx" |
| | | :model="warehouse" |
| | | ref="warehouseRef" |
| | | > |
| | | <h2 class="text_align_center padding_bottom18 padding15">物料批次信息</h2> |
| | | <!-- <view class="line flex justify-between"> |
| | | <text class="text-gray">物料编号</text> |
| | | <text>{{materlist.wareMaterialCode}}</text> |
| | | </view> |
| | | <view class="line flex justify-between"> |
| | | <text class="text-gray">物料名称</text> |
| | | <text>{{materlist.name}}</text> |
| | | </view> --> |
| | | <view class="line flex justify-between"> |
| | | <text class="text-gray">批次</text> |
| | | <text> |
| | | <u-input |
| | | v-model.trim="addBatch" |
| | | placeholder="请输入批次" |
| | | class="width" |
| | | @focus="addBatch = ''" |
| | | style="font-size: 36rpx; text-align: right" |
| | | <!-- <u-row |
| | | class="border_bottom margin_top10rpx padding_left25rpx" |
| | | style="background-color: #fff" |
| | | > |
| | | <u-col span="12"> |
| | | <u-form-item |
| | | label="包装号:" |
| | | prop="packageCode" |
| | | required |
| | | class="uFormItem" |
| | | > |
| | | </u-input> |
| | | </text> |
| | | </view> |
| | | <view class="margin_top140rpx"> |
| | | <button-modal :subShow="true" garmenTitle="确认" @submit="submitPc" /> |
| | | </view> |
| | | </u-popup> |
| | | <u-input |
| | | v-model.trim="warehouse.packageCode" |
| | | @confirm="getContainerData(1)" |
| | | placeholder="请录入或扫码" |
| | | class="width" |
| | | :focus="curFoucus" |
| | | > |
| | | </u-input> |
| | | </u-form-item> |
| | | </u-col> |
| | | </u-row> --> |
| | | <u-row |
| | | class="border_bottom margin_top10rpx padding_left25rpx" |
| | | style="background-color: #fff" |
| | | > |
| | | <u-col span="12"> |
| | | <u-form-item label="部件条码:" class="uFormItem"> |
| | | <u-input |
| | | v-model="warehouse.upi" |
| | | ref="materialRef" |
| | | placeholder="请扫码录入" |
| | | @focus="warehouse.upi = ''" |
| | | @confirm="getContainerData" |
| | | style="font-weight: bolder; margin-left: 15rpx" |
| | | class="width padding_left25rpx" |
| | | > |
| | | </u-input> |
| | | </u-form-item> |
| | | </u-col> |
| | | </u-row> |
| | | </u-form> |
| | | <!-- 列表 --> |
| | | <view class="margin_top10rpx"> |
| | | <u-swipe-action |
| | | :show="item.show" |
| | | :index="eindex" |
| | | v-for="(item, eindex) in singlist" |
| | | :key="eindex" |
| | | :options="options" |
| | | @click="longpress" |
| | | @open="open" |
| | | @close="close" |
| | | class="margin_bottom10rpx" |
| | | > |
| | | <view class="item u-border-bottom"> |
| | | <!-- 此层wrap在此为必写的,否则可能会出现标题定位错误 --> |
| | | <view class="title-wrap"> |
| | | <view |
| | | :class="item.checked ? 'bg_item' : ''" |
| | | class="fontSize32rpx width margin_auto background_fff padding10 relative box_sizing transition" |
| | | > |
| | | <!-- 部件名称 upi、材料、尺寸,位置、板件状态 --> |
| | | <u-row> |
| | | <u-col span="12" class="flex align-center"> |
| | | <!-- <u-checkbox v-model="item.checked" size="50rpx"></u-checkbox> --> |
| | | <view |
| | | class="flex justify-center align-center" |
| | | style=" |
| | | background-color: #f18202; |
| | | color: #fff; |
| | | border-radius: 50vh; |
| | | width: 40rpx; |
| | | height: 40rpx; |
| | | " |
| | | > |
| | | {{ eindex + 1 }} |
| | | </view> |
| | | <text class="color_f18202 padding_left10rpx"> |
| | | {{ item.upi }} |
| | | </text> |
| | | </u-col> |
| | | </u-row> |
| | | <u-row> |
| | | <u-col span="8"> |
| | | <text class="color_80 padding_left25rpx"> |
| | | 部件名称: {{ item.detailName }} |
| | | </text> |
| | | </u-col> |
| | | <u-col span="4"> |
| | | <text class="color_80"> 位置:{{ item.location }} </text> |
| | | </u-col> |
| | | </u-row> |
| | | <u-row> |
| | | <u-col span="8"> |
| | | <text class="color_80 padding_left25rpx"> |
| | | 材料:{{ item.info18 }} |
| | | </text> |
| | | </u-col> |
| | | <u-col span="4"> |
| | | <text class="color_80"> 尺寸:{{ item.info16 }} </text> |
| | | </u-col> |
| | | </u-row> |
| | | <u-row> |
| | | <u-col span="8"> |
| | | <text class="color_80 padding_left25rpx"> |
| | | 板件状态:{{ getEnumName(item.upiStatus) }} |
| | | </text> |
| | | </u-col> |
| | | <u-col span="4"> |
| | | <text class="color_80"> 次序:{{ item.shelf }} </text> |
| | | </u-col> |
| | | </u-row> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </u-swipe-action> |
| | | </view> |
| | | <modal-code :rescode="rescode" :resmessage="resmessage" ref="resmodal" /> |
| | | |
| | | <button-modal |
| | | :issueShow="true" |
| | | issueTitle="重置" |
| | | subTitle="确认NG" |
| | | restTiltle="取消NG" |
| | | @reset="submit(2)" |
| | | @submit="submit(1)" |
| | | @issue="rest" |
| | | /> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import ButtonModal from "../../../components/buttonModal.vue"; |
| | | import ModalCode from "../../../components/ModalCode.vue"; |
| | | import tkiBarcode from "@/components/tki-barcode/tki-barcode"; |
| | | import bluet from "@/components/blue.vue"; |
| | | import BluePrint from "@/pages/print/bluePrint.js"; |
| | | import ButtonModal from "@/components/buttonModal.vue"; |
| | | import ModalCode from "@/components/ModalCode.vue"; |
| | | import { |
| | | getMaterial, |
| | | getPurchaseOrderDetail, |
| | | addDelivery, |
| | | getQhdOrderDetail, |
| | | getSapSelect, |
| | | addShouhuoJiaoYan, |
| | | } from "../../../api/takeMaterial/orderpiece.js"; |
| | | import { pathToBase64, base64ToPath } from "image-tools"; |
| | | import { addPrintRecord } from "../../../api/print.js"; |
| | | import { getAttrValue } from "@/utils/tool.js"; |
| | | import { translateapp, translateImg } from "@/utils/compress.js"; |
| | | import { deletePicture } from "@/api/deliver.js"; |
| | | import printComp from "@/mixins/printPoLabel.js"; |
| | | import printBanma from "@/mixins/printBanma.js"; |
| | | import mixCheckbox from "@/mixins/checkboxYueKu.js"; |
| | | WmsOperationTaskSetNG, |
| | | WmsOperationTaskCancelNG, |
| | | getBhbMaterialList, |
| | | getenumDataList, |
| | | } from "@/api/putIn/artificial.js"; |
| | | |
| | | export default { |
| | | mixins: [printComp, printBanma, mixCheckbox], |
| | | data() { |
| | | return { |
| | | materialCode: "", //物料编号 |
| | | renameFocus: true, |
| | | detailshow: false, |
| | | rescode: 0, |
| | | autoFoucs: true, |
| | | resmessage: "", |
| | | showBtn: 0, |
| | | current: 0, //滑块默认值 |
| | | fileList: [], |
| | | fileListImgSrc: [], //上传图片列表 |
| | | lastlist: [], |
| | | overlist: [], //收货列表 |
| | | lacklist: [], //缺料列表 |
| | | image: "", //当前显示的图片地址 |
| | | action: this.$myHOST + "/api/sysFile/uploadFile", |
| | | singlist: [], //物料详情 |
| | | lists: [ |
| | | { |
| | | name: "收货(0)", |
| | | }, |
| | | { |
| | | name: "", |
| | | }, |
| | | ], |
| | | list: [], |
| | | arr: [], |
| | | materlist: {}, //物料详情数据 |
| | | operator: "", |
| | | warehouse: { |
| | | barcodeMy: "", |
| | | PageSize: 10000, |
| | | PageNo: 1, |
| | | packageCode: "", |
| | | upi: "", |
| | | }, |
| | | warehouseRules: { |
| | | barcodeMy: [ |
| | | { |
| | | required: true, |
| | | message: "条码不能为空", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | singlist: [ ], //详情列表 |
| | | ordersId: 0, //当前容器绑定的上架单 |
| | | rescode: 0, |
| | | resmessage: "", |
| | | options: [ |
| | | { |
| | | text: "详情", |
| | | text: "打印", |
| | | style: { |
| | | backgroundColor: "#fc9f35", |
| | | }, |
| | | }, |
| | | { |
| | | text: "删除", |
| | | style: { |
| | | backgroundColor: "#fc4b4b", |
| | | }, |
| | | }, |
| | | ], |
| | | operator: "", |
| | | QuantityTotal: 0, //送货总数 |
| | | collectedTotal: 0, //已收货数 |
| | | uncollectedTotal: 0, //收货总数 |
| | | lackTotal: 0, //缺货总数 |
| | | code: "", |
| | | addForm: { |
| | | //打印记录 |
| | | code: "", |
| | | name: "", |
| | | batchNo: "", |
| | | specificationModel: "", |
| | | }, |
| | | lotNo: "", |
| | | contLabel: 1, //打印张数 |
| | | ermNum: "", |
| | | detailshow: false, |
| | | materlist: {}, |
| | | curFoucus: true, |
| | | timer: null, |
| | | printflag: false, |
| | | sapLocate: "", |
| | | modalshow2: false, |
| | | wolist2: [], |
| | | timerT: null, |
| | | addBatch: "", |
| | | detailshowPc: false, |
| | | itemPcAddIndex: "", |
| | | timerSm: null, |
| | | detailableZb: false, |
| | | detailable: false, |
| | | gridFocus: false, |
| | | gridable: true, |
| | | kwbhAllowed: false, |
| | | enumList: [], |
| | | }; |
| | | }, |
| | | components: { |
| | | ButtonModal, |
| | | ModalCode, |
| | | tkiBarcode, |
| | | bluet, |
| | | }, |
| | | onLoad(option) { |
| | | // 越库返回 查数据 |
| | | if (option.po) { |
| | | this.warehouse.PurchaseNo = option.po; |
| | | this.warehouse.asnNo = option.po; |
| | | this.materialBlur(); |
| | | } |
| | | created() { |
| | | getenumDataList({ |
| | | EnumName: "UpiStatusEnum", |
| | | }).then((res) => { |
| | | this.enumList = res.result || []; |
| | | }); |
| | | }, |
| | | onReady() { |
| | | this.$refs.warehouseRef.setRules(this.warehouseRules); |
| | | }, |
| | | mounted() { |
| | | onLoad() { |
| | | this.operator = JSON.parse(uni.getStorageSync("userInfo")).name; |
| | | // this.getVehicleType2() //SAP下拉 |
| | | }, |
| | | mounted() {}, |
| | | methods: { |
| | | showDetail(item, eindex) { |
| | | if (item.WareMaterialCode == "") { |
| | | return; |
| | | } |
| | | item.childen = !item.childen; |
| | | if (this.singlist[eindex].SortingOrderDetailsList.length > 0) { |
| | | return; |
| | | } |
| | | getQhdOrderDetail({ |
| | | WareMaterialCode: item.wareMaterialCode, |
| | | // 'orderType':this.orderType |
| | | }).then((res) => { |
| | | if (res.code == 200) { |
| | | if (Array.isArray(res.data) && res.data.length >= 0) { |
| | | if (res.data.length == 0) { |
| | | uni.showToast({ |
| | | title: "暂无取货数据", |
| | | icon: "none", |
| | | duration: 2000, |
| | | }); |
| | | return; |
| | | } |
| | | res.data.forEach((item) => { |
| | | item.uncollectedQuantity = ""; |
| | | // return item; |
| | | }); |
| | | this.singlist[eindex].SortingOrderDetailsList = res.data; |
| | | } |
| | | } |
| | | }); |
| | | getEnumName(value) { |
| | | const name = this.enumList.find((item) => item.value === value); |
| | | return name ? name.name : ""; |
| | | }, |
| | | //获取print date print time |
| | | getCurrentDate() { |
| | | let date = new Date(); |
| | | let year = date.getFullYear(); //年 |
| | | let month = date.getMonth() + 1; //月 |
| | | month = month >= 10 ? month : "0" + month; |
| | | let day = date.getDate(); //日 |
| | | day = day >= 10 ? day : "0" + day; |
| | | let hour = date.getHours(); //时 |
| | | hour = hour >= 10 ? hour : "0" + hour; |
| | | let min = date.getMinutes(); //分 |
| | | min = min >= 10 ? min : "0" + min; |
| | | let second = date.getSeconds(); //秒 |
| | | second = second >= 10 ? second : "0" + second; |
| | | return { |
| | | date: `${day}.${month}.${year}`, |
| | | time: `${hour}:${min}:${second}`, |
| | | formate: `${year}/${month}/${day}`, |
| | | }; |
| | | }, |
| | | //打印 |
| | | init(param) { |
| | | const arr = ["wareMaterialCode", "barNo", "uncollectedQuantity"]; |
| | | const arrzw = ["物料编号", "批次", "实际收货数"]; |
| | | let isAllow = ""; |
| | | Object.keys(this.materlist).forEach((item) => { |
| | | if (arr.includes(item)) { |
| | | if (!this.materlist[item]) { |
| | | isAllow = arr.indexOf(item); |
| | | return; |
| | | } |
| | | } |
| | | }); |
| | | if (isAllow != "") { |
| | | this.detailshow = false; |
| | | this.rescode = 400; |
| | | this.resmessage = `${arrzw[isAllow]}为空,不能继续打印`; |
| | | this.showBtn = 0; |
| | | this.$refs.resmodal.show = true; |
| | | return; |
| | | } |
| | | |
| | | if (!this.contLabel || !this.ermNum) { |
| | | //获取的信息 |
| | | getContainerData() { |
| | | if (!this.warehouse.upi) { |
| | | uni.showToast({ |
| | | title: "数量不能为空且大于0", |
| | | icon: "none", |
| | | }); |
| | | return; |
| | | } |
| | | if (param == 1) { |
| | | this.printComp(); |
| | | } else { |
| | | // 供应商编号 供应商名字 |
| | | if (this.materlist.supplier) { |
| | | let arr = this.materlist.supplier.split(" "); |
| | | this.materlist.supplier = arr[0]; |
| | | this.materlist.supplierName = arr[1]; |
| | | } |
| | | console.log(this.materlist); |
| | | this.printBanma(); |
| | | } |
| | | }, |
| | | //物料查询 |
| | | materialBlur(param) { |
| | | var pramCd = {}; |
| | | if (this.warehouse.barcodeMy && this.warehouse.barcodeMy.length > 0) { |
| | | if (this.warehouse.barcodeMy.indexOf(",") != -1) { |
| | | pramCd = { |
| | | SN_1d: "", |
| | | SN_2d: this.warehouse.barcodeMy |
| | | }; |
| | | } else { |
| | | pramCd = { |
| | | SN_1d: this.warehouse.barcodeMy, |
| | | SN_2d: "", |
| | | }; |
| | | } |
| | | console.log(pramCd) |
| | | getPurchaseOrderDetail({ |
| | | ...pramCd, |
| | | }).then((res) => { |
| | | if (res.code == 200) { |
| | | var arrList = res.result.items; |
| | | if (arrList.length == 0) { |
| | | this.resmessage = "暂无数据"; |
| | | this.rescode = 400; |
| | | this.showBtn = 0; |
| | | this.$refs.resmodal.show = true; |
| | | } |
| | | if (Array.isArray(arrList) && arrList.length >= 1) { |
| | | arrList.forEach((item) => { |
| | | item.uncollectedQuantity = ""; |
| | | item.key = item.id; |
| | | }); |
| | | var stockQty = arrList[0].stockQty || 0; |
| | | var allHe = Number(arrList[0].quantity + stockQty).toFixed(3); |
| | | //最高库存maxImumqty < 收货数quantity + 库存数stockQty |
| | | if(arrList[0].maxImumqty && arrList[0].maxImumqty > 0 && |
| | | (arrList[0].maxImumqty < allHe)){ |
| | | var s1 = `物料${arrList[0].materialCode}当前库存${stockQty}和收货数${arrList[0].quantity}之和超出最高库存${arrList[0].maxImumqty},是否继续收货?`; |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: s1, |
| | | showCancel: true, |
| | | cancelColor: "#333333", |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | arrList.forEach((item) => { |
| | | var arrNo = this.singlist.findIndex((v) => v.id == item.id); |
| | | if (arrNo == -1) { |
| | | this.singlist.unshift(item); |
| | | } |
| | | }); |
| | | } else if (res.cancel) { |
| | | } |
| | | }, |
| | | }); |
| | | }else{ |
| | | arrList.forEach((item) => { |
| | | var arrNo = this.singlist.findIndex((v) => v.id == item.id); |
| | | if (arrNo == -1) { |
| | | this.singlist.unshift(item); |
| | | } |
| | | }); |
| | | } |
| | | } else { |
| | | this.resmessage = "暂无数据"; |
| | | this.rescode = 400; |
| | | this.showBtn = 0; |
| | | this.$refs.resmodal.show = true; |
| | | } |
| | | } |
| | | }); |
| | | } else { |
| | | uni.showToast({ |
| | | title: "请扫码", |
| | | title: "请扫部件条码", |
| | | icon: "none", |
| | | duration: 2000, |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | }, |
| | | //删除详情 |
| | | longpredel(index, eindex) { |
| | | if (eindex == 1) { |
| | | this.singlist.splice(index, 1); |
| | | } else { |
| | | this.materlist = this.singlist[index]; |
| | | this.detailshow = true; |
| | | } |
| | | }, |
| | | //卡片选中 |
| | | click(e) { |
| | | e.cardNum = true; |
| | | this.$forceUpdate(); |
| | | getBhbMaterialList({ |
| | | upi: this.warehouse.upi, |
| | | }).then((res) => { |
| | | const result = res.result; |
| | | if (Array.isArray(result) && result.length == 0) { |
| | | uni.showToast({ |
| | | title: "数据不存在", |
| | | icon: "none", |
| | | duration: 2000, |
| | | }); |
| | | this.singlist = []; |
| | | return; |
| | | } |
| | | this.singlist = res.result; |
| | | }); |
| | | }, |
| | | // 如果打开一个的时候,不需要关闭其他,则无需实现本方法 |
| | | open(index) { |
| | | // 先将正在被操作的swipeAction标记为打开状态,否则由于props的特性限制, |
| | | // 原本为'false',再次设置为'false'会无效 |
| | | this.singlist[index].cardNum = true; |
| | | this.singlist[index].show = true; |
| | | this.singlist.map((val, idx) => { |
| | | if (index != idx) this.singlist[idx].show = false; |
| | | }); |
| | | this.$forceUpdate(); |
| | | }, |
| | | close(index) { |
| | | this.singlist[index].show = false; |
| | | this.singlist[index].cardNum = false; |
| | | this.$forceUpdate(); |
| | | }, |
| | | // tabs通知swiper切换 |
| | | tabsChange(index) { |
| | | this.current = index; |
| | | }, |
| | | //改变收货数量 |
| | | changeNum(val) { |
| | | val.cardNum = false; |
| | | if (!val.uncollectedQuantity) { |
| | | this.rescode = 400; |
| | | this.resmessage = "收货数量不能为空且大于0"; |
| | | this.showBtn = 0; |
| | | this.$refs.resmodal.show = true; |
| | | } |
| | | // val.uncollectedQuantity = Number(val.uncollectedQuantity.toString().match(/^\d+(?:\.\d{0,2})?/)) //保留2位小数 |
| | | let num1 = Number( |
| | | Number(val.deliveryQuantity) - Number(val.goodsQuantity) |
| | | ).toFixed(3); //必须保留3位小数 -否则会造成剩余物料是小数的时候,无法收货 |
| | | if (Number(val.uncollectedQuantity).toFixed(3) > Number(num1)) { |
| | | val.uncollectedQuantity = 0; |
| | | this.rescode = 400; |
| | | this.resmessage = |
| | | "收货数" + |
| | | val.uncollectedQuantity + |
| | | "不能大于采购总数" + |
| | | val.deliveryQuantity + |
| | | "减已收货数" + |
| | | val.goodsQuantity; |
| | | this.showBtn = 0; |
| | | this.$refs.resmodal.show = true; |
| | | } |
| | | if (val.uncollectedQuantity && val.uncollectedQuantity >= 0) { |
| | | val.edit = true; |
| | | this.$forceUpdate(); |
| | | } |
| | | //物料详情 |
| | | longpress(index, eindex) { |
| | | this.materlist = this.singlist[index]; |
| | | this.detailshow = true; |
| | | }, |
| | | |
| | | changeNumIn(val, valParent) { |
| | | if (val.uncollectedQuantity === "" || val.uncollectedQuantity < 0) { |
| | | this.rescode = 400; |
| | | this.resmessage = "收货数量不能为空"; |
| | | this.showBtn = 0; |
| | | this.$refs.resmodal.show = true; |
| | | } |
| | | val.uncollectedQuantity = Number( |
| | | val.uncollectedQuantity.toString().match(/^\d+(?:\.\d{0,3})?/) |
| | | ); //保留2位小数 |
| | | |
| | | if (val.uncollectedQuantity > val.quantity) { |
| | | val.uncollectedQuantity = 0; |
| | | this.rescode = 400; |
| | | this.resmessage = "不能大于缺料数"; |
| | | this.showBtn = 0; |
| | | this.$refs.resmodal.show = true; |
| | | } |
| | | if (val.uncollectedQuantity > valParent.uncollectedQuantity) { |
| | | val.uncollectedQuantity = 0; |
| | | this.rescode = 400; |
| | | this.resmessage = "不能大于收货数"; |
| | | this.showBtn = 0; |
| | | this.$refs.resmodal.show = true; |
| | | } |
| | | }, |
| | | upload() { |
| | | this.fileList = []; |
| | | uni.chooseImage({ |
| | | sourceType: ["camera", "album"], |
| | | sizeType: "original", //选择原图 |
| | | count: 1, |
| | | success: (res) => { |
| | | res.tempFilePaths.forEach((item, index) => { |
| | | uni.showLoading({ |
| | | title: "上传中...", |
| | | }); |
| | | translateapp(item, 80, (imgUrl) => { |
| | | let fileData = [{ uri: imgUrl }]; |
| | | uni.uploadFile({ |
| | | url: this.action, |
| | | files: fileData, //blob: |
| | | fileType: "image", |
| | | success: (res) => { |
| | | uni.hideLoading(); |
| | | const resJson = JSON.parse(res.data); |
| | | if (resJson.code == 200) { |
| | | var jsonImg = resJson.result; |
| | | if ( |
| | | jsonImg == null || |
| | | jsonImg.url == null || |
| | | jsonImg.url == "" |
| | | ) { |
| | | this.image = ""; |
| | | this.fileList = []; |
| | | this.$u.toast("图片上传服务器失败"); |
| | | return; |
| | | } |
| | | this.fileList.push(jsonImg.url); |
| | | this.fileListImgSrc.push({ |
| | | resSrc: jsonImg.url, |
| | | bendiSrc: item, |
| | | }); |
| | | } else { |
| | | this.$u.toast("图片上传失败"); |
| | | this.fileList = []; |
| | | this.image = ""; |
| | | } |
| | | }, |
| | | }); |
| | | }); |
| | | }); |
| | | }, |
| | | }); |
| | | }, |
| | | // 删除图片 |
| | | delimage(filepath, index) { |
| | | if (!filepath) { |
| | | return; |
| | | } |
| | | deletePicture({ |
| | | id: filepath, |
| | | }).then((res) => { |
| | | if (res.code == 200) { |
| | | this.fileListImgSrc.splice(index, 1); |
| | | this.$u.toast("移除图片成功"); |
| | | } else { |
| | | this.rescode = 400; |
| | | this.resmessage = `删除图片失败`; |
| | | this.$refs.resmodal.show = true; |
| | | } |
| | | }); |
| | | }, |
| | | //预览图片 |
| | | imgClick(index) { |
| | | var urlsArr = []; |
| | | this.fileListImgSrc.forEach((item) => { |
| | | urlsArr.push(item.resSrc); |
| | | }); |
| | | uni.previewImage({ |
| | | urls: urlsArr, |
| | | current: urlsArr[index], |
| | | }); |
| | | }, |
| | | //监听原生返回键 |
| | | onBackPress(e) { |
| | | this.delimage(); |
| | | }, |
| | | //下一步 |
| | | next() { |
| | | if (this.warehouse.asnNo == "") { |
| | | uni.showToast({ |
| | | title: "请输入ASN单号!", |
| | | icon: "none", |
| | | }); |
| | | return; |
| | | } |
| | | this.singlist.forEach((item, index) => { |
| | | item.uncollectedQuantity = item.quantity; |
| | | }); |
| | | // // isBatchMge为true: 批次管理的物料 必须输入 |
| | | // let arrMge = this.singlist.filter((v)=>(v.isBatchMge == 1 && v.barNo==''|| v.isBatchMge == 1 && v.barNo==null)).filter((v2)=>(v2.uncollectedQuantity>0)) |
| | | // if(arrMge.length>0){ |
| | | // uni.showToast({ |
| | | // title: `${arrMge[0].wareMaterialCode}请填写空的批次`, |
| | | // icon:'none' |
| | | // }) |
| | | // return |
| | | //确认 |
| | | submit(type) { |
| | | // const filterArr = this.singlist.filter((item) => item.checked); |
| | | // if (filterArr.length <= 0) { |
| | | // this.rescode = 400; |
| | | // this.resmessage = "请选择解绑的物料!"; |
| | | // this.$refs.resmodal.show = true; |
| | | // return; |
| | | // } |
| | | this.lastlist = this.singlist.filter((v) => v.uncollectedQuantity > 0); |
| | | |
| | | this.lacklist = this.singlist.reduce((curr, item) => { |
| | | if ( |
| | | item.deliveryQuantity - |
| | | item.uncollectedQuantity - |
| | | item.goodsQuantity > |
| | | 0 |
| | | ) { |
| | | curr.push(item); |
| | | } |
| | | return curr; |
| | | }, []); |
| | | |
| | | let params2 = []; |
| | | |
| | | this.lastlist.forEach((item, index) => { |
| | | params2.push({ |
| | | ...item, |
| | | // id: item.id, |
| | | // wareMaterialCode: item.wareMaterialCode, |
| | | // uncollectedQuantity: item.uncollectedQuantity, |
| | | // purchaseNo: this.warehouse.PurchaseNo, |
| | | // asnNo: this.warehouse.asnNo,//到货单号 |
| | | // batchNo: item.barNo, |
| | | // isCheck: item.isCheck, |
| | | // isBatchMge: item.isBatchMge, |
| | | // ebelp: item.ebelp, |
| | | // sap_Location: item.sap_Location, //sap位置 |
| | | }); |
| | | }); |
| | | |
| | | // 已收货数 |
| | | this.QuantityTotal = this.singlist.reduce((prev, next) => { |
| | | let num = Number(prev) + Number(next.deliveryQuantity); |
| | | return Number(num).toFixed(3); |
| | | }, 0); |
| | | |
| | | this.collectedTotal = this.singlist.reduce((prev, next) => { |
| | | let num = Number(prev) + Number(next.goodsQuantity); |
| | | return Number(num).toFixed(3); |
| | | }, 0); |
| | | this.uncollectedTotal = this.singlist.reduce((prev, next) => { |
| | | let num = Number(prev) + Number(next.uncollectedQuantity); |
| | | return Number(num).toFixed(3); |
| | | }, 0); |
| | | this.lackTotal = this.singlist.reduce((prev, next) => { |
| | | let num = |
| | | Number(prev) + |
| | | Number(next.deliveryQuantity) - |
| | | Number(next.uncollectedQuantity) - |
| | | Number(next.goodsQuantity); |
| | | return Number(num).toFixed(3); |
| | | }, 0); |
| | | this.lists[0].name = `收货(${this.lastlist.length})`; |
| | | // this.lists[1].name = `缺料(${this.lacklist.length})` |
| | | this.lists[1].name = ""; |
| | | |
| | | if (this.uncollectedTotal <= 0) { |
| | | uni.showToast({ |
| | | title: "收货总数大于0", |
| | | icon: "none", |
| | | duration: 2000, |
| | | }); |
| | | // const warehousOrderDetails = filterArr.reduce((curr, item) => { |
| | | // curr.push({ |
| | | // ...item, |
| | | // }); |
| | | // return curr; |
| | | // }, []); |
| | | var upi = this.singlist[0]?.upi || ""; |
| | | if (this.singlist.length != 1 || !upi) { |
| | | this.rescode = 400; |
| | | this.resmessage = "请扫正确的部件条码!"; |
| | | this.$refs.resmodal.show = true; |
| | | return; |
| | | } |
| | | |
| | | this.renameFocus = false; |
| | | |
| | | // addShouhuoJiaoYan(params2).then((res) => { |
| | | // if (res.code == 200) { |
| | | // if (res.data) { |
| | | // uni.showModal({ |
| | | // title: '提示', |
| | | // content: `${res.data},确认下一步?`, |
| | | // showCancel: true, |
| | | // cancelColor: '#333333', |
| | | // success: (res => { |
| | | // if (res.confirm) { |
| | | // this.renameFocus = false; |
| | | // } else if (res.cancel) { |
| | | // } |
| | | // }) |
| | | // }); |
| | | // } else { |
| | | // this.renameFocus = false |
| | | // } |
| | | // } |
| | | // }) |
| | | }, |
| | | //确认收货 |
| | | submit() { |
| | | if (this.uncollectedTotal <= 0) { |
| | | uni.showToast({ |
| | | title: "收货总数大于0", |
| | | icon: "none", |
| | | duration: 2000, |
| | | }); |
| | | return; |
| | | } |
| | | let params = []; |
| | | //图片地址 |
| | | let idImg = []; |
| | | if (this.fileListImgSrc && this.fileListImgSrc.length > 0) { |
| | | this.fileListImgSrc.forEach((item) => { |
| | | idImg.push(item.resSrc); |
| | | const params = { |
| | | Upi: upi, |
| | | Reason: "", |
| | | }; |
| | | if (type == 1) { |
| | | uni.showModal({ |
| | | title: "NG处理", |
| | | content: "是否确认NG处理?", |
| | | showCancel: true, |
| | | cancelColor: "#333333", |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | WmsOperationTaskSetNG(params).then((res) => { |
| | | this.rescode = 200; |
| | | this.$refs.resmodal.show = true; |
| | | this.resmessage = "NG处理成功"; |
| | | this.rest(); |
| | | }); |
| | | } else if (res.cancel) { |
| | | } |
| | | }, |
| | | }); |
| | | } |
| | | this.lastlist.forEach((item, index) => { |
| | | params.push({ |
| | | PDAReceivingActionType: 1, //标准收货 |
| | | OrderAsnDetailsId: item.id, //ASN单明细ID |
| | | createdUserId: JSON.parse(uni.getStorageSync("userInfo")).id, |
| | | createdUserName: JSON.parse(uni.getStorageSync("userInfo")).name, |
| | | updatedUserId: JSON.parse(uni.getStorageSync("userInfo")).id, |
| | | updatedUserName: JSON.parse(uni.getStorageSync("userInfo")).name, |
| | | id: item.id, |
| | | ...item, |
| | | ImageIds: idImg.join(","), //图片地址 |
| | | |
| | | if (type == 2) { |
| | | uni.showModal({ |
| | | title: "取消NG处理", |
| | | content: "是否确认取消NG处理?", |
| | | showCancel: true, |
| | | cancelColor: "#333333", |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | WmsOperationTaskCancelNG(params).then((res) => { |
| | | this.rescode = 200; |
| | | this.$refs.resmodal.show = true; |
| | | this.resmessage = "取消NG成功"; |
| | | this.rest(); |
| | | }); |
| | | } else if (res.cancel) { |
| | | } |
| | | }, |
| | | }); |
| | | }); |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: "是否确认收货?", |
| | | showCancel: true, |
| | | cancelColor: "#333333", |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | addDelivery(params).then((res) => { |
| | | this.rescode = res.code; |
| | | this.resmessage = res.message || "收货成功"; |
| | | this.$refs.resmodal.show = true; |
| | | if (res.code == 200) { |
| | | this.showBtn = 0; |
| | | this.renameFocus = true; |
| | | this.singlist = []; |
| | | this.warehouse.barcodeMy = ""; |
| | | this.fileList = []; |
| | | this.fileListImgSrc = []; |
| | | } else { |
| | | this.showBtn = 0; |
| | | } |
| | | }); |
| | | } else if (res.cancel) { |
| | | } |
| | | }, |
| | | }); |
| | | } |
| | | }, |
| | | //清楚选中 |
| | | resthandle(parm) { |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: "是否确认重置?", |
| | | showCancel: true, |
| | | cancelColor: "#333333", |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | this.rest(); |
| | | } else if (res.cancel) { |
| | | } |
| | | }, |
| | | }); |
| | | }, |
| | | //清楚选中 |
| | | rest(parm) { |
| | | this.warehouse.barcodeMy = ""; |
| | | this.autoFoucs = true; |
| | | rest() { |
| | | this.warehouse.upi = ""; |
| | | this.singlist = []; |
| | | this.asnNo = ""; |
| | | this.delimage(); |
| | | }, |
| | | reset(back) { |
| | | if (back) { |
| | | this.autoFoucs = false; |
| | | } |
| | | this.renameFocus = true; |
| | | }, |
| | | //打印 |
| | | onPrint() { |
| | | let _this = this; |
| | | if (!uni.getStorageSync("deviceId")) { |
| | | uni.showToast({ |
| | | title: "请连接打印机", |
| | | icon: "error", |
| | | duration: 2000, |
| | | }); |
| | | return; |
| | | } |
| | | this.writeBLECharacteristicValue(); |
| | | }, |
| | | beforeDestroy() { |
| | | // 销毁定时器 |
| | | if (this.timer) { |
| | | clearTimeout(this.timer); |
| | | this.timer = null; |
| | | } |
| | | }, |
| | | //类型聚焦事件 |
| | | containerFocus2() { |
| | | uni.hideKeyboard(); |
| | | this.modalshow2 = true; |
| | | }, |
| | | getVehicleType2() { |
| | | getSapSelect().then((res) => { |
| | | if (res.code == 200) { |
| | | const dataT = res.data; |
| | | if (dataT && dataT.length == 0) { |
| | | this.wolist2 = []; |
| | | return; |
| | | } |
| | | let dataDst = []; |
| | | dataT.forEach((item) => { |
| | | dataDst.push({ |
| | | text: item, |
| | | id: item, |
| | | }); |
| | | }); |
| | | this.wolist2 = dataDst; |
| | | this.sapLocate = dataDst[0].id; |
| | | } |
| | | }); |
| | | }, |
| | | //类型选择 |
| | | confirm2(index) { |
| | | // this.warehouse.containerCode = this.wolist2[index].text; |
| | | // this.warehouse.containerCode = this.wolist2[index].id; |
| | | console.log(this.wolist2[index].text); |
| | | this.sapLocate = this.wolist2[index].text; |
| | | this.singlist.forEach((item) => { |
| | | item.sap_Location = this.wolist2[index].text; |
| | | }); |
| | | console.log(this.singlist); |
| | | this.$forceUpdate(); |
| | | }, |
| | | goYuKu() { |
| | | this.$refs.resmodal.show = false; |
| | | uni.navigateTo({ |
| | | url: |
| | | "/pages/takeMaterial/orderpiece/poYueku?po=" + |
| | | this.warehouse.PurchaseNo, |
| | | }); |
| | | // uni.showModal({ |
| | | // title: '提示', |
| | | // content: '是否确认越库?', |
| | | // showCancel: true, |
| | | // cancelColor: '#333333', |
| | | // success: (res => { |
| | | // if (res.confirm) { |
| | | // uni.navigateTo({ |
| | | // url: '/pages/crossDock/crossDock?ids='+this.arrIds |
| | | // }) |
| | | // } else if (res.cancel) { |
| | | // } |
| | | // }) |
| | | // }); |
| | | }, |
| | | // 添加批次 |
| | | addBath(index) { |
| | | this.itemPcAddIndex = index; |
| | | this.detailshowPc = true; |
| | | }, |
| | | // 确认 添加批次 |
| | | submitPc() { |
| | | if (!this.addBatch) { |
| | | uni.showToast({ |
| | | title: "批次号不能为空!", |
| | | icon: "none", |
| | | duration: 2000, |
| | | }); |
| | | return; |
| | | } |
| | | let itemNow = JSON.parse( |
| | | JSON.stringify(this.singlist[this.itemPcAddIndex]) |
| | | ); |
| | | itemNow.barNo = this.addBatch; |
| | | itemNow.uncollectedQuantity = 1; |
| | | this.singlist.splice(this.itemPcAddIndex, 0, itemNow); |
| | | this.detailshowPc = false; |
| | | }, |
| | | |
| | | |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | .title-wrap { |
| | | margin-bottom: 15rpx; |
| | | border-bottom: 1px solid #f18202; |
| | | border-top: 1px solid #f18202; |
| | | padding: 3px; |
| | | .content { |
| | | height: 500rpx; |
| | | overflow-y: scroll; |
| | | width: 100%; |
| | | padding: 15rpx; |
| | | box-sizing: border-box; |
| | | |
| | | .content-item { |
| | | padding: 15rpx; |
| | | background-color: #fff; |
| | | margin-bottom: 15rpx; |
| | | border-radius: 8rpx; |
| | | font-size: 32rpx; |
| | | } |
| | | } |
| | | |
| | | .bg_item { |
| | | background: #ffebcd !important; |
| | | } |
| | | |
| | | .qhd_wp { |
| | | padding: 0 20rpx; |
| | | border-top: 1px solid #f18202; |
| | | } |
| | | |
| | | .detail_btn { |
| | | text-align: right; |
| | | padding: 10px; |
| | | } |
| | | |
| | | |
| | | </style> |
| | |
| | | > |
| | | <u-input |
| | | v-model.trim="warehouse.packageCode" |
| | | @focus="warehouse.packageCode = ''" |
| | | @confirm="getContainerData(1)" |
| | | placeholder="请录入或扫码" |
| | | class="width" |
| | |
| | | style="background-color: #fff" |
| | | > |
| | | <u-col span="12"> |
| | | <u-form-item label="板件号:" class="uFormItem"> |
| | | <u-form-item label="部件条码:" class="uFormItem"> |
| | | <u-input |
| | | v-model="warehouse.upi" |
| | | ref="materialRef" |
| | |
| | | <!-- 部件名称 upi、材料、尺寸,位置、板件状态 --> |
| | | <u-row> |
| | | <u-col span="12" class="flex align-center"> |
| | | <u-checkbox v-model="item.checked" size="50rpx"></u-checkbox> |
| | | <!-- <u-checkbox v-model="item.checked" size="50rpx"></u-checkbox> --> |
| | | <view |
| | | class="flex justify-center align-center" |
| | | style=" |
| | |
| | | <u-row> |
| | | <u-col span="8"> |
| | | <text class="color_80 padding_left25rpx"> |
| | | 板件状态:{{ item.upiStatus }} |
| | | 板件状态:{{ getEnumName(item.upiStatus) }} |
| | | </text> |
| | | </u-col> |
| | | <u-col span="4"> |
| | |
| | | </u-swipe-action> |
| | | </view> |
| | | <modal-code :rescode="rescode" :resmessage="resmessage" ref="resmodal" /> |
| | | <u-popup |
| | | v-model="detailshow" |
| | | border-radius="14" |
| | | @close="detailshow = false" |
| | | mode="bottom" |
| | | > |
| | | <!-- <view class="pop "> --> |
| | | <h2 class="text_align_center padding_bottom18 padding15">物料信息</h2> |
| | | <view class="line flex justify-between"> |
| | | <text class="text-gray">物料编号</text> |
| | | <text>{{ this.materlist.materialCode }}</text> |
| | | </view> |
| | | <view class="line flex justify-between"> |
| | | <text class="text-gray">物料名称</text> |
| | | <text>{{ this.materlist.materialName }}</text> |
| | | </view> |
| | | <view class="line flex justify-between"> |
| | | <text class="text-gray">物料小类</text> |
| | | <text>{{ this.materlist.materialTypeName }}</text> |
| | | </view> |
| | | <view class="line flex justify-between"> |
| | | <text class="text-gray">批次</text> |
| | | <text>{{ this.materlist.batchNo }}</text> |
| | | </view> |
| | | <view class="line flex justify-between"> |
| | | <text class="text-gray">物料规格</text> |
| | | <text>{{ this.materlist.specificationModel }}</text> |
| | | </view> |
| | | <view class="line flex justify-between"> |
| | | <text class="text-gray">数量</text> |
| | | <text>{{ this.materlist.unBindQuantity }}</text> |
| | | </view> |
| | | <!-- </view> --> |
| | | <view class="margin_top140rpx"> |
| | | <button-modal |
| | | :subShow="true" |
| | | garmenTitle="打印" |
| | | @submit="init" |
| | | @reset="rest" |
| | | /> |
| | | </view> |
| | | </u-popup> |
| | | |
| | | <button-modal |
| | | :empTytowerShow="true" |
| | | cleaningTitle="重置" |
| | | garmenTitle="物料解绑" |
| | | @submit="submit" |
| | | @reset="back" |
| | | :subShow="true" |
| | | garmenTitle="重置" |
| | | @submit="rest" |
| | | @reset="rest" |
| | | /> |
| | | </view> |
| | | </template> |
| | |
| | | gridFocus: false, |
| | | gridable: true, |
| | | kwbhAllowed: false, |
| | | enumList: [], |
| | | }; |
| | | }, |
| | | components: { |
| | | ButtonModal, |
| | | ModalCode, |
| | | }, |
| | | created() { |
| | | getenumDataList({ |
| | | EnumName: "UpiStatusEnum", |
| | | }).then((res) => { |
| | | this.enumList = res.result || []; |
| | | }); |
| | | }, |
| | | onLoad() { |
| | | this.operator = JSON.parse(uni.getStorageSync("userInfo")).name; |
| | | }, |
| | | mounted() { |
| | | getenumDataList({ |
| | | EnumName: "UpiStatusEnum", |
| | | }).then((res) => { |
| | | this.singlist = res.data.result || []; |
| | | }); |
| | | |
| | | }, |
| | | |
| | | methods: { |
| | | getEnumName(value) { |
| | | const name = this.enumList.find((item) => item.value === value); |
| | | return name? name.name : ""; |
| | | }, |
| | | // 如果打开一个的时候,不需要关闭其他,则无需实现本方法 |
| | | open(index) { |
| | | // 先将正在被操作的swipeAction标记为打开状态,否则由于props的特性限制, |
| | |
| | | this.materlist = this.singlist[index]; |
| | | this.detailshow = true; |
| | | }, |
| | | //标签重新打印 |
| | | init() { |
| | | const arr = ["materialCode", "unBindQuantity"]; |
| | | const arrzw = ["物料编号", "本次解绑数量"]; |
| | | let isAllow = ""; |
| | | Object.keys(this.materlist).forEach((item) => { |
| | | if (arr.includes(item)) { |
| | | if (!this.materlist[item]) { |
| | | isAllow = arr.indexOf(item); |
| | | // this.rescode = 400 |
| | | // this.resmessage = `${arrzw[isAllow]}为空,不能继续打印` |
| | | // this.resmessage = `${item}为空,不能继续打印` |
| | | // this.$refs.resmodal.show = true |
| | | return; |
| | | } |
| | | } |
| | | }); |
| | | if (isAllow != "") { |
| | | this.detailshow = false; |
| | | this.rescode = 400; |
| | | this.resmessage = `${arrzw[isAllow]}为空,不能继续打印`; |
| | | this.$refs.resmodal.show = true; |
| | | return; |
| | | } |
| | | if ( |
| | | this.materlist.unBindQuantity <= 0 || |
| | | this.materlist.unBindQuantity > this.materlist.quantity |
| | | ) { |
| | | this.detailshow = false; |
| | | this.rescode = 400; |
| | | this.resmessage = `数量不符合规范,不能继续打印`; |
| | | this.$refs.resmodal.show = true; |
| | | return; |
| | | } |
| | | if (!this.materlist.specificationModel) { |
| | | this.materlist.specificationModel = ""; |
| | | } |
| | | let ptintContext = [ |
| | | { |
| | | type: "text", |
| | | x: 0, |
| | | y: 0, |
| | | text: "", |
| | | size: 2, |
| | | rotate: 0, |
| | | bold: 0, |
| | | underline: false, |
| | | reverse: false, |
| | | }, |
| | | { |
| | | type: "text", |
| | | x: 0, |
| | | y: 0, |
| | | text: "", |
| | | size: 2, |
| | | rotate: 0, |
| | | bold: 0, |
| | | underline: false, |
| | | reverse: false, |
| | | }, |
| | | { |
| | | type: "text", |
| | | x: 0, |
| | | y: 0, |
| | | text: "", |
| | | size: 2, |
| | | rotate: 0, |
| | | bold: 0, |
| | | underline: false, |
| | | reverse: false, |
| | | }, |
| | | /* 以上空数据,为防止丢包时打印不正常 */ |
| | | { type: "line", x1: 3, y1: 3, x2: 565, y2: 3, width: 2 }, |
| | | { type: "line", x1: 3, y1: 3, x2: 3, y2: 345, width: 2 }, |
| | | { type: "line", x1: 3, y1: 345, x2: 565, y2: 345, width: 2 }, |
| | | { type: "line", x1: 565, y1: 345, x2: 565, y2: 3, width: 2 }, |
| | | { |
| | | type: "text", |
| | | x: 80, |
| | | y: 15, |
| | | text: "牧野汽车装备(武汉)有限公司", |
| | | size: 3, |
| | | rotate: 0, |
| | | bold: 1, |
| | | underline: false, |
| | | reverse: false, |
| | | }, |
| | | { type: "line", x1: 3, y1: 60, x2: 565, y2: 60, width: 2 }, |
| | | { |
| | | type: "text", |
| | | x: 10, |
| | | y: 75, |
| | | text: `物料编号: ${this.materlist.materialCode}`, |
| | | size: 2, |
| | | rotate: 0, |
| | | bold: 1, |
| | | underline: false, |
| | | reverse: false, |
| | | }, |
| | | { type: "line", x1: 3, y1: 110, x2: 380, y2: 110, width: 2 }, |
| | | { |
| | | type: "text", |
| | | x: 10, |
| | | y: 125, |
| | | text: `物料名称: ${this.materlist.materialTypeName || ""}`, |
| | | size: 2, |
| | | rotate: 0, |
| | | bold: 1, |
| | | underline: false, |
| | | reverse: false, |
| | | }, |
| | | { type: "line", x1: 3, y1: 160, x2: 380, y2: 160, width: 2 }, |
| | | { |
| | | type: "text", |
| | | x: 10, |
| | | y: 175, |
| | | text: `批次: ${this.materlist.batchNo}`, |
| | | size: 2, |
| | | rotate: 0, |
| | | bold: 1, |
| | | underline: false, |
| | | reverse: false, |
| | | }, |
| | | { type: "line", x1: 3, y1: 210, x2: 565, y2: 210, width: 2 }, |
| | | { type: "line", x1: 380, y1: 60, x2: 380, y2: 210, width: 2 }, |
| | | { |
| | | type: "qr", |
| | | x: 410, |
| | | y: 72, |
| | | text: `PARTS NUMBER: ${this.materlist.materialCode},SAP: ${ |
| | | this.materlist.sap_Location || "" |
| | | },BOXNUM: ${this.materlist.boxNo || ""},LOT NO: ${ |
| | | this.materlist.batchNo |
| | | },QUANTITY: ${this.materlist.unBindQuantity}`, |
| | | width: 3, |
| | | level: 1, |
| | | }, |
| | | { |
| | | type: "text", |
| | | x: 10, |
| | | y: 225, |
| | | text: `规格型号: ${ |
| | | this.materlist.specificationModel.length > 32 |
| | | ? this.materlist.specificationModel.substr(0, 32) |
| | | : this.materlist.specificationModel |
| | | }`, |
| | | size: 2, |
| | | rotate: 0, |
| | | bold: 1, |
| | | underline: false, |
| | | reverse: false, |
| | | }, |
| | | { type: "line", x1: 3, y1: 260, x2: 565, y2: 260, width: 2 }, |
| | | { |
| | | type: "text", |
| | | x: 120, |
| | | y: 290, |
| | | text: "MAKINO J(CHINA) CO.LTD", |
| | | size: 3, |
| | | rotate: 0, |
| | | bold: 1, |
| | | underline: false, |
| | | reverse: false, |
| | | }, |
| | | ]; |
| | | console.log(ptintContext); |
| | | BluePrint.print(this.$store, ptintContext) |
| | | .then(() => { |
| | | // 关闭弹框 并恢复滑动块 |
| | | this.detailshow = false; |
| | | this.addForm.code = this.materlist.materlist; |
| | | this.addForm.name = this.materlist.materialName; |
| | | this.addForm.batchNo = this.materlist.batchNo; |
| | | this.addForm.specificationModel = this.materlist.specificationModel; |
| | | addPrintRecord(this.addForm).then((res) => { |
| | | console.log(res); |
| | | }); |
| | | uni.showToast({ |
| | | title: "打印成功", |
| | | duration: 2000, |
| | | }); |
| | | }) |
| | | .catch((err) => { |
| | | // uni.showToast({ |
| | | // title:'打印失败', |
| | | // duration: 2000 |
| | | // }) |
| | | }); |
| | | |
| | | rest() { |
| | | this.warehouse.upi = ""; |
| | | this.warehouse.packageCode = ""; |
| | | this.singlist = []; |
| | | }, |
| | | materialBlur() { |
| | | clearTimeout(this.timerSm); |
| | | this.timerSm = null; |
| | | if (this.warehouse.materialCode == "") { |
| | | return; |
| | | } |
| | | |
| | | this.timer = setTimeout(() => { |
| | | //多次触发bug 延迟bug |
| | | //判断当前物料是否在盘点列表中 |
| | | const index = this.singlist.findIndex( |
| | | (item) => |
| | | item.materialCode == this.warehouse.materialCode && |
| | | item.batchNo == lotNo |
| | | ); |
| | | if (index > -1) { |
| | | this.singlist[index].checked = 1; |
| | | this.singlist.unshift(...this.singlist.splice(index, 1)); |
| | | return; |
| | | } else { |
| | | clearTimeout(this.timer); |
| | | this.timer = null; |
| | | this.containerBlur(); |
| | | } |
| | | }, 100); |
| | | }, |
| | | containerBlur() { |
| | | if ( |
| | | this.warehouse.packageCode == "" || |
| | | this.warehouse.materialCode == "" |
| | | ) { |
| | | return; |
| | | } |
| | | getContainerMaterial(this.warehouse).then((res) => { |
| | | if (res.data == null || res.data.length == 0) { |
| | | this.rescode = 400; |
| | | this.resmessage = "暂无数据"; |
| | | this.$refs.resmodal.show = true; |
| | | return; |
| | | } |
| | | this.warehouse.dutyCycle = res.data[0].dutyCycle || 0; |
| | | //给所有的材料一个未选中的状态 |
| | | res.data.map((item) => { |
| | | (item.checked = true), (item.unBindQuantity = ""); |
| | | }); |
| | | this.singlist.unshift(...res.data); |
| | | this.ordersId = res.data[0].ordersId; |
| | | }); |
| | | }, |
| | | //解绑数量失焦事件 |
| | | changeNum(option) { |
| | | //判断是否勾选,如果勾选了,就要对数量校验 |
| | | if (!option.checked) { |
| | | return; |
| | | } |
| | | if (option.unBindQuantity == "") { |
| | | this.rescode = 400; |
| | | this.resmessage = "解绑数量不能为空"; |
| | | this.$refs.resmodal.show = true; |
| | | } |
| | | |
| | | if (option.unBindQuantity <= 0) { |
| | | this.rescode = 400; |
| | | this.resmessage = "解绑数量必须大于0"; |
| | | this.$refs.resmodal.show = true; |
| | | } |
| | | if (option.unBindQuantity > option.quantity) { |
| | | this.rescode = 400; |
| | | this.resmessage = "解绑数量不能大于库存数量"; |
| | | this.$refs.resmodal.show = true; |
| | | } |
| | | if (this.detailable) { |
| | | let filterHas = this.singlist.filter( |
| | | (item) => item.unBindQuantity == Number(item.quantity) |
| | | ); |
| | | if (filterHas.length > 0) { |
| | | this.warehouse.exitNumber = |
| | | this.warehouse.useNumber - filterHas.length; |
| | | } |
| | | } |
| | | }, |
| | | //确认解绑 |
| | | submit() { |
| | | const filterArr = this.singlist.filter((item) => item.checked); |
| | | if (filterArr.length <= 0) { |
| | | this.rescode = 400; |
| | | this.resmessage = "请选择解绑的物料!"; |
| | | this.$refs.resmodal.show = true; |
| | | return; |
| | | } |
| | | //判断选中的里面是否存在解绑的数量不符合规范的 |
| | | // const index = filterArr.findIndex(item => item.unBindQuantity == '' || item.unBindQuantity <= 0 || item.unBindQuantity > item.quantity) |
| | | // if (index > -1) { |
| | | // this.rescode = 400 |
| | | // this.resmessage = '解绑数量不符合要求' |
| | | // this.$refs.resmodal.show = true |
| | | // return |
| | | // } |
| | | const warehousOrderDetails = filterArr.reduce((curr, item) => { |
| | | curr.push({ |
| | | ...item, |
| | | }); |
| | | return curr; |
| | | }, []); |
| | | const params = { |
| | | flag: 3, //3:物料解绑 |
| | | packageCode: this.warehouse.packageCode, |
| | | orderDetails: warehousOrderDetails, |
| | | }; |
| | | uni.showModal({ |
| | | title: "解绑", |
| | | content: "是否确认解绑?", |
| | | showCancel: true, |
| | | cancelColor: "#333333", |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | unbindOrder(params).then((res) => { |
| | | this.rescode = 200; |
| | | this.$refs.resmodal.show = true; |
| | | this.resmessage = "解绑成功"; |
| | | this.back(); |
| | | }); |
| | | } else if (res.cancel) { |
| | | } |
| | | }, |
| | | }); |
| | | }, |
| | | rest() {}, |
| | | //检查容器栅格数 |
| | | checkGrid() {}, |
| | | //获取容器的信息 |
| | |
| | | if (param == 1) { |
| | | this.warehouse.upi = ""; |
| | | } |
| | | if (this.warehouse.packageCode == "") { |
| | | if (!this.warehouse.packageCode) { |
| | | uni.showToast({ |
| | | title: "请扫容器编号", |
| | | title: "请扫包装号", |
| | | icon: "none", |
| | | duration: 2000, |
| | | }); |
| | |
| | | packageCode: this.warehouse.packageCode, |
| | | upi: this.warehouse.upi, |
| | | }).then((res) => { |
| | | // //debugger |
| | | const result = res.result; |
| | | if (Array.isArray(result) && result.length == 0) { |
| | | uni.showToast({ |
| | | title: "数据不存在", |
| | | title: "没有查到数据", |
| | | icon: "none", |
| | | duration: 2000, |
| | | }); |
| | | this.singlist = []; |
| | | return; |
| | | // this.kwbhAllowed = true |
| | | } |
| | | //容器编号入口 |
| | | // if (param == 1) { |
| | | // } |
| | | if (res.result && res.result.length == 1) { |
| | | res.result[0].checked = true; |
| | | } |
| | | this.singlist = res.result; |
| | | |
| | | //物料入口 根据id 判断物料是否存在 |
| | | // res.result.forEach(item => { |
| | | // let index = this.singlist.findIndex(v => v.upi == item.upi); |
| | | // if (index == -1) { |
| | | |
| | | // this.singlist.unshift({ |
| | | // ...item |
| | | // }) |
| | | // } |
| | | // }); |
| | | this.singlist = result; |
| | | }); |
| | | }, |
| | | onlyUpdateDutyCycleClick() { |
| | | this.$refs.warehouseRef.setRules(this.warehouseRules); |
| | | this.$refs.warehouseRef.validate((valid) => { |
| | | if (valid) { |
| | | //请求参数 |
| | | let params = { |
| | | warepackageCode: this.warehouse.packageCode, |
| | | dutyCycle: this.warehouse.dutyCycle, |
| | | }; |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: "是否确认仅更新空间占比数据?", |
| | | showCancel: true, |
| | | cancelColor: "#333333", |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | onlyUpdateDutyCycle(params).then((res) => { |
| | | this.warhouseTph = this.warehouse.packageCode; |
| | | this.rescode = res.code; |
| | | this.resmessage = res.message; |
| | | this.$refs.resmodal.show = true; |
| | | this.rest(); |
| | | }); |
| | | } else if (res.cancel) { |
| | | } |
| | | }, |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | gridBtnClick() { |
| | | this.gridable = !this.gridable; |
| | | if (!this.gridable) { |
| | | this.$nextTick(() => { |
| | | this.gridFocus = true; |
| | | }); |
| | | } else { |
| | | this.$nextTick(() => { |
| | | this.gridFocus = false; |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | //全部取消 |
| | | back() { |
| | | this.ordersId = 0; |
| | |
| | | this.warehouse.packageCode = ""; |
| | | }, |
| | | }, |
| | | unmounted() { |
| | | if (this.timer) { |
| | | clearTimeout(this.timer); |
| | | this.timer = null; |
| | | } |
| | | }, |
| | | |
| | | }; |
| | | </script> |
| | | <style lang="scss"> |