采购列表页面,部分手机无法输入价格、数量:售价、进价,需要排查
This commit is contained in:
parent
82fdf4b73d
commit
c329fa5864
@ -4,22 +4,19 @@
|
|||||||
"version" : "0.0",
|
"version" : "0.0",
|
||||||
"configurations" : [
|
"configurations" : [
|
||||||
{
|
{
|
||||||
"app-plus" :
|
"app-plus" : {
|
||||||
{
|
|
||||||
"launchtype" : "local"
|
"launchtype" : "local"
|
||||||
},
|
},
|
||||||
"default" :
|
"default" : {
|
||||||
{
|
|
||||||
"launchtype" : "local"
|
"launchtype" : "local"
|
||||||
},
|
},
|
||||||
"mp-weixin" :
|
"mp-weixin" : {
|
||||||
{
|
|
||||||
"launchtype" : "local"
|
"launchtype" : "local"
|
||||||
},
|
},
|
||||||
"type" : "uniCloud"
|
"type" : "uniCloud"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"playground" : "custom",
|
"playground" : "standard",
|
||||||
"type" : "uni-app:app-android"
|
"type" : "uni-app:app-android"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -3,7 +3,8 @@ module.exports = {
|
|||||||
// baseUrl: 'https://www.nuoyunr.com',
|
// baseUrl: 'https://www.nuoyunr.com',
|
||||||
// baseUrl: 'http://124.222.105.7:48080',
|
// baseUrl: 'http://124.222.105.7:48080',
|
||||||
// baseUrl: 'http://192.168.1.4:48080',
|
// baseUrl: 'http://192.168.1.4:48080',
|
||||||
baseUrl: "http://localhost:48080",
|
// baseUrl: "http://localhost:48080",
|
||||||
|
baseUrl: "http://rzqhb7.natappfree.cc",
|
||||||
imagesUrl: 'http://shequ.0315e.com/static/images/pages/',
|
imagesUrl: 'http://shequ.0315e.com/static/images/pages/',
|
||||||
baseImageUrl: 'https://www.nuoyunr.com/minio/',
|
baseImageUrl: 'https://www.nuoyunr.com/minio/',
|
||||||
shareUrl: 'https://www.lighting-it.cn/share?inviteId=',
|
shareUrl: 'https://www.lighting-it.cn/share?inviteId=',
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
<view class="formItem" v-if="isInput">
|
<view class="formItem" v-if="isInput">
|
||||||
<text class="formLabel">关键字</text>
|
<text class="formLabel">关键字</text>
|
||||||
<input type="text" style="text-align: right" v-model="query" placeholder="名称、规格、编码"/>
|
<input type="text" style="text-align: right" v-model="query" placeholder="名称、规格、编码"/>
|
||||||
<view @click="searchQuery">查询</view>
|
<view @click="searchQuery" style="width: 3rem">查询</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="formItem" v-if="!isInput">
|
<view class="formItem" v-if="!isInput">
|
||||||
<text class="formLabel">备注</text>
|
<text class="formLabel">备注</text>
|
||||||
@ -35,8 +35,8 @@
|
|||||||
</view>
|
</view>
|
||||||
</uni-card>
|
</uni-card>
|
||||||
<uni-collapse ref="collapse">
|
<uni-collapse ref="collapse">
|
||||||
<uni-collapse-item v-for="[key, value] in partList" :title="key + `(${value.length})`">
|
<uni-collapse-item v-for="(key, index) in keys" :key="index" :title="key + `(${values.get(key).length})`">
|
||||||
<uni-card v-for="(item, index) in value" :key="index">
|
<uni-card v-for="(item, index) in values.get(key)" :key="index">
|
||||||
<template>
|
<template>
|
||||||
<view class="card-header">
|
<view class="card-header">
|
||||||
<radio v-if="isInput" :checked="item.isSelected" @click="chooseItem(item)"/>
|
<radio v-if="isInput" :checked="item.isSelected" @click="chooseItem(item)"/>
|
||||||
@ -45,16 +45,19 @@
|
|||||||
</template>
|
</template>
|
||||||
<view class="formItem">
|
<view class="formItem">
|
||||||
<view class="formLabel">进价</view>
|
<view class="formLabel">进价</view>
|
||||||
<input type="number" style="text-align: right" v-model="item.wares.purPrice" placeholder="请输入单价"/>
|
<input type="number" style="text-align: right" v-model="item.wares.purPrice"
|
||||||
|
placeholder="请输入单价"/>
|
||||||
</view>
|
</view>
|
||||||
<view class="formItem">
|
<view class="formItem">
|
||||||
<view class="formLabel">售价</view>
|
<view class="formLabel">售价</view>
|
||||||
<input type="number" style="text-align: right" v-model="item.wares.price" placeholder="请输入单价"/>
|
<input type="number" style="text-align: right" v-model="item.wares.price"
|
||||||
|
placeholder="请输入单价"/>
|
||||||
</view>
|
</view>
|
||||||
<view class="formItem">
|
<view class="formItem">
|
||||||
<view class="formLabel">分类</view>
|
<view class="formLabel">分类</view>
|
||||||
<view>
|
<view>
|
||||||
<picker @change="bindPickerChange($event, item)" :range="options" range-key="label">
|
<picker @change="bindPickerChange($event, item)" :range="options"
|
||||||
|
range-key="label">
|
||||||
<view class="picker">
|
<view class="picker">
|
||||||
{{ getServerName(item.wares.type) }}
|
{{ getServerName(item.wares.type) }}
|
||||||
</view>
|
</view>
|
||||||
@ -63,7 +66,8 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="formItem">
|
<view class="formItem">
|
||||||
<view class="formLabel">计量单价</view>
|
<view class="formLabel">计量单价</view>
|
||||||
<picker @change="bindUnitChange($event, item)" :range="unitList" range-key="label">
|
<picker @change="bindUnitChange($event, item)" :range="unitList"
|
||||||
|
range-key="label">
|
||||||
<view class="picker">
|
<view class="picker">
|
||||||
{{ getUnitName(item.wares.unit) }}
|
{{ getUnitName(item.wares.unit) }}
|
||||||
</view>
|
</view>
|
||||||
@ -71,30 +75,23 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="formItem" v-if="!isInput">
|
<view class="formItem" v-if="!isInput">
|
||||||
<view class="formLabel">数量</view>
|
<view class="formLabel">数量</view>
|
||||||
<input type="number" style="text-align: right" v-model="item.waresCount" placeholder="请输入数量"/>
|
<input type="number" style="text-align: right" v-model="item.waresCount"
|
||||||
|
placeholder="请输入数量"/>
|
||||||
</view>
|
</view>
|
||||||
<view class="formItem" v-if="isInput">
|
<view class="formItem" v-if="isInput">
|
||||||
<view class="formLabel">数量</view>
|
<view class="formLabel">数量</view>
|
||||||
<input type="number" style="text-align: right" v-model="item.inCount" placeholder="请输入数量"/>
|
<input type="number" style="text-align: right" v-model="item.inCount"
|
||||||
|
placeholder="请输入数量"/>
|
||||||
</view>
|
</view>
|
||||||
<view class="formItem">
|
<view class="formItem">
|
||||||
<view class="formLabel">仓库</view>
|
<view class="formLabel">仓库</view>
|
||||||
<uni-data-picker placeholder="请选择仓库" popup-title="请选择仓库" :localdata="waresTree" v-model="item.wares.warehouse">
|
<uni-data-picker placeholder="请选择仓库" popup-title="请选择仓库"
|
||||||
|
:localdata="waresTree" v-model="item.wares.warehouse">
|
||||||
</uni-data-picker>
|
</uni-data-picker>
|
||||||
</view>
|
</view>
|
||||||
</uni-card>
|
</uni-card>
|
||||||
</uni-collapse-item>
|
</uni-collapse-item>
|
||||||
</uni-collapse>
|
</uni-collapse>
|
||||||
<!-- <uni-card v-for="(item, index) in partList" :key="index" :title="item.name" :extra="'上次价格:'+item.purPrice">-->
|
|
||||||
<!-- <view class="formItem">-->
|
|
||||||
<!-- <view class="formLabel">单价</view>-->
|
|
||||||
<!-- <input type="number" style="text-align: right" v-model="item.newPrice" placeholder="请输入单价"/>-->
|
|
||||||
<!-- </view>-->
|
|
||||||
<!-- <view class="formItem">-->
|
|
||||||
<!-- <view class="formLabel">数量</view>-->
|
|
||||||
<!-- <input type="number" style="text-align: right" v-model="item.count" placeholder="请输入数量"/>-->
|
|
||||||
<!-- </view>-->
|
|
||||||
<!-- </uni-card>-->
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="footer">
|
<view class="footer">
|
||||||
@ -151,6 +148,8 @@ export default {
|
|||||||
subLoading: false,
|
subLoading: false,
|
||||||
waresTree: [],
|
waresTree: [],
|
||||||
chooseWares: null,
|
chooseWares: null,
|
||||||
|
keys: [],
|
||||||
|
values: null
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(data) {
|
onLoad(data) {
|
||||||
@ -182,29 +181,29 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
chooseItem(item) {
|
chooseItem(item) {
|
||||||
const parentIndex = this.partList.map(([key, value]) => value).reduce((acc, value) => acc.concat(value)).findIndex(i => i.id === item.id)
|
const index = this.selectRows.findIndex(i => i.id === item.id);
|
||||||
const index = this.selectRows.findIndex(i => i.id === item.id)
|
|
||||||
if (index === -1) {
|
if (index === -1) {
|
||||||
this.$set(item, 'isSelected', true)
|
item.isSelected = true;
|
||||||
this.selectRows.push(item)
|
this.selectRows.push(item);
|
||||||
} else {
|
} else {
|
||||||
this.$set(item, 'isSelected', false)
|
item.isSelected = false;
|
||||||
this.selectRows.splice(index, 1)
|
this.selectRows.splice(index, 1);
|
||||||
}
|
}
|
||||||
if (parentIndex !== -1){
|
|
||||||
const partListFlat = this.partList
|
// 将 Map 中的所有值展平成一个数组
|
||||||
.map(([key, value]) => value)
|
const partListFlat = Array.from(this.values.values()).flat();
|
||||||
.reduce((acc, value) => acc.concat(value), []);
|
|
||||||
this.$set(partListFlat, parentIndex, { ...partListFlat[parentIndex], isSelected: item.isSelected });
|
// 更新 Map 中的值
|
||||||
const updatedPartList = this.partList.map(([key, value]) => {
|
const updatedValues = new Map();
|
||||||
|
for (const [key, value] of this.values) {
|
||||||
const newValue = value.map(v => {
|
const newValue = value.map(v => {
|
||||||
const foundItem = partListFlat.find(f => f.id === v.id);
|
const foundItem = partListFlat.find(f => f.id === v.id);
|
||||||
return foundItem ? { ...v, ...foundItem } : v;
|
return foundItem ? { ...v, ...foundItem } : v;
|
||||||
});
|
});
|
||||||
return [key, newValue];
|
updatedValues.set(key, newValue);
|
||||||
});
|
|
||||||
this.$set(this, 'partList', updatedPartList);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.values = updatedValues;
|
||||||
},
|
},
|
||||||
searchQuery() {
|
searchQuery() {
|
||||||
this.getSoiId()
|
this.getSoiId()
|
||||||
@ -325,6 +324,8 @@ export default {
|
|||||||
i.totalPrice = i.waresCount * i.wares.purPrice
|
i.totalPrice = i.waresCount * i.wares.purPrice
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
this.keys = this.partList.map(([key, value]) => key)
|
||||||
|
this.values = new Map(this.partList)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@ -360,7 +361,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
const userInfo = getUserInfo()
|
const userInfo = getUserInfo()
|
||||||
const values = this.partList.map(([key, value]) => value).reduce((acc, value) => acc.concat(value))
|
const values = Array.from(this.values.values()).flat();
|
||||||
const data = {
|
const data = {
|
||||||
soType: '01',
|
soType: '01',
|
||||||
purchaseType: '01',
|
purchaseType: '01',
|
||||||
@ -439,6 +440,8 @@ export default {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
this.keys = this.partList.map(([key, value]) => key)
|
||||||
|
this.values = new Map(this.partList)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@ -451,7 +454,7 @@ export default {
|
|||||||
id: this.soId,
|
id: this.soId,
|
||||||
soNo: createUniqueCodeByHead("RK")
|
soNo: createUniqueCodeByHead("RK")
|
||||||
}
|
}
|
||||||
const values = this.partList.map(([key, value]) => value).reduce((acc, item) => acc.concat(item))
|
const values = Array.from(this.values.values()).flat();
|
||||||
if (this.selectRows && this.selectRows.length > 0) {
|
if (this.selectRows && this.selectRows.length > 0) {
|
||||||
const ids = this.selectRows.map(item => item.id)
|
const ids = this.selectRows.map(item => item.id)
|
||||||
const newSelect = values.filter(item => ids.includes(item.id))
|
const newSelect = values.filter(item => ids.includes(item.id))
|
||||||
|
Loading…
Reference in New Issue
Block a user