|
|
@@ -15,10 +15,20 @@
|
|
|
<!-- 按钮操作 -->
|
|
|
<view class="open-box">
|
|
|
<view class="button-area">
|
|
|
- <view class="active">提交</view>
|
|
|
+ <view class="active" @click="showCommitFn()">提交</view>
|
|
|
<view class="active" @click="clearItemFn">清空</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+
|
|
|
+ <!-- 清空 -->
|
|
|
+ <uni-popup ref="clearItemRef" type="dialog">
|
|
|
+ <uni-popup-dialog type="info" cancelText="取消" confirmText="确认" title="提示" content="确认清空?" @confirm="confirmClearItem"></uni-popup-dialog>
|
|
|
+ </uni-popup>
|
|
|
+
|
|
|
+ <uni-popup ref="commitRef" type="dialog">
|
|
|
+ <uni-popup-dialog type="info" cancelText="取消" confirmText="确认" title="提示" content="确认提交?" @confirm="commitMake"></uni-popup-dialog>
|
|
|
+ </uni-popup>
|
|
|
+
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
@@ -28,6 +38,7 @@ import rightGoods from './components/rightGoods.vue'
|
|
|
import leftArea from './components/leftArea.vue'
|
|
|
import casherNav from './components/nav.vue'
|
|
|
import productMins from "@/mixins/product"
|
|
|
+import {goodsCreateFn} from '@/api/work'
|
|
|
export default {
|
|
|
name: "make",
|
|
|
components: { rightGoods,leftArea, casherNav},
|
|
|
@@ -78,11 +89,29 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- logout(){
|
|
|
-
|
|
|
+ showCommitFn(){
|
|
|
+ this.$refs.commitRef.open('center')
|
|
|
+ },
|
|
|
+ commitMake(){
|
|
|
+ if(this.$util.isEmpty(this.selectList)){
|
|
|
+ this.$msg('请选择商品')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ let goods = this.selectList.map(ele=>{
|
|
|
+ return {productId:ele.id,num:ele.currentNum}
|
|
|
+ })
|
|
|
+ uni.showLoading({mask:true})
|
|
|
+ goodsCreateFn({goods:JSON.stringify(goods)}).then(res=>{
|
|
|
+ uni.hideLoading()
|
|
|
+ if(res.code == 1){
|
|
|
+ this.$msg(res.msg)
|
|
|
+ this.confirmClearItem()
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
clearItemFn(){
|
|
|
-
|
|
|
+ this.$util.hitRemind()
|
|
|
+ this.$refs.clearItemRef.open()
|
|
|
},
|
|
|
changeProperty(property){
|
|
|
this.currentProperty = property
|
|
|
@@ -96,6 +125,11 @@ export default {
|
|
|
},
|
|
|
init() {
|
|
|
},
|
|
|
+ //确认清空花材
|
|
|
+ confirmClearItem(){
|
|
|
+ this.$util.hitRemind()
|
|
|
+ this.removeFromSaveDirect()
|
|
|
+ },
|
|
|
}
|
|
|
};
|
|
|
</script>
|