Pārlūkot izejas kodu

快速制作单

shish 4 gadi atpakaļ
vecāks
revīzija
5c858448ae

+ 17 - 13
hdApp/src/admin/order/workOrder.vue

@@ -39,8 +39,8 @@
           </tui-list-cell>
 
           <tui-list-cell class="line-cell" :hover="false" :arrow="false" >
-            <view class="tui-title">金额</view>
-            <input type="digit" @focus="modifyPrice=''" :focus="true" v-model="modifyPrice" placeholder-class="tui-placeholder"/>
+            <view class="tui-title">单价</view>
+            <input type="digit" @focus="goodsPrice=''" :focus="true" v-model="goodsPrice" placeholder-class="tui-placeholder"/>
           </tui-list-cell>
 
         </view>
@@ -99,7 +99,7 @@ export default {
         remark:'',
         flowerNum:''
       },
-      modifyPrice:'',
+      goodsPrice:'',
 			payWayindex:0,
 			payWayList:[{name:"微信",id:0},{name:"支付宝",id:1},{name:"现金",id:4},{name:"银行卡",id:5}],
       plantClassData:[],
@@ -169,22 +169,26 @@ export default {
     confirmToSubmit () {
       let that = this
 
-      if(this.$util.isEmpty(this.modifyPrice) || Number(this.modifyPrice)<=0){
-        this.$msg("请输入金额")
+      if(this.$util.isEmpty(this.goodsPrice) || Number(this.goodsPrice)<=0){
+        this.$msg("请输入单价")
         return false
       }
-      if (this.$util.isEmpty(this.form.cover)) {
-        this.$msg("请上传图片")
-        return false
+      //允许不传图片
+      if (!this.$util.isEmpty(this.form.cover)) {
+        if(Array.isArray(this.form.cover)){
+          this.form.cover = this.form.cover[0]
+        }
       }
-      if(Array.isArray(this.form.cover)){
-        this.form.cover = this.form.cover[0]
+      if(this.$util.isEmpty(this.form.num) || Number(this.form.num)<0){
+        this.$msg('请填写数量')
+        return false
       }
-
+      let modifyPrice = Number(this.goodsPrice)*Number(this.form.num)
+      modifyPrice = modifyPrice.toFixed(2)
       that.form = {...that.$refs.appDelivery.form,...that.form}
       that.$util.confirmModal({content:'确认提交?'},() => {
-          createOrder({...that.form,lsGoodsPrice:this.modifyPrice,modifyPrice:this.modifyPrice}).then((res) => {
-            that.pageTo({url: '/admin/order/addOrderResult',type:2,query:{id:res.data.id}})
+          createOrder({...that.form,unitGoodsPrice:this.goodsPrice,modifyPrice:modifyPrice}).then((res) => {
+            that.pageTo({url: '/admin/order/workOrderResult',type:2,query:{id:res.data.id}})
           })
       })
     }

+ 84 - 0
hdApp/src/admin/order/workOrderResult.vue

@@ -0,0 +1,84 @@
+<template>
+	<view class="app-content">
+		<view class="billing_box_bg">
+			<view class="top-view"> </view>
+			<view class="result-view">
+				<view class="iconfont iconchenggong"></view>
+				<view class="result-title">操作成功</view>
+				<view class="result-title" v-if="sn!=''">制作单序号:{{sn}}</view>
+				<button class="admin-button-com big blue" style="width:45vw;" @click="goBackHome">返回</button>
+			</view>
+		</view>
+	</view>
+</template>
+<script>
+import { getInfoByOrderId } from "@/api/work";
+export default {
+    name: "success",
+  	data () {
+		return {
+			sn:''
+		}
+	},
+	onLoad (option) {
+		let id = option.id
+		getInfoByOrderId({orderId:id}).then(res=>{
+			if(res.code == 1){
+				this.sn = res.data.info.sn
+			}
+		})
+	},
+	methods: {
+		goBackHome() {
+			uni.navigateBack({})
+		}
+	}
+};
+</script>
+<style lang="scss" scoped>
+.go-back{
+	width: 80%;
+	height: 80upx;
+	color: #FFFFFF;
+	margin-top: 50upx;
+	background: #3385FF;
+	border-radius: 10upx;
+	font-size:30upx;
+}
+.billing_box_bg {
+	position: relative;
+	padding: 60upx 30upx;
+	display: flex;
+	background: white;
+	flex-direction: column;
+    background-color: #f5f5f5;
+	.top-view {
+		position: absolute;
+		top: 0;
+		left: 0;
+		width: 100%;
+		height: 299upx;
+		background: #3385ff;
+		border-radius: 0upx 0upx 83upx 83upx;
+	}
+	.result-view {
+		position: relative;
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		padding: 70upx;
+		width: 100%;
+		background: #ffffff;
+		border-radius: 20upx;
+		z-index: 1;
+		.iconchenggong {
+			font-size: 170upx;
+			color: $mainColor1;
+		}
+		.result-title {
+			margin: 50upx 0 70upx;
+			font-size: 32upx;
+		}
+	}
+}
+</style>

+ 4 - 0
hdApp/src/api/work/index.js

@@ -23,4 +23,8 @@ export const cancelWork = data => {
 //选款制作 ssh 20220426
 export const goodsCreateFn = data =>{
 	return https.post('/work/goods-create',data)
+}
+
+export const getInfoByOrderId = data =>{
+	return https.get('/work/get-info-by-order-id', data)
 }

+ 1 - 0
hdApp/src/pages.json

@@ -285,6 +285,7 @@
 				{ "path": "addOrder", "style": { "navigationBarTitleText": "开单" } },
 				{ "path": "addOrderConfirm", "style": { "navigationBarTitleText": "确认" } },
 				{ "path": "addOrderResult", "style": { "navigationBarTitleText": "结果" } },
+				{ "path": "workOrderResult", "style": { "navigationBarTitleText": "结果" } },
 				{ "path": "refund", "style": { "navigationBarTitleText": "退款" } },
 				{ "path": "refundList", "style": { "navigationBarTitleText": "退款记录" } },
 				{ "path": "refundDetail", "style": { "navigationBarTitleText": "退款详情" } },

+ 3 - 1
hdPad/src/pages/home/components/workInfo.vue

@@ -22,7 +22,9 @@
           ¥{{orderInfo.orderPrice && Number(orderInfo.orderPrice)>0 ? parseFloat(orderInfo.orderPrice) : ''}}
           </text>
         </view>
-        <view><text class="left">数量</text><text class="right">{{orderInfo.num}}</text></view>
+        <view><text class="left">数量</text>
+        <text class="right" style="color:red;font-weight:bold;">{{orderInfo.num}}</text>
+        </view>
         <view><text class="left">分类</text><text class="right">{{orderInfo.catName}}</text></view>
         <view><text class="left">名称</text><text class="right">{{orderInfo.name}}</text></view>
         <view><text class="left">支数</text><text class="right">{{orderInfo.flowerNum}}</text></view>