Browse Source

mycomponents/job mycomponents/item mycomponents/qty 文件迁移Vue2升级Vue3 8/2-10/25

hella_vue3
王志国 3 weeks ago
parent
commit
fc15060dc3
  1. 2
      src/mycomponents/item/itemFilter.vue
  2. 36
      src/mycomponents/job/jobAccept.vue
  3. 189
      src/mycomponents/qty/qtyEdit.vue

2
src/mycomponents/item/itemFilter.vue

@ -6,7 +6,7 @@
<view class="uni-flex" style="flex-direction: column; width: 100%; margin-top: 10rpx"> <view class="uni-flex" style="flex-direction: column; width: 100%; margin-top: 10rpx">
<view class="" style="font-size: 35rpx; margin-bottom: 10rpx"> 库位 </view> <view class="" style="font-size: 35rpx; margin-bottom: 10rpx"> 库位 </view>
<uni-easyinput v-model="locationCode" placeholder="请输入库位"></uni-easyinput> <u-einput v-model="locationCode" placeholder="请输入库位"></u-einput>
</view> </view>
<view class="" style="font-size: 35rpx; margin-top: 10rpx; margin-bottom: 10rpx"> <view class="" style="font-size: 35rpx; margin-top: 10rpx; margin-bottom: 10rpx">
库存状态 : 库存状态 :

36
src/mycomponents/job/jobAccept.vue

@ -12,35 +12,19 @@
</view> </view>
</template> </template>
<script> <script setup>
import { import {
dateFormat dateFormat
} from '@/common/basic.js'; } from '@/common/basic.js';
const props = defineProps({
export default { dataContent: {
components: { type: Object,
default: {}
}, }
data() { })
return { const formatDate = function(val) {
return dateFormat(val)
}; }
},
watch: {},
props: {
dataContent: {
type: Object,
default: {}
}
},
methods: {
formatDate: function(val) {
return dateFormat(val)
}
}
}
</script> </script>
<style lang="scss"> <style lang="scss">

189
src/mycomponents/qty/qtyEdit.vue

@ -1,6 +1,6 @@
<template> <template>
<view class=""> <view class="">
<uni-popup ref="popup"> <u-popup v-model="show" mode="bottom">
<view class="uni-flex uni-column pop_customer"> <view class="uni-flex uni-column pop_customer">
<view class="" style="padding:10rpx"> <view class="" style="padding:10rpx">
<view class="uni-flex u-col-center uni-row space-between" style="padding: 10rpx 10rpx 20rpx 10rpx"> <view class="uni-flex u-col-center uni-row space-between" style="padding: 10rpx 10rpx 20rpx 10rpx">
@ -31,112 +31,101 @@
<button class="btn_edit_big_confirm" hover-class="btn_edit_big_after" @click="confirm()">确认</button> <button class="btn_edit_big_confirm" hover-class="btn_edit_big_after" @click="confirm()">确认</button>
</view> </view>
</view> </view>
</uni-popup> </u-popup>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
</template> </template>
<script> <script setup>
import uom from '@/mycomponents/qty/uom.vue' import uom from '@/mycomponents/qty/uom.vue'
import StdUom from '@/mycomponents/qty/StdUom.vue' import StdUom from '@/mycomponents/qty/StdUom.vue'
import balanceStatus from '@/mycomponents/status/balanceStatus.vue' import balanceStatus from '@/mycomponents/status/balanceStatus.vue'
// import {
// getInspectReasonList import { ref,onBeforeMount } from 'vue';
// } from '@/common/directory.js'; import { onLoad } from '@dcloudio/uni-app'; // uni-app onLoad
export default { const props = defineProps({
components: { title: {
uom, type: String,
StdUom, default: "编辑数量"
balanceStatus, },
}, settingParam: {
data() { type: Object,
return { default: () => ({})
allQty: 0, },
stdCount: 1, isShowStatus: {
stateData: 0, type: Boolean,
balanceQty: 0, default: true
inventoryStatus: "", },
originalInventoryStatus: "", allowEditStatus: {
dataContent: {}, type: Boolean,
handleQty: 0, default: false
FailedQty: 0, }
reasonList: [], });
reason: "" const emit = defineEmits(['confirm']);
}
},
watch: { const popup = ref(null);
const comMessage = ref(null);
},
created() { const allQty = ref(0);
// this.reasonList = getInspectReasonList(); const balanceQty = ref(0);
}, const inventoryStatus = ref("");
const originalInventoryStatus = ref("");
props: { const dataContent = ref({});
title: { const handleQty = ref(0);
type: String, const reason = ref("");
default: "编辑数量" const show = ref(false);
},
settingParam: {
type: Object, const openEditPopup = (item, handleQty) => {
default: {} dataContent.value = item;
}, allQty.value = Number(handleQty);
isShowStatus: { setTimeout(() => {
type: Boolean, show.value = true
default: true }, 100);
}, };
allowEditStatus: {
type: Boolean, const closeEditPopup = () => {
default: false show.value = false
} };
},
methods: { const confirm = () => {
openEditPopup(item, handleQty) { setValue();
this.dataContent = item };
this.allQty = Number(handleQty)
setTimeout(res => { const cancel = () => {
this.$refs.popup.open('bottom') dataContent.value.inventoryStatus = originalInventoryStatus.value;
}, 100) closeEditPopup();
}, };
closeEditPopup() {
this.$refs.popup.close() const calcQty = (val) => {
}, allQty.value = val * Number(dataContent.value.packQty);
confirm() { };
this.setValue();
}, const setValue = () => {
cancel() { const balanceQtyValue = Number(dataContent.value.qty);
this.dataContent.inventoryStatus = this.originalInventoryStatus; if (allQty.value === 0) {
this.closeEditPopup(); comMessage.value.showConfirmWarningModal('数量必须大于0', () => {
}, allQty.value = balanceQtyValue;
calcQty(val) { });
this.allQty = val * Number(this.dataContent.packQty); } else if (allQty.value > balanceQtyValue) {
}, comMessage.value.showConfirmWarningModal(`数量[${allQty.value}]不允许大于库存数量[${balanceQtyValue}]`, () => {
setValue() { allQty.value = balanceQtyValue;
var balanceQty = Number(this.dataContent.qty); });
if (this.allQty == 0) { } else {
this.$refs.comMessage.showConfirmWarningModal('数量必须大于0', console.log(33, allQty.value);
res => { emit('confirm', Number(allQty.value));
this.allQty = balanceQty; closeEditPopup();
}) }
} else if (this.allQty > balanceQty) { };
this.$refs.comMessage.showConfirmWarningModal('数量[' + this.allQty + ']不允许大于库存数量[' + balanceQty + ']',
res => { const updateStatus = (value) => {
this.allQty = balanceQty; inventoryStatus.value = value;
}) console.log(inventoryStatus.value);
} else { };
console.log(33,this.allQty)
this.$emit("confirm", Number(this.allQty));
this.closeEditPopup();
}
},
updateStatus(value) {
this.inventoryStatus = value
console.log(this.inventoryStatus)
}
}
}
</script> </script>
<style lang="scss"> <style lang="scss">

Loading…
Cancel
Save