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. 24
      src/mycomponents/job/jobAccept.vue
  3. 149
      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">
库存状态 : 库存状态 :

24
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 {
components: {
},
data() {
return {
};
},
watch: {},
props: {
dataContent: { dataContent: {
type: Object, type: Object,
default: {} default: {}
} }
}, })
const formatDate = function(val) {
methods: {
formatDate: function(val) {
return dateFormat(val) return dateFormat(val)
} }
}
}
</script> </script>
<style lang="scss"> <style lang="scss">

149
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,56 +31,27 @@
<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
// } from '@/common/directory.js';
export default {
components: {
uom,
StdUom,
balanceStatus,
},
data() {
return {
allQty: 0,
stdCount: 1,
stateData: 0,
balanceQty: 0,
inventoryStatus: "",
originalInventoryStatus: "",
dataContent: {},
handleQty: 0,
FailedQty: 0,
reasonList: [],
reason: ""
} import { ref,onBeforeMount } from 'vue';
}, import { onLoad } from '@dcloudio/uni-app'; // uni-app onLoad
watch: {
}, const props = defineProps({
created() {
// this.reasonList = getInspectReasonList();
},
props: {
title: { title: {
type: String, type: String,
default: "编辑数量" default: "编辑数量"
}, },
settingParam: { settingParam: {
type: Object, type: Object,
default: {} default: () => ({})
}, },
isShowStatus: { isShowStatus: {
type: Boolean, type: Boolean,
@ -90,53 +61,71 @@
type: Boolean, type: Boolean,
default: false default: false
} }
}, });
methods: { const emit = defineEmits(['confirm']);
openEditPopup(item, handleQty) {
this.dataContent = item
this.allQty = Number(handleQty)
setTimeout(res => { const popup = ref(null);
this.$refs.popup.open('bottom') const comMessage = ref(null);
}, 100)
}, const allQty = ref(0);
closeEditPopup() { const balanceQty = ref(0);
this.$refs.popup.close() const inventoryStatus = ref("");
}, const originalInventoryStatus = ref("");
confirm() { const dataContent = ref({});
this.setValue(); const handleQty = ref(0);
}, const reason = ref("");
cancel() { const show = ref(false);
this.dataContent.inventoryStatus = this.originalInventoryStatus;
this.closeEditPopup();
}, const openEditPopup = (item, handleQty) => {
calcQty(val) { dataContent.value = item;
this.allQty = val * Number(this.dataContent.packQty); allQty.value = Number(handleQty);
}, setTimeout(() => {
setValue() { show.value = true
var balanceQty = Number(this.dataContent.qty); }, 100);
if (this.allQty == 0) { };
this.$refs.comMessage.showConfirmWarningModal('数量必须大于0',
res => { const closeEditPopup = () => {
this.allQty = balanceQty; show.value = false
}) };
} else if (this.allQty > balanceQty) {
this.$refs.comMessage.showConfirmWarningModal('数量[' + this.allQty + ']不允许大于库存数量[' + balanceQty + ']', const confirm = () => {
res => { setValue();
this.allQty = balanceQty; };
})
const cancel = () => {
dataContent.value.inventoryStatus = originalInventoryStatus.value;
closeEditPopup();
};
const calcQty = (val) => {
allQty.value = val * Number(dataContent.value.packQty);
};
const setValue = () => {
const balanceQtyValue = Number(dataContent.value.qty);
if (allQty.value === 0) {
comMessage.value.showConfirmWarningModal('数量必须大于0', () => {
allQty.value = balanceQtyValue;
});
} else if (allQty.value > balanceQtyValue) {
comMessage.value.showConfirmWarningModal(`数量[${allQty.value}]不允许大于库存数量[${balanceQtyValue}]`, () => {
allQty.value = balanceQtyValue;
});
} else { } else {
console.log(33,this.allQty) console.log(33, allQty.value);
this.$emit("confirm", Number(this.allQty)); emit('confirm', Number(allQty.value));
this.closeEditPopup(); closeEditPopup();
} }
}, };
const updateStatus = (value) => {
inventoryStatus.value = value;
console.log(inventoryStatus.value);
};
updateStatus(value) {
this.inventoryStatus = value
console.log(this.inventoryStatus)
}
}
}
</script> </script>
<style lang="scss"> <style lang="scss">

Loading…
Cancel
Save