|
|
@@ -13,6 +13,10 @@
|
|
|
{
|
|
|
label: '电脑编号',
|
|
|
value: 'pc_num'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '套餐',
|
|
|
+ value: 'set_meal'
|
|
|
}
|
|
|
]"
|
|
|
></cl-search-key>
|
|
|
@@ -20,11 +24,23 @@
|
|
|
|
|
|
<el-row>
|
|
|
<cl-table v-bind="table">
|
|
|
+ <template #column-rent_price="{ scope }">
|
|
|
+ <span v-if="scope.row.price_type == 0"
|
|
|
+ >{{ scope.row.rent_price }}元 / 天</span
|
|
|
+ >
|
|
|
+ <span v-if="scope.row.price_type == 1"
|
|
|
+ >{{ scope.row.rent_price }}元 / 周</span
|
|
|
+ >
|
|
|
+ <span v-if="scope.row.price_type == 2"
|
|
|
+ >{{ scope.row.rent_price }}元 / 月</span
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+
|
|
|
<template #slot-renew="{ scope }">
|
|
|
<el-button type="text" size="mini" @click="renew(scope.row)">续费</el-button>
|
|
|
</template>
|
|
|
<template #slot-renting-out="{ scope }">
|
|
|
- <el-button type="text" size="mini" @click="rentingOut(scope.row)"
|
|
|
+ <el-button type="text" size="mini" @click="switchRentingOut(scope.row)"
|
|
|
>退租</el-button
|
|
|
>
|
|
|
</template>
|
|
|
@@ -66,7 +82,7 @@
|
|
|
</template>
|
|
|
</cl-upsert>
|
|
|
|
|
|
- <cl-dialog title="租机编号更换" v-model="visible">
|
|
|
+ <cl-dialog title="租机编号更换" v-model="visible_replaceNum">
|
|
|
<el-form ref="elForm" :model="replaceNumForm" size="medium" label-width="100px">
|
|
|
<el-row>
|
|
|
<el-form-item label="警告:" prop="">
|
|
|
@@ -97,13 +113,82 @@
|
|
|
</el-form-item>
|
|
|
</el-row>
|
|
|
<el-form-item>
|
|
|
- <el-button size="small" @click="visible = false">取消</el-button>
|
|
|
+ <el-button size="small" @click="visible_replaceNum = false">取消</el-button>
|
|
|
<el-button type="primary" size="small" @click="replaceNum(replaceNumForm)"
|
|
|
>提交</el-button
|
|
|
>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</cl-dialog>
|
|
|
+ <cl-dialog title="租机退租" v-model="visible_rentingOut">
|
|
|
+ <el-form ref="elForm" :model="rentingOutForm" size="medium" label-width="100px">
|
|
|
+ <el-row>
|
|
|
+ <el-form-item label="警告:" prop="">
|
|
|
+ <el-col :span="24">
|
|
|
+ <p style="color: red; font-size: larger">请勿随意操作!!!</p>
|
|
|
+ </el-col>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-form-item label="租机编号" prop="pc_num">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-input
|
|
|
+ v-model="rentingOutForm.pc_num"
|
|
|
+ placeholder="租机编号"
|
|
|
+ disabled="true"
|
|
|
+ ></el-input>
|
|
|
+ </el-col>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="退租时间" prop="rent_end">
|
|
|
+ <el-col>
|
|
|
+ <el-date-picker
|
|
|
+ v-model="rentingOutForm.rent_end"
|
|
|
+ format="YYYY-MM-DD HH:mm:ss"
|
|
|
+ type="datetime"
|
|
|
+ :style="{ width: '100%' }"
|
|
|
+ placeholder="请选择日期"
|
|
|
+ clearable
|
|
|
+ ></el-date-picker>
|
|
|
+ </el-col>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+ <el-row><el-button size="small" @click="addCardMsg()">匀时间</el-button></el-row>
|
|
|
+ <el-row>
|
|
|
+ <div class="container-scrollbar">
|
|
|
+ <el-scrollbar max-height="200px">
|
|
|
+ <el-row :gutter="24" v-for="(item, index) in cardList" :key="index">
|
|
|
+ <el-col :span="10">
|
|
|
+ <el-form-item label="租机编号">
|
|
|
+ <demo-select-rentComputerList v-model="item.pc_id" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="增加天数">
|
|
|
+ <el-input v-model="item.add_day"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="2" v-if="cardList.length !== 1">
|
|
|
+ <el-button
|
|
|
+ @click="deleteCardMsg(index)"
|
|
|
+ class="el-icon-delete"
|
|
|
+ size="mini"
|
|
|
+ circle
|
|
|
+ >
|
|
|
+ </el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-scrollbar>
|
|
|
+ </div>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-form-item>
|
|
|
+ <el-button size="small" @click="visible_rentingOut = false">取消</el-button>
|
|
|
+ <el-button type="primary" size="small" @click="rentingOut(rentingOutForm)"
|
|
|
+ >提交</el-button
|
|
|
+ >
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </cl-dialog>
|
|
|
</cl-crud>
|
|
|
</template>
|
|
|
|
|
|
@@ -111,6 +196,7 @@
|
|
|
import { CrudLoad, Table, Upsert } from "cl-admin-crud-vue3/types";
|
|
|
import { defineComponent, inject, reactive, ref } from "vue";
|
|
|
import QueryIsExpire from "../components/query-is_expire.vue";
|
|
|
+import shuyouRentComputerListSelect from "../components/shuyouRentComputerList-select.vue";
|
|
|
import dayjs from "dayjs";
|
|
|
import { ElMessage } from "element-plus";
|
|
|
import { useRefs } from "/@/core";
|
|
|
@@ -119,7 +205,8 @@ export default defineComponent({
|
|
|
name: "rent-computer",
|
|
|
|
|
|
components: {
|
|
|
- "demo-query-is_expire": QueryIsExpire
|
|
|
+ "demo-query-is_expire": QueryIsExpire,
|
|
|
+ "demo-select-rentComputerList": shuyouRentComputerListSelect
|
|
|
},
|
|
|
|
|
|
setup() {
|
|
|
@@ -136,12 +223,22 @@ export default defineComponent({
|
|
|
shop_id: 0,
|
|
|
rent_duration: 0,
|
|
|
rent_end: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
|
|
|
+ set_meal: "",
|
|
|
+ price_type: 0,
|
|
|
rent_price: 0,
|
|
|
rent_price_day: 0,
|
|
|
pay_method: 0,
|
|
|
rent_person_id: ""
|
|
|
});
|
|
|
- const visible = ref<boolean>(false);
|
|
|
+ const rentingOutForm = reactive<any>({
|
|
|
+ pc_num: "",
|
|
|
+ pc_id: 0,
|
|
|
+ rent_end: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
|
|
|
+ addList: []
|
|
|
+ });
|
|
|
+ const visible_replaceNum = ref<boolean>(false);
|
|
|
+ const visible_rentingOut = ref<boolean>(false);
|
|
|
+ let cardList = ref<any[]>([]);
|
|
|
|
|
|
// 新增、编辑配置
|
|
|
const upsert = reactive<Upsert>({
|
|
|
@@ -191,7 +288,7 @@ export default defineComponent({
|
|
|
},
|
|
|
{
|
|
|
prop: "shop_id",
|
|
|
- label: "供应商",
|
|
|
+ label: "供应商名",
|
|
|
span: 8,
|
|
|
component: {
|
|
|
name: "shuyouRentComputerShopSelect",
|
|
|
@@ -204,39 +301,21 @@ export default defineComponent({
|
|
|
message: "供应商不能为空"
|
|
|
}
|
|
|
},
|
|
|
- // {
|
|
|
- // prop: "taskIdList",
|
|
|
- // label: "游戏任务",
|
|
|
- // span: 24,
|
|
|
- // component: {
|
|
|
- // name: "el-input",
|
|
|
- // props: {
|
|
|
- // placeholder: "游戏任务"
|
|
|
- // }
|
|
|
- // },
|
|
|
- // rules: {
|
|
|
- // required: true,
|
|
|
- // message: "游戏任务不能为空"
|
|
|
- // }
|
|
|
- // },
|
|
|
{
|
|
|
- prop: "taskIdList",
|
|
|
- label: "游戏任务",
|
|
|
- span: 24,
|
|
|
- value: [],
|
|
|
+ prop: "set_meal",
|
|
|
+ label: "套餐名",
|
|
|
+ span: 12,
|
|
|
component: {
|
|
|
- name: "shuyouGameTaskNameselect",
|
|
|
+ name: "el-input",
|
|
|
props: {
|
|
|
- props: {
|
|
|
- // "multiple-limit": 3
|
|
|
- }
|
|
|
+ placeholder: "示例:无忧套餐1"
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
prop: "rent_start",
|
|
|
label: "起租时间",
|
|
|
- span: 12,
|
|
|
+ span: 8,
|
|
|
value: Date(),
|
|
|
component: {
|
|
|
name: "slot-rent_start"
|
|
|
@@ -255,7 +334,7 @@ export default defineComponent({
|
|
|
prop: "rent_duration",
|
|
|
label: "租机时长",
|
|
|
value: 1,
|
|
|
- span: 12,
|
|
|
+ span: 8,
|
|
|
component: {
|
|
|
name: "slot-rent_duration"
|
|
|
},
|
|
|
@@ -267,7 +346,7 @@ export default defineComponent({
|
|
|
{
|
|
|
prop: "rent_end",
|
|
|
label: "到期时间",
|
|
|
- span: 12,
|
|
|
+ span: 8,
|
|
|
component: {
|
|
|
name: "el-date-picker",
|
|
|
props: {
|
|
|
@@ -278,7 +357,30 @@ export default defineComponent({
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
- label: "租机价格",
|
|
|
+ prop: "price_type",
|
|
|
+ label: "价格套餐",
|
|
|
+ value: 0,
|
|
|
+ span: 12,
|
|
|
+ component: {
|
|
|
+ name: "el-radio-group",
|
|
|
+ options: [
|
|
|
+ {
|
|
|
+ label: "天卡",
|
|
|
+ value: 0
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "周卡",
|
|
|
+ value: 1
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "月卡",
|
|
|
+ value: 2
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "价格标准",
|
|
|
prop: "rent_price",
|
|
|
value: 0.0,
|
|
|
span: 12,
|
|
|
@@ -295,10 +397,23 @@ export default defineComponent({
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
+ prop: "taskIdList",
|
|
|
+ label: "游戏任务",
|
|
|
+ span: 24,
|
|
|
+ value: [],
|
|
|
+ component: {
|
|
|
+ name: "shuyouGameTaskNameselect",
|
|
|
+ props: {
|
|
|
+ props: {
|
|
|
+ // "multiple-limit": 3
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
prop: "remark",
|
|
|
label: "备注",
|
|
|
span: 24,
|
|
|
- group: "base_msg",
|
|
|
component: {
|
|
|
name: "el-input",
|
|
|
props: {
|
|
|
@@ -312,7 +427,6 @@ export default defineComponent({
|
|
|
prop: "pay_method",
|
|
|
label: "结算方式",
|
|
|
value: 0,
|
|
|
- group: "base_msg",
|
|
|
component: {
|
|
|
name: "el-radio-group",
|
|
|
options: [
|
|
|
@@ -335,7 +449,6 @@ export default defineComponent({
|
|
|
prop: "is_expire",
|
|
|
label: "是否到期",
|
|
|
value: 0,
|
|
|
- group: "base_msg",
|
|
|
component: {
|
|
|
name: "el-radio-group",
|
|
|
options: [
|
|
|
@@ -378,7 +491,15 @@ export default defineComponent({
|
|
|
sortable: "true",
|
|
|
headerAlign: "left",
|
|
|
align: "left",
|
|
|
- minWidth: 180
|
|
|
+ minWidth: 100
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "set_meal",
|
|
|
+ label: "套餐",
|
|
|
+ sortable: "true",
|
|
|
+ headerAlign: "left",
|
|
|
+ align: "left",
|
|
|
+ minWidth: 100
|
|
|
},
|
|
|
{
|
|
|
prop: "pc_num",
|
|
|
@@ -437,14 +558,13 @@ export default defineComponent({
|
|
|
{
|
|
|
prop: "rent_duration",
|
|
|
label: "租机时常",
|
|
|
- sortable: "true",
|
|
|
headerAlign: "left",
|
|
|
align: "left",
|
|
|
- minWidth: 120
|
|
|
+ minWidth: 80
|
|
|
},
|
|
|
{
|
|
|
prop: "rent_price",
|
|
|
- label: "租机价格",
|
|
|
+ label: "价格标准",
|
|
|
sortable: "true",
|
|
|
headerAlign: "left",
|
|
|
align: "left",
|
|
|
@@ -552,20 +672,75 @@ export default defineComponent({
|
|
|
}
|
|
|
// 续费
|
|
|
async function renew(rowData) {}
|
|
|
+ // 拉起退租弹窗
|
|
|
+ async function switchRentingOut(rowData: any) {
|
|
|
+ cardList.value = [];
|
|
|
+ rentingOutForm.pc_num = rowData.pc_num;
|
|
|
+ rentingOutForm.pc_id = rowData.id;
|
|
|
+ rentingOutForm.rent_end = rowData.rent_end;
|
|
|
+ if (visible_rentingOut.value == false) {
|
|
|
+ visible_rentingOut.value = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ function addCardMsg() {
|
|
|
+ let hasFlag = false;
|
|
|
+ for (let i = 0; i < cardList.value.length; i++) {
|
|
|
+ if (cardList.value[i].pc_id == "" || cardList.value[i].add_day == "") {
|
|
|
+ hasFlag = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (hasFlag == true) {
|
|
|
+ ElMessage.error("有未填写项");
|
|
|
+ } else {
|
|
|
+ cardList.value.push({
|
|
|
+ pc_id: "",
|
|
|
+ add_day: ""
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ function deleteCardMsg(index: number) {
|
|
|
+ cardList.value.splice(index, 1);
|
|
|
+ }
|
|
|
// 退租
|
|
|
- async function rentingOut(rowData: any) {}
|
|
|
+ async function rentingOut(rowData: any) {
|
|
|
+ let doForm = {
|
|
|
+ pc_num: rowData.pc_num,
|
|
|
+ pc_id: rowData.pc_id,
|
|
|
+ rent_end: rowData.rent_end,
|
|
|
+ addList: cardList.value
|
|
|
+ };
|
|
|
+ service.shuyouRentComputer
|
|
|
+ .rentingOut(doForm)
|
|
|
+ .then((data: any) => {
|
|
|
+ console.log(data);
|
|
|
+ if (data.code == 1) {
|
|
|
+ visible_rentingOut.value = false;
|
|
|
+ ElMessage.success(data.message);
|
|
|
+ } else {
|
|
|
+ ElMessage.error(data.message);
|
|
|
+ }
|
|
|
+ // console.log('刷新页面')
|
|
|
+ refs.value.crud.refresh();
|
|
|
+ })
|
|
|
+ .catch((err: string) => {
|
|
|
+ ElMessage.error(err);
|
|
|
+ });
|
|
|
+ }
|
|
|
// 拉起换编号弹窗
|
|
|
async function switchReplaceNum(rowData: any) {
|
|
|
replaceNumForm.pc_num_old = rowData.pc_num;
|
|
|
replaceNumForm.shop_id = rowData.shop_id;
|
|
|
replaceNumForm.rent_duration = rowData.rent_duration;
|
|
|
replaceNumForm.rent_end = rowData.rent_end;
|
|
|
+ replaceNumForm.set_meal = rowData.set_meal;
|
|
|
+ replaceNumForm.price_type = rowData.price_type;
|
|
|
replaceNumForm.rent_price = rowData.rent_price;
|
|
|
replaceNumForm.rent_price_day = rowData.rent_price_day;
|
|
|
replaceNumForm.pay_method = rowData.pay_method;
|
|
|
replaceNumForm.rent_person_id = rowData.rent_person_id;
|
|
|
- if (visible.value == false) {
|
|
|
- visible.value = true;
|
|
|
+ if (visible_replaceNum.value == false) {
|
|
|
+ visible_replaceNum.value = true;
|
|
|
}
|
|
|
}
|
|
|
// 换编
|
|
|
@@ -576,6 +751,8 @@ export default defineComponent({
|
|
|
shop_id: rowData.shop_id,
|
|
|
rent_duration: rowData.rent_duration,
|
|
|
rent_end: rowData.rent_end,
|
|
|
+ set_meal: rowData.set_meal,
|
|
|
+ price_type: rowData.price_type,
|
|
|
rent_price: rowData.rent_price,
|
|
|
rent_price_day: rowData.rent_price_day,
|
|
|
pay_method: rowData.pay_method,
|
|
|
@@ -587,7 +764,7 @@ export default defineComponent({
|
|
|
.then((data: any) => {
|
|
|
// console.log(data);
|
|
|
if (data.code == 1) {
|
|
|
- visible.value = false;
|
|
|
+ visible_replaceNum.value = false;
|
|
|
ElMessage.success(data.message);
|
|
|
} else {
|
|
|
ElMessage.error(data.message);
|
|
|
@@ -628,9 +805,22 @@ export default defineComponent({
|
|
|
replaceNum,
|
|
|
deleteNum,
|
|
|
switchReplaceNum,
|
|
|
- visible,
|
|
|
- replaceNumForm
|
|
|
+ switchRentingOut,
|
|
|
+ visible_replaceNum,
|
|
|
+ visible_rentingOut,
|
|
|
+ replaceNumForm,
|
|
|
+ rentingOutForm,
|
|
|
+ addCardMsg,
|
|
|
+ deleteCardMsg,
|
|
|
+ cardList
|
|
|
};
|
|
|
}
|
|
|
});
|
|
|
</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.container-scrollbar {
|
|
|
+ border: 1px solid #dcdde0;
|
|
|
+ padding-top: 20px;
|
|
|
+ border-radius: 3px;
|
|
|
+}
|
|
|
+</style>
|