|
@@ -18,7 +18,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
<view class="item rx-sc">
|
|
<view class="item rx-sc">
|
|
|
<view class="rx ww55 ">
|
|
<view class="rx ww55 ">
|
|
|
<view class="lable rx-cc">数量</view>
|
|
<view class="lable rx-cc">数量</view>
|
|
@@ -66,38 +65,48 @@
|
|
|
|
|
|
|
|
<view class="content_table2" v-if="item.sampleList.length > 0">
|
|
<view class="content_table2" v-if="item.sampleList.length > 0">
|
|
|
<view class="head row rx-sc">
|
|
<view class="head row rx-sc">
|
|
|
- <view class="item ww15">类型</view>
|
|
|
|
|
- <view class="item ww20">数量</view>
|
|
|
|
|
- <view class="item ww55">处置</view>
|
|
|
|
|
|
|
+ <view class="item ww15">货位</view>
|
|
|
|
|
+ <view class="item ww30">类型</view>
|
|
|
|
|
+ <view class="item ww45">处置</view>
|
|
|
<view class="item ww15">操作</view>
|
|
<view class="item ww15">操作</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<view class="table">
|
|
<view class="table">
|
|
|
|
|
|
|
|
- <view class="tr row rx-sc" v-for="(it, index) in item.sampleList" :key='index'>
|
|
|
|
|
|
|
+ <view v-for="(it, index) in item.sampleList" :key='index'>
|
|
|
|
|
+ <view class="tr row rx-sc ">
|
|
|
|
|
+ <view class="item ww15 content_num">
|
|
|
|
|
+ {{ it.code }}
|
|
|
|
|
+ </view>
|
|
|
|
|
|
|
|
|
|
+ <view class="item ww30 content_num">
|
|
|
|
|
+ <zxz-uni-data-select v-model="it.selectType" :localdata="rangeList"
|
|
|
|
|
+ :disabled="isDetails" @change="hendleReuseNum"></zxz-uni-data-select>
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
|
|
+ <view class="item ww45 content_num">
|
|
|
|
|
+ <zxz-uni-data-select :localdata="warehouseList" :disabled="isDetails"
|
|
|
|
|
+ v-if='it.selectType == 2' v-model="it.warehouseId" dataValue='id' dataKey="name"
|
|
|
|
|
+ filterable format='{name}'></zxz-uni-data-select>
|
|
|
|
|
|
|
|
- <view class="item ww15 content_num">
|
|
|
|
|
- {{ it.selectType == 1 ? '回用' : it.selectType == 2 ? '入库' : '' }}
|
|
|
|
|
- </view>
|
|
|
|
|
|
|
|
|
|
- <view class="item ww20 content_num">
|
|
|
|
|
- <input class="uni-input" v-if='!isDetails' v-model="it.num" @input="hendleReuseNum(it)"></input>
|
|
|
|
|
- <view v-else> {{ it.num }}</view>
|
|
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="item ww15">
|
|
|
|
|
+ <view class="left rx-ss" @click="getDelete(index)">
|
|
|
|
|
+ <uni-icons custom-prefix="iconfont" v-if="!isDetails" type="icon-shanchu" size="20"
|
|
|
|
|
+ color="#fa3534"></uni-icons>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
- <view class="item ww55 content_num">
|
|
|
|
|
- <zxz-uni-data-select :localdata="warehouseList" :disabled="isDetails"
|
|
|
|
|
- v-if='it.selectType != 1' v-model="it.warehouseId" dataValue='id' dataKey="name"
|
|
|
|
|
- filterable format='{name}'></zxz-uni-data-select>
|
|
|
|
|
|
|
|
|
|
- <view v-if="it.selectType == 1" class="turnover_btn"> </view>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="item ww15">
|
|
|
|
|
- <view class="left rx-ss" @click="getDelete(index)">
|
|
|
|
|
- <uni-icons custom-prefix="iconfont" v-if="!isDetails" type="icon-shanchu" size="20"
|
|
|
|
|
- color="#fa3534"></uni-icons>
|
|
|
|
|
|
|
+ <view class="tr row rx-sc wrap" style="margin-bottom: 30rpx;">
|
|
|
|
|
+
|
|
|
|
|
+ <view class="item ww25 content_num cx-cc" v-for="(p, i) in it.paramList" :key="index + i">
|
|
|
|
|
+ <view class="name">{{p.name}}</view>
|
|
|
|
|
+ <input v-model="p.value" style="width: 168rpx ;"></input>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
</view>
|
|
</view>
|
|
@@ -105,8 +114,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
@@ -149,8 +156,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
</u-popup>
|
|
</u-popup>
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -165,7 +172,7 @@
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
props: {
|
|
props: {
|
|
|
item: {
|
|
item: {
|
|
@@ -185,6 +192,11 @@
|
|
|
turnoverList: {
|
|
turnoverList: {
|
|
|
type: Array,
|
|
type: Array,
|
|
|
default: () => []
|
|
default: () => []
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ paramList: {
|
|
|
|
|
+ type: Array,
|
|
|
|
|
+ default: () => []
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -197,9 +209,10 @@
|
|
|
immediate: true,
|
|
immediate: true,
|
|
|
deep: true,
|
|
deep: true,
|
|
|
handler(newVal) {
|
|
handler(newVal) {
|
|
|
- console.log(newVal)
|
|
|
|
|
|
|
+
|
|
|
this.turnoverCount = 0
|
|
this.turnoverCount = 0
|
|
|
|
|
|
|
|
|
|
+
|
|
|
newVal.forEach(f => {
|
|
newVal.forEach(f => {
|
|
|
if (f.extInfo && f.extInfo.positionList && f.extInfo.positionList.length > 0) {
|
|
if (f.extInfo && f.extInfo.positionList && f.extInfo.positionList.length > 0) {
|
|
|
f.extInfo.positionList.forEach(o => {
|
|
f.extInfo.positionList.forEach(o => {
|
|
@@ -210,6 +223,37 @@
|
|
|
|
|
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ this.mergedArray = []
|
|
|
|
|
+ if (f.extInfo && f.extInfo.positionList && f.extInfo.positionList.length > 0) {
|
|
|
|
|
+ f.extInfo.positionList.forEach(obj => {
|
|
|
|
|
+ if (Object.prototype.hasOwnProperty.call(obj, 'sampleNum') && obj
|
|
|
|
|
+ .sampleNum > 1) {
|
|
|
|
|
+ for (let i = 0; i < obj.sampleNum; i++) {
|
|
|
|
|
+ // 创建对象的副本,以避免引用相同的对象
|
|
|
|
|
+ const objCopy = {
|
|
|
|
|
+ ...obj,
|
|
|
|
|
+ paramList: JSON.parse(JSON.stringify(this.paramList))
|
|
|
|
|
+ };
|
|
|
|
|
+ // 可以选择删除 num 属性,如果不需要在最终结果中保留它
|
|
|
|
|
+ delete objCopy.sampleNum;
|
|
|
|
|
+ this.mergedArray.push(objCopy);
|
|
|
|
|
+ }
|
|
|
|
|
+ } else if (obj.sampleNum == 1) {
|
|
|
|
|
+ // 如果 sampleNum 等于 1,直接推入数组(可以选择删除 sampleNum 属性)
|
|
|
|
|
+ const objCopy = {
|
|
|
|
|
+ ...obj,
|
|
|
|
|
+ paramList: JSON.parse(JSON.stringify(this.paramList))
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ this.mergedArray.push(objCopy);
|
|
|
|
|
+ }
|
|
|
|
|
+ // 如果 num 小于 1,则不执行任何操作(根据需求调整)
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ console.log(this.mergedArray)
|
|
|
|
|
+
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
@@ -232,12 +276,13 @@
|
|
|
text: "入库"
|
|
text: "入库"
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- value: 3,
|
|
|
|
|
- text: "损耗"
|
|
|
|
|
|
|
+ value: 3,
|
|
|
|
|
+ text: "损耗"
|
|
|
}
|
|
}
|
|
|
],
|
|
],
|
|
|
|
|
|
|
|
- turnoverCount: 0
|
|
|
|
|
|
|
+ turnoverCount: 0,
|
|
|
|
|
+ mergedArray: []
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
@@ -257,6 +302,7 @@
|
|
|
|
|
|
|
|
penalize() {
|
|
penalize() {
|
|
|
|
|
|
|
|
|
|
+
|
|
|
if (Number(this.item.sampleNum <= 0)) {
|
|
if (Number(this.item.sampleNum <= 0)) {
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
icon: 'none',
|
|
icon: 'none',
|
|
@@ -264,71 +310,35 @@
|
|
|
})
|
|
})
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- this.show = true
|
|
|
|
|
|
|
+ this.item.sampleList = JSON.parse(JSON.stringify(this.mergedArray))
|
|
|
|
|
+ this.$forceUpdate()
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- save() {
|
|
|
|
|
- this.show = false
|
|
|
|
|
- if (this.selectType) {
|
|
|
|
|
-
|
|
|
|
|
- if(this.selectType == 1) {
|
|
|
|
|
-
|
|
|
|
|
- let isFals = this.item.sampleList.some(m => m.selectType == 1)
|
|
|
|
|
- if(isFals) {
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- icon: 'none',
|
|
|
|
|
- title: '已经存在回用类型'
|
|
|
|
|
- })
|
|
|
|
|
- return false
|
|
|
|
|
- } else {
|
|
|
|
|
-
|
|
|
|
|
- this.$set(this.item, 'showReuseTurnover', true)
|
|
|
|
|
- this.item.sampleList.push({
|
|
|
|
|
- selectType: this.selectType,
|
|
|
|
|
- num: null,
|
|
|
|
|
- warehouseId: null
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- } else {
|
|
|
|
|
- this.item.sampleList.push({
|
|
|
|
|
- selectType: this.selectType,
|
|
|
|
|
- num: null,
|
|
|
|
|
- warehouseId: null
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- } else {
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- icon: 'none',
|
|
|
|
|
- title: '请先选项处置方法'
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- },
|
|
|
|
|
|
|
|
|
|
getDelete(idx) {
|
|
getDelete(idx) {
|
|
|
this.item.sampleList.splice(idx, 1)
|
|
this.item.sampleList.splice(idx, 1)
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
- hendleReuseNum(it) {
|
|
|
|
|
- if(it.selectType == 1) {
|
|
|
|
|
- this.$set(this.item, 'reuseNum', it.num)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
+ hendleReuseNum() {
|
|
|
|
|
+ let count = 0
|
|
|
|
|
+ if(this.item.sampleList.length > 0) {
|
|
|
|
|
+ this.item.sampleList.forEach(f=> {
|
|
|
|
|
+ if (Object.prototype.hasOwnProperty.call(f, 'selectType') && f.selectType == 1) {
|
|
|
|
|
+ count = count + 1
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ if(count > 0) {
|
|
|
|
|
+ this.$set(this.item, 'reuseNum', count)
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -474,6 +484,9 @@
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
margin-top: 8rpx;
|
|
margin-top: 8rpx;
|
|
|
|
|
|
|
|
|
|
+ .wrap {
|
|
|
|
|
+ flex-wrap: wrap;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
.row {
|
|
.row {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
@@ -491,6 +504,10 @@
|
|
|
width: 40rpx;
|
|
width: 40rpx;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ .ww25 {
|
|
|
|
|
+ width: 25%;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
.ww30 {
|
|
.ww30 {
|
|
|
width: 30%;
|
|
width: 30%;
|
|
|
}
|
|
}
|
|
@@ -503,6 +520,11 @@
|
|
|
width: 35%;
|
|
width: 35%;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ .ww45 {
|
|
|
|
|
+ width: 45%;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
.ww55 {
|
|
.ww55 {
|
|
|
width: 55%;
|
|
width: 55%;
|
|
|
}
|
|
}
|
|
@@ -510,11 +532,11 @@
|
|
|
.ww15 {
|
|
.ww15 {
|
|
|
width: 15%;
|
|
width: 15%;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- .turnover_btn{
|
|
|
|
|
- color: $theme-color;
|
|
|
|
|
- font-size: 24rpx;
|
|
|
|
|
- padding-left: 12rpx;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ .turnover_btn {
|
|
|
|
|
+ color: $theme-color;
|
|
|
|
|
+ font-size: 24rpx;
|
|
|
|
|
+ padding-left: 12rpx;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -534,6 +556,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
.tr {
|
|
.tr {
|
|
|
border-top: 2rpx solid #E3E5E5;
|
|
border-top: 2rpx solid #E3E5E5;
|
|
|
border-left: 2rpx solid #E3E5E5;
|
|
border-left: 2rpx solid #E3E5E5;
|
|
@@ -577,22 +601,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- .popup_box {
|
|
|
|
|
- width: 78vw;
|
|
|
|
|
- padding: 32rpx;
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- .operate_box {
|
|
|
|
|
- margin-top: 32rpx;
|
|
|
|
|
- padding: 10rpx 100rpx;
|
|
|
|
|
-
|
|
|
|
|
- /deep/ .u-button {
|
|
|
|
|
- width: 160rpx;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
</style>
|
|
</style>
|