shish 4 лет назад
Родитель
Сommit
e28ad624ce

+ 5 - 0
hdPad/src/api/work/index.js

@@ -26,4 +26,9 @@ export const cancelWork = data => {
 //创建工单 ssh 20220426
 export const createWorkFn = data => {
 	return https.post('/work/create', data)
+}
+
+//选款制作 ssh 20220426
+export const goodsCreateFn = data =>{
+	return https.post('/work/goods-create',data)
 }

+ 1 - 5
hdPad/src/pages/home/components/selectNum.vue

@@ -134,12 +134,8 @@ export default {
                 this.$msg('请填写数量')
                 return
             }
-            if(Number(this.unitPrice)  <= 0) {
-                this.$msg('请填写价格')
-                return
-            }
             this.customData.currentNum = this.currentNum
-            this.customData.unitPrice = this.unitPrice
+            this.customData.unitPrice = this.unitPrice || 0
             this.customData.unitType = this.unitType
             this.customData.unitName = this.unitName
             this.$emit('confirmAddItemModel', this.customData)

+ 38 - 4
hdPad/src/pages/home/selectMake.vue

@@ -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>