Browse Source

修改直接完工功能2024/7/18 17:24:08

hella_vue3
zhang_li 3 months ago
parent
commit
5a00aaf5c8
  1. 4
      src/api/request2.js
  2. 28
      src/common/style/new_style.css
  3. 2
      src/mycomponents/balance/location.vue
  4. 8
      src/mycomponents/balance/toLocation.vue
  5. 4
      src/mycomponents/item/itemCompareQty.vue
  6. 2
      src/mycomponents/job/jobComMainDetailCard.vue
  7. 16
      src/mycomponents/qty/recommendQty.vue
  8. 75
      src/pages/fg/coms/comReceiptPopup.vue
  9. 177
      src/uni_modules/vk-uview-ui/components/u-select/u-select.vue

4
src/api/request2.js

@ -2648,3 +2648,7 @@ export function getPlaneInfoByproductLine(productionLine,planDate) {
export function planReceiptSubmit(data) {
return http.post("/wms/production-main/getPlanProductionByProductionLineAndPlanDate",data)
}
export function getProductionlineAndWorkStation() {
return http.get("/wms/production-main/getProductionlineAndWorkStation")
}

28
src/common/style/new_style.css

@ -2076,6 +2076,11 @@ button::after {
color:#2E3A63;
margin-left:20rpx
}
.card_big_content {
font-size: 40rpx;
font-weight: bold;
padding: 5px;
}
.card_icon_normal {
width: 30rpx;
@ -2085,23 +2090,25 @@ button::after {
}
.card_packing_code {
color: #1677FF;
font-size: 26rpx;
font-style: italic;
color: #3315EB;
padding: 5px;
font-size: 30rpx;
}
.card_batch {
color: #9747FF;
font-size: 26rpx;
font-style: italic;
padding: 5px;
font-size: 30rpx;
}
.card_container {
color: #0076F6;
padding: 5px;
font-size: 30rpx;
}
.card_container_content {
font-size: 32rpx;
padding: 5px;
@ -2497,10 +2504,17 @@ button[disabled] {
.text_recommend {
color: #0A84FF;
font-size: 38rpx;
font-weight:bold
font-size: 34rpx;
font-weight: bold;
}
.text_packQty {
color: #3315EB;
font-size: 40rpx;
font-weight: bold;
}
.text_balance {
font-size: 36rpx;
}

2
src/mycomponents/balance/location.vue

@ -1,7 +1,7 @@
<template>
<view class="card_view">
<text class="card_location">{{ title }}</text>
<text class="card_content" style="font-size: 37rpx">{{ locationCode }}</text>
<text class="card_big_content" style="font-size: 40rpx">{{ locationCode }}</text>
</view>
</template>

8
src/mycomponents/balance/toLocation.vue

@ -7,15 +7,13 @@
<script setup lang="ts">
const props = defineProps({
locationCode: {
type: String,
type: String
},
title: {
type: String,
default: '库位'
},
}
})
</script>
<style>
</style>
<style></style>

4
src/mycomponents/item/itemCompareQty.vue

@ -3,8 +3,8 @@
<view style="flex: 1">
<item :dataContent="dataContent"></item>
</view>
<view style="width: 30%; display: flex; justify-content: flex-end; margin-right: 10rpx">
<recommend-qty v-if="handleQty == 0" :dataContent="dataContent" :isShowStatus="false" :isShowStdPack="true" :objTextStyle="objTextStyle"></recommend-qty>
<view style="width: 40%; display: flex; justify-content: flex-end; margin-right: 10rpx">
<recommend-qty v-if="handleQty == 0" :dataContent="dataContent" :isShowStatus="false" :isShowStdPack="true"></recommend-qty>
<compare-qty v-else :dataContent="dataContent" :recommendQty="Number(dataContent.qty)" :handleQty="Number(handleQty)" :isShowStatus="false" :isShowPackUnit="isShowPackUnit"> </compare-qty>
</view>
</view>

2
src/mycomponents/job/jobComMainDetailCard.vue

@ -1,7 +1,7 @@
<template>
<view class="">
<view class="task_text" style="border-top: 1px solid #dedede; padding-top: 20rpx">
<itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty" :isShowPackUnit="false" :objTextStyle="{ fontWeight: 'bold', fontSize: '40rpx' }"></itemCompareQty>
<itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty" :isShowPackUnit="false"></itemCompareQty>
<div>
<pack v-if="isShowPack && dataContent.packingNumber != null" :packingCode="dataContent.packingNumber"> </pack>
<batch v-if="isShowBatch && dataContent.batch != null" :batch="dataContent.batch"></batch>

16
src/mycomponents/qty/recommendQty.vue

@ -1,12 +1,16 @@
<template>
<view>
<status v-if="isShowStatus" :status='dataContent.inventoryStatus'></status>
<status v-if="isShowStatus" :status="dataContent.inventoryStatus"></status>
<view class="u-flex u-row center">
<view class="text_recommend " :style='objTextStyle'>
<view class="text_recommend">
{{ Number(dataContent.qty) }}
</view>
<uom :uom="dataContent.uom"></uom>
<view v-if="dataContent.packQty != undefined" class="uni-flex uni-row">
<view class="uom">/</view>
<view class="text_packQty">{{ calc(dataContent.qty, dataContent.packQty) }} </view>
</view>
</view>
<view>
<pack-unit :dataContent="dataContent"></pack-unit>
@ -18,6 +22,7 @@
import packUnit from '@/mycomponents/qty/packUnit.vue'
import uom from '@/mycomponents/qty/uom.vue'
import status from '@/mycomponents/status/status.vue'
const props = defineProps({
type: {
type: String,
@ -51,8 +56,9 @@
default: null
}
})
const calc = (qty, packQty) => {
return Math.ceil(Number(qty) / Number(packQty))
}
</script>
<style lang="scss">
</style>
<style lang="scss"></style>

75
src/pages/fg/coms/comReceiptPopup.vue

@ -17,13 +17,12 @@
<view class="customerBorder" @click="showSelectLine">
{{ productionLineName }}
</view>
<u-select v-model="showProductLineSelect" mode="single-column" :list="productLineList" @confirm="confirmSelectLine"></u-select>
<u-select v-model="showProductLineSelect" mode="mutil-column-auto" :list="productLineList" @confirm="confirmSelectLine"></u-select>
<view class="">
<image src="/static/icons/down.svg" mode="" style="width: 40rpx; height: 40rpx; margin-left: 20rpx" @click="showSelectLine"> </image>
</view>
</view>
<view class="split_line"></view>
<view class="title" style="display: flex; align-items: center; padding: 10rpx">
@ -31,6 +30,7 @@
<view class="customerBorder">
{{ itemCode }}
</view>
<view v-if="planQty > 0">{{ planQty }}({{ getUomInfo(uom) }})</view>
<u-select v-model="showItemCodeSelect" mode="single-column" :list="itemCodeList" @confirm="confirmSelectItem"></u-select>
<view class="">
<image src="/static/icons/down.svg" mode="" style="width: 40rpx; height: 40rpx; margin-left: 20rpx" @click="showSelectItemCode"> </image>
@ -46,22 +46,23 @@
</view>
</view>
<view class="split_line"></view>
<view class="title" style="display: flex; align-items: center; padding: 10rpx">
<text style="flex-shrink: 0; width: 25%">计划数量</text>
<!-- <view class="title " style="display: flex;align-items: center;padding: 10rpx;">
<text style=" flex-shrink: 0; width: 25%;">计划数量</text>
<view class="customerBorder">
{{planQty}}
</view>
<view class="">
<image src="" mode="" style="width: 40rpx; height: 40rpx; margin-left: 20rpx"> </image>
</view>
<image src="" mode="" style=" width: 40rpx;height: 40rpx;margin-left: 20rpx;">
</image>
</view>
</view> -->
<view class="split_line"></view>
<view class="title" style="display: flex; align-items: center; padding: 10rpx">
<text style="flex-shrink: 0; width: 25%">包装规格</text>
<view class="customerBorder">
{{ packUnit }}
</view>
<u-select v-model="showPackUnitSelect" mode="mutil-column-auto" :list="packUnitList" @confirm="confirmSelectPackUnit"></u-select>
<u-select v-model="showPackUnitSelect" mode="mutil-column" :list="packUnitList" @confirm="confirmSelectPackUnit"></u-select>
<view class="">
<image src="/static/icons/down.svg" mode="" style="width: 40rpx; height: 40rpx; margin-left: 20rpx" @click="showSelectPackUnit"> </image>
</view>
@ -82,7 +83,7 @@
</template>
<script>
import { getIssueJobByProductionline, getPlaneInfoByproductLine, getPackUnitByItemCode } from '@/api/request2.js'
import { getIssueJobByProductionline, getPlaneInfoByproductLine, getPackUnitByItemCode, getProductionlineAndWorkStation } from '@/api/request2.js'
import { getPackUnitName, getUomInfo } from '@/common/directory.js'
import { getCurrDate, getBatch8 } from '@/common/basic.js'
@ -115,36 +116,7 @@ export default {
showPackUnitSelect: false,
itemCodeList: [],
showItemCodeSelect: false,
packUnitList: [
{
value: 1,
label: '中国',
children: [
{
value: 2,
label: '广东'
},
{
value: 5,
label: '广西'
}
]
},
{
value: 8,
label: '美国',
children: [
{
value: 9,
label: '纽约'
},
{
value: 10,
label: '华盛顿'
}
]
}
]
packUnitList: []
}
},
props: {
@ -247,13 +219,13 @@ export default {
title: '加载中',
mask: true
})
getIssueJobByProductionline()
getProductionlineAndWorkStation()
.then((res) => {
uni.hideLoading()
if (res.data && res.data.length > 0) {
res.data.forEach((item) => {
item.label = item.name
})
// res.data.forEach(item => {
// item.label = item.name
// })
this.productLineList = res.data
this.showProductLineSelect = true
} else {
@ -285,7 +257,8 @@ export default {
uni.hideLoading()
if (res.data && res.data.length > 0) {
res.data.forEach((item) => {
item.label = item.itemCode
item.label = `${item.itemCode}${item.planQty}${item.uom})`
item.value = item
})
this.itemCodeList = res.data
this.showItemCodeSelect = true
@ -302,11 +275,17 @@ export default {
}
},
confirmSelectItem(data) {
this.itemCode = data[0].label
const item = this.itemCodeList.find((res) => res.itemCode == this.itemCode)
this.uom = item.uom
this.planQty = item.planQty
this.number = item.number
const productionPlan = data[0].value
this.itemCode = productionPlan.itemCode
// var item = this.itemCodeList.find(res => res.itemCode == this.itemCode)
this.uom = productionPlan.uom
this.planQty = productionPlan.planQty
this.number = productionPlan.number
// this.itemCode = data[0].label
// var item = this.itemCodeList.find(res => res.itemCode == this.itemCode)
// this.uom = item.uom
// this.planQty = item.planQty
// this.number = item.number
},
showSelectPackUnit() {

177
src/uni_modules/vk-uview-ui/components/u-select/u-select.vue

@ -12,26 +12,13 @@
<u-popup :blur="blur" :maskCloseAble="maskCloseAble" mode="bottom" :popup="false" v-model="popupValue" length="auto" :safeAreaInsetBottom="safeAreaInsetBottom" @close="close" :z-index="uZIndex">
<view class="u-select">
<view class="u-select__header" @touchmove.stop.prevent="">
<view
class="u-select__header__cancel u-select__header__btn"
:style="{ color: cancelColor }"
hover-class="u-hover-class"
:hover-stay-time="150"
@tap.stop="getResult('cancel')"
>
<view class="u-select__header__cancel u-select__header__btn" :style="{ color: cancelColor }" hover-class="u-hover-class" :hover-stay-time="150" @tap.stop="getResult('cancel')">
{{ cancelText }}
</view>
<view class="u-select__header__title">
{{ title }}
</view>
<view
class="u-select__header__confirm u-select__header__btn"
:style="{ color: moving ? cancelColor : confirmColor }"
hover-class="u-hover-class"
:hover-stay-time="150"
@touchmove.stop=""
@tap.stop="getResult('confirm')"
>
<view class="u-select__header__confirm u-select__header__btn" :style="{ color: moving ? cancelColor : confirmColor }" hover-class="u-hover-class" :hover-stay-time="150" @touchmove.stop="" @tap.stop="getResult('confirm')">
{{ confirmText }}
</view>
</view>
@ -73,7 +60,7 @@
*/
export default {
emits: ["update:modelValue", "input", "confirm","cancel"],
emits: ['update:modelValue', 'input', 'confirm', 'cancel'],
props: {
//
value: {
@ -88,7 +75,7 @@ export default {
list: {
type: Array,
default() {
return [];
return []
}
},
//
@ -124,7 +111,7 @@ export default {
defaultValue: {
type: Array,
default() {
return [0];
return [0]
}
},
// single-column-mutil-column-mutil-column-auto-
@ -166,7 +153,7 @@ export default {
blur: {
type: [Number, String],
default: 0
},
}
},
data() {
return {
@ -183,197 +170,195 @@ export default {
columnNum: 0,
//
moving: false
};
}
},
watch: {
// select
value: {
immediate: true,
handler(val) {
if(val) setTimeout(() => this.init(), 10);
this.popupValue = val;
if (val) setTimeout(() => this.init(), 10)
this.popupValue = val
}
},
modelValue: {
immediate: true,
handler(val) {
if(val) setTimeout(() => this.init(), 10);
this.popupValue = val;
if (val) setTimeout(() => this.init(), 10)
this.popupValue = val
}
}
},
},
computed: {
uZIndex() {
// z-index使
return this.zIndex ? this.zIndex : this.$u.zIndex.popup;
},
return this.zIndex ? this.zIndex : this.$u.zIndex.popup
}
},
methods: {
//
pickstart() {
// #ifdef MP-WEIXIN
this.moving = true;
this.moving = true
// #endif
},
//
pickend() {
// #ifdef MP-WEIXIN
this.moving = false;
this.moving = false
// #endif
},
init() {
this.setColumnNum();
this.setDefaultSelector();
this.setColumnData();
this.setSelectValue();
this.setColumnNum()
this.setDefaultSelector()
this.setColumnData()
this.setSelectValue()
},
//
setDefaultSelector() {
// columnNum0
this.defaultSelector = this.defaultValue.length == this.columnNum ? this.defaultValue : Array(this.columnNum).fill(0);
this.lastSelectIndex = this.$u.deepClone(this.defaultSelector);
this.defaultSelector = this.defaultValue.length == this.columnNum ? this.defaultValue : Array(this.columnNum).fill(0)
this.lastSelectIndex = this.$u.deepClone(this.defaultSelector)
},
//
setColumnNum() {
// 1
if(this.mode == 'single-column') this.columnNum = 1;
if (this.mode == 'single-column') this.columnNum = 1
// this.list
else if(this.mode == 'mutil-column') this.columnNum = this.list.length;
else if (this.mode == 'mutil-column') this.columnNum = this.list.length
// this.list
else if (this.mode == 'mutil-column-auto') {
let num = 1;
let column = this.list;
let num = 1
let column = this.list
// children
while (column[0][this.childName]) {
column = column[0] ? column[0][this.childName] : {};
num ++;
column = column[0] ? column[0][this.childName] : {}
num++
}
this.columnNum = num;
this.columnNum = num
}
},
// picker
setColumnData() {
let data = [];
this.selectValue = [];
let data = []
this.selectValue = []
if (this.mode == 'mutil-column-auto') {
//
let column = this.list[this.defaultSelector.length ? this.defaultSelector[0] : 0];
let column = this.list[this.defaultSelector.length ? this.defaultSelector[0] : 0]
//
for (let i = 0; i < this.columnNum; i++) {
// list
if (i == 0) {
data[i] = this.list;
column = column[this.childName];
data[i] = this.list
column = column[this.childName]
} else {
//
data[i] = column;
column = column[this.defaultSelector[i]][this.childName];
data[i] = column
column = column[this.defaultSelector[i]][this.childName]
}
}
} else if (this.mode == 'single-column') {
data[0] = this.list;
data[0] = this.list
} else {
data = this.list;
data = this.list
}
this.columnData = data;
this.columnData = data
},
// defaultValue
setSelectValue() {
let tmp = null;
let tmp = null
for (let i = 0; i < this.columnNum; i++) {
tmp = this.columnData[i][this.defaultSelector[i]];
let data = {
tmp = this.columnData[i][this.defaultSelector[i]]
const data = {
value: tmp ? tmp[this.valueName] : null,
label: tmp ? tmp[this.labelName] : null
};
}
//
if(tmp && tmp.extra) data.extra = tmp.extra;
if (tmp && tmp.extra) data.extra = tmp.extra
this.selectValue.push(data)
}
},
//
columnChange(e) {
let index = null;
let columnIndex = e.detail.value;
let index = null
const columnIndex = e.detail.value
// push
this.selectValue = [];
this.selectValue = []
if (this.mode == 'mutil-column-auto') {
//
this.lastSelectIndex.map((val, idx) => {
if (val != columnIndex[idx]) index = idx;
});
this.defaultSelector = columnIndex;
if (val != columnIndex[idx]) index = idx
})
this.defaultSelector = columnIndex
for (let i = index + 1; i < this.columnNum; i++) {
// children
//
this.columnData[i] = this.columnData[i - 1][i - 1 == index ? columnIndex[index] : 0][this.childName];
this.columnData[i] = this.columnData[i - 1][i - 1 == index ? columnIndex[index] : 0][this.childName]
//
this.defaultSelector[i] = 0;
this.defaultSelector[i] = 0
}
// this.columnDatacolumnChange
// undefined
columnIndex.map((item, index) => {
let data = this.columnData[index][columnIndex[index]];
let tmp = {
const data = this.columnData[index][columnIndex[index]]
const tmp = {
value: data ? data[this.valueName] : null,
label: data ? data[this.labelName] : null,
};
label: data ? data[this.labelName] : null
}
//
if(data && data.extra !== undefined) tmp.extra = data.extra;
this.selectValue.push(tmp);
if (data && data.extra !== undefined) tmp.extra = data.extra
this.selectValue.push(tmp)
})
//
this.lastSelectIndex = columnIndex;
this.lastSelectIndex = columnIndex
} else if (this.mode == 'single-column') {
let data = this.columnData[0][columnIndex[0]];
const data = this.columnData[0][columnIndex[0]]
//
let tmp = {
const tmp = {
value: data ? data[this.valueName] : null,
label: data ? data[this.labelName] : null,
};
label: data ? data[this.labelName] : null
}
//
if(data && data.extra !== undefined) tmp.extra = data.extra;
this.selectValue.push(tmp);
if (data && data.extra !== undefined) tmp.extra = data.extra
this.selectValue.push(tmp)
} else if (this.mode == 'mutil-column') {
//
columnIndex.map((item, index) => {
let data = this.columnData[index][columnIndex[index]];
const data = this.columnData[index][columnIndex[index]]
//
let tmp = {
const tmp = {
value: data ? data[this.valueName] : null,
label: data ? data[this.labelName] : null,
};
label: data ? data[this.labelName] : null
}
//
if(data && data.extra !== undefined) tmp.extra = data.extra;
this.selectValue.push(tmp);
if (data && data.extra !== undefined) tmp.extra = data.extra
this.selectValue.push(tmp)
})
}
},
close() {
this.$emit('input', false);
this.$emit("update:modelValue", false);
this.$emit('input', false)
this.$emit('update:modelValue', false)
},
//
getResult(event = null) {
// #ifdef MP-WEIXIN
if (this.moving) return;
if (this.moving) return
// #endif
if (event) this.$emit(event, this.selectValue);
this.close();
if (event) this.$emit(event, this.selectValue)
this.close()
},
selectHandler() {
this.$emit('click');
this.$emit('click')
}
}
}
};
</script>
<style scoped lang="scss">
@import "../../libs/css/style.components.scss";
@import '../../libs/css/style.components.scss';
.u-select {
&__action {
position: relative;
line-height: $u-form-item-height;
@ -383,7 +368,7 @@ export default {
position: absolute;
right: 20rpx;
top: 50%;
transition: transform .4s;
transition: transform 0.4s;
transform: translateY(-50%);
z-index: 1;
@ -415,7 +400,7 @@ export default {
&__body {
width: 100%;
height: 300rpx;
height: 500rpx;
overflow: hidden;
background-color: #fff;

Loading…
Cancel
Save