Merge branch 'test' of e.coding.net:g-cphe0354/yinshoukeguanliduan/management into gyq

This commit is contained in:
gyq
2024-10-15 09:03:06 +08:00
8 changed files with 176 additions and 62 deletions

View File

@@ -50,9 +50,12 @@
<!-- <el-radio label="2">部分商品</el-radio> --> <!-- <el-radio label="2">部分商品</el-radio> -->
</el-radio-group> </el-radio-group>
<div v-if="forms.classifyPrint == 1" style="margin-left:70px"> <div v-if="forms.classifyPrint == 1" style="margin-left:70px">
<el-tree :data="partList" show-checkbox node-key="id" ref="tree" :default-checked-keys="this.forms.categoryIds" <!-- <el-tree :data="partList" show-checkbox node-key="id" ref="tree" :default-checked-keys="this.forms.categoryIds"
:props="{ children: 'childrenList', label: 'name' }"> :props="{ children: 'childrenList', label: 'name' }">
</el-tree> </el-tree> -->
<el-checkbox-group v-model="forms.selectcheckbox">
<el-checkbox v-for="item in partList" :key="item.id" :label="item.name"></el-checkbox>
</el-checkbox-group>
</div> </div>
</el-form-item> </el-form-item>
@@ -113,7 +116,8 @@ export default {
forms: { forms: {
sort: "0", sort: "0",
status: "0", status: "0",
connectionType: "network", printType: [] connectionType: "network", printType: [],
selectcheckbox: []
}, },
partList: [] partList: []
} }
@@ -121,13 +125,11 @@ export default {
filters: { filters: {
}, },
mounted() { mounted() {
if (this.$route.query.id) {
this.getList(this.$route.query.id)
}
this.getpartList() this.getpartList()
}, },
methods: { methods: {
handleNodeClick(d) { console.log(d) },
async onSubmit() { async onSubmit() {
// 删除时间字段 // 删除时间字段
@@ -137,17 +139,17 @@ export default {
} }
// 处理打印部分分类 // 处理打印部分分类
if (this.forms.classifyPrint == 1) { if (this.forms.classifyPrint == 1) {
let data = this.$refs.tree.getCheckedNodes()
let idstr = '' let idstr = ''
let arr = [] let arr = []
data.forEach(element => { this.forms.selectcheckbox.forEach(element => {
idstr += element.id + ',' let prts = this.partList.filter(ele => ele.name == element)[0]
arr.push({ id: element.id, name: element.name }) idstr = idstr + prts.id + ','
}); arr.push(prts)
this.forms.categoryList = JSON.stringify(arr) })
this.forms.categoryIds = idstr.substring(0, idstr.length - 1) this.forms.categoryIds = idstr.substring(0, idstr.length - 1)
} this.forms.categoryList = JSON.stringify(arr)
}
const res = await configprinter({ const res = await configprinter({
shopId: localStorage.getItem('shopId'), shopId: localStorage.getItem('shopId'),
...this.forms, ...this.forms,
@@ -163,18 +165,44 @@ export default {
page: 0, page: 0,
size: 500 size: 500
}) })
this.partList = res.content let arr = []
res.content.forEach(ele => {
arr.push({
id: ele.id,
name: ele.name
})
if (ele.childrenList.length > 0) {
ele.childrenList.forEach(element => {
arr.push({
id: element.id,
name: element.name
})
})
}
})
this.partList = arr
if (this.$route.query.id) {
this.getList(this.$route.query.id)
}
}, },
async getList(id) { async getList(id) {
const res = await printerd(id) const res = await printerd(id)
this.forms = res this.forms = res
this.forms.categoryIds=this.forms.categoryIds.split(',') if (res.categoryIds) {
console.log(this.forms.categoryIds,'调试11111') let ids = res.categoryIds.split(',')
let arr = []
ids.forEach(element => {
let prts = this.partList.filter(ele => ele.id == element)[0]
arr.push(prts.name)
})
this.$set(this.forms, 'selectcheckbox', arr)
} else {
this.$set(this.forms, 'selectcheckbox', [])
}
if (res.printType) { if (res.printType) {
this.forms.printType = JSON.parse(res.printType) this.forms.printType = JSON.parse(res.printType)
} else { } else {
this.forms.printType = [] this.forms.printType = []
} }
} }
} }

View File

@@ -148,7 +148,7 @@
</template> </template>
<!-- 动态信息 出库 报损 消耗 手动减少 减少数量 入库 手动增加 增加数量 现有数量--> <!-- 动态信息 出库 报损 消耗 手动减少 减少数量 入库 手动增加 增加数量 现有数量-->
<el-dialog :title="variabilitytitle" :visible.sync="variabilityshow"> <el-dialog :title="variabilitytitle" :visible.sync="variabilityshow" width="75%">
<div class="head-container"> <div class="head-container">
<el-table ref="table" :data="stockData.data" v-loading="stockData.loading" row-key="id" height="450"> <el-table ref="table" :data="stockData.data" v-loading="stockData.loading" row-key="id" height="450">
<!-- 共存前面 --> <!-- 共存前面 -->
@@ -165,7 +165,15 @@
<span :class="{ red: scope.row.bizType == '-' }">{{ scope.row.bizType }}{{ scope.row.amount }}</span> <span :class="{ red: scope.row.bizType == '-' }">{{ scope.row.bizType }}{{ scope.row.amount }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" prop="bizName" /> <el-table-column label="操作类型" prop="bizName" />
<el-table-column v-if="variabilitytitle == '消耗'" label="订单编号" prop="orderNo">
<template v-slot="scope">
<div>
<el-button type="text" @click="toGoodslist(scope.row.orderNo)">{{ scope.row.orderNo }}</el-button>
</div>
</template>
</el-table-column>
<!-- 减少数量 --> <!-- 减少数量 -->
<el-table-column v-if="variabilitytitle == '报损'" label="图片" prop="coverImg" /> <el-table-column v-if="variabilitytitle == '报损'" label="图片" prop="coverImg" />
<!-- 尾巴 --> <!-- 尾巴 -->
@@ -341,8 +349,8 @@
<el-form-item label=" "> <el-form-item label=" ">
<i class="el-icon-remove-outline color-danger" @click="ruleFormsReduce(index)"></i> <i class="el-icon-remove-outline color-danger" @click="ruleFormsReduce(index)"></i>
</el-form-item> </el-form-item>
<el-form-item label="单位" prop="conUnit"> <el-form-item label="耗材信息名称" prop="conName">
<el-input v-model="item.conUnit" placeholder="请输入单位"></el-input> <el-input v-model="item.conName" placeholder="请输入耗材信息名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="耗材类型" prop="conTypeId"> <el-form-item label="耗材类型" prop="conTypeId">
<el-select v-model="item.conTypeId" placeholder="请选择" <el-select v-model="item.conTypeId" placeholder="请选择"
@@ -368,8 +376,9 @@
>去选择</el-button >去选择</el-button
> >
</el-form-item> --> </el-form-item> -->
<el-form-item label="耗材信息名称" prop="conName">
<el-input v-model="item.conName" placeholder="请输入耗材信息名称"></el-input> <el-form-item label="单位" prop="conUnit">
<el-input v-model="item.conUnit" placeholder="请输入单位"></el-input>
</el-form-item> </el-form-item>
<!-- <el-form-item label="耗材信息代码" prop="conCode"> <!-- <el-form-item label="耗材信息代码" prop="conCode">
<el-input <el-input
@@ -403,9 +412,7 @@
<template v-else> <template v-else>
<el-form :inline="true" ref="refruleForm" :model="ruleForm" :rules="rules" class="demo-form-inline"> <el-form :inline="true" ref="refruleForm" :model="ruleForm" :rules="rules" class="demo-form-inline">
<el-form-item label="单位" prop="conUnit">
<el-input v-model="ruleForm.conUnit" placeholder="请输入单位"></el-input>
</el-form-item>
<!-- <el-form-item label="单位" prop="conUnit" v-if="dialogtitle == '添加'"> <!-- <el-form-item label="单位" prop="conUnit" v-if="dialogtitle == '添加'">
<el-input v-model="ruleForm.conUnit" placeholder="请输入单位"></el-input> <el-input v-model="ruleForm.conUnit" placeholder="请输入单位"></el-input>
</el-form-item> </el-form-item>
@@ -443,6 +450,9 @@
<!-- <el-form-item label="耗材价格"> <!-- <el-form-item label="耗材价格">
<el-input v-model="ruleForm.price" placeholder="请输入耗材价格"></el-input> <el-input v-model="ruleForm.price" placeholder="请输入耗材价格"></el-input>
</el-form-item> --> </el-form-item> -->
<el-form-item label="单位" prop="conUnit">
<el-input v-model="ruleForm.conUnit" placeholder="请输入单位"></el-input>
</el-form-item>
<el-form-item label="预警值"> <el-form-item label="预警值">
<el-input v-model="ruleForm.conWarning" placeholder="请输入耗材预警值"></el-input> <el-input v-model="ruleForm.conWarning" placeholder="请输入耗材预警值"></el-input>
</el-form-item> </el-form-item>
@@ -741,6 +751,15 @@ export default {
} }
}) })
}, },
//跳转订单列表
toGoodslist(orderNo) {
this.$router.push({
path: '/order_manage/order_list',
query: {
orderNo: orderNo
}
})
},
//添加耗材弹窗增加 //添加耗材弹窗增加
ruleFormsAdd() { ruleFormsAdd() {
console.log('add') console.log('add')
@@ -944,6 +963,7 @@ export default {
shopId: localStorage.getItem("shopId"), shopId: localStorage.getItem("shopId"),
productId: '',//预留耗材id productId: '',//预留耗材id
column: this.stockData.column,//列名 column: this.stockData.column,//列名
conName:this.query.conName,
createdAt: arr//耗材id createdAt: arr//耗材id
}) })
this.stockData.loading = false; this.stockData.loading = false;
@@ -1029,7 +1049,7 @@ export default {
this.dialogtitle = "添加"; this.dialogtitle = "添加";
this.gettbConsType() this.gettbConsType()
this.$nextTick(() => { this.$nextTick(() => {
// this.$refs.refruleForm.resetFields(); this.$refs.refruleForm.resetFields();
this.resetRuleForms() this.resetRuleForms()
}); });
} else { } else {

View File

@@ -2,7 +2,7 @@
<div class="app-container"> <div class="app-container">
<div class="head-container"> <div class="head-container">
<el-form ref="queryForm" :model="queryForm" :rules="queryRules" label-position="left" label-width="80px"> <el-form ref="queryForm" :model="queryForm" :rules="queryRules" label-position="left" label-width="80px">
<el-form-item label="出库内容"> <!-- <el-form-item label="出库内容">
<div class="shop_type_box"> <div class="shop_type_box">
<div class="item" v-for="item in inTabs" :key="item.value" <div class="item" v-for="item in inTabs" :key="item.value"
:class="{ active: inTabValue == item.value }" @click="tabChange(item.value, item.type)"> :class="{ active: inTabValue == item.value }" @click="tabChange(item.value, item.type)">
@@ -12,7 +12,7 @@
</div> </div>
</div> </div>
</div> </div>
</el-form-item> </el-form-item> -->
<!-- <el-form-item label="出库类型" v-if="inTabValue == 'goods'"> <!-- <el-form-item label="出库类型" v-if="inTabValue == 'goods'">
<div class="shop_type_box"> <div class="shop_type_box">
<div class="item" v-for="(item, index) in shopTypes" :key="index" <div class="item" v-for="(item, index) in shopTypes" :key="index"
@@ -228,7 +228,7 @@ export default {
data() { data() {
return { return {
formatDecimal, formatDecimal,
inTabValue: 'goods', inTabValue: 'consumable',
inTabs: [ inTabs: [
{ {
label: '商品出库', label: '商品出库',
@@ -241,7 +241,7 @@ export default {
type: 'out' type: 'out'
} }
], ],
shopTypesActive: 1, shopTypesActive: 0,
shopTypes: [ shopTypes: [
{ {
label: '供应商退货', label: '供应商退货',

View File

@@ -244,6 +244,7 @@ export default {
this.getTableData(); this.getTableData();
}, 200); }, 200);
} }
}, },
methods: { methods: {
// 获取订单汇总 // 获取订单汇总

View File

@@ -752,17 +752,21 @@ export default {
// 提交 // 提交
submitHandle() { submitHandle() {
console.log(this.form.skuList) // 如果找到undefined立即停止搜索并返回true
const hasUndefined = this.form.skuList.some(obj => { const hasUndefined = this.form.skuList.some(obj => {
for (const key in obj) { for (const key in obj) {
console.log(key, obj) if (this.shopTypesActive == 0) {//单规格判断
if (obj['salePrice'] === undefined || obj['memberPrice'] === undefined || obj['costPrice'] === undefined || obj['originPrice'] === undefined) { if (obj['salePrice'] == undefined || obj['memberPrice'] == undefined) {
return true; // 如果找到undefined立即停止搜索并返回true return true;
}
} else {//多规格判断
if (obj['salePrice'] == undefined || obj['memberPrice'] == undefined || obj['costPrice'] == undefined || obj['originPrice'] == undefined) {
return true;
}
} }
} }
return false; // 如果没有找到undefined返回false return false;
}); });
// 停止执行下面的数据
if (hasUndefined) { if (hasUndefined) {
this.$message({ this.$message({
message: "请完善规格属性的参数!", message: "请完善规格属性的参数!",
@@ -770,6 +774,7 @@ export default {
}); });
return false; return false;
} }
let arr = []; let arr = [];
this.imgList.forEach((ele) => { this.imgList.forEach((ele) => {
arr.push(ele.url); arr.push(ele.url);

View File

@@ -50,7 +50,12 @@
</div> </div>
<div class="head-container"> <div class="head-container">
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size" <el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
@current-change="paginationChange" layout="total, sizes, prev, pager, next, jumper"></el-pagination> @current-change="paginationChange" layout="total, sizes, prev, pager, next, jumper" @size-change="(e) => {
tableData.size = e;
tableData.page = 0;
getTableData();
}
"></el-pagination>
</div> </div>
</div> </div>
</template> </template>

View File

@@ -52,7 +52,7 @@
<!-- <img :src="codeImg" class="codeImg" alt="" /> --> <!-- <img :src="codeImg" class="codeImg" alt="" /> -->
</div> </div>
<div class="color-333 u-font-20 u-m-t-20">32.00</div> <div class="color-333 u-font-20 u-m-t-20">{{price|to2}}</div>
<div class="color-aaa u-font-12 u-m-t-10"> <div class="color-aaa u-font-12 u-m-t-10">
<i class="el-icon-loading"></i> <i class="el-icon-loading"></i>
<span>等待用户支付</span> <span>等待用户支付</span>
@@ -91,6 +91,11 @@ export default {
default: "请使用扫码枪扫描付款码", default: "请使用扫码枪扫描付款码",
}, },
}, },
filters:{
to2(n){
return n.toFixed(2)
}
},
data() { data() {
return { return {
tips: "", tips: "",
@@ -191,7 +196,7 @@ export default {
this.show = true; this.show = true;
this.form.money = Number(this.price).toFixed(2); this.form.money = Number(this.price).toFixed(2);
if (this.openSwitch) { if (this.openSwitch) {
$getOrderPayUrl({ orderId: this.order.id }).then((res) => { $getOrderPayUrl({ orderId: this.order.id,payAmount:this.price.toFixed(2) }).then((res) => {
console.log(res); console.log(res);
this.paymentQrcode = res; this.paymentQrcode = res;
}); });

View File

@@ -177,7 +177,7 @@
<el-button-group> <el-button-group>
<el-button <el-button
:class="{ active: item.value == useTypes.sel }" :class="{ active: item.value == useTypes.sel }"
:disabled="order.old.list.length > 0||item.disabled" :disabled="order.old.list.length > 0 || item.disabled"
v-for="(item, index) in useTypes.list" v-for="(item, index) in useTypes.list"
@click="changeUseType(item.value)" @click="changeUseType(item.value)"
:key="index" :key="index"
@@ -353,11 +353,12 @@
<div class="flex mt-14"> <div class="flex mt-14">
<template v-if="!postPay"> <template v-if="!postPay">
<template v-if="isCreateOrder"> <template v-if="isCreateOrder">
<!-- <template v-if="false"> -->
<button <button
class="my-btn flex-1 default" class="my-btn flex-1 default"
@click="createOrderClose" @click="createOrderClose"
> >
<span>/返回</span> <span>/返回</span>
</button> </button>
</template> </template>
<template v-else> <template v-else>
@@ -1191,17 +1192,17 @@ export default {
shopInfo: {}, shopInfo: {},
//就餐饭方式 //就餐饭方式
useTypes: { useTypes: {
list:[], list: [],
list: [ list: [
{ {
name: "堂食", name: "堂食",
value: "dine-in", value: "dine-in",
disabled:true disabled: true,
}, },
{ {
name: "自取", name: "自取",
value: "takeout", value: "takeout",
disabled:true disabled: true,
}, },
], ],
sel: "dine-in", sel: "dine-in",
@@ -1647,7 +1648,14 @@ export default {
this.order.extra.selIndex = index; this.order.extra.selIndex = index;
}, },
async morePayClick() { async morePayClick() {
if (this.order.list.length <= 0) {
return this.$message("请选择菜品");
}
// if(this.isCreateOrder){
// return
// }
const res = await this.returnCreateOrderData(); const res = await this.returnCreateOrderData();
this.payBeforeClear();
this.createOrder.data = res; this.createOrder.data = res;
this.order.payType = ""; this.order.payType = "";
this.isCreateOrder = true; this.isCreateOrder = true;
@@ -1662,8 +1670,8 @@ export default {
this.cachePay(); this.cachePay();
}); });
}, },
returnCreateOrderData() { async returnCreateOrderData() {
return $createOrder({ const res = await $createOrder({
masterId: this.order.masterId || this.masterId, masterId: this.order.masterId || this.masterId,
vipUserId: this.vipUser.id, vipUserId: this.vipUser.id,
tableId: this.table.tableId, tableId: this.table.tableId,
@@ -1671,16 +1679,58 @@ export default {
postPay: this.postPay, postPay: this.postPay,
orderld: this.order.orderId, orderld: this.order.orderId,
}); });
this.createOrder.data = res;
this.createOrder.discount = 1;
// const lastItem = this.order.old.list[this.order.old.list.length - 1];
// const nowPlaceNum = lastItem ? lastItem.placeNum : 0;
// this.order.old.list = [
// ...this.order.old.list,
// { info: this.order.list, placeNum: nowPlaceNum + 1 },
// ];
this.order.list = [];
this.order.old.list = [];
return res;
},
async payBeforeClear() {
this.getMasterId().then(res=>{
this.masterId = res.masterId;
})
this.loading = false;
this.order.list = [];
this.order.query.page = 1;
this.goods.total = 0;
this.order.list = [];
this.order.selIndex = -1;
this.order.selPlaceNum = -1;
this.order.selGoods = "";
this.order.seatFee = { totalAmount: 0 }; //餐位费
this.prveOrder.list = [];
this.prveOrder.selIndex = -1;
this.order.old.selIndex = -1;
this.isCreateOrder = false;
this.createOrder.status = "";
this.createOrder.code = "";
this.note.content = "";
this.vipUser = { id: "" };
this.order.masterId = "";
this.allPack = false;
this.note.content = "";
this.isPrverOrder = false;
this.createOrder.discount = 1;
this.order.cacheNumber = 1;
this.key = "";
this.order.orderId = "";
this.perpole = "";
this.useTypes.sel = "dine-in";
}, },
async cachePay() { async cachePay() {
const res = await this.returnCreateOrderData(); await this.returnCreateOrderData();
this.createOrder.data = res; this.payBeforeClear({});
this.pays(); this.pays();
}, },
async scanPayClick() { async scanPayClick() {
const res = await this.returnCreateOrderData(); await this.returnCreateOrderData();
this.createOrder.data = res; this.payBeforeClear();
this.createOrder.discount = 1;
this.order.payType = "scanCode"; this.order.payType = "scanCode";
this.payTypeItemClick({ payType: "scanCode" }); this.payTypeItemClick({ payType: "scanCode" });
}, },
@@ -2112,7 +2162,7 @@ export default {
if (this.table.tableId) { if (this.table.tableId) {
return $getMasterId({ return $getMasterId({
tableId: this.table.tableId, tableId: this.table.tableId,
orderId:this.table.orderId, orderId: this.table.orderId,
vipUserId: this.vipUser.id, vipUserId: this.vipUser.id,
useType: this.useTypes.sel == "takeout" ? "takeout" : "", useType: this.useTypes.sel == "takeout" ? "takeout" : "",
}); });
@@ -2917,14 +2967,14 @@ export default {
async open(params) { async open(params) {
const shopId = localStorage.getItem("shopId"); const shopId = localStorage.getItem("shopId");
const shopInfo = await tbShopInfo(shopId); const shopInfo = await tbShopInfo(shopId);
for(let i in shopInfo.eatModel){ for (let i in shopInfo.eatModel) {
let model=shopInfo.eatModel[i]; let model = shopInfo.eatModel[i];
model=model=='take-out'?model.replace(/-/g,""):model; model = model == "take-out" ? model.replace(/-/g, "") : model;
console.log(model); console.log(model);
const item=this.useTypes.list.find(v=>v.value==model); const item = this.useTypes.list.find((v) => v.value == model);
console.log(item); console.log(item);
if(item){ if (item) {
item.disabled=false; item.disabled = false;
} }
} }
this.shopInfo = shopInfo; this.shopInfo = shopInfo;
@@ -2945,8 +2995,8 @@ export default {
tableId: params.tableId, tableId: params.tableId,
useType: params.useType, useType: params.useType,
maxCapacity: params.maxCapacity * 1, maxCapacity: params.maxCapacity * 1,
masterId:params.masterId, masterId: params.masterId,
orderId:params.orderId, orderId: params.orderId,
}, },
key = params.key, key = params.key,
perpoleNumber = params.num; perpoleNumber = params.num;