|
@@ -22,7 +22,11 @@
|
|
>
|
|
>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
- <div class="mt-5" style="text-align: center" v-if="personnelList.length==0">
|
|
|
|
|
|
+ <div
|
|
|
|
+ class="mt-5"
|
|
|
|
+ style="text-align: center"
|
|
|
|
+ v-if="personnelList.length == 0"
|
|
|
|
+ >
|
|
请至少添加一名加油员,否则小程序无法进行支付~
|
|
请至少添加一名加油员,否则小程序无法进行支付~
|
|
</div>
|
|
</div>
|
|
<el-table :data="personnelList" v-else>
|
|
<el-table :data="personnelList" v-else>
|
|
@@ -45,6 +49,7 @@
|
|
label="操作"
|
|
label="操作"
|
|
align="center"
|
|
align="center"
|
|
class-name="small-padding fixed-width"
|
|
class-name="small-padding fixed-width"
|
|
|
|
+ width="200"
|
|
>
|
|
>
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-button
|
|
<el-button
|
|
@@ -61,6 +66,13 @@
|
|
@click="handleDelete(scope.row)"
|
|
@click="handleDelete(scope.row)"
|
|
>删除</el-button
|
|
>删除</el-button
|
|
>
|
|
>
|
|
|
|
+ <el-button
|
|
|
|
+ size="mini"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="el-icon-download"
|
|
|
|
+ @click="exportQr(scope.row)"
|
|
|
|
+ >导出加油员码</el-button
|
|
|
|
+ >
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -76,7 +88,10 @@
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
<el-form-item label="姓名" prop="personnelName">
|
|
<el-form-item label="姓名" prop="personnelName">
|
|
- <el-input v-model="form.personnelName" placeholder="请输入加油员姓名" />
|
|
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="form.personnelName"
|
|
|
|
+ placeholder="请输入加油员姓名"
|
|
|
|
+ />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="负责枪号" prop="checkedGunList">
|
|
<el-form-item label="负责枪号" prop="checkedGunList">
|
|
<template v-if="allGunList.length === 0">
|
|
<template v-if="allGunList.length === 0">
|
|
@@ -109,7 +124,13 @@
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
|
<el-dialog
|
|
<el-dialog
|
|
- :title="personnelList.length == 0 ? '添加加油员须知' : personnelList.length == 1 ? '添加加油员确认' : '删除加油员确认'"
|
|
|
|
|
|
+ :title="
|
|
|
|
+ personnelList.length == 0
|
|
|
|
+ ? '添加加油员须知'
|
|
|
|
+ : personnelList.length == 1
|
|
|
|
+ ? '添加加油员确认'
|
|
|
|
+ : '删除加油员确认'
|
|
|
|
+ "
|
|
:visible.sync="confirmDialog"
|
|
:visible.sync="confirmDialog"
|
|
width="500px"
|
|
width="500px"
|
|
append-to-body
|
|
append-to-body
|
|
@@ -120,10 +141,15 @@
|
|
1、请至少添加一名加油员,否则小程序无法进行支付。
|
|
1、请至少添加一名加油员,否则小程序无法进行支付。
|
|
</div>
|
|
</div>
|
|
<div style="color: red; font-size: 12px; text-indent: 2em" class="mt-2">
|
|
<div style="color: red; font-size: 12px; text-indent: 2em" class="mt-2">
|
|
- 2、当您只添加 【<b>一名加油员</b>】 :小程序采取开放模式(即用户<b>可以不通过扫加油员码进入</b>),小程序会拉取该加油员所管理的油枪,用户产生的订单全部算在该加油员的名下。
|
|
|
|
|
|
+ 2、当您只添加 【<b>一名加油员</b>】
|
|
|
|
+ :小程序采取开放模式(即用户<b>可以不通过扫加油员码进入</b>),小程序会拉取该加油员所管理的油枪,用户产生的订单全部算在该加油员的名下。
|
|
</div>
|
|
</div>
|
|
- <div style="color: red; font-size: 12px; text-indent: 2em" class="mt-2 mb-3">
|
|
|
|
- 3、当您添加了 【<b>多名加油员</b>】 :小程序采取限制模式(即<b>只能够通过扫加油员码进入</b>),小程序会拉取对应加油员码下的加油员所管理的油枪,用户扫加油员码产生的订单算在对应加油员的名下。
|
|
|
|
|
|
+ <div
|
|
|
|
+ style="color: red; font-size: 12px; text-indent: 2em"
|
|
|
|
+ class="mt-2 mb-3"
|
|
|
|
+ >
|
|
|
|
+ 3、当您添加了 【<b>多名加油员</b>】
|
|
|
|
+ :小程序采取限制模式(即<b>只能够通过扫加油员码进入</b>),小程序会拉取对应加油员码下的加油员所管理的油枪,用户扫加油员码产生的订单算在对应加油员的名下。
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="m-2" v-else-if="personnelList.length == 1">
|
|
<div class="m-2" v-else-if="personnelList.length == 1">
|
|
@@ -151,7 +177,9 @@
|
|
</div>
|
|
</div>
|
|
<div class="m-2" v-else-if="personnelList.length == 2">
|
|
<div class="m-2" v-else-if="personnelList.length == 2">
|
|
<div>您目前有两名加油员,订单会根据加油员码计入加油员名下。</div>
|
|
<div>您目前有两名加油员,订单会根据加油员码计入加油员名下。</div>
|
|
- <div>您正在删除一名加油员,操作成功之后,<b>系统将发生以下变化:</b></div>
|
|
|
|
|
|
+ <div>
|
|
|
|
+ 您正在删除一名加油员,操作成功之后,<b>系统将发生以下变化:</b>
|
|
|
|
+ </div>
|
|
<div style="color: red; font-size: 12px; text-indent: 2em" class="mt-4">
|
|
<div style="color: red; font-size: 12px; text-indent: 2em" class="mt-4">
|
|
1、小程序端会开放用户进入的方式,用户可以通过多种方式进入小程序进行支付。
|
|
1、小程序端会开放用户进入的方式,用户可以通过多种方式进入小程序进行支付。
|
|
</div>
|
|
</div>
|
|
@@ -169,11 +197,16 @@
|
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
<el-button
|
|
<el-button
|
|
- :type="personnelList.length == 0 || personnelList.length == 1 ? 'primary' : 'danger'"
|
|
|
|
|
|
+ :type="
|
|
|
|
+ personnelList.length == 0 || personnelList.length == 1
|
|
|
|
+ ? 'primary'
|
|
|
|
+ : 'danger'
|
|
|
|
+ "
|
|
@click="confirmSubmit"
|
|
@click="confirmSubmit"
|
|
>{{
|
|
>{{
|
|
- personnelList.length == 0 ? '我知道了~':
|
|
|
|
- personnelList.length == 1
|
|
|
|
|
|
+ personnelList.length == 0
|
|
|
|
+ ? "我知道了~"
|
|
|
|
+ : personnelList.length == 1
|
|
? "我已经了解,继续添加加油员"
|
|
? "我已经了解,继续添加加油员"
|
|
: "我已经了解,确认删除该加油员"
|
|
: "我已经了解,确认删除该加油员"
|
|
}}</el-button
|
|
}}</el-button
|
|
@@ -181,6 +214,24 @@
|
|
<el-button @click="confirmCancel">取 消</el-button>
|
|
<el-button @click="confirmCancel">取 消</el-button>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
+
|
|
|
|
+ <el-dialog
|
|
|
|
+ :visible.sync="exportQrDialog"
|
|
|
|
+ width="600px"
|
|
|
|
+ append-to-body
|
|
|
|
+ title="导出标签"
|
|
|
|
+ >
|
|
|
|
+ <div>
|
|
|
|
+ <qr text="121111" @downloadImg="downloadImg" name="员工码">
|
|
|
|
+ <div>员工码:{{ this.currentExport.personnelName }}</div>
|
|
|
|
+ <div >负责枪号:
|
|
|
|
+ <span v-for="ele in currentExport.checkedGunList" :key="ele">
|
|
|
|
+ {{ ele + '号枪-' + transferGunnumToOilname(ele) + " "}}
|
|
|
|
+ </span>
|
|
|
|
+ </div>
|
|
|
|
+ </qr>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -195,6 +246,10 @@ import {
|
|
} from "@/api/station/personnel";
|
|
} from "@/api/station/personnel";
|
|
import { stationinfo, listGun } from "@/api/station/gun";
|
|
import { stationinfo, listGun } from "@/api/station/gun";
|
|
import { getDept } from "@/api/system/dept";
|
|
import { getDept } from "@/api/system/dept";
|
|
|
|
+import Base64 from "@/utils/base64";
|
|
|
|
+import vueQr from "vue-qr";
|
|
|
|
+import qr from "@/components/QrCode";
|
|
|
|
+
|
|
export default {
|
|
export default {
|
|
name: "Station_Employee",
|
|
name: "Station_Employee",
|
|
data() {
|
|
data() {
|
|
@@ -240,13 +295,27 @@ export default {
|
|
pageStatus: 0,
|
|
pageStatus: 0,
|
|
confirmDialog: false,
|
|
confirmDialog: false,
|
|
deletePersonnelId: undefined,
|
|
deletePersonnelId: undefined,
|
|
|
|
+ exportQrDialog: false,
|
|
|
|
+ qrStr: "",
|
|
|
|
+ currentExport: {},
|
|
};
|
|
};
|
|
},
|
|
},
|
|
|
|
+ components: {
|
|
|
|
+ vueQr,
|
|
|
|
+ qr,
|
|
|
|
+ },
|
|
created() {
|
|
created() {
|
|
|
|
+ const base = new Base64();
|
|
|
|
+ const a = base.encode("12李哈哈");
|
|
|
|
+ console.log("加密", a);
|
|
|
|
+ console.log("解密", base.decode(a));
|
|
this.init();
|
|
this.init();
|
|
this.setPageStatus();
|
|
this.setPageStatus();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ downloadImg() {
|
|
|
|
+ this.msgSuccess("导出成功~");
|
|
|
|
+ },
|
|
/** 查询油站加油员信息列表 */
|
|
/** 查询油站加油员信息列表 */
|
|
getList() {
|
|
getList() {
|
|
listPersonnel(this.queryParams).then((response) => {
|
|
listPersonnel(this.queryParams).then((response) => {
|
|
@@ -286,6 +355,7 @@ export default {
|
|
stationId: this.deptId,
|
|
stationId: this.deptId,
|
|
}).then((response) => {
|
|
}).then((response) => {
|
|
this.allGunList = response.rows;
|
|
this.allGunList = response.rows;
|
|
|
|
+ console.log('this.allGunList',this.allGunList);
|
|
});
|
|
});
|
|
},
|
|
},
|
|
// 取消按钮
|
|
// 取消按钮
|
|
@@ -365,21 +435,22 @@ export default {
|
|
this.deletePersonnelId = row.personnelId;
|
|
this.deletePersonnelId = row.personnelId;
|
|
if (this.personnelList.length == 2) {
|
|
if (this.personnelList.length == 2) {
|
|
this.confirmDialog = true;
|
|
this.confirmDialog = true;
|
|
-
|
|
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
this.$confirm("是否确认删除油站加油员信息", "警告", {
|
|
this.$confirm("是否确认删除油站加油员信息", "警告", {
|
|
confirmButtonText: "确定",
|
|
confirmButtonText: "确定",
|
|
cancelButtonText: "取消",
|
|
cancelButtonText: "取消",
|
|
type: "warning",
|
|
type: "warning",
|
|
- }).then( ()=> {
|
|
|
|
|
|
+ }).then(() => {
|
|
console.log(123);
|
|
console.log(123);
|
|
- delPersonnel(this.deletePersonnelId).then(() => {
|
|
|
|
- this.getList();
|
|
|
|
- this.msgSuccess("删除成功~");
|
|
|
|
- }).catch(() => {
|
|
|
|
- this.msgError("删除失败~");
|
|
|
|
- });
|
|
|
|
|
|
+ delPersonnel(this.deletePersonnelId)
|
|
|
|
+ .then(() => {
|
|
|
|
+ this.getList();
|
|
|
|
+ this.msgSuccess("删除成功~");
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {
|
|
|
|
+ this.msgError("删除失败~");
|
|
|
|
+ });
|
|
});
|
|
});
|
|
},
|
|
},
|
|
/** 导出按钮操作 */
|
|
/** 导出按钮操作 */
|
|
@@ -397,6 +468,32 @@ export default {
|
|
this.download(response.msg);
|
|
this.download(response.msg);
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ exportQr(row) {
|
|
|
|
+ this.currentExport = JSON.parse(JSON.stringify(row));
|
|
|
|
+ if (row.gunNo !== null) {
|
|
|
|
+ this.currentExport.checkedGunList = [
|
|
|
|
+ ...new Set(row.gunNo.split(",")),
|
|
|
|
+ ].filter((ele) => {
|
|
|
|
+ return ele.toString().trim() !== "";
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ this.currentExport.checkedGunList = [];
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const base = new Base64();
|
|
|
|
+ const encodeStr = "e" + row.personnelId + "/";
|
|
|
|
+ const encodedStr = base.encode(encodeStr);
|
|
|
|
+ const trimEqualStr = encodedStr.replace(/={1,}$/g, "");
|
|
|
|
+ console.log(base.decode(trimEqualStr));
|
|
|
|
+ this.qrStr = "https://goto.huijy.net/" + this.deptId + "/" + trimEqualStr;
|
|
|
|
+ this.exportQrDialog = true;
|
|
|
|
+ },
|
|
|
|
+ transferGunnumToOilname(gunNo){
|
|
|
|
+ const gun = this.allGunList.find((ele)=>{
|
|
|
|
+ return ele.oilGunNo == gunNo;
|
|
|
|
+ })
|
|
|
|
+ return gun.oilName
|
|
|
|
+ }
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|