|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div class="bg-in-stock" ref="printId">
|
|
|
<!-- <h2 v-if="barcodeValue">订单编号</h2> -->
|
|
|
- <div class="numOrder" v-if="barcodeValue &&type !=='pone'">
|
|
|
+ <div class="numOrder" v-if="(barcodeValue && type !== 'pone') && orderType == 'check'">
|
|
|
<barcode :value="barcodeValue"></barcode>
|
|
|
</div>
|
|
|
<el-form ref="orderFormRef" :rules="rules" :model="OrderForm" label-width="120px" inline :disabled="isDetail">
|
|
@@ -9,59 +9,29 @@
|
|
|
<el-row>
|
|
|
<el-col :span="10">
|
|
|
<el-form-item label="订单类型" prop="type" :rules="rules.type">
|
|
|
- <!-- @change="cleanGoodsList" -->
|
|
|
- <el-select v-model="OrderForm.type" clearable :disabled="type=='pone'">
|
|
|
+ <el-select v-model="OrderForm.type" clearable :disabled="type == 'pone'">
|
|
|
<el-option v-for="(item, index) in orderTypeList" :key="index" :label="item.label" :value="item.value" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="10">
|
|
|
- <el-form-item label="起始时间" prop="time" :rules="rules.start_time" v-if="OrderForm.type == 'TO_C'" >
|
|
|
- <el-date-picker v-model="OrderForm.start_time" type="datetime" placeholder="选择日期时间" :disabled="type=='pone'"
|
|
|
- :picker-options="pickerOptions" value-format="yyyy-MM-dd HH:mm:ss">
|
|
|
- </el-date-picker>
|
|
|
- <!--
|
|
|
- <el-date-picker
|
|
|
- v-model="time"
|
|
|
- type="daterange"
|
|
|
- align="center"
|
|
|
- :editable="false"
|
|
|
- unlink-panels
|
|
|
- :clearable="false"
|
|
|
- :default-time="['00:00:00', '23:59:59']"
|
|
|
- range-separator="-"
|
|
|
- start-placeholder="开始日期"
|
|
|
- end-placeholder="结束日期"
|
|
|
- value-format="yyyy-MM-dd hh:mm:ss"
|
|
|
- :picker-options="{
|
|
|
- disabledDate(time) {
|
|
|
- return (
|
|
|
- time.getTime() <=
|
|
|
- new Date(
|
|
|
- new Date().getFullYear(),
|
|
|
- new Date().getMonth(),
|
|
|
- new Date().getDate()
|
|
|
- ).getTime() -
|
|
|
- 86400000
|
|
|
- );
|
|
|
- },
|
|
|
- shortcuts: MixinPickerShortcuts,
|
|
|
- }"
|
|
|
- >
|
|
|
- </el-date-picker>-->
|
|
|
+ <el-form-item label="下单客户" prop="member_id" :rules="rules.member_id">
|
|
|
+ <el-select v-model="OrderForm.member_id" clearable :disabled="type == 'pone'">
|
|
|
+ <el-option v-for="item in customerList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
+ </el-select>
|
|
|
+ <el-button type="primary" v-if="type !== 'pone'" @click="addCust">新增客户</el-button>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="10">
|
|
|
- <el-form-item label="下单客户" prop="member_id" :rules="rules.member_id" >
|
|
|
- <el-select v-model="OrderForm.member_id" clearable :disabled="type=='pone'">
|
|
|
- <el-option v-for="item in customerList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
- </el-select>
|
|
|
- <el-button type="primary" v-if="type!=='pone'" @click="addCust">新增客户</el-button>
|
|
|
+ <el-form-item label="起始时间" prop="time" :rules="rules.start_time" v-if="OrderForm.type == 'TO_C'">
|
|
|
+ <el-date-picker v-model="OrderForm.start_time" type="datetime" placeholder="选择日期时间"
|
|
|
+ :disabled="type == 'pone'" :picker-options="pickerOptions" value-format="yyyy-MM-dd HH:mm:ss">
|
|
|
+ </el-date-picker>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="10">
|
|
|
- <el-form-item label="付款方式" prop="pay_type" :rules="rules.pay_type" >
|
|
|
- <el-select v-model="OrderForm.pay_type" clearable :disabled="type=='pone'">
|
|
|
+ <el-form-item label="付款方式" prop="pay_type" :rules="rules.pay_type">
|
|
|
+ <el-select v-model="OrderForm.pay_type" clearable :disabled="type == 'pone'">
|
|
|
<el-option v-for="item in collectingAccountList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
@@ -72,68 +42,68 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="10">
|
|
|
- <el-form-item label="实付金额:" prop="pay_price" :rules="rules.pay_price">
|
|
|
- <!-- @input="validateNumber" -->
|
|
|
- <span>折扣:<el-input placeholder="请输入" v-model="discount" @blur="handleBlur" style="width: 70px" :disabled="type=='pone'"></el-input>
|
|
|
+ <el-form-item label="折扣:" prop="">
|
|
|
+ <el-input placeholder="请输入" v-model="discount" @blur="handleBlur" :disabled="type == 'pone'"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="10">
|
|
|
+ <el-form-item label="实付金额:" prop="real_price" :rules="rules.pay_price">
|
|
|
+ <!-- @input="validateNumber"
|
|
|
+ <span>折扣:
|
|
|
</span>
|
|
|
- <span>折后金额:</span>
|
|
|
- <el-input v-model="OrderForm.real_price" placeholder="请输入" :disabled="type=='pone'"></el-input>
|
|
|
+ <span>折后金额:</span>-->
|
|
|
+ <el-input v-model="OrderForm.real_price" placeholder="请输入" :disabled="type == 'pone'"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="10">
|
|
|
- <el-form-item label="销售人员" :rules="rules.marketing_id">
|
|
|
- <el-select v-model="OrderForm.marketing_id" clearable :disabled="type=='pone'">
|
|
|
+ <el-form-item label="销售人员" prop="marketing_id" :rules="rules.marketing_id">
|
|
|
+ <el-select v-model="OrderForm.marketing_id" clearable :disabled="type == 'pone'">
|
|
|
<el-option v-for="item in marketingList" :key="item.id" :label="item.real_name" :value="item.id" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="10">
|
|
|
- <el-form-item label="配送方式" prop="send_type" :rules="rules.send_type" >
|
|
|
- <el-select v-model="OrderForm.send_type" clearable :disabled="type=='pone'">
|
|
|
+ <el-form-item label="配送方式" prop="send_type" :rules="rules.send_type">
|
|
|
+ <el-select v-model="OrderForm.send_type" clearable :disabled="type == 'pone'">
|
|
|
<el-option v-for="item in deliveryTypeList" :key="item.code" :label="item.name" :value="item.code" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="10">
|
|
|
- <el-form-item label="配送仓库" prop="warehouse_id" :rules="rules.warehouse_id" >
|
|
|
+ <el-form-item label="配送仓库" prop="warehouse_id" :rules="rules.warehouse_id">
|
|
|
<!-- <el-cascader v-model="OrderForm.dept_id" :options="deptList" :props="{
|
|
|
label: 'name',
|
|
|
value: 'id',
|
|
|
emitPath: false,
|
|
|
checkStrictly: true
|
|
|
}" clearable></el-cascader> -->
|
|
|
- <el-select @change="cleanGoodsList" v-model="OrderForm.warehouse_id" multiple clearable :disabled="type=='pone'">
|
|
|
+ <el-select @change="cleanGoodsList" v-model="OrderForm.warehouse_id" multiple clearable
|
|
|
+ :disabled="type == 'pone'">
|
|
|
<el-option v-for="item in warehouseList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="10">
|
|
|
<el-form-item label="配送地址" prop="province_city_area_address">
|
|
|
- <!-- <el-select v-model="OrderForm.addres">
|
|
|
- <el-option
|
|
|
- v-for="item in marketingList"
|
|
|
- :key="item.id"
|
|
|
- :label="item.real_name"
|
|
|
- :value="item.id"
|
|
|
- />
|
|
|
- </el-select> -->
|
|
|
- <el-cascader size="large" :options="options" clearable v-model="selectedOptions" @change="handleChange" :disabled="type=='pone'">
|
|
|
+ <el-cascader size="large" :options="options" clearable v-model="selectedOptions" @change="handleChange"
|
|
|
+ :disabled="type == 'pone'">
|
|
|
</el-cascader>
|
|
|
- <el-input v-model="OrderForm.address" placeholder="请输入" :disabled="type=='pone'"></el-input>
|
|
|
+ <el-input v-model="OrderForm.address" placeholder="请输入" :disabled="type == 'pone'"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="10">
|
|
|
<el-form-item label="允许负库存">
|
|
|
- <el-radio-group v-model="OrderForm.subtract_stock" :disabled="type=='pone'">
|
|
|
+ <el-radio-group v-model="OrderForm.subtract_stock" :disabled="type == 'pone'">
|
|
|
<el-radio :label="false">禁止</el-radio>
|
|
|
<el-radio :label="true">允许</el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="10">
|
|
|
+ <el-col :span="24">
|
|
|
<div class="redClass">
|
|
|
- <el-form-item label="备注" prop="remark" >
|
|
|
- <el-input v-model="OrderForm.remark" type="textarea" :autosize="{ minRows: 2 }" :disabled="type=='pone'"></el-input>
|
|
|
+ <el-form-item label="备注" prop="remark">
|
|
|
+ <el-input v-model="OrderForm.remark" type="textarea" :autosize="{ minRows: 2 }"
|
|
|
+ :disabled="type == 'pone'"></el-input>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</el-col>
|
|
@@ -142,6 +112,7 @@
|
|
|
<h3>商品明细</h3>
|
|
|
<div v-if="!isDetail">
|
|
|
<el-button class="button" size="mini" type="primary" @click="handleSelectGoods">手动选择</el-button>
|
|
|
+ <el-button class="button" size="mini" type="primary" @click="handleSelectGrou">选择分组商品</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div style="display: block">
|
|
@@ -150,7 +121,8 @@
|
|
|
<el-table-column type="selection" width="40" align="center" />
|
|
|
<el-table-column label="图标">
|
|
|
<template slot-scope="scope">
|
|
|
- <img :src="scope.row.goods_vo.image_small_list[0].original" alt="" width="50px">
|
|
|
+ <img :src="scope.row.goods_vo.image_small_list[0].original" alt="" width="50px"
|
|
|
+ v-if="scope.row.goods_vo.image_small_list.length !== 0">
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="仓库名称">
|
|
@@ -267,7 +239,7 @@
|
|
|
<span v-else>{{ scope.row.remark }}</span>
|
|
|
</template>
|
|
|
</el-table-column> -->
|
|
|
- <el-table-column label="操作" v-if="!isDetail&& type!=='pone'">
|
|
|
+ <el-table-column label="操作" v-if="!isDetail && type !== 'pone'">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button size="mini" type="danger" @click="OrderForm.product_list.splice(scope.$index, 1)">删除
|
|
|
</el-button>
|
|
@@ -320,9 +292,12 @@
|
|
|
</el-table>
|
|
|
</div> -->
|
|
|
<div class="footer">
|
|
|
- <el-button type="primary" @click="submit" v-if="!isDetail&&type=='pone'" :loading="formLoading">确认</el-button>
|
|
|
- <el-button type="primary" @click="submitOrderForm" v-if="!isDetail&&type!=='pone'" :loading="formLoading">保存</el-button>
|
|
|
- <el-button type="primary" @click="saveSubmitOrderForm" v-if="!isDetail&&type!=='pone'" :loading="formLoading">确认并保存</el-button>
|
|
|
+ <el-button type="primary" @click="submit" v-if="!isDetail && type == 'pone'"
|
|
|
+ :loading="formLoading">确认</el-button>
|
|
|
+ <el-button type="primary" @click="submitOrderForm" v-if="!isDetail && type !== 'pone'"
|
|
|
+ :loading="formLoading">保存</el-button>
|
|
|
+ <el-button type="primary" @click="saveSubmitOrderForm" v-if="!isDetail && type !== 'pone'"
|
|
|
+ :loading="formLoading">确认并保存</el-button>
|
|
|
<el-button @click="printIng" :disabled="false" v-if="isDetail">打印</el-button>
|
|
|
<!-- <el-button type="primary" :disabled="false" @click="handleAudit(true)" v-if="isDetail && checkPermission(['order:audit']) && OrderForm.allowable.audit">审核通过</el-button>
|
|
|
<el-button type="danger" :disabled="false" @click="handleAudit(false)" v-if="isDetail && checkPermission(['order:audit']) && OrderForm.allowable.audit">审核驳回</el-button> -->
|
|
@@ -369,6 +344,20 @@
|
|
|
<el-button type="primary" @click="submitSupplierForm">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog title="商品列表" :visible.sync="goodsVisible" width="1000px" @close="closeGoosData">
|
|
|
+ <el-table ref="table" :data="goodsData.records" border style="width: 100%" @selection-change="handleSelChange">
|
|
|
+ <el-table-column type="selection" width="55" />
|
|
|
+ <el-table-column prop="name" label="分组名称"> </el-table-column>
|
|
|
+ <el-table-column prop="remark" label="描述"> </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <el-pagination @size-change="handlePageSizeChange" @current-change="handlePageCurrentChange"
|
|
|
+ :current-page="goodsData.page" :page-sizes="[10, 20, 50, 100]" :page-size="goodsData.size"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper" :total="goodsData.total"></el-pagination>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="closeGoosData">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitGoosData()">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -379,6 +368,7 @@ import * as API_BasicSetting from "@/api/basicSetting";
|
|
|
import * as API_Member from "@/api/member";
|
|
|
import * as API_Setting from "@/api/setting";
|
|
|
import * as API_CollectingAccount from "@/api/collectingAccount";
|
|
|
+import * as API_productClass from "@/api/productClass.js"
|
|
|
import { RegExp } from "~/ui-utils";
|
|
|
import {
|
|
|
provinceAndCityData,
|
|
@@ -434,6 +424,7 @@ export default {
|
|
|
province_city_area: "",
|
|
|
//详细信息
|
|
|
address: "",
|
|
|
+ real_price: '',
|
|
|
province_city_area_address: "",
|
|
|
subtract_stock: false,
|
|
|
warehouse_id: [],
|
|
@@ -456,10 +447,11 @@ export default {
|
|
|
marketing_id: [this.MixinRequired("请选择销售人员", "change")],
|
|
|
send_type: [this.MixinRequired("请选择配送方式", "change")],
|
|
|
warehouse_id: [this.MixinRequired("请选择仓库", "change")],
|
|
|
- member_id: [this.MixinRequired("请选择会员", "change")],
|
|
|
+ member_id: [this.MixinRequired("请选择下单客户", "change")],
|
|
|
order_time: [this.MixinRequired("下单时间不能为空", "change")],
|
|
|
payment_status: [this.MixinRequired("支付状态不能为空", "change")],
|
|
|
payment_time: [this.MixinRequired("支付时间不能为空", "change")],
|
|
|
+ real_price: [this.MixinRequired("请输入实付金额", "blur")],
|
|
|
// delivery_type: [this.MixinRequired("请选择配送方式", "change")],
|
|
|
product_list: {
|
|
|
num: [
|
|
@@ -618,20 +610,29 @@ export default {
|
|
|
return v.getTime() < new Date().getTime() - 86400000;// - 86400000是否包括当天
|
|
|
}
|
|
|
},
|
|
|
- pickerOptionsEnd:{
|
|
|
- disabledDate(time){
|
|
|
+ pickerOptionsEnd: {
|
|
|
+ disabledDate(time) {
|
|
|
// 禁用所有在 start_time 之前的时间
|
|
|
- return time.getTime() < new Date().getTime() ;
|
|
|
+ return time.getTime() < new Date().getTime();
|
|
|
}
|
|
|
},
|
|
|
- type:'',
|
|
|
+ type: '',
|
|
|
+ goodsData: [],
|
|
|
+ goodsVisible: false,
|
|
|
+ goodsList: [],//暂存勾选的分类
|
|
|
+ params: {
|
|
|
+ pages: 1,
|
|
|
+ size: 10
|
|
|
+ },//商品分页
|
|
|
+ orderType: '',//条形码查看类型
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
...mapGetters(["user"])
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.type=this.$route.params.type
|
|
|
+ this.type = this.$route.params.type
|
|
|
+ this.orderType = this.$route.params.type
|
|
|
this.GET_WarehouseList();
|
|
|
this.GET_MemberList();
|
|
|
this.GET_MarketingList();
|
|
@@ -641,6 +642,34 @@ export default {
|
|
|
this.GET_CustomerList();
|
|
|
},
|
|
|
methods: {
|
|
|
+ //选择商品
|
|
|
+ handleSelChange(val) {
|
|
|
+ if (val.length > 1) {
|
|
|
+ // 如果当前选中数量超过1,移除先前选中的,保留最后选中的
|
|
|
+ const lastSelected = val[val.length - 1];
|
|
|
+ this.$refs.table.clearSelection(); // 清除所有选中
|
|
|
+ this.$refs.table.toggleRowSelection(lastSelected, true); // 重新选中最后一个
|
|
|
+ }
|
|
|
+ this.goodsList = val // 更新当前选中的行
|
|
|
+ },
|
|
|
+ // 保存已选商品
|
|
|
+ submitGoosData() {
|
|
|
+ if (this.goodsList.length >= 1) {
|
|
|
+ API_productClass.getProductByGroup(this.OrderForm.warehouse_id, this.goodsList[0].id).then(res => {
|
|
|
+ res.map(el => {
|
|
|
+ this.OrderForm.product_list.push(el)
|
|
|
+ })
|
|
|
+ this.goodsVisible = false;
|
|
|
+ })
|
|
|
+
|
|
|
+ } else {
|
|
|
+ this.$message.error("请选择商品信息");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 关闭商品明细
|
|
|
+ closeGoosData() {
|
|
|
+ this.goodsVisible = false;
|
|
|
+ },
|
|
|
handleBlur() {
|
|
|
const value = this.discount;
|
|
|
const regex = /^(10|([1-9](\.\d{0,1})?))$/;
|
|
@@ -859,6 +888,38 @@ export default {
|
|
|
|
|
|
this.OrderForm.product_list = goodsData;
|
|
|
},
|
|
|
+ /** 分页大小发生改变 */
|
|
|
+ handlePageSizeChange(size) {
|
|
|
+ this.params.size = size;
|
|
|
+ API_productClass.getProductList(this.params).then(res => {
|
|
|
+ this.goodsData = res
|
|
|
+ this.goodsVisible = true
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /** 分页页数发生改变 */
|
|
|
+ handlePageCurrentChange(page) {
|
|
|
+ this.params.page = page;
|
|
|
+ API_productClass.getProductList(this.params).then(res => {
|
|
|
+ this.goodsData = res
|
|
|
+ this.goodsVisible = true
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /* 选择分组商品 */
|
|
|
+ handleSelectGrou() {
|
|
|
+ if (!this.OrderForm.type) {
|
|
|
+ this.$message.error("请选择订单类型!");
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.OrderForm.warehouse_id.length == 0) {
|
|
|
+ this.$message.error("请选择仓库!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.params.order_choose_type = this.OrderForm.type
|
|
|
+ API_productClass.getProductList(this.params).then(res => {
|
|
|
+ this.goodsData = res
|
|
|
+ this.goodsVisible = true
|
|
|
+ })
|
|
|
+ },
|
|
|
/** 添加支付方式 */
|
|
|
handleInsertPayment() {
|
|
|
const defaultCollectingAccount = this.collectingAccountList.findLast(
|
|
@@ -1077,7 +1138,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
//延期确定
|
|
|
- async submit(){
|
|
|
+ async submit() {
|
|
|
// 校验商品明细数据
|
|
|
const valid = await this.$refs.orderFormRef
|
|
|
.validate()
|
|
@@ -1093,18 +1154,18 @@ export default {
|
|
|
}
|
|
|
this.OrderForm.province_city_area_address = loc + this.OrderForm.address; */
|
|
|
const params = this.MixinClone(this.OrderForm);
|
|
|
- /* params.pay_price = this.price;
|
|
|
- params.real_price = Number(params.real_price); */
|
|
|
+ /* params.pay_price = this.price;
|
|
|
+ params.real_price = Number(params.real_price); */
|
|
|
params.item_list = params.product_list;
|
|
|
this.formLoading = true;
|
|
|
API_Order.extension(id, params)
|
|
|
- .then((response) => {
|
|
|
- this.$message.success("调整成功!");
|
|
|
- this.backOrderList();
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- this.formLoading = false;
|
|
|
- });
|
|
|
+ .then((response) => {
|
|
|
+ this.$message.success("调整成功!");
|
|
|
+ this.backOrderList();
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.formLoading = false;
|
|
|
+ });
|
|
|
},
|
|
|
/** 获取仓库 */
|
|
|
GET_WarehouseList() {
|
|
@@ -1146,7 +1207,7 @@ export default {
|
|
|
response.product_list = response.item_list.map(el => {
|
|
|
el.good_vo = el.goods_vo
|
|
|
return el
|
|
|
- });
|
|
|
+ });
|
|
|
this.selectedOptions = response.province_city_area.split(",");
|
|
|
this.OrderForm = response;
|
|
|
console.log(this.OrderForm.product_list);
|
|
@@ -1169,41 +1230,81 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
computed: {
|
|
|
- price() {
|
|
|
- let total = 0;
|
|
|
- if (!this.OrderForm.product_list) return
|
|
|
- if (!this.id) {
|
|
|
- if (this.OrderForm.type == "TO_C") {
|
|
|
- var start = new Date(this.OrderForm.start_time); // 将起始日期字符串转换为Date对象
|
|
|
- this.OrderForm.product_list.map((item) => {
|
|
|
- var end = new Date(item.end_time); // 将结束日期字符串转换为Date对象
|
|
|
- var timeDiff = Math.abs(end.getTime() - start.getTime()); // 获取时间差(单位:毫秒)
|
|
|
- var monthDiff = Math.ceil(timeDiff / (24 * 60 * 60 * 1000)); // 根据每个月平均天数进行近似计算
|
|
|
- total += item.product_vo.day_price * item.num * monthDiff;
|
|
|
- });
|
|
|
-
|
|
|
- return total;
|
|
|
+ price: {
|
|
|
+ get() {
|
|
|
+ let total = 0;
|
|
|
+ if (!this.OrderForm.product_list) return
|
|
|
+ if (!this.id) {
|
|
|
+ if (this.OrderForm.type == "TO_C") {
|
|
|
+ var start = new Date(this.OrderForm.start_time); // 将起始日期字符串转换为Date对象
|
|
|
+ this.OrderForm.product_list.map((item) => {
|
|
|
+ var end = new Date(item.end_time); // 将结束日期字符串转换为Date对象
|
|
|
+ var timeDiff = Math.abs(end.getTime() - start.getTime()); // 获取时间差(单位:毫秒)
|
|
|
+ var monthDiff = Math.ceil(timeDiff / (24 * 60 * 60 * 1000)); // 根据每个月平均天数进行近似计算
|
|
|
+ total += item.product_vo.day_price * item.num * monthDiff;
|
|
|
+ });
|
|
|
+
|
|
|
+ return total;
|
|
|
+ } else {
|
|
|
+ this.OrderForm.product_list.map((item) => {
|
|
|
+ total += item.product_vo.price * item.num;
|
|
|
+ });
|
|
|
+ return total;
|
|
|
+ }
|
|
|
} else {
|
|
|
- this.OrderForm.product_list.map((item) => {
|
|
|
- total += item.product_vo.price * item.num;
|
|
|
- });
|
|
|
- return total;
|
|
|
+ if (this.OrderForm.type == "TO_C") {
|
|
|
+ var start = new Date(this.time[1]); // 将起始日期字符串转换为Date对象
|
|
|
+ var end = new Date(this.time[0]); // 将结束日期字符串转换为Date对象
|
|
|
+ var timeDiff = Math.abs(end.getTime() - start.getTime()); // 获取时间差(单位:毫秒)
|
|
|
+ var monthDiff = Math.ceil(timeDiff / (24 * 60 * 60 * 1000)); // 根据每个月平均天数进行近似计算
|
|
|
+ this.OrderForm.product_list.map((item) => {
|
|
|
+ total += item.product_vo.day_price * item.num * monthDiff;
|
|
|
+ });
|
|
|
+ return total;
|
|
|
+ } else {
|
|
|
+ this.OrderForm.product_list.map((item) => {
|
|
|
+ total += item.product_vo.price * item.num;
|
|
|
+ });
|
|
|
+ return total;
|
|
|
+ }
|
|
|
}
|
|
|
- } else {
|
|
|
- if (this.OrderForm.type == "TO_C") {
|
|
|
- var start = new Date(this.time[1]); // 将起始日期字符串转换为Date对象
|
|
|
- var end = new Date(this.time[0]); // 将结束日期字符串转换为Date对象
|
|
|
- var timeDiff = Math.abs(end.getTime() - start.getTime()); // 获取时间差(单位:毫秒)
|
|
|
- var monthDiff = Math.ceil(timeDiff / (24 * 60 * 60 * 1000)); // 根据每个月平均天数进行近似计算
|
|
|
- this.OrderForm.product_list.map((item) => {
|
|
|
- total += item.product_vo.day_price * item.num * monthDiff;
|
|
|
- });
|
|
|
- return total;
|
|
|
+ },
|
|
|
+ set(newValue) {
|
|
|
+ let total = 0;
|
|
|
+ if (!this.OrderForm.product_list) return
|
|
|
+ if (!this.id) {
|
|
|
+ if (this.OrderForm.type == "TO_C") {
|
|
|
+ var start = new Date(this.OrderForm.start_time); // 将起始日期字符串转换为Date对象
|
|
|
+ this.OrderForm.product_list.map((item) => {
|
|
|
+ var end = new Date(item.end_time); // 将结束日期字符串转换为Date对象
|
|
|
+ var timeDiff = Math.abs(end.getTime() - start.getTime()); // 获取时间差(单位:毫秒)
|
|
|
+ var monthDiff = Math.ceil(timeDiff / (24 * 60 * 60 * 1000)); // 根据每个月平均天数进行近似计算
|
|
|
+ total += item.product_vo.day_price * item.num * monthDiff;
|
|
|
+ });
|
|
|
+
|
|
|
+ return total;
|
|
|
+ } else {
|
|
|
+ this.OrderForm.product_list.map((item) => {
|
|
|
+ total += item.product_vo.price * item.num;
|
|
|
+ });
|
|
|
+ return total;
|
|
|
+ }
|
|
|
} else {
|
|
|
- this.OrderForm.product_list.map((item) => {
|
|
|
- total += item.product_vo.price * item.num;
|
|
|
- });
|
|
|
- return total;
|
|
|
+ if (this.OrderForm.type == "TO_C") {
|
|
|
+ var start = new Date(this.time[1]); // 将起始日期字符串转换为Date对象
|
|
|
+ var end = new Date(this.time[0]); // 将结束日期字符串转换为Date对象
|
|
|
+ var timeDiff = Math.abs(end.getTime() - start.getTime()); // 获取时间差(单位:毫秒)
|
|
|
+ var monthDiff = Math.ceil(timeDiff / (24 * 60 * 60 * 1000)); // 根据每个月平均天数进行近似计算
|
|
|
+ this.OrderForm.product_list.map((item) => {
|
|
|
+ total += item.product_vo.day_price * item.num * monthDiff;
|
|
|
+ });
|
|
|
+ return total;
|
|
|
+ } else {
|
|
|
+ this.OrderForm.product_list.map((item) => {
|
|
|
+ total += item.product_vo.price * item.num;
|
|
|
+ });
|
|
|
+ return total;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -1338,10 +1439,10 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-.redClass /deep/ .el-form-item__label {
|
|
|
+.redClass /deep/ .el-form-item__content {
|
|
|
//color: red !important;
|
|
|
font-weight: 700;
|
|
|
- width: 500px;
|
|
|
+ width: 500px !important;
|
|
|
}
|
|
|
|
|
|
/deep/ .el-form-item {
|