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="" 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 class="" style="font-size: 35rpx; margin-top: 10rpx; margin-bottom: 10rpx">
库存状态 :

36
src/mycomponents/job/jobAccept.vue

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

189
src/mycomponents/qty/qtyEdit.vue

@ -1,6 +1,6 @@
<template>
<view class="">
<uni-popup ref="popup">
<u-popup v-model="show" mode="bottom">
<view class="uni-flex uni-column pop_customer">
<view class="" style="padding: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>
</view>
</view>
</uni-popup>
</u-popup>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
<script setup>
import uom from '@/mycomponents/qty/uom.vue'
import StdUom from '@/mycomponents/qty/StdUom.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: ""
}
},
watch: {
},
created() {
// this.reasonList = getInspectReasonList();
},
props: {
title: {
type: String,
default: "编辑数量"
},
settingParam: {
type: Object,
default: {}
},
isShowStatus: {
type: Boolean,
default: true
},
allowEditStatus: {
type: Boolean,
default: false
}
},
methods: {
openEditPopup(item, handleQty) {
this.dataContent = item
this.allQty = Number(handleQty)
setTimeout(res => {
this.$refs.popup.open('bottom')
}, 100)
},
closeEditPopup() {
this.$refs.popup.close()
},
confirm() {
this.setValue();
},
cancel() {
this.dataContent.inventoryStatus = this.originalInventoryStatus;
this.closeEditPopup();
},
calcQty(val) {
this.allQty = val * Number(this.dataContent.packQty);
},
setValue() {
var balanceQty = Number(this.dataContent.qty);
if (this.allQty == 0) {
this.$refs.comMessage.showConfirmWarningModal('数量必须大于0',
res => {
this.allQty = balanceQty;
})
} else if (this.allQty > balanceQty) {
this.$refs.comMessage.showConfirmWarningModal('数量[' + this.allQty + ']不允许大于库存数量[' + balanceQty + ']',
res => {
this.allQty = balanceQty;
})
} else {
console.log(33,this.allQty)
this.$emit("confirm", Number(this.allQty));
this.closeEditPopup();
}
},
updateStatus(value) {
this.inventoryStatus = value
console.log(this.inventoryStatus)
}
}
}
import { ref,onBeforeMount } from 'vue';
import { onLoad } from '@dcloudio/uni-app'; // uni-app onLoad
const props = defineProps({
title: {
type: String,
default: "编辑数量"
},
settingParam: {
type: Object,
default: () => ({})
},
isShowStatus: {
type: Boolean,
default: true
},
allowEditStatus: {
type: Boolean,
default: false
}
});
const emit = defineEmits(['confirm']);
const popup = ref(null);
const comMessage = ref(null);
const allQty = ref(0);
const balanceQty = ref(0);
const inventoryStatus = ref("");
const originalInventoryStatus = ref("");
const dataContent = ref({});
const handleQty = ref(0);
const reason = ref("");
const show = ref(false);
const openEditPopup = (item, handleQty) => {
dataContent.value = item;
allQty.value = Number(handleQty);
setTimeout(() => {
show.value = true
}, 100);
};
const closeEditPopup = () => {
show.value = false
};
const confirm = () => {
setValue();
};
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 {
console.log(33, allQty.value);
emit('confirm', Number(allQty.value));
closeEditPopup();
}
};
const updateStatus = (value) => {
inventoryStatus.value = value;
console.log(inventoryStatus.value);
};
</script>
<style lang="scss">

Loading…
Cancel
Save