|
|
@@ -37,22 +37,28 @@
|
|
|
<selectPrice @confirmSelectPrice="confirmSelectPrice" @cancelSelectPrice="cancelSelectPrice"></selectPrice>
|
|
|
</uni-popup>
|
|
|
|
|
|
+ <!-- 开单选花材输入数量和金额 -->
|
|
|
+ <uni-popup ref="selectNumPriceRef" background-color="#fff" type="center" :animation="false">
|
|
|
+ <selectNumPrice @confirmAddItemModel="confirmAddItemModel" :customData.sync="customData" @cancelKdSelectNumPrice="addItemModelHidden"></selectNumPrice>
|
|
|
+ </uni-popup>
|
|
|
+
|
|
|
</view>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import settlePop from './settlePop.vue'
|
|
|
-import toPayWay from './toPay.vue'
|
|
|
+import settlePop from './settlePop'
|
|
|
+import toPayWay from './toPay'
|
|
|
import { wastageCreateOrder } from '@/api/home/index'
|
|
|
import { createOrder} from '@/api/order'
|
|
|
import {goodsWastage} from '@/api/wastage'
|
|
|
import productMins from "@/mixins/product"
|
|
|
import { allProduct } from '@/api/product'
|
|
|
import { getBySn } from '@/api/goods'
|
|
|
-import selectPrice from './selectPrice.vue'
|
|
|
+import selectPrice from './selectPrice'
|
|
|
+import selectNumPrice from './selectNumPrice'
|
|
|
export default {
|
|
|
name:'console',
|
|
|
mixins: [productMins],
|
|
|
- components:{ settlePop,toPayWay,selectPrice},
|
|
|
+ components:{ settlePop,toPayWay,selectPrice,selectNumPrice},
|
|
|
props: {
|
|
|
customId: {
|
|
|
type: Number,
|
|
|
@@ -95,6 +101,12 @@ export default {
|
|
|
created(){
|
|
|
this.initData()
|
|
|
},
|
|
|
+ destroyed(){
|
|
|
+ // #ifdef APP-PLUS
|
|
|
+ //避免重复,每次进来先移除全局自定义事件监听器
|
|
|
+ uni.$off('listenGetScanCode')
|
|
|
+ // #endif
|
|
|
+ },
|
|
|
methods:{
|
|
|
cancelSelectPrice(){
|
|
|
this.$refs.gatheringRef.close()
|
|
|
@@ -137,6 +149,7 @@ export default {
|
|
|
this.calc = this.calc == 'add' ? 'sub' : 'add'
|
|
|
},
|
|
|
async takeItem(code){
|
|
|
+ console.log(code)
|
|
|
if(this.$util.isEmpty(code)){
|
|
|
return false
|
|
|
}
|
|
|
@@ -148,8 +161,16 @@ export default {
|
|
|
const res = await getBySn({sn:code})
|
|
|
if(res.code == 1){
|
|
|
current = res.data
|
|
|
+ if(this.$util.isEmpty(current)){
|
|
|
+ return false
|
|
|
+ }
|
|
|
unitName = '份'
|
|
|
unitPrice = Number(res.data.price)
|
|
|
+ this.customData = current
|
|
|
+ this.customData.currentNum = 1
|
|
|
+ this.customData.unitPrice = unitPrice
|
|
|
+ this.customData.property = 0
|
|
|
+ this.$refs.selectNumPriceRef.open('center')
|
|
|
}
|
|
|
}else{
|
|
|
//花材
|
|
|
@@ -159,17 +180,17 @@ export default {
|
|
|
if(current == undefined){
|
|
|
return false
|
|
|
}
|
|
|
+ if(this.$util.isEmpty(current)){
|
|
|
+ return false
|
|
|
+ }
|
|
|
unitName = current.bigUnit
|
|
|
unitPrice = current.bigPrice
|
|
|
+ this.$util.hitRemind()
|
|
|
+ let num = this.calc == 'add' ? 1 : -1
|
|
|
+ let params = {...current,unitName:unitName,unitPrice:unitPrice,currentNum:num}
|
|
|
+ console.log(params)
|
|
|
+ this.replaceItemFn(params,1)
|
|
|
}
|
|
|
- if(this.$util.isEmpty(current)){
|
|
|
- return false
|
|
|
- }
|
|
|
- this.$util.hitRemind()
|
|
|
- let num = this.calc == 'add' ? 1 : -1
|
|
|
- let params = {...current,unitName:unitName,unitPrice:unitPrice,currentNum:num}
|
|
|
- console.log(params)
|
|
|
- this.replaceItemFn(params,1)
|
|
|
},
|
|
|
changeProperty(){
|
|
|
this.property = this.property == 1 ? 0 : 1
|