Commit acab798e by LJM

产地拆分

parent 6992d7d6
......@@ -42,7 +42,8 @@
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
],
"minSdkVersion" : 21
},
/* ios打包配置 */
"ios" : {
......
......@@ -12,7 +12,7 @@
</view>
<view class="pick-list row bothSide verCenter">
<picker @change="bindPickerChange($event, 1)" :value="goods_index" :range="goods_list" :range-key="'model'" style="width: 80%;">
<view class="uni-text">{{ goods_list[goods_index].model || '请选择型号' }}</view>
<view class="uni-text">{{ (goods_list[goods_index] && goods_list[goods_index].model) || '请选择型号' }}</view>
</picker>
<text class="iconfont icon-sanjiaoxing1"></text>
</view>
......@@ -57,7 +57,7 @@
<view class="uni-text" @click="open(index)">{{ detail_json[index].origin ? detail_json[index].origin : '请选择国家地区' }}</view>
<text class="iconfont icon-sanjiaoxing1"></text>
</view>
<view class="input-wrap"><input @input="onInputNum" type="number" inputmode="numeric" placeholder="请输入拆分数量" class="uni-input" placeholder-style="color:#404547;font-weight:bold;" v-model="detail_json[index].tally_num" /></view>
<view class="input-wrap"><input @input="onInputNum" type="number" placeholder="请输入拆分数量" class="uni-input" placeholder-style="color:#404547;font-weight:bold;" v-model="detail_json[index].tally_num" /></view>
</view>
</view>
</view>
......@@ -135,7 +135,7 @@
* @param {Object} target
*/
findIndex(arr, target) {
const result = [];
var result = [];
arr.map((item, index) => {
if (item === target) {
result.push(index);
......@@ -144,7 +144,7 @@
return result;
},
onInputNum() {
const total = this.detail_json.reduce((sum, item) => {
var total = this.detail_json.reduce((sum, item) => {
if (item.tally_num) {
return sum + item.tally_num * 1;
} else {
......@@ -265,7 +265,7 @@
return false;
});
const hasDuplicates = this.hasDuplicateOrigin(this.detail_json);
var hasDuplicates = this.hasDuplicateOrigin(this.detail_json);
if (hasDuplicates) {
uni.showToast({
title: '不允许有相同产地,请重新选择产地',
......@@ -275,8 +275,8 @@
}
if (shouldContinue) {
const totalTallyNum = this.detail_json.reduce((total, item) => total + parseInt(item.tally_num), 0);
const total = this.goods_list[this.goods_index].qty * 1;
var totalTallyNum = this.detail_json.reduce((total, item) => total + parseFloat(item.tally_num || 0), 0);
var total = this.goods_list[this.goods_index].qty * 1;
if (totalTallyNum != total) {
uni.showModal({
title: '错误提示',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment