|
|
@@ -6,17 +6,8 @@
|
|
|
<view class="module-com">
|
|
|
<view class="commodity-view">
|
|
|
<view class="commodity-list">
|
|
|
- <view
|
|
|
- class="commodity-item"
|
|
|
- v-for="(item, index) in selectList"
|
|
|
- :key="index"
|
|
|
- >
|
|
|
- <image
|
|
|
- class="item-icon"
|
|
|
- :src="item.cover"
|
|
|
- alt="商品图"
|
|
|
- />
|
|
|
-
|
|
|
+ <view class="commodity-item" v-for="(item, index) in selectList" :key="index">
|
|
|
+ <image class="item-icon" :src="item.cover" alt="商品图" />
|
|
|
<view class="item-info">
|
|
|
<view class="info-line">
|
|
|
<text class="item-name">{{ item.itemName }}</text>
|
|
|
@@ -44,10 +35,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="summary-bar">
|
|
|
- <view
|
|
|
- class="operate-view"
|
|
|
- @click="gobackEvent"
|
|
|
- >
|
|
|
+ <view class="operate-view" @click="gobackEvent">
|
|
|
<text class="iconfont icongouwuche"></text>
|
|
|
重选花材
|
|
|
</view>
|
|
|
@@ -61,6 +49,11 @@
|
|
|
</view>
|
|
|
<!-- 登录信息 -->
|
|
|
<view class="module-com input-line-wrap">
|
|
|
+ <view class="tab-box flex-space">
|
|
|
+ <view class="flex-center tab" :class="isBilling?'active':''" @tap="isBilling=true">开单</view>
|
|
|
+ <view class="flex-center tab" :class="isBilling?'':'active'" @tap="isBilling=false">损耗登记</view>
|
|
|
+ </view>
|
|
|
+ <view class="" v-if="isBilling">
|
|
|
<tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="showCustomer = true">
|
|
|
<view class="tui-title">客户</view>
|
|
|
<view class="tui-input" v-if="form.customId" >{{ form.customName }}</view>
|
|
|
@@ -104,18 +97,18 @@
|
|
|
<view class="tui-title">优惠</view>
|
|
|
<text style="color: #3385FF">{{ (allPrice.toFixed(2) - realMoney + Number(this.form.sendCost)).toFixed(2) }}</text>
|
|
|
</tui-list-cell>
|
|
|
-
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</form>
|
|
|
</view>
|
|
|
<view class="under-bar">
|
|
|
<view class="price-view">
|
|
|
- <text class="price-title">{{form.debt == 1 ? "欠款" : "已收款"}}</text>
|
|
|
+ <text class="price-title" v-if="isBilling">{{form.debt == 1 ? "欠款" : "已收款"}}</text>
|
|
|
+ <text class="price-title" v-else>金额</text>
|
|
|
<text class="price-number">
|
|
|
¥
|
|
|
- <!--<text class="large" v-if="form.sendType == 1">{{ (allPrice + Number(form.sendCost)).toFixed(2) }}</text>-->
|
|
|
- <!--<text class="large" v-else >{{ allPrice.toFixed(2) }}</text>-->
|
|
|
- <text class="large" >{{ realMoney?realMoney:0 }}</text>
|
|
|
+ <text class="large" v-if="isBilling">{{ realMoney?realMoney:0 }}</text>
|
|
|
+ <text class="large" v-else>{{ allPrice.toFixed(2) }}</text>
|
|
|
</text>
|
|
|
</view>
|
|
|
<button class="admin-button-com blue middle" @click="affirmFormSubmit">
|
|
|
@@ -139,7 +132,7 @@ import appAddressGroup from "@/components/app-address-group";
|
|
|
import appSendTime from "@/components/app-send-time";
|
|
|
import appFormSend from "@/components/app-form-send";
|
|
|
const formUtil = require("@/utils/formValidation.js");
|
|
|
-import { createOrder, freight } from "@/api/order/index";
|
|
|
+import { createOrder, freight,wastage } from "@/api/order/index";
|
|
|
import { mapActions, mapGetters } from "vuex";
|
|
|
export default {
|
|
|
name: "BillingAffirm", // 开单确认
|
|
|
@@ -158,6 +151,7 @@ export default {
|
|
|
data () {
|
|
|
return {
|
|
|
autoLoad: false,
|
|
|
+ isBilling: true,
|
|
|
form: {
|
|
|
debt: 1, //付款方式 1欠款订单 0正常订单
|
|
|
shopId: "",
|
|
|
@@ -285,29 +279,58 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
affirmFormSubmit () {
|
|
|
- let rules = [
|
|
|
- {
|
|
|
- name: "customId",
|
|
|
- rule: ["required"],
|
|
|
- msg: ["请选择客户"],
|
|
|
- },
|
|
|
- ];
|
|
|
- let checkRes = formUtil.validation(this.form, rules);
|
|
|
- if (checkRes) {
|
|
|
- this.$msg(checkRes);
|
|
|
- return false;
|
|
|
- }
|
|
|
+ let self = this;
|
|
|
+ if(this.isBilling){
|
|
|
+ let rules = [
|
|
|
+ {
|
|
|
+ name: "customId",
|
|
|
+ rule: ["required"],
|
|
|
+ msg: ["请选择客户"],
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ let checkRes = formUtil.validation(this.form, rules);
|
|
|
+ if (checkRes) {
|
|
|
+ this.$msg(checkRes);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ uni.showModal({
|
|
|
+ title: "提示",
|
|
|
+ content: "确认开单?",
|
|
|
+ success: function (res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ self.formSubmit();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ let product = this.selectList.map((ele) => {
|
|
|
+ return {
|
|
|
+ productId: ele.id,
|
|
|
+ bigNum: ele.bigCount,
|
|
|
+ smallNum: ele.smallCount,
|
|
|
+ classId: ele.classId,
|
|
|
+ itemId: ele.itemId,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ console.log(product)
|
|
|
+ // formData.product = JSON.stringify(product);
|
|
|
+ uni.showModal({
|
|
|
+ title: "提示",
|
|
|
+ content: "损耗登记?",
|
|
|
+ success: function (res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ wastage({product:JSON.stringify(product)}).then((res) => {
|
|
|
+ self.resetSelectInfoByType(self.pageType);
|
|
|
+ const {data: { id, orderSn },} = res;
|
|
|
+ let url = `/admin/billing/result?orderId=${id}&orderSn=${orderSn}`;
|
|
|
+ uni.redirectTo({url: url,success: (result) => { },fail: () => { },complete: () => { },
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
- let self = this;
|
|
|
- uni.showModal({
|
|
|
- title: "提示",
|
|
|
- content: "确认开单?",
|
|
|
- success: function (res) {
|
|
|
- if (res.confirm) {
|
|
|
- self.formSubmit();
|
|
|
- }
|
|
|
- },
|
|
|
- });
|
|
|
},
|
|
|
// 表单验证
|
|
|
async formSubmit (e) {
|
|
|
@@ -452,6 +475,22 @@ export default {
|
|
|
|
|
|
border-radius: 10px;
|
|
|
overflow: hidden;
|
|
|
+ .tab-box{
|
|
|
+ padding: 10rpx 30rpx 30rpx;
|
|
|
+ .tab{
|
|
|
+ width: 45%;
|
|
|
+ height: 80rpx;
|
|
|
+ color: #a2a2a2;
|
|
|
+ border: 1px solid #dcdcdc;
|
|
|
+ border-radius: 10rpx;
|
|
|
+ font-size: 28rpx;
|
|
|
+ font-weight: 700;
|
|
|
+ &.active{
|
|
|
+ color: #ff4d4d;
|
|
|
+ border: 1px solid #ff4d4d;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
.member-wrap {
|
|
|
.member-det {
|
|
|
font-size: 24px;
|