Commit acab798e by LJM

产地拆分

parent 6992d7d6
...@@ -42,7 +42,8 @@ ...@@ -42,7 +42,8 @@
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>", "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>", "<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>" "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
] ],
"minSdkVersion" : 21
}, },
/* ios打包配置 */ /* ios打包配置 */
"ios" : { "ios" : {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</view> </view>
<view class="pick-list row bothSide verCenter"> <view class="pick-list row bothSide verCenter">
<picker @change="bindPickerChange($event, 1)" :value="goods_index" :range="goods_list" :range-key="'model'" style="width: 80%;"> <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> </picker>
<text class="iconfont icon-sanjiaoxing1"></text> <text class="iconfont icon-sanjiaoxing1"></text>
</view> </view>
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<view class="uni-text" @click="open(index)">{{ detail_json[index].origin ? detail_json[index].origin : '请选择国家地区' }}</view> <view class="uni-text" @click="open(index)">{{ detail_json[index].origin ? detail_json[index].origin : '请选择国家地区' }}</view>
<text class="iconfont icon-sanjiaoxing1"></text> <text class="iconfont icon-sanjiaoxing1"></text>
</view> </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> </view>
</view> </view>
...@@ -135,7 +135,7 @@ ...@@ -135,7 +135,7 @@
* @param {Object} target * @param {Object} target
*/ */
findIndex(arr, target) { findIndex(arr, target) {
const result = []; var result = [];
arr.map((item, index) => { arr.map((item, index) => {
if (item === target) { if (item === target) {
result.push(index); result.push(index);
...@@ -144,7 +144,7 @@ ...@@ -144,7 +144,7 @@
return result; return result;
}, },
onInputNum() { onInputNum() {
const total = this.detail_json.reduce((sum, item) => { var total = this.detail_json.reduce((sum, item) => {
if (item.tally_num) { if (item.tally_num) {
return sum + item.tally_num * 1; return sum + item.tally_num * 1;
} else { } else {
...@@ -265,7 +265,7 @@ ...@@ -265,7 +265,7 @@
return false; return false;
}); });
const hasDuplicates = this.hasDuplicateOrigin(this.detail_json); var hasDuplicates = this.hasDuplicateOrigin(this.detail_json);
if (hasDuplicates) { if (hasDuplicates) {
uni.showToast({ uni.showToast({
title: '不允许有相同产地,请重新选择产地', title: '不允许有相同产地,请重新选择产地',
...@@ -275,8 +275,8 @@ ...@@ -275,8 +275,8 @@
} }
if (shouldContinue) { if (shouldContinue) {
const totalTallyNum = this.detail_json.reduce((total, item) => total + parseInt(item.tally_num), 0); var totalTallyNum = this.detail_json.reduce((total, item) => total + parseFloat(item.tally_num || 0), 0);
const total = this.goods_list[this.goods_index].qty * 1; var total = this.goods_list[this.goods_index].qty * 1;
if (totalTallyNum != total) { if (totalTallyNum != total) {
uni.showModal({ uni.showModal({
title: '错误提示', 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