Merge branch 'test' of https://e.coding.net/g-cphe0354/yinshoukeguanliduan/management into dwb
This commit is contained in:
commit
833c45e566
|
|
@ -345,16 +345,16 @@ export default {
|
|||
this.resetForm = { ...this.queryForm }
|
||||
this.tbShopPurveyorGet()
|
||||
console.log(this.$route.query.consdata)
|
||||
if (this.$route.query.consdata) {
|
||||
let arr = this.$route.query.consdata.map(item => {
|
||||
item.number = formatDecimal(item.stockNumber - item.stockConsume, 2, true)
|
||||
item.stockNumber = 0
|
||||
item.costPrice = item.price
|
||||
item.conInfoId = item.id
|
||||
return item
|
||||
})
|
||||
this.tableData.list = [...this.tableData.list, ...arr]
|
||||
}
|
||||
// if (this.$route.query.consdata) {
|
||||
// let arr = this.$route.query.consdata.map(item => {
|
||||
// item.number = formatDecimal(item.stockNumber - item.stockConsume, 2, true)
|
||||
// item.stockNumber = 0
|
||||
// item.costPrice = item.price
|
||||
// item.conInfoId = item.id
|
||||
// return item
|
||||
// })
|
||||
// this.tableData.list = [...this.tableData.list, ...arr]
|
||||
// }
|
||||
},
|
||||
methods: {
|
||||
async querySearchAsync(queryString, cb) {//快捷搜索
|
||||
|
|
|
|||
|
|
@ -40,8 +40,7 @@
|
|||
<el-form-item label="供应商">
|
||||
<el-select clearable v-model="queryForm.purveyorId" placeholder="请选择供应商"
|
||||
style="width: 220px;" @change="changeTypeEnum">
|
||||
<el-option :label="item.purveyorName" :value="item.id" v-for="item in purveyorList"
|
||||
:key="item.id"></el-option>
|
||||
<el-option v-for="item in purveyorList" :label="item.purveyorName" :value="item.id" :key="item.id"></el-option>
|
||||
</el-select>
|
||||
{{ queryForm.waitAmount }}
|
||||
</el-form-item>
|
||||
|
|
@ -120,13 +119,14 @@
|
|||
@change="consCountTotal($event, scope.row, 'price')"></el-input-number>
|
||||
<div class="tips" style="font-size: 16px;">原价¥
|
||||
<!-- {{ scope.row.costPrice }}/{{ scope.row.conUnit }} -->
|
||||
{{ !scope.row.unit ?
|
||||
(scope.row.defaultUnit ?
|
||||
scope.row.defaultUnit== scope.row.conUnitTwo?
|
||||
((scope.row.costPrice*scope.row.conUnitTwoConvert).toFixed(2)): scope.row.costPrice:scope.row.costPrice)
|
||||
: scope.row.unit== scope.row.conUnitTwo?
|
||||
((scope.row.costPrice*scope.row.conUnitTwoConvert).toFixed(2)): scope.row.costPrice}}
|
||||
/
|
||||
{{ !scope.row.unit ?
|
||||
(scope.row.defaultUnit ?
|
||||
scope.row.defaultUnit == scope.row.conUnitTwo ?
|
||||
((scope.row.costPrice * scope.row.conUnitTwoConvert).toFixed(2)) :
|
||||
scope.row.costPrice : scope.row.costPrice)
|
||||
: scope.row.unit == scope.row.conUnitTwo ?
|
||||
((scope.row.costPrice * scope.row.conUnitTwoConvert).toFixed(2)) : scope.row.costPrice }}
|
||||
/
|
||||
{{ !scope.row.unit ? (scope.row.defaultUnit ? scope.row.defaultUnit :
|
||||
scope.row.conUnit) : scope.row.unit }}
|
||||
|
||||
|
|
@ -154,13 +154,13 @@
|
|||
<!-- <div class="tips" style="font-size: 16px;">出库前:{{ scope.row.number }}{{ scope.row.conUnit }}</div> -->
|
||||
|
||||
<div class="tips" style="font-size: 16px;">出库前:
|
||||
{{ !scope.row.unit ?
|
||||
(scope.row.defaultUnit ?
|
||||
scope.row.defaultUnit== scope.row.conUnitTwo?
|
||||
(scope.row.number/scope.row.conUnitTwoConvert): scope.row.number:scope.row.number)
|
||||
: scope.row.unit== scope.row.conUnitTwo?
|
||||
(scope.row.number/scope.row.conUnitTwoConvert): scope.row.number}}
|
||||
|
||||
{{ !scope.row.unit ?
|
||||
(scope.row.defaultUnit ?
|
||||
scope.row.defaultUnit == scope.row.conUnitTwo ?
|
||||
(scope.row.number / scope.row.conUnitTwoConvert) : scope.row.number : scope.row.number)
|
||||
: scope.row.unit == scope.row.conUnitTwo ?
|
||||
(scope.row.number / scope.row.conUnitTwoConvert) : scope.row.number }}
|
||||
|
||||
{{ !scope.row.unit ? (scope.row.defaultUnit ? scope.row.defaultUnit :
|
||||
scope.row.conUnit) : scope.row.unit }}
|
||||
</div>
|
||||
|
|
@ -208,7 +208,8 @@
|
|||
<template v-slot="scope">
|
||||
<el-input-number v-model="scope.row.number" :min="0" controls-position="right"
|
||||
@change="modifyPrice($event, scope.row, 'number', 'totalAmount')"></el-input-number>
|
||||
<div class="tips" style="font-size: 16px;">出库前:{{ scope.row.stockNumber }}{{ scope.row.unitName }}</div>
|
||||
<div class="tips" style="font-size: 16px;">出库前:{{ scope.row.stockNumber }}{{ scope.row.unitName
|
||||
}}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="小计">
|
||||
|
|
@ -260,7 +261,7 @@ import { tbShopPurveyorGet, tbProductStockOperateOutAndOn, stockInOut, tbConsInf
|
|||
|
||||
import { formatDecimal } from '@/utils'
|
||||
export default {
|
||||
name:'operation_out',
|
||||
name: 'operation_out',
|
||||
components: {
|
||||
shopList,
|
||||
ConsumableList
|
||||
|
|
@ -342,6 +343,18 @@ export default {
|
|||
mounted() {
|
||||
this.resetForm = { ...this.queryForm }
|
||||
this.tbShopPurveyorGet()
|
||||
if (this.$route.query.consdata) {
|
||||
this.queryForm.purveyorId = Number(this.$route.query.purveyorId)//供应商id
|
||||
console.log(this.$route.query.purveyorId)
|
||||
let arr = this.$route.query.consdata.map(item => {
|
||||
item.number = formatDecimal(item.stockNumber - item.stockConsume, 2, true)
|
||||
item.stockNumber = 0
|
||||
item.costPrice = item.price
|
||||
item.conInfoId = item.id
|
||||
return item
|
||||
})
|
||||
this.tableData.list = [...this.tableData.list, ...arr]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async querySearchAsync(queryString, cb) {//快捷搜索
|
||||
|
|
@ -562,7 +575,7 @@ export default {
|
|||
},
|
||||
// 切换类型
|
||||
changeTypeEnum(index) {
|
||||
let filterd= this.purveyorList.filter(ele=>ele.id == index)
|
||||
let filterd = this.purveyorList.filter(ele => ele.id == index)
|
||||
this.queryForm.waitAmount = filterd[0].waitAmount
|
||||
|
||||
if (this.queryForm.purveyorId) {
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@
|
|||
gettbConsInfoFlowstock();
|
||||
}" /> -->
|
||||
<div></div>
|
||||
<div style="color: #43a9fe;" @click="func()">转出库单</div>
|
||||
<div v-if="consdata.length != 0" style="color: #43a9fe;" @click="func()">转出库单</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
|
@ -467,26 +467,31 @@ export default {
|
|||
console.log(error)
|
||||
}
|
||||
},
|
||||
wstockChange(e) {
|
||||
this.stockData.page = e - 1;
|
||||
this.gettbConsInfoFlowstock();
|
||||
},
|
||||
// wstockChange(e) {
|
||||
// this.stockData.page = e - 1;
|
||||
// this.gettbConsInfoFlowstock();
|
||||
// },
|
||||
func() {
|
||||
this.$router.push({
|
||||
name: 'operation_in',
|
||||
name: 'operation_out',
|
||||
query: {
|
||||
consdata: this.consdata
|
||||
consdata: this.consdata,
|
||||
purveyorId:this.stockData.purveyorId
|
||||
}
|
||||
})
|
||||
},
|
||||
async gettbConsInfoFlowstock(item) {
|
||||
console.log(item)
|
||||
if (item) {
|
||||
if (item.conFlows) {
|
||||
this.stockData.id = item.id
|
||||
this.stockData.purveyorId = item.purveyorId//供应商id
|
||||
this.consdata = item.cons
|
||||
this.stockData.data = item.conFlows
|
||||
this.variabilityshow = true
|
||||
}else{
|
||||
this.$message({ message: '暂无数据!' });
|
||||
}
|
||||
this.variabilityshow = true
|
||||
|
||||
// this.stockData.loading = true;
|
||||
let arr = []
|
||||
// if (this.query.createdAt.length) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,204 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<el-form :model="query" inline>
|
||||
<!-- <el-form-item>
|
||||
<el-input v-model="query.d_order_id" placeholder="订单号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="query.status" placeholder="状态">
|
||||
<el-option label="等待验券" value="0" />
|
||||
<el-option label="成功" value="1" />
|
||||
<el-option label="失败" value="2" />
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
|
||||
<el-form-item>
|
||||
<el-date-picker v-model="query.date" type="date" placeholder="请选择日期" @blur="getTableData()"
|
||||
@change="getTableData()">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-table border :data="tableData.data">
|
||||
<!-- <el-table-column label="订单号" prop="couponCode" width="100px"></el-table-column>
|
||||
<el-table-column label="店铺名称" prop="title" width="100px"></el-table-column> -->
|
||||
<el-table-column label="套餐名称" prop="dealTitle"></el-table-column>
|
||||
<!-- <el-table-column label="支付金额"> </el-table-column> -->
|
||||
<el-table-column label="金额" prop="couponBuyPrice"> </el-table-column>
|
||||
<el-table-column label="使用时间" prop="couponUseTime"></el-table-column>
|
||||
<el-table-column label="状态" prop="couponStatusDesc" width="80"> </el-table-column>
|
||||
<el-table-column label="操作" width="150">
|
||||
<template v-slot="scope">
|
||||
<el-button type="primary" v-if="!scope.row.type" @click="showRefund(scope.row)">撤销核销</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
@current-change="paginationChange"></el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as $api from "@/api/coup/index.js";
|
||||
import dayjs from "dayjs";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
query: {
|
||||
d_order_id: "",
|
||||
status: "",
|
||||
},
|
||||
resetQuery: "",
|
||||
tableData: {
|
||||
data: [],
|
||||
page: 1,
|
||||
loading: false,
|
||||
total: 0,
|
||||
size: 10
|
||||
},
|
||||
payTypes: [
|
||||
{
|
||||
value: "wechatPay",
|
||||
label: "微信支付",
|
||||
},
|
||||
{
|
||||
value: "aliPay",
|
||||
label: "支付宝支付",
|
||||
},
|
||||
],
|
||||
statusList: [
|
||||
{
|
||||
value: "0",
|
||||
label: "等待验券",
|
||||
type: "warning",
|
||||
},
|
||||
{
|
||||
value: "1",
|
||||
label: "成功",
|
||||
type: "primary",
|
||||
},
|
||||
{
|
||||
value: "2",
|
||||
label: "失败",
|
||||
type: "success",
|
||||
},
|
||||
],
|
||||
row: "",
|
||||
showDialog: false,
|
||||
refundNumList: [],
|
||||
refundLoading: false,
|
||||
refundForm: {
|
||||
num: "",
|
||||
orderId: "",
|
||||
refundAmount: "",
|
||||
refundDesc: "",
|
||||
refundReason: "",
|
||||
},
|
||||
refundFormRules: {
|
||||
num: [
|
||||
{
|
||||
required: true,
|
||||
message: " ",
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
filters: {
|
||||
timeFilter(s) {
|
||||
return dayjs(s).format("YYYY-MM-DD HH:mm:ss");
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getTableData();
|
||||
this.resetQuery = { ...this.query };
|
||||
},
|
||||
methods: {
|
||||
statusF(t) {
|
||||
if (!t) {
|
||||
return ''
|
||||
}
|
||||
return this.statusList[t] ? this.statusList[t].type : '';
|
||||
},
|
||||
returnStatus(status) {
|
||||
return this.statusList[status].label || "";
|
||||
}, // 撤销核销
|
||||
showRefund(row) {
|
||||
this.$confirm("是否确认撤销核销", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
// for(let i in row.douyinCodeGoods){
|
||||
const item = row
|
||||
$api.$meituan_fulfilmentcertificatecancel({
|
||||
couponCode: item.couponCode
|
||||
}).then(res => {
|
||||
this.$message.success("撤销核销成功");
|
||||
this.getTableData();
|
||||
})
|
||||
// }
|
||||
})
|
||||
.catch(() => { });
|
||||
},
|
||||
// 切换状态
|
||||
async statusChange(e, row) {
|
||||
try {
|
||||
this.tableData.loading = true;
|
||||
const data = { ...row };
|
||||
data.status = e;
|
||||
await tbPrintMachine(data, "put");
|
||||
this.getTableData();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
this.tableData.loading = false;
|
||||
}
|
||||
},
|
||||
// 重置查询
|
||||
resetHandle() {
|
||||
this.query = { ...this.resetQuery };
|
||||
this.getTableData();
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e;
|
||||
this.getTableData();
|
||||
},
|
||||
// 获取列表
|
||||
async getTableData() {
|
||||
this.tableData.loading = true;
|
||||
try {
|
||||
const res = await $api.$meituan_orderlist({
|
||||
// ...this.query,
|
||||
date: this.query.date ? dayjs(this.query.date).format("YYYY-MM-DD") : '',
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size,
|
||||
});
|
||||
this.tableData.loading = false;
|
||||
// this.tableData.data = res.list;
|
||||
this.tableData.data = res.list.map(item => {
|
||||
// 计算60天后
|
||||
item.couponUseTimes = dayjs(item.couponUseTime).add(60, 'day').format('YYYY-MM-DD HH:mm:ss')
|
||||
item.type = dayjs().isAfter(dayjs(item.couponUseTime).add(60, 'day'), 'year')
|
||||
return item
|
||||
});
|
||||
this.tableData.total = res.count;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
@ -198,8 +198,10 @@
|
|||
</el-table-column>-->
|
||||
<el-table-column label="起售数量" prop="suit">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number @change="priceFormat(scope.row, 'suit')" @blur="priceFormat(scope.row, 'suit')" :min="0"
|
||||
v-model="scope.row.suit" controls-position="right" v-if="form.type == 'weigh'"></el-input-number>
|
||||
<el-input-number @change="priceFormat(scope.row, 'suit')" @blur="priceFormat(scope.row, 'suit')" :min="1"
|
||||
v-model="scope.row.suit" controls-position="right"></el-input-number>
|
||||
v-model="scope.row.suit" controls-position="right" v-else></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="库存数量" prop="stockNumber">
|
||||
|
|
@ -592,7 +594,7 @@ export default {
|
|||
isGrounding: 1,
|
||||
productId: this.$route.query.goods_id ? this.$route.query.goods_id : "",
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
suit: 0,
|
||||
suit: '',
|
||||
},
|
||||
tableAddShopIndex: null,
|
||||
isEditor: false,
|
||||
|
|
@ -663,11 +665,11 @@ export default {
|
|||
singleOrderLimit: 0,
|
||||
singlePeopleLimit: 0,
|
||||
weight: '',
|
||||
days: [],
|
||||
days: couponEnum.cycle.map(item => item.value),
|
||||
startTime: '',
|
||||
endTime: ''
|
||||
},
|
||||
useTime: ['', ''],
|
||||
useTime: ['00:00', '23:59'],
|
||||
imgList: [],
|
||||
rules: {
|
||||
typeEnum: [
|
||||
|
|
@ -1049,6 +1051,25 @@ export default {
|
|||
} else {
|
||||
await tbProductPost(this.form);
|
||||
}
|
||||
// 点击确定之后自动删除上面的导航栏
|
||||
try {
|
||||
let view = this.$store.state.tagsView.visitedViews[this.$store.state.tagsView.visitedViews.findIndex(item => item.name === 'add_shop')]
|
||||
// 删除导航栏
|
||||
this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
|
||||
// 默认保存成功删除上面add_shop导航栏
|
||||
const latestView = visitedViews.slice(-1)[0]
|
||||
if (latestView) {
|
||||
this.$router.push(latestView)
|
||||
} else {
|
||||
if (view.name === 'Dashboard') {
|
||||
// to reload home page
|
||||
this.$router.replace({ path: '/redirect' + view.fullPath })
|
||||
} else {
|
||||
this.$router.push('/')
|
||||
}
|
||||
}
|
||||
})
|
||||
} catch (error) { }
|
||||
this.$notify({
|
||||
title: "成功",
|
||||
message: `${this.form.id ? "编辑" : "添加"}成功`,
|
||||
|
|
@ -1079,6 +1100,19 @@ export default {
|
|||
item.number = 1
|
||||
return item
|
||||
})
|
||||
|
||||
// let newres = []
|
||||
|
||||
// for (let item of res) {
|
||||
// item.proId = item.id
|
||||
// item.proName = item.name
|
||||
// item.price = item.lowPrice
|
||||
// item.skuId = ''
|
||||
// item.skuName = ''
|
||||
// item.number = 1
|
||||
// newres.push(item)
|
||||
// }
|
||||
|
||||
if (this.form.groupType == 0) {
|
||||
let obj = {
|
||||
title: '',
|
||||
|
|
@ -1089,6 +1123,7 @@ export default {
|
|||
this.form.proGroupVo = [{ ...obj }]
|
||||
} else {
|
||||
if (this.addGroupIndex !== false) {
|
||||
this.form.proGroupVo[this.addGroupIndex].count = newres.length
|
||||
this.form.proGroupVo[this.addGroupIndex].goods = newres
|
||||
} else {
|
||||
let arr = [...this.form.proGroupVo]
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
>
|
||||
<div class="absolute status-box">
|
||||
<span class="pack" v-if="item.isPack === 'true'"> 包 </span>
|
||||
<span class="da" v-if="item.isPrint"> 打 </span>
|
||||
<span class="da" v-if="item.isPrint||item.isPrint===null"> 打 </span>
|
||||
<span class="isWaitCall" v-if="item.isWaitCall">等 </span>
|
||||
<span class="tui" v-if="item.status === 'return'"> 退 </span>
|
||||
</div>
|
||||
|
|
@ -35,6 +35,9 @@
|
|||
>赠</span
|
||||
>
|
||||
</div>
|
||||
<div v-if="item.typeEnum=='weight'" class="specSnap">
|
||||
¥{{ currentPrice}}/{{ item.unit }}
|
||||
</div>
|
||||
<div v-if="item.specSnap" class="specSnap">
|
||||
{{ item.specSnap }}
|
||||
</div>
|
||||
|
|
@ -164,6 +167,12 @@ export default {
|
|||
};
|
||||
},
|
||||
computed: {
|
||||
currentPrice(){
|
||||
if(!this.isShowVipPrice){
|
||||
return this.item.salePrice
|
||||
}
|
||||
return this.memberPrice?this.memberPrice:this.item.salePrice
|
||||
},
|
||||
discountNewPrice(){
|
||||
const item = this.item;
|
||||
const originPrice=this.isShowVipPrice?this.vipAllPrice:this.allPrice
|
||||
|
|
@ -317,6 +326,7 @@ export default {
|
|||
.pack {
|
||||
background: #35ac6a;
|
||||
}
|
||||
|
||||
.da {
|
||||
background: #35ac6a;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,28 +2,21 @@
|
|||
<el-dialog title="选择商品" width="450px" :visible.sync="show">
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<el-table
|
||||
:data="tableData"
|
||||
ref="table"
|
||||
@selection-change="handleSelectionChange"
|
||||
@cell-click="cellClick"
|
||||
>
|
||||
<el-table :data="tableData" ref="table" @selection-change="handleSelectionChange" @cell-click="cellClick">
|
||||
<el-table-column type="selection" width="55"> </el-table-column>
|
||||
<el-table-column label="套餐名称" prop="title"></el-table-column>
|
||||
<el-table-column label="原价" prop="amount"></el-table-column>
|
||||
</el-table>
|
||||
<div class="u-flex u-row-center u-m-t-50 gap-20">
|
||||
<el-button size="medium" @click="close">取消</el-button>
|
||||
<el-button size="medium" type="primary" @click="confirm"
|
||||
>确认核销</el-button
|
||||
>
|
||||
<el-button size="medium" type="primary" @click="confirm">确认核销</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
<script>
|
||||
import {
|
||||
$douyin_certificateprepare,
|
||||
$meituan_certificateprepare,
|
||||
|
|
@ -57,7 +50,7 @@ export default {
|
|||
this.show = false;
|
||||
},
|
||||
async confirm() {
|
||||
console.log(this.selArr.length);
|
||||
console.log(this.selArr.length);
|
||||
if (this.selArr.length <= 0) {
|
||||
return this.$message.error("请选择套餐商品");
|
||||
}
|
||||
|
|
@ -86,15 +79,18 @@ export default {
|
|||
},
|
||||
open(res, types) {
|
||||
this.data = res;
|
||||
this.types = types?types:this.types;
|
||||
this.types = types ? types : this.types;
|
||||
this.tableData = res.goods;
|
||||
this.show = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.table.toggleAllSelection()
|
||||
})
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
<style scoped lang="scss">
|
||||
.user_info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
|
@ -103,6 +99,7 @@ export default {
|
|||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep .el-input--small .el-input__inner {
|
||||
height: 36px;
|
||||
line-height: 36px;
|
||||
|
|
@ -150,12 +147,13 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.flex {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.gap-20 {
|
||||
gap: 20px;
|
||||
}
|
||||
</style>
|
||||
|
||||
</style>
|
||||
|
|
@ -169,7 +169,7 @@ export default {
|
|||
|
||||
confirm() {
|
||||
console.log(this.form.discount / 100)
|
||||
this.$emit("confirm", (this.form.discount / 100));
|
||||
this.$emit("confirm", {discount:this.form.discount / 100,currentPrice:((this.form.discount*this.form.money)/100).toFixed(2)} );
|
||||
this.close();
|
||||
},
|
||||
open(data) {
|
||||
|
|
|
|||
|
|
@ -112,6 +112,7 @@ export default {
|
|||
reset() {
|
||||
this.note = "";
|
||||
this.number = 1;
|
||||
this.price='';
|
||||
this.tags.map((v) => {
|
||||
v.checked = false;
|
||||
});
|
||||
|
|
@ -129,11 +130,12 @@ export default {
|
|||
open(item) {
|
||||
this.goods = item ? item : this.goods;
|
||||
this.max=returnCartPrice(this.goods,this.vipUser)
|
||||
console.log(this.goods);
|
||||
this.show = true;
|
||||
if (item.productId != "-999") {
|
||||
if (this.goods != "-999") {
|
||||
|
||||
} else {
|
||||
this.price = item.discountSaleAmount||'';
|
||||
this.price =this.goods.discountSaleAmount||'';
|
||||
}
|
||||
},
|
||||
close() {
|
||||
|
|
|
|||
|
|
@ -3,40 +3,22 @@
|
|||
<el-dialog width="400px" :title="title" :visible.sync="show" @close="reset">
|
||||
<div class="u-p-15">
|
||||
<div v-if="openSwitch">
|
||||
<el-button
|
||||
size="medium"
|
||||
@click="changeKey('paysSel', index)"
|
||||
v-for="(item, index) in pays"
|
||||
:key="index"
|
||||
:type="paysSel == index ? 'primary' : ''"
|
||||
>{{ item.text }}</el-button
|
||||
>
|
||||
<el-button size="medium" @click="changeKey('paysSel', index)" v-for="(item, index) in pays" :key="index"
|
||||
:type="paysSel == index ? 'primary' : ''">{{ item.text }}</el-button>
|
||||
</div>
|
||||
<div class="u-m-t-20">
|
||||
<el-alert
|
||||
:closable="false"
|
||||
v-if="tips"
|
||||
:title="tips"
|
||||
type="warning"
|
||||
show-icon
|
||||
>
|
||||
<el-alert :closable="false" v-if="tips" :title="tips" type="warning" show-icon>
|
||||
</el-alert>
|
||||
</div>
|
||||
<div class="u-m-t-20">
|
||||
<el-form label-width="90px" label-position="left">
|
||||
<el-form-item label="券码">
|
||||
<el-input
|
||||
v-model="form.code"
|
||||
@change="codeInputChange"
|
||||
placeholder="请扫码或者输入券码"
|
||||
ref="refInputCode"
|
||||
></el-input>
|
||||
<el-input v-model="form.code" @change="codeInputChange" placeholder="请扫码或者输入券码"
|
||||
ref="refInputCode"></el-input>
|
||||
</el-form-item>
|
||||
<div class="u-flex u-row-center u-m-t-50">
|
||||
<el-button size="medium" @click="close">取消</el-button>
|
||||
<el-button size="medium" type="primary" @click="confirm"
|
||||
>确定</el-button
|
||||
>
|
||||
<el-button size="medium" type="primary" @click="confirm">确定</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
|
|
@ -44,13 +26,10 @@
|
|||
</el-dialog>
|
||||
|
||||
<bind-shop ref="refBindShop"></bind-shop>
|
||||
<choose-goods
|
||||
ref="refChooseGoods"
|
||||
@hexiaoSuccess="hexiaoSuccess"
|
||||
></choose-goods>
|
||||
<choose-goods ref="refChooseGoods" @hexiaoSuccess="hexiaoSuccess"></choose-goods>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
<script>
|
||||
import * as $Api from "@/api/coup/index.js";
|
||||
import { tbOrderInfoDetail } from "@/api/order";
|
||||
import bindShop from "./douyin-quan-bind-shop.vue";
|
||||
|
|
@ -115,8 +94,8 @@ export default {
|
|||
},
|
||||
},
|
||||
methods: {
|
||||
refChooseGoodsOpen(data,types) {
|
||||
this.$refs.refChooseGoods.open(data,types);
|
||||
refChooseGoodsOpen(data, types) {
|
||||
this.$refs.refChooseGoods.open(data, types);
|
||||
},
|
||||
refBindShopOpen() {
|
||||
this.$refs.refBindShop.open();
|
||||
|
|
@ -147,6 +126,9 @@ export default {
|
|||
},
|
||||
changeKey(key, val) {
|
||||
this[key] = val;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.refInputCode.focus() //获取焦点
|
||||
})
|
||||
},
|
||||
|
||||
async confirm() {
|
||||
|
|
@ -154,35 +136,37 @@ export default {
|
|||
return this.$message.error("请输入或扫付券码");
|
||||
}
|
||||
|
||||
if (this.paysSel == 1) {
|
||||
if (this.paysSel === 1) {
|
||||
//抖音
|
||||
const res = await $Api.$douyin_fulfilmentcertificateprepare({
|
||||
object_id: this.form.code,
|
||||
});
|
||||
if (res.code == 4399) {
|
||||
this.refBindShopOpen();
|
||||
}
|
||||
if (res) {
|
||||
} else {
|
||||
console.log(res, 1111)
|
||||
// if (res.code == 1) {
|
||||
this.refChooseGoodsOpen(res);
|
||||
// }
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (this.paysSel == 0) {
|
||||
if (this.paysSel === 0) {
|
||||
//美团
|
||||
const res = await $Api.$meituan_searchstorestatus({
|
||||
});
|
||||
if(res.status==0){
|
||||
const res2 = await $Api.$meituan_getuisdkurl({
|
||||
});
|
||||
window.open(res2);
|
||||
return;
|
||||
if (res.status == 0) {
|
||||
const res2 = await $Api.$meituan_getuisdkurl({
|
||||
});
|
||||
window.open(res2);
|
||||
return;
|
||||
}
|
||||
const res1 = await $Api.$meituan_fulfilmentcertificateprepare({
|
||||
code: this.form.code,
|
||||
code: this.form.code,
|
||||
});
|
||||
if(res1){
|
||||
const types='meituan'
|
||||
this.refChooseGoodsOpen(res1,types);
|
||||
if (res1) {
|
||||
const types = 'meituan'
|
||||
this.refChooseGoodsOpen(res1, types);
|
||||
}
|
||||
}
|
||||
// this.$message.success("核销成功");
|
||||
|
|
@ -214,8 +198,8 @@ export default {
|
|||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.codeImg {
|
||||
width: 164px;
|
||||
border: 1px solid rgb(220, 223, 230);
|
||||
|
|
|
|||
|
|
@ -8,13 +8,13 @@
|
|||
<div class="">
|
||||
<div>单价</div>
|
||||
<div class="u-m-t-10">
|
||||
<el-tag type="primary" size="medium">¥{{ item.lowPrice }}/{{ item.unitName }}</el-tag>
|
||||
<el-tag type="primary" size="medium">¥{{ price }}/{{ item.unitName }}</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="u-font-14">重量</div>
|
||||
<div class="u-m-t-10">
|
||||
<el-input placeholder="请输入挂账金额" v-model="number" @input="inputNumber" @change="inputChange"
|
||||
<el-input placeholder="请输入重量" v-model="number" @input="inputNumber" @change="inputChange"
|
||||
@focus="inputFocus" @blur="inputBlur" :type="focus ? 'number' : 'text'">
|
||||
<template slot="append">{{ item.unitName }}</template>
|
||||
</el-input>
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</key-board>
|
||||
<div class="price u-text-left w-full">¥ {{ item.lowPrice * number }}</div>
|
||||
<div class="price u-text-left w-full">¥ {{ allPrice }}</div>
|
||||
|
||||
<div class="confirm_btns u-flex u-m-t-20">
|
||||
<el-button style="width: 100%;" type="primary" size="medium" @click="confirm">确定</el-button>
|
||||
|
|
@ -30,20 +30,22 @@
|
|||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<choose-guazhang ref="refChooseGuazhang" @confirm="chooseGuazhangConfirm"></choose-guazhang>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import keyBoard from "./keyboard.vue";
|
||||
import chooseGuazhang from "./choose-guazhang.vue";
|
||||
export default {
|
||||
components: { keyBoard, chooseGuazhang },
|
||||
components: { keyBoard },
|
||||
props: {
|
||||
payMoney: {
|
||||
type: [Number, String],
|
||||
default: 0,
|
||||
},
|
||||
isShowVipPrice:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -60,25 +62,19 @@ export default {
|
|||
},
|
||||
watch: {
|
||||
number(newval) {
|
||||
// 处理小数点
|
||||
// if (newval == '.' || newval == '0.') {
|
||||
// this.number = newval;
|
||||
// } else {
|
||||
if (newval * 1 > this.payMoney * 1) {
|
||||
this.number = this.payMoney;
|
||||
this.number = newval;
|
||||
}
|
||||
if (newval * 1 > this.payMoney * 1) {
|
||||
this.tips = "已超出未结账金额";
|
||||
} else {
|
||||
const shengyu = this.payMoney - this.number;
|
||||
|
||||
this.tips =
|
||||
shengyu > 0 ? "还需额外支付" + shengyu.toFixed(2) + "元" : "";
|
||||
}
|
||||
// }
|
||||
},
|
||||
},
|
||||
computed:{
|
||||
allPrice(){
|
||||
return (this.price*this.number).toFixed(2);
|
||||
},
|
||||
price(){
|
||||
if(!this.item){
|
||||
return 0
|
||||
}
|
||||
return this.item.lowPrice;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
inputFocus() {
|
||||
this.focus = true;
|
||||
|
|
@ -86,51 +82,34 @@ export default {
|
|||
inputBlur() {
|
||||
this.focus = false;
|
||||
},
|
||||
chooseGuazhangConfirm(e) {
|
||||
this.guazhangRen = e;
|
||||
},
|
||||
guazhangShow() {
|
||||
this.$refs.refChooseGuazhang.open();
|
||||
},
|
||||
|
||||
inputNumber(e) {
|
||||
console.log("inputNumber");
|
||||
if (e * 1 > this.payMoney * 1) {
|
||||
this.tips = "已超出未结账金额";
|
||||
}
|
||||
console.log(e);
|
||||
|
||||
},
|
||||
inputChange(e) {
|
||||
if (e * 1 > this.payMoney * 1) {
|
||||
this.tips = "已超出未结账金额";
|
||||
}
|
||||
console.log(e);
|
||||
},
|
||||
clear(e) {
|
||||
console.log(e);
|
||||
this.number = "";
|
||||
this.item=""
|
||||
},
|
||||
confirm() {
|
||||
// if (this.number * 1 > this.payMoney * 1) {
|
||||
// return this.$message("已超出未结账金额");
|
||||
// }
|
||||
// if (this.number * 1 <= 0) {
|
||||
// return this.$message("支付金额不正确");
|
||||
// }
|
||||
// if (!this.guazhangRen) {
|
||||
// return this.$message("请选择挂账人");
|
||||
// }
|
||||
this.$emit("confirm", this.item, this.number);
|
||||
if(this.number*1<=0){
|
||||
return this.$message("请输入重量");
|
||||
}
|
||||
this.$emit("confirm", this.item, (this.number*1).toFixed(2));
|
||||
this.close();
|
||||
},
|
||||
open(item) {
|
||||
console.log(item);
|
||||
this.item = item
|
||||
this.number = this.payMoney * 1;
|
||||
this.show = true;
|
||||
this.tips = "还需额外支付" + this.payMoney + "元";
|
||||
},
|
||||
close() {
|
||||
this.show = false;
|
||||
this.number = "";
|
||||
this.item=""
|
||||
},
|
||||
},
|
||||
mounted() { },
|
||||
|
|
|
|||
|
|
@ -1321,7 +1321,9 @@
|
|||
<div class="key" @click="keyboradAdd('9')">9</div>
|
||||
</div>
|
||||
<div class="key-line">
|
||||
<div class="key"></div>
|
||||
<div class="key" @click="keyboradAdd('.')">
|
||||
<span v-if="selGoods.isSku=='weight'">.</span>
|
||||
</div>
|
||||
<div class="key" @click="keyboradAdd('0')">0</div>
|
||||
<div
|
||||
class="key"
|
||||
|
|
@ -1502,6 +1504,8 @@
|
|||
|
||||
<!-- 称重商品 -->
|
||||
<popup-weight-goods
|
||||
:isShowVipPrice="isShowVipPrice"
|
||||
|
||||
ref="refWeightGoods"
|
||||
@confirm="refWeightGoodsConfirm"
|
||||
>
|
||||
|
|
@ -1829,7 +1833,8 @@ export default {
|
|||
if (this.order.selIndex < 0) {
|
||||
return "免厨打";
|
||||
}
|
||||
return this.order.list[this.order.selIndex].isPrint
|
||||
const cart=this.order.list[this.order.selIndex]
|
||||
return (cart.isPrint||cart.isPrint===null)
|
||||
? "免厨打"
|
||||
: "打印";
|
||||
},
|
||||
|
|
@ -1856,10 +1861,13 @@ export default {
|
|||
}
|
||||
},
|
||||
gaijia() {
|
||||
if(!this.createOrder.data.amount ){
|
||||
return 0
|
||||
}
|
||||
const disCountOriginPrice =
|
||||
this.createOrder.data.amount - this.coupdiscount;
|
||||
const disocunt = (1 - this.createOrder.discount) * disCountOriginPrice;
|
||||
return disocunt.toFixed(2);
|
||||
this.createOrder.data.amount - this.productCouponDiscountAmount;
|
||||
const discountPrice= ((1-this.createOrder.discount)*disCountOriginPrice).toFixed(2)
|
||||
return discountPrice;
|
||||
},
|
||||
pointsCanDicountMoney() {
|
||||
return (this.yinFuJinE - this.points.toMoney).toFixed(2);
|
||||
|
|
@ -1876,11 +1884,24 @@ export default {
|
|||
}, 0);
|
||||
return n;
|
||||
},
|
||||
productCouponDiscountAmount(){
|
||||
const n = this.quansSelArr.filter(v=>v.type==2).reduce((prve, cur) => {
|
||||
return prve + cur.discountAmount * 1;
|
||||
}, 0);
|
||||
return n;
|
||||
},
|
||||
fullCouponDiscountAmount(){
|
||||
const n = this.quansSelArr.filter(v=>v.type==1).reduce((prve, cur) => {
|
||||
return prve + cur.discountAmount * 1;
|
||||
}, 0);
|
||||
return n;
|
||||
},
|
||||
currentPayMoney() {
|
||||
const amount = this.createOrder.data.amount || 0;
|
||||
const discount = this.createOrder.discount || 1;
|
||||
// const total=((amount - this.coupdiscount) * this.createOrder.discount - this.points.toMoney)
|
||||
const total = amount - this.gaijia - this.coupdiscount;
|
||||
// const total = amount - this.gaijia - this.coupdiscount;
|
||||
const total = amount - this.productCouponDiscountAmount-this.gaijia -this.fullCouponDiscountAmount;
|
||||
return total <= 0 ? 0 : total;
|
||||
},
|
||||
yinFuJinE() {
|
||||
|
|
@ -2088,7 +2109,8 @@ export default {
|
|||
const cartNumber = this.order.list.reduce((a, b) => {
|
||||
return a + b.number * 1;
|
||||
}, 0);
|
||||
return oldNumber + cartNumber;
|
||||
const total= oldNumber + cartNumber
|
||||
return (Math.floor(total)==total?total:total.toFixed(2));
|
||||
},
|
||||
selGoodsHide() {
|
||||
this.selGoods.show = false;
|
||||
|
|
@ -2308,23 +2330,20 @@ export default {
|
|||
const oldGoods = this.order.old.list.find((v) => {
|
||||
return v.productId === productId && v.skuId === skuId;
|
||||
});
|
||||
const newNum=this.order.number + (oldGoods ? oldGoods.number : 0)
|
||||
$updateCart({
|
||||
cartId: item.id,
|
||||
productId,
|
||||
skuId,
|
||||
tableId: this.table.tableId,
|
||||
num: this.order.number + (oldGoods ? oldGoods.number : 0), // 0会删除此商品
|
||||
num:newNum.toFixed(2) , // 0会删除此商品
|
||||
}).then((res) => {
|
||||
this.$set(this.order.list, this.order.selIndex, {
|
||||
...res,
|
||||
specSnap: item.specSnap || res.skuName,
|
||||
number: this.order.number,
|
||||
});
|
||||
});
|
||||
return;
|
||||
this.updateOrder({
|
||||
num: newval, // 0会删除此商品
|
||||
});
|
||||
}, 30),
|
||||
"goods.query.productId": function (newval) {
|
||||
if (!this.$goodsData) {
|
||||
|
|
@ -2361,15 +2380,9 @@ export default {
|
|||
},
|
||||
//称重商品确认
|
||||
async refWeightGoodsConfirm(item,number){
|
||||
let {masterId} =await this.getMasterId()
|
||||
let obj = {
|
||||
num:number *1,
|
||||
masterId,
|
||||
productId: this.selGoods.data.id,
|
||||
}
|
||||
// console.log(obj,'拿到的obj')
|
||||
// console.log(this.selGoods,'拿到的')
|
||||
this.chooseSkuConfirm()
|
||||
console.log(item)
|
||||
console.log(number)
|
||||
this.goodsClick(item,number,true)
|
||||
},
|
||||
//挂账人支付确认
|
||||
guazhangPayConfirm(guazhangren, price) {
|
||||
|
|
@ -2583,9 +2596,9 @@ export default {
|
|||
});
|
||||
},
|
||||
async returnCreateOrderData() {
|
||||
this.isWaitCall=false;
|
||||
if (this.key == "isJieZhang" || this.order.list.length <= 0) {
|
||||
//结账来的下单或者已经生成订单
|
||||
// this.order.old.list = formatOrderGoodsList(this.createOrder.data.detailList||[]);
|
||||
this.isCreateOrder = true;
|
||||
return this.createOrder.data;
|
||||
}
|
||||
|
|
@ -2920,7 +2933,8 @@ export default {
|
|||
});
|
||||
}
|
||||
},
|
||||
ChangeDiscount(discount) {
|
||||
ChangeDiscount(e) {
|
||||
const {discount,currentPrice}=e;
|
||||
const fullCoupIndex = this.quansSelArr.findIndex((v) => v.type == 1);
|
||||
const fullCoup = this.quansSelArr[fullCoupIndex];
|
||||
this.createOrder.discount = discount;
|
||||
|
|
@ -2952,7 +2966,7 @@ export default {
|
|||
if (!canDiscount) {
|
||||
return;
|
||||
}
|
||||
const amount = (this.createOrder.data.amount - this.coupdiscount).toFixed(
|
||||
const amount = (this.createOrder.data.amount -this.productCouponDiscountAmount).toFixed(
|
||||
2
|
||||
);
|
||||
console.log(amount);
|
||||
|
|
@ -3299,6 +3313,9 @@ export default {
|
|||
});
|
||||
},
|
||||
keyboradAdd(n) {
|
||||
if(this.selGoods.isSku!='weight'&&n=='.'){
|
||||
return
|
||||
}
|
||||
if (Number(this.keyborad.number) === 0) {
|
||||
return (this.keyborad.number = n);
|
||||
}
|
||||
|
|
@ -3327,9 +3344,13 @@ export default {
|
|||
},
|
||||
changeKeyboradShow(show) {
|
||||
if (show) {
|
||||
this.selGoods=this.order.list[this.order.selIndex]
|
||||
this.keyborad.number = `${this.order.list[this.order.selIndex].number}`;
|
||||
}
|
||||
this.keyborad.show = show;
|
||||
if(!show){
|
||||
this.selGoods=''
|
||||
}
|
||||
},
|
||||
// 获取本地缓存挂单
|
||||
// getPrveCart() {
|
||||
|
|
@ -3368,7 +3389,7 @@ export default {
|
|||
return this.removeCart();
|
||||
}
|
||||
if (key === "print") {
|
||||
const isPrint = orderGoods.isPrint;
|
||||
const isPrint = (orderGoods.isPrint||orderGoods.isPrint===null)?true:false;
|
||||
this.updateOrder({ isPrint: !isPrint });
|
||||
return;
|
||||
}
|
||||
|
|
@ -3897,6 +3918,7 @@ export default {
|
|||
},
|
||||
reset() {
|
||||
// this.goods.list = [];
|
||||
this.isAllWaitCall=false;
|
||||
this.guazhangRen = "";
|
||||
this.order.status = "";
|
||||
this.loading = false;
|
||||
|
|
@ -4069,12 +4091,11 @@ export default {
|
|||
}
|
||||
},
|
||||
//根据右侧商品单规格多规格做不同处理
|
||||
async goodsClick(item) {
|
||||
async goodsClick(item,number=0, isConfirm=false) {
|
||||
// if (!this.table) {
|
||||
// return this.$message.error("暂不支持无桌台下单,请先选择桌台");
|
||||
// }
|
||||
if(item.type=='weigh'){
|
||||
console.log(item)
|
||||
if(item.type=='weigh'&&!isConfirm){
|
||||
return this.refWeightGoodsShow(item)
|
||||
}
|
||||
if (item.typeEnum === "sku") {
|
||||
|
|
@ -4108,7 +4129,8 @@ export default {
|
|||
// tableId: this.table.tableId,
|
||||
// num: orderGoods.number * 1 + item.specList[0].suit, // 0会删除此商品
|
||||
// });
|
||||
orderGoods.number += item.specList[0].suit;
|
||||
const suit=number||item.specList[0].suit
|
||||
orderGoods.number +=suit*1 ;
|
||||
this.order.number = orderGoods.number;
|
||||
this.changeOrderSel(orderGoodsIndex);
|
||||
} else {
|
||||
|
|
@ -4123,7 +4145,7 @@ export default {
|
|||
productId: item.id,
|
||||
skuId: item.specList[0].id,
|
||||
tableId: this.table.tableId,
|
||||
num: item.specList[0].suit, // 0会删除此商品
|
||||
num:number|| item.specList[0].suit, // 0会删除此商品
|
||||
isPack: false, // 是否打包
|
||||
isWaitCall:this.isAllWaitCall //是否等叫
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue