|
@@ -1,284 +1,369 @@
|
|
|
<template>
|
|
|
- <el-container direction="vertical">
|
|
|
+<el-container direction="vertical">
|
|
|
<el-header height="40px" style="border-bottom: 1px solid #eee">
|
|
|
- <div style="float:left;">柜体控制</div>
|
|
|
- <div style="float:right;height:40px;">
|
|
|
- <el-dropdown>
|
|
|
- <span class="el-dropdown-link">
|
|
|
- 柜体操作
|
|
|
- <i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
- </span>
|
|
|
- <el-dropdown-menu slot="dropdown">
|
|
|
- <el-dropdown-item icon="el-icon-lock" style="color:red;">锁柜</el-dropdown-item>
|
|
|
- <el-dropdown-item icon="el-icon-unlock">解除锁柜</el-dropdown-item>
|
|
|
- <el-dropdown-item icon="el-icon-warning">解除报警</el-dropdown-item>
|
|
|
- <el-dropdown-item icon="el-icon-refresh-left" style="color:#409EFF;">重启</el-dropdown-item>
|
|
|
- </el-dropdown-menu>
|
|
|
- </el-dropdown>
|
|
|
- </div>
|
|
|
+ <div style="float:left;">柜体控制</div>
|
|
|
+ <div style="float:right;height:40px;">
|
|
|
+ <el-dropdown>
|
|
|
+ <span class="el-dropdown-link">
|
|
|
+ 柜体操作
|
|
|
+ <i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
+ </span>
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <el-dropdown-item icon="el-icon-lock" style="color:red;">锁柜</el-dropdown-item>
|
|
|
+ <el-dropdown-item icon="el-icon-unlock">解除锁柜</el-dropdown-item>
|
|
|
+ <el-dropdown-item icon="el-icon-warning">解除报警</el-dropdown-item>
|
|
|
+ <el-dropdown-item icon="el-icon-refresh-left" style="color:#409EFF;">重启</el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
+ </div>
|
|
|
</el-header>
|
|
|
|
|
|
- <el-tabs
|
|
|
- type="card"
|
|
|
- v-model="tabActive"
|
|
|
- style="margin-top:10px;"
|
|
|
- :before-leave="onBeforeChangeTab"
|
|
|
- @tab-click="onTabClick"
|
|
|
- >
|
|
|
- <template v-for="(item,index) in cabinetList">
|
|
|
- <el-tab-pane :label="item.alias" :key="index" :name="item.id">
|
|
|
- <div>
|
|
|
- <el-row justify="space-around" :gutter="10">
|
|
|
- <template v-for="(v,k) in boxList[index]">
|
|
|
- <el-col :span="6" :key="k">
|
|
|
- <el-card class="box-card">
|
|
|
- <div slot="header" class="clearfix">
|
|
|
- <span>{{v.box_number}}号箱 已{{v.status_text}}</span>
|
|
|
- <el-dropdown>
|
|
|
- <span class="el-dropdown-link">
|
|
|
- 箱子操作
|
|
|
- <i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
- </span>
|
|
|
- <el-dropdown-menu slot="dropdown">
|
|
|
- <el-dropdown-item icon="el-icon-unlock" style="color:#409EFF;" disabled>开箱</el-dropdown-item>
|
|
|
- </el-dropdown-menu>
|
|
|
- </el-dropdown>
|
|
|
- </div>
|
|
|
-
|
|
|
-<!-- <div style="height:72px;">
|
|
|
+ <el-tabs type="card" v-model="tabActive" style="margin-top:10px;" :before-leave="onBeforeChangeTab" @tab-click="onTabClick">
|
|
|
+ <template v-for="(item,index) in cabinetList">
|
|
|
+ <el-tab-pane :label="item.alias" :key="index" :name="item.id">
|
|
|
+ <div>
|
|
|
+ <el-row justify="space-around" :gutter="10">
|
|
|
+ <template v-for="(v,k) in boxList[index]">
|
|
|
+ <el-col :span="6" :key="k">
|
|
|
+ <el-card class="box-card">
|
|
|
+ <div slot="header" class="clearfix">
|
|
|
+ <span>
|
|
|
+ {{v.box_number}}号箱
|
|
|
+ <el-tag size="mini">已{{v.status_text}}</el-tag>
|
|
|
+ </span>
|
|
|
+ <el-dropdown @command="command=>onHandleBox(command,v.cabinet_number,v.box_number,v.order_sn)">
|
|
|
+ <span class="el-dropdown-link">
|
|
|
+ 操作
|
|
|
+ <i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
+ </span>
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <el-dropdown-item icon="el-icon-unlock" style="color:red;" command="openBox">开箱</el-dropdown-item>
|
|
|
+ <el-dropdown-item icon="el-icon-phone-outline" style="color:#409EFF;" command="inform" :disabled="v.order_sn == ''">通知</el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- <div style="height:72px;">
|
|
|
<el-row type="flex" align="middle" style="height:100%;">
|
|
|
<el-tag effect="dark">箱子已{{v.status_text}}</el-tag>
|
|
|
</el-row>
|
|
|
- </div> -->
|
|
|
- <el-row type="flex" justify="space-between" v-if="v.order_sn == ''">
|
|
|
- <h4>空闲中</h4>
|
|
|
- </el-row>
|
|
|
+ </div>-->
|
|
|
+ <el-row type="flex" justify="space-between" v-if="v.order_sn == ''">
|
|
|
+ <div style="height:72px;">
|
|
|
+ <h4>空闲中</h4>
|
|
|
+ </div>
|
|
|
+ </el-row>
|
|
|
|
|
|
- <el-row type="flex" justify="space-between" v-if="v.order_sn != ''">
|
|
|
-<!-- <el-row type="flex" align="middle">
|
|
|
+ <el-row type="flex" justify="space-between" v-if="v.order_sn != ''">
|
|
|
+ <!-- <el-row type="flex" align="middle">
|
|
|
<el-tag type="danger" effect="dark">{{v.status_text}}</el-tag>
|
|
|
- </el-row> -->
|
|
|
- <div style="height:72px;">
|
|
|
- <h4>
|
|
|
- 订单号:{{v.order_sn}}
|
|
|
- <el-button style="margin-left:10px;" size="mini" type="primary">通知</el-button>
|
|
|
- </h4>
|
|
|
- <h4>入柜日期:{{v.enter_time}}</h4>
|
|
|
- <h4>已使用:{{v.use_time}}</h4>
|
|
|
- </div>
|
|
|
- </el-row>
|
|
|
+ </el-row>-->
|
|
|
+ <div style="height:72px;">
|
|
|
+ <h4>
|
|
|
+ 订单号:{{v.order_sn}}
|
|
|
+ <!-- <el-button style="margin-left:10px;" size="mini" type="primary">通知</el-button> -->
|
|
|
+ </h4>
|
|
|
+ <h4>入柜日期:{{v.enter_time}}</h4>
|
|
|
+ <h4>已使用:{{v.use_time}}</h4>
|
|
|
+ </div>
|
|
|
+ </el-row>
|
|
|
|
|
|
- <div style="height:72px;" v-if="v.box_status == 3">
|
|
|
- <el-row type="flex" align="middle" style="height:100%;">
|
|
|
- <el-tag type="info" effect="dark">{{v.status_text}}</el-tag>
|
|
|
- </el-row>
|
|
|
- </div>
|
|
|
- </el-card>
|
|
|
- </el-col>
|
|
|
- </template>
|
|
|
- <el-col :span="6">
|
|
|
- <el-card class="box-card">
|
|
|
- <div slot="header" class="clearfix">
|
|
|
- <span>新增箱子</span>
|
|
|
- </div>
|
|
|
- <div style="height:72px;">
|
|
|
- <el-row type="flex" align="middle" style="height:100%;">
|
|
|
- <el-button type="primary">新增</el-button>
|
|
|
+ <!-- <div style="height:72px;" v-if="v.box_status == 3">
|
|
|
+ <el-row type="flex" align="middle" style="height:100%;">
|
|
|
+ <el-tag type="info" effect="dark">{{v.status_text}}</el-tag>
|
|
|
+ </el-row>
|
|
|
+ </div>-->
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+ </template>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-card class="box-card">
|
|
|
+ <div slot="header" class="clearfix">
|
|
|
+ <span>新增箱子</span>
|
|
|
+ </div>
|
|
|
+ <div style="height:72px;">
|
|
|
+ <el-row type="flex" align="middle" style="height:100%;">
|
|
|
+ <el-button type="primary">新增</el-button>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
- </div>
|
|
|
- </el-card>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
|
|
|
- <!-- <el-row style="margin-top:10px;" type="flex" justify="end">
|
|
|
+ <!-- <el-row style="margin-top:10px;" type="flex" justify="end">
|
|
|
<el-pagination background layout="prev, pager, next" :total="30"></el-pagination>
|
|
|
</el-row>
|
|
|
-->
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
+ </el-tab-pane>
|
|
|
+ </template>
|
|
|
+ <el-tab-pane name="add">
|
|
|
+ <span slot="label">
|
|
|
+ <i class="el-icon-plus">新增</i>
|
|
|
+ </span>
|
|
|
</el-tab-pane>
|
|
|
- </template>
|
|
|
- <el-tab-pane name="add">
|
|
|
- <span slot="label">
|
|
|
- <i class="el-icon-plus">新增</i>
|
|
|
- </span>
|
|
|
- </el-tab-pane>
|
|
|
</el-tabs>
|
|
|
|
|
|
<el-dialog title="新增柜体" :visible.sync="addVisible" width="50%" @closed="onCloseAddDialog">
|
|
|
- <el-form
|
|
|
- :model="ruleForm"
|
|
|
- :rules="rules"
|
|
|
- ref="ruleForm"
|
|
|
- label-width="120px"
|
|
|
- class="demo-ruleForm"
|
|
|
- >
|
|
|
- <el-form-item label="请求地址" prop="requrl">
|
|
|
- <el-input v-model="ruleForm.requrl"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="柜子名称" prop="alias">
|
|
|
- <el-input v-model="ruleForm.alias"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="柜子编号" prop="number">
|
|
|
- <el-input v-model="ruleForm.number"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="柜子登录key" prop="login_key">
|
|
|
- <el-input v-model="ruleForm.login_key"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="箱子个数" prop="count">
|
|
|
- <el-input v-model="ruleForm.count"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="onCloseAddDialog">取 消</el-button>
|
|
|
- <el-button type="primary" @click="onAddSubmit('ruleForm')">立即添加</el-button>
|
|
|
- </span>
|
|
|
+ <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px" class="demo-ruleForm">
|
|
|
+ <el-form-item label="请求地址" prop="requrl">
|
|
|
+ <el-input v-model="ruleForm.requrl"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="柜子名称" prop="alias">
|
|
|
+ <el-input v-model="ruleForm.alias"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="柜子编号" prop="number">
|
|
|
+ <el-input v-model="ruleForm.number"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="柜子登录key" prop="login_key">
|
|
|
+ <el-input v-model="ruleForm.login_key"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="箱子个数" prop="count">
|
|
|
+ <el-input v-model="ruleForm.count"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="onCloseAddDialog">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="onAddSubmit('ruleForm')">立即添加</el-button>
|
|
|
+ </span>
|
|
|
</el-dialog>
|
|
|
- </el-container>
|
|
|
+</el-container>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { cabinetList, boxList, addCabinet, reboot } from "@/api";
|
|
|
+import {
|
|
|
+ cabinetList,
|
|
|
+ boxList,
|
|
|
+ addCabinet,
|
|
|
+ reboot,
|
|
|
+ openBox,
|
|
|
+ sendMsg,
|
|
|
+} from "@/api";
|
|
|
import moment from "moment";
|
|
|
export default {
|
|
|
- data() {
|
|
|
- return {
|
|
|
- tabActive: "",
|
|
|
- addVisible: false,
|
|
|
- ruleForm: {
|
|
|
- requrl: "",
|
|
|
- alias: "",
|
|
|
- number: "",
|
|
|
- login_key: "",
|
|
|
- count: "",
|
|
|
- },
|
|
|
- rules: {
|
|
|
- requrl: [
|
|
|
- { required: true, message: "请输入请求地址", trigger: "blur" },
|
|
|
- ],
|
|
|
- alias: [{ required: true, message: "请输入柜子名称", trigger: "blur" }],
|
|
|
- number: [
|
|
|
- { required: true, message: "请输入柜子编号", trigger: "blur" },
|
|
|
- ],
|
|
|
- login_key: [
|
|
|
- { required: true, message: "请输入柜子登录key", trigger: "blur" },
|
|
|
- ],
|
|
|
- count: [{ required: true, message: "请输入箱子个数", trigger: "blur" }],
|
|
|
- },
|
|
|
- cabinetList: [],
|
|
|
- boxList: [],
|
|
|
- currentCabinetState: {},
|
|
|
- };
|
|
|
- },
|
|
|
- computed: {
|
|
|
- diffTime() {
|
|
|
- return (date) => {
|
|
|
- const currentTime = moment();
|
|
|
- const startDate = moment(date);
|
|
|
- const date3 = currentTime.diff(startDate, "minute"); //计算相差的分钟数
|
|
|
- const h = Math.floor(date3 / 60); //相差的小时数
|
|
|
- const mm = date3 % 60; //计算相差小时后余下的分钟数
|
|
|
- return `${h}小时${mm}分钟`;
|
|
|
- };
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ tabActive: "",
|
|
|
+ addVisible: false,
|
|
|
+ ruleForm: {
|
|
|
+ requrl: "",
|
|
|
+ alias: "",
|
|
|
+ number: "",
|
|
|
+ login_key: "",
|
|
|
+ count: "",
|
|
|
+ },
|
|
|
+ rules: {
|
|
|
+ requrl: [{
|
|
|
+ required: true,
|
|
|
+ message: "请输入请求地址",
|
|
|
+ trigger: "blur",
|
|
|
+ }, ],
|
|
|
+ alias: [{
|
|
|
+ required: true,
|
|
|
+ message: "请输入柜子名称",
|
|
|
+ trigger: "blur",
|
|
|
+ }, ],
|
|
|
+ number: [{
|
|
|
+ required: true,
|
|
|
+ message: "请输入柜子编号",
|
|
|
+ trigger: "blur",
|
|
|
+ }, ],
|
|
|
+ login_key: [{
|
|
|
+ required: true,
|
|
|
+ message: "请输入柜子登录key",
|
|
|
+ trigger: "blur",
|
|
|
+ }, ],
|
|
|
+ count: [{
|
|
|
+ required: true,
|
|
|
+ message: "请输入箱子个数",
|
|
|
+ trigger: "blur",
|
|
|
+ }, ],
|
|
|
+ },
|
|
|
+ cabinetList: [],
|
|
|
+ boxList: [],
|
|
|
+ currentCabinetState: {},
|
|
|
+ };
|
|
|
},
|
|
|
- },
|
|
|
- created() {
|
|
|
- this.getCabinetList();
|
|
|
- },
|
|
|
- methods: {
|
|
|
- getReboot(cabinetId) {
|
|
|
- reboot({ cabinet_number: cabinetId }).then((res) => {
|
|
|
- console.log(888, res);
|
|
|
- });
|
|
|
- },
|
|
|
- getCabinetList() {
|
|
|
- cabinetList().then((res) => {
|
|
|
- console.log(res);
|
|
|
- if (res && res.msg == "ok") {
|
|
|
- this.cabinetList = res.data.rows.map((item) => {
|
|
|
- item.id = item.id + "";
|
|
|
- return item;
|
|
|
- });
|
|
|
-
|
|
|
- this.boxList = res.data.rows.map(() => {
|
|
|
- return [];
|
|
|
- });
|
|
|
- this.getBoxList(res.data.rows[0].id, 0);
|
|
|
- this.getReboot(res.data.rows[0].id);
|
|
|
- this.tabActive = res.data.rows[0].id + "";
|
|
|
- console.log(this.tabActive);
|
|
|
- }
|
|
|
- });
|
|
|
+ computed: {
|
|
|
+ diffTime() {
|
|
|
+ return (date) => {
|
|
|
+ const currentTime = moment();
|
|
|
+ const startDate = moment(date);
|
|
|
+ const date3 = currentTime.diff(startDate, "minute"); //计算相差的分钟数
|
|
|
+ const h = Math.floor(date3 / 60); //相差的小时数
|
|
|
+ const mm = date3 % 60; //计算相差小时后余下的分钟数
|
|
|
+ return `${h}小时${mm}分钟`;
|
|
|
+ };
|
|
|
+ },
|
|
|
},
|
|
|
- getBoxList(id, cabinetIndex) {
|
|
|
- const _self = this;
|
|
|
- boxList({ cabinet_number: id }).then((res) => {
|
|
|
- console.log(res);
|
|
|
- if (res && res.data.rows) {
|
|
|
- let boxList = [..._self.boxList];
|
|
|
- boxList[cabinetIndex] = res.data.rows;
|
|
|
- _self.boxList = boxList;
|
|
|
- }
|
|
|
- });
|
|
|
+ created() {
|
|
|
+ this.getCabinetList();
|
|
|
},
|
|
|
- onCloseAddDialog() {
|
|
|
- this.ruleForm = {};
|
|
|
- this.addVisible = false;
|
|
|
- this.$refs.ruleForm.resetFields();
|
|
|
- },
|
|
|
- onBeforeChangeTab(activeName) {
|
|
|
- if (activeName == "add") {
|
|
|
- this.addVisible = true;
|
|
|
- return false;
|
|
|
- }
|
|
|
- },
|
|
|
- onAddSubmit(formName) {
|
|
|
- this.$refs[formName].validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- this.addCabinet();
|
|
|
- } else {
|
|
|
- console.log("error submit!!");
|
|
|
- return false;
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- addCabinet() {
|
|
|
- let requrl = "";
|
|
|
- let alias = "";
|
|
|
- let number = "";
|
|
|
- let login_key = "";
|
|
|
- let count = "";
|
|
|
- addCabinet(requrl, alias, number, login_key, count).then((res) => {
|
|
|
- console.log(res);
|
|
|
- if (res && res.msg == "ok") {
|
|
|
- this.getCabinetList();
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- onTabClick(e) {
|
|
|
- if (e.name != "add") {
|
|
|
- this.getBoxList(e.name, e.index);
|
|
|
- }
|
|
|
+ methods: {
|
|
|
+ getReboot(cabinetId) {
|
|
|
+ reboot({
|
|
|
+ cabinet_number: cabinetId,
|
|
|
+ }).then((res) => {
|
|
|
+ console.log(888, res);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getCabinetList() {
|
|
|
+ cabinetList().then((res) => {
|
|
|
+ console.log(res);
|
|
|
+ if (res && res.msg == "ok") {
|
|
|
+ this.cabinetList = res.data.rows.map((item) => {
|
|
|
+ item.id = item.id + "";
|
|
|
+ return item;
|
|
|
+ });
|
|
|
+
|
|
|
+ this.boxList = res.data.rows.map(() => {
|
|
|
+ return [];
|
|
|
+ });
|
|
|
+ this.getBoxList(res.data.rows[0].id, 0);
|
|
|
+ this.getReboot(res.data.rows[0].id);
|
|
|
+ this.tabActive = res.data.rows[0].id + "";
|
|
|
+ console.log(this.tabActive);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getBoxList(id, cabinetIndex) {
|
|
|
+ const _self = this;
|
|
|
+ boxList({
|
|
|
+ cabinet_number: id,
|
|
|
+ }).then((res) => {
|
|
|
+ console.log(res);
|
|
|
+ if (res && res.data.rows) {
|
|
|
+ let boxList = [..._self.boxList];
|
|
|
+ boxList[cabinetIndex] = res.data.rows;
|
|
|
+ _self.boxList = boxList;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ onCloseAddDialog() {
|
|
|
+ this.ruleForm = {};
|
|
|
+ this.addVisible = false;
|
|
|
+ this.$refs.ruleForm.resetFields();
|
|
|
+ },
|
|
|
+ onBeforeChangeTab(activeName) {
|
|
|
+ if (activeName == "add") {
|
|
|
+ this.addVisible = true;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onAddSubmit(formName) {
|
|
|
+ this.$refs[formName].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this.addCabinet();
|
|
|
+ } else {
|
|
|
+ console.log("error submit!!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ addCabinet() {
|
|
|
+ let requrl = "";
|
|
|
+ let alias = "";
|
|
|
+ let number = "";
|
|
|
+ let login_key = "";
|
|
|
+ let count = "";
|
|
|
+ addCabinet(requrl, alias, number, login_key, count).then((res) => {
|
|
|
+ console.log(res);
|
|
|
+ if (res && res.msg == "ok") {
|
|
|
+ this.getCabinetList();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ onTabClick(e) {
|
|
|
+ if (e.name != "add") {
|
|
|
+ this.getBoxList(e.name, e.index);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onHandleBox(command, cabinet_number, box_number, order_sn) {
|
|
|
+ if (command == "openBox") {
|
|
|
+ this.$confirm(
|
|
|
+ `确认打开【${cabinet_number}】柜【${box_number}】箱?`,
|
|
|
+ "提示"
|
|
|
+ )
|
|
|
+ .then(() => {
|
|
|
+ openBox({
|
|
|
+ cabinet_number: cabinet_number,
|
|
|
+ box_number: box_number,
|
|
|
+ }).then((res) => {
|
|
|
+ if (res && res.msg == "ok") {
|
|
|
+ this.$message({
|
|
|
+ message: "操作成功",
|
|
|
+ type: "success",
|
|
|
+ center: true,
|
|
|
+ duration: 1000,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: "操作失败",
|
|
|
+ type: "error",
|
|
|
+ center: true,
|
|
|
+ duration: 1000,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ console.log(res);
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ console.log("取消");
|
|
|
+ });
|
|
|
+ } else if (command == "inform") {
|
|
|
+ this.$confirm(`是否通知用户?`, "提示")
|
|
|
+ .then(() => {
|
|
|
+ sendMsg({
|
|
|
+ cabinet_number: cabinet_number,
|
|
|
+ box_number: box_number,
|
|
|
+ order_sn: order_sn,
|
|
|
+ }).then((res) => {
|
|
|
+ if (res && res.msg == "ok") {
|
|
|
+ this.$message({
|
|
|
+ message: "操作成功",
|
|
|
+ type: "success",
|
|
|
+ center: true,
|
|
|
+ duration: 1000,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: "操作失败",
|
|
|
+ type: "error",
|
|
|
+ center: true,
|
|
|
+ duration: 1000,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ console.log(res);
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ console.log("取消");
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
- },
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
.box-card {
|
|
|
- color: #fff;
|
|
|
- background: rgb(107, 107, 107);
|
|
|
- margin-top: 10px;
|
|
|
+ color: #fff;
|
|
|
+ background: rgb(107, 107, 107);
|
|
|
+ margin-top: 10px;
|
|
|
}
|
|
|
+
|
|
|
.el-dropdown-link {
|
|
|
- cursor: pointer;
|
|
|
- color: #409eff;
|
|
|
+ cursor: pointer;
|
|
|
+ color: #409eff;
|
|
|
}
|
|
|
+
|
|
|
.el-icon-arrow-down {
|
|
|
- font-size: 12px;
|
|
|
+ font-size: 12px;
|
|
|
}
|
|
|
+
|
|
|
.clearfix {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: space-between;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|