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-group>
<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' }">
</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>
</el-form-item>
@@ -113,7 +116,8 @@ export default {
forms: {
sort: "0",
status: "0",
connectionType: "network", printType: []
connectionType: "network", printType: [],
selectcheckbox: []
},
partList: []
}
@@ -121,13 +125,11 @@ export default {
filters: {
},
mounted() {
if (this.$route.query.id) {
this.getList(this.$route.query.id)
}
this.getpartList()
},
methods: {
handleNodeClick(d) { console.log(d) },
async onSubmit() {
// 删除时间字段
@@ -137,17 +139,17 @@ export default {
}
// 处理打印部分分类
if (this.forms.classifyPrint == 1) {
let data = this.$refs.tree.getCheckedNodes()
let idstr = ''
let arr = []
data.forEach(element => {
idstr += element.id + ','
arr.push({ id: element.id, name: element.name })
});
this.forms.categoryList = JSON.stringify(arr)
this.forms.selectcheckbox.forEach(element => {
let prts = this.partList.filter(ele => ele.name == element)[0]
idstr = idstr + prts.id + ','
arr.push(prts)
})
this.forms.categoryIds = idstr.substring(0, idstr.length - 1)
}
this.forms.categoryList = JSON.stringify(arr)
}
const res = await configprinter({
shopId: localStorage.getItem('shopId'),
...this.forms,
@@ -163,18 +165,44 @@ export default {
page: 0,
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) {
const res = await printerd(id)
this.forms = res
this.forms.categoryIds=this.forms.categoryIds.split(',')
console.log(this.forms.categoryIds,'调试11111')
if (res.categoryIds) {
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) {
this.forms.printType = JSON.parse(res.printType)
} else {
this.forms.printType = []
}
}
}

View File

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

View File

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

View File

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

View File

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

View File

@@ -50,7 +50,12 @@
</div>
<div class="head-container">
<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>
</template>

View File

@@ -52,7 +52,7 @@
<!-- <img :src="codeImg" class="codeImg" alt="" /> -->
</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">
<i class="el-icon-loading"></i>
<span>等待用户支付</span>
@@ -91,6 +91,11 @@ export default {
default: "请使用扫码枪扫描付款码",
},
},
filters:{
to2(n){
return n.toFixed(2)
}
},
data() {
return {
tips: "",
@@ -191,7 +196,7 @@ export default {
this.show = true;
this.form.money = Number(this.price).toFixed(2);
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);
this.paymentQrcode = res;
});

View File

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