Merge branch 'master' into version_report

This commit is contained in:
quyixiao 2020-09-18 16:10:20 +08:00
commit d17d7dad14
12 changed files with 1666 additions and 9 deletions

5
package-lock.json generated
View File

@ -18616,6 +18616,11 @@
"integrity": "sha512-KmvZVtmM26BQOMK1rwUZsrqxEGeKiYSZGA7SNWE6uExx8UX/cj9hq2MRV/wWC3Cq6AoeDGk57rL9YMFRel/q+g==",
"dev": true
},
"vue-infinite-loading": {
"version": "2.4.5",
"resolved": "https://registry.npmjs.org/vue-infinite-loading/-/vue-infinite-loading-2.4.5.tgz",
"integrity": "sha512-xhq95Mxun060bRnsOoLE2Be6BR7jYwuC89kDe18+GmCLVrRA/dU0jrGb12Xu6NjmKs+iTW0AA6saSEmEW4cR7g=="
},
"vue-jest": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/vue-jest/-/vue-jest-1.0.2.tgz",

View File

@ -38,6 +38,7 @@
"vconsole": "^3.3.4",
"vue": "2.5.16",
"vue-cookie": "1.1.4",
"vue-infinite-loading": "^2.4.5",
"vue-router": "3.0.1",
"vuex": "3.0.1",
"wangeditor": "^3.1.1"

36
src/api/api_equipment.js Normal file
View File

@ -0,0 +1,36 @@
import http from '../utils/http'
/**
* 设备相关的
*/
// 设备分类
export const apiFindEquipmentType = data => {
return http({ url: '/lz_management/api/findEquipmentType', method: 'post', data })
}
// 修改设备信息
export const apiChangeEquipment = data => {
return http({ url: '/lz_management/api/changeEquipmentInfo', method: 'post', data })
}
// 根据编码获取设备信息
export const apiFindEquipmentByCode = (data, code) => {
return http({ url: `/lz_management/api/findEquipmentById?code=${code}`, method: 'get', data })
}
// 搜索用户
export const apiFindStaff = data => {
return http({ url: `/lz_management/api/findEmployeeByName`, method: 'post', data })
}
// 搜索使用地
export const apiFindDepat = data => {
return http({ url: `/lz_management/api/findSpecialApplyByName`, method: 'post', data })
}
// 获取使用地,使用人的设备信息
export const apiFindStaffDevice = data => {
return http({ url: `/lz_management/api/findUsersEquipmentsByName`, method: 'post', data })
}

View File

@ -26,6 +26,16 @@ const globalRoutes = [
{ path: '/login', component: _import('common/login'), name: 'login', meta: { title: '登录' } }
]
const dingtalkRoutes=[
{ path: '/devicemain', component: _import('modules/device/device-main'), name: 'devicemain', meta: { title: '资产盘点主入口' } },
{ path: '/devicetype', component: _import('modules/device/device-type'), name: 'devicetype', meta: { title: '设备类型' } },
{ path: '/deviceqr', component: _import('modules/device/device-qr'), name: 'deviceqr', meta: { title: '设备自带编码' } },
{ path: '/devicemark', component: _import('modules/device/device-mark'), name: 'devicemark', meta: { title: '设备备注' } },
{ path: '/devicestaff', component: _import('modules/device/device-staff-device'), name: 'devicestaff', meta: { title: '人员资产信息' } },
{ path: '/devicestaffdepat', component: _import('modules/device/device-staff-depat'), name: 'devicestaffdepat', meta: { title: '搜索人员' } },
{ path: '/devicedetail', component: _import('modules/device/device-detail'), name: 'devicedetail', meta: { title: '资产盘点设备详情页' } }
]
const configRoutes = [
{
path: '/recorddetail',
@ -48,25 +58,43 @@ const mainRoutes = {
// 2. iframeUrl: 是否通过iframe嵌套展示内容, '以http[s]://开头': 是, '': 否
// 提示: 如需要通过iframe嵌套展示内容, 但不通过tab打开, 请自行创建组件使用iframe处理!
{ path: '/home', component: _import('common/home'), name: 'home', meta: { title: '首页' } },
{ path: '/theme', component: _import('common/theme'), name: 'theme', meta: { title: '主题' } }
],
beforeEnter (to, from, next) {
let token = Vue.cookie.get('token')
//console.log('检查token')
if(fnCheckToken()){
next()
} else {
clearLoginInfo()
next({ name: 'login' })
}
/*let token = Vue.cookie.get('token')
if (!token || !/\S/.test(token)) {
clearLoginInfo()
next({ name: 'login' })
} else {
next()
}
}*/
}
}
function fnCheckToken() {
console.log('检查token')
let token = Vue.cookie.get('token')
if (!token || !/\S/.test(token)) {
return false;
}
return true
}
const router = new Router({
base: '/management/',
mode: 'history',
scrollBehavior: () => ({ y: 0 }),
isAddDynamicMenuRoutes: false, // 是否已经添加动态(菜单)路由
routes: globalRoutes.concat(mainRoutes)
routes: globalRoutes.concat(mainRoutes).concat(dingtalkRoutes)
})
router.beforeEach((to, from, next) => {
@ -75,17 +103,24 @@ router.beforeEach((to, from, next) => {
// 2. 获取菜单列表, 添加并保存本地存储
if (router.options.isAddDynamicMenuRoutes || fnCurrentRouteType(to, globalRoutes) === 'global') {
next()
} /*else if (fnIsInRoutes(to, configRoutes)) {//判断是否全屏路由
console.log(to)
} else if (fnIsInRoutes(to, dingtalkRoutes)) {//判断是否全屏路由
if(fnCheckToken()){
next()
} else {
clearLoginInfo()
next({ name: 'login' })
}
//next()
/*console.log(to)
let newpage = router.resolve({
name: to.path,
query:to.query
})
console.log(newpage.href)
window.open(newpage.href, '_blank')
next()
}*/ else {
window.open(newpage.href, '_blank')*/
//next()
} else {
apiGetMenuNav({}).then(res => {
if (res && res.code === 0) {
fnAddDynamicMenuRoutes(res.menuList)

View File

@ -86,7 +86,6 @@
this.userName = res.user.username
this.$store.state.user = res.user
this.mobile = res.user.mobile
console.log('真实姓名' + res.user.realName);
this.$watermark.set(res.user.realName + ' ' + this.mobile.substr(7, 4))
} else {

View File

@ -0,0 +1,633 @@
<template>
<div v-loading="dataListLoading">
<el-row>
<el-col :span="5">
<div class="grid-content flex">
<label class="flex_son">设备类型</label>
</div>
</el-col>
<el-col :span="19">
<div class="grid-content bg-purple-light">
<el-button class="div_width div_height" @click="btnClic(0)">
{{deviceInfo.type}}
<i class="el-icon-arrow-right el-icon--right"></i>
</el-button>
</div>
</el-col>
</el-row>
<el-row margin-bottom="0">
<el-col :span="5">
<div class="grid-content flex">
<label class="flex_son">设备名称</label>
</div>
</el-col>
<el-col :span="19">
<div class="grid-content bg-purple-light">
<el-button class="div_width div_height" @click="btnClic(1)">
{{deviceInfo.brandName}}
<i class="el-icon-arrow-right el-icon--right"></i>
</el-button>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="5">
<div class="grid-content flex">
<label class="flex_son">规格型号</label>
</div>
</el-col>
<el-col :span="19">
<div class="grid-content bg-purple-light">
<el-button class="div_width div_height" @click="btnClic(2)">
{{deviceInfo.specType}}
<i class="el-icon-arrow-right el-icon--right"></i>
</el-button>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="5">
<div class="grid-content flex">
<label class="flex_son">条码编号</label>
</div>
</el-col>
<el-col :span="19">
<div class="grid-content bg-purple-light">
<el-button class="div_width div_height" @click="btnClic(3)">
{{deviceInfo.code}}
<i class="el-icon-arrow-right el-icon--right"></i>
</el-button>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="5">
<div class="grid-content flex">
<label class="flex_son">设备状态</label>
</div>
</el-col>
<el-col :span="19">
<el-select
v-model="deviceInfo.selectValue"
ref="pop"
class="div_width"
@change="selectChange(deviceInfo.selectValue)"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-col>
</el-row>
<el-row>
<el-col :span="5">
<div class="grid-content flex">
<label class="flex_son">使用者</label>
</div>
</el-col>
<el-col :span="19">
<div class="grid-content bg-purple-light">
<el-dropdown
placement="bottom"
trigger="click"
@command="batchOperate"
class="div_width div_height"
>
<el-button class="div_width div_height">
{{deviceInfo.user}}
<i class="el-icon-arrow-right el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="staff">人员</el-dropdown-item>
<el-dropdown-item command="depat">使用地/部门/库存</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="5">
<div class="grid-content flex">
<label class="flex_son">自带编码</label>
</div>
</el-col>
<el-col :span="19">
<div class="grid-content bg-purple-light">
<el-button class="div_width div_height" @click="btnClic(5)">
{{deviceInfo.qr}}
<i class="el-icon-arrow-right el-icon--right"></i>
</el-button>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="5">
<div class="grid-content flex">
<label class="flex_son">入库时间</label>
</div>
</el-col>
<el-col :span="19">
<div class="grid-content bg-purple-light">
<el-button class="div_width div_height" @click="btnClic(6)">{{deviceInfo.gmtInbound}}</el-button>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="5">
<div class="grid-content flex">
<label class="flex_son">出借时间</label>
</div>
</el-col>
<el-col :span="19">
<div class="grid-content bg-purple-light">
<el-button class="div_width div_height" @click="btnClic(7)">{{deviceInfo.gmtOutbound}}</el-button>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="5">
<div class="grid-content flex">
<label class="flex_son">备注</label>
</div>
</el-col>
<el-col :span="19">
<div class="grid-content bg-purple-light">
<el-button class="div_width div_height" @click="btnClic(8)">
{{deviceInfo.mark}}
<i class="el-icon-arrow-right el-icon--right"></i>
</el-button>
</div>
</el-col>
</el-row>
<el-button type="primary" class="div_width" @click="goOrGo">{{btnScanValue}}</el-button>
</div>
</template>>
<script>
import {
apiFindEquipmentByCode,
apiChangeEquipment,
} from "@/api/api_equipment";
import * as dd from "dingtalk-jsapi";
export default {
data() {
return {
options: [
{
value: 0,
label: "入库",
},
{
value: 1,
label: "售出",
},
{
value: 2,
label: "不可用",
},
{
value: 3,
label: "调拨",
},
{
value: 4,
label: "申领",
},
],
staff: "",
deviceInfo: {
id: 0,
code: "",
selectValue: "",
type: "",
specType: "",
brandName: "",
typeId: "",
specId: "",
brandId: "",
user: "",
userId: "",
gmtInbound: "",
gmtOutbound: "",
originalCode: "", //
mark: "",
employee: true, //使
state: 0, //
equipmentState: 0, //
no: "", //
buyAmount: 0.0, //
saleAmount: 0.0, //
qr: "", //
owner: "", //
unit: "", //
num: 0, //
},
dataListLoading: false,
btnScanValue: "继续盘点",
btnOpt: 0, //0 1
oldKey: "", //
userId: 0, //id
};
},
created() {
// this.handleGetImgCaptcha()
},
mounted() {
this.getDateCookie();
console.log(this.deviceInfo.code.length);
if (typeof this.$route.query.type == "undefined") {
if (this.deviceInfo.code.length == 0) {
//
this.scan();
this.deviceInfo.selectValue = this.options[0].value;
}
} else if (this.$route.query.type == 4) {
//
this.btnScanValue = "继续回收";
this.userId = this.$cookie.get("idUser");
this.scan();
} else {
this.checkEditDevicinfo();
if (this.$route.query.type == 2) {
//
this.deviceInfo.employee = true;
} else if (this.$route.query.type == 3) {
//使
this.deviceInfo.employee = false;
}
}
},
methods: {
batchOperate(command) {
this.saveDateCookie();
switch (command) {
case "staff":
//
this.$router.push({ name: "devicestaffdepat", query: { type: 0 } });
break;
case "depat":
//
this.$router.push({ name: "devicestaffdepat", query: { type: 1 } });
break;
}
},
goOrGo() {
console.log(this.btnOpt);
console.log;
if (this.btnOpt == 0) {
this.scan();
} else {
//
//
if (this.deviceInfo.user == "") {
this.$message.error("请选择使用者");
return;
}
if (this.deviceInfo.code == "") {
this.$message.error("请扫码后再编辑");
return;
}
if (this.deviceInfo.type == "") {
this.$message.error("请选择设备类型");
return;
}
if (this.deviceInfo.brandName == "") {
this.$message.error("请选择设备名称");
return;
}
if (this.deviceInfo.specType == "") {
this.$message.error("请选择规格型号");
return;
}
this.dataListLoading = true;
apiChangeEquipment(this.deviceInfo).then((data) => {
console.log(data.data);
if (data.code == 0) {
if(this.$route.query.type == 4){
this.$message("回收成功");
this.btnOpt = 0;
this.btnScanValue = "继续回收";
}else{
this.$message("更新成功");
this.btnOpt = 0;
this.btnScanValue = "继续盘点";
}
} else {
this.$message.error("异常");
}
this.dataListLoading = false;
});
}
},
scan() {
this.clearDateCookie();
console.log("开始扫码");
console.log(dd);
dd.biz.util.scan({
type: "all", // type allqrCodebarCodeall
onSuccess: function (data) {
console.log("sucess");
console.log(data);
this.deviceInfo.code = data.text;
this.getDeviceInfo();
}.bind(this),
onFail: function (err) {
console.log("fail");
console.log(err);
}.bind(this),
});
},
btnClic(type) {
console.log("btnClick");
this.saveDateCookie();
if (type === 0) {
//
this.$router.push({ name: "devicetype" });
} else if (type === 1) {
//
this.$router.push({ name: "devicetype", query: { type: 1 } });
} else if (type === 2) {
//
this.$router.push({ name: "devicetype", query: { type: 2 } });
} else if (type === 3) {
//
this.scan();
} else if (type === 4) {
//使
this.$refs.pop.$el.click();
} else if (type === 5) {
//
this.$router.push({ name: "deviceqr" });
} else if (type === 6) {
//
} else if (type === 7) {
//
} else if (type === 8) {
//
this.$router.push({ name: "devicemark" });
}
},
checkEditDevicinfo() {
if (this.oldKey !== this.getKey()) {
this.btnOpt = 1;
this.btnScanValue = "更新设备信息";
}
},
selectChange(value) {
this.deviceInfo.state = value;
this.deviceInfo.equipmentState = value;
//console.log(value)
this.saveDateCookie();
this.checkEditDevicinfo();
},
getDeviceInfo() {
this.dataListLoading = true;
apiFindEquipmentByCode({}, this.deviceInfo.code).then((data) => {
console.log(data.data);
if (data.code == 0) {
if (typeof data.data == "undefined") {
this.$message("未绑定设备");
} else {
this.deviceInfo.type = data.data.type;
this.deviceInfo.typeId = data.data.typeId;
this.deviceInfo.specType = data.data.specType;
this.deviceInfo.specId = data.data.specId;
this.deviceInfo.brandName = data.data.brandName;
this.deviceInfo.brandId = data.data.brandId;
this.deviceInfo.code = data.data.code;
this.deviceInfo.user = data.data.user;
this.deviceInfo.userId = data.data.userId;
this.deviceInfo.gmtInbound = data.data.gmtInbound;
this.deviceInfo.gmtOutbound = data.data.gmtOutbound;
this.deviceInfo.originalCode = data.data.originalCode;
this.deviceInfo.mark = data.data.mark;
this.deviceInfo.id = data.data.id;
this.deviceInfo.num = data.data.num;
this.deviceInfo.unit = data.data.unit;
this.deviceInfo.owner = data.data.owner;
this.deviceInfo.qr = data.data.qr;
this.deviceInfo.state = data.data.state;
this.deviceInfo.equipmentState = data.data.equipmentState;
this.deviceInfo.buyAmount = data.data.buyAmount;
this.deviceInfo.saleAmount = data.data.saleAmount;
this.deviceInfo.no = data.data.no;
this.deviceInfo.employee = data.data.employee;
//this.deviceInfo.selectValue = data.data.selectValue
this.deviceInfo.selectValue = this.options[
this.deviceInfo.equipmentState
].value;
this.oldKey = this.getKey();
if (this.$route.query.type == 4) {
if (data.data.userId != this.userId) {
this.$message.error("改设备不在该人员名下!请核对!");
} else {
this.deviceInfo.state = 0
this.deviceInfo.equipmentState = 0
this.deviceInfo.selectValue = this.options[
this.deviceInfo.equipmentState
].value;
this.deviceInfo.employee = false
this.deviceInfo.userId = 217
this.deviceInfo.user = '库房'
this.deviceInfo.owner = '库房'
this.btnScanValue = '资产回收'
this.btnOpt = 1
}
}
}
} else {
this.$message.error("异常");
}
this.dataListLoading = false;
});
},
clearDateCookie() {
this.deviceInfo.type = "";
this.deviceInfo.typeId = "";
this.deviceInfo.specType = "";
this.deviceInfo.specId = "";
this.deviceInfo.brandName = "";
this.deviceInfo.brandId = "";
this.deviceInfo.code = "";
this.deviceInfo.user = "";
this.deviceInfo.userId = "";
this.deviceInfo.gmtInbound = "";
this.deviceInfo.gmtOutbound = "";
this.deviceInfo.originalCode = "";
this.deviceInfo.mark = "";
this.deviceInfo.id = 0;
this.deviceInfo.num = 0;
this.deviceInfo.unit = "";
this.deviceInfo.owner = "";
this.deviceInfo.qr = "";
this.deviceInfo.state = 0;
this.deviceInfo.equipmentState = 0;
this.deviceInfo.buyAmount = 0.0;
this.deviceInfo.saleAmount = 0.0;
this.deviceInfo.no = "";
this.deviceInfo.employee = true;
//this.deviceInfo.selectValue = this.$cookie.set('selectValue')
this.deviceInfo.selectValue = this.options[
this.deviceInfo.equipmentState
].value;
this.saveDateCookie();
},
getKey() {
return (
this.deviceInfo.type +
this.deviceInfo.typeId +
this.deviceInfo.specType +
this.deviceInfo.specId +
this.deviceInfo.brandName +
this.deviceInfo.brandId +
this.deviceInfo.code +
this.deviceInfo.user +
this.deviceInfo.userId +
this.deviceInfo.gmtInbound +
this.deviceInfo.gmtOutbound +
this.deviceInfo.originalCode +
this.deviceInfo.mark +
this.deviceInfo.id +
this.deviceInfo.num +
this.deviceInfo.unit +
this.deviceInfo.owner +
this.deviceInfo.qr +
this.deviceInfo.state +
this.deviceInfo.equipmentState +
this.deviceInfo.buyAmount +
this.deviceInfo.saleAmount +
this.deviceInfo.no +
this.deviceInfo.employee
);
},
saveDateCookie() {
this.$cookie.set("strFirs", this.deviceInfo.type);
this.$cookie.set("idFirs", this.deviceInfo.typeId);
this.$cookie.set("strThir", this.deviceInfo.specType);
this.$cookie.set("idThir", this.deviceInfo.specId);
this.$cookie.set("strSec", this.deviceInfo.brandName);
this.$cookie.set("idSec", this.deviceInfo.brandId);
this.$cookie.set("qrCode", this.deviceInfo.code);
this.$cookie.set("userName", this.deviceInfo.user);
this.$cookie.set("idUser", this.deviceInfo.userId);
this.$cookie.set("inputTime", this.deviceInfo.gmtInbound);
this.$cookie.set("outTime", this.deviceInfo.gmtOutbound);
this.$cookie.set("code", this.deviceInfo.originalCode);
this.$cookie.set("reamrk", this.deviceInfo.mark);
this.$cookie.set("devId", this.deviceInfo.id);
this.$cookie.set("devNum", this.deviceInfo.num);
this.$cookie.set("devUnit", this.deviceInfo.unit);
this.$cookie.set("devOwner", this.deviceInfo.owner);
this.$cookie.set("devQr", this.deviceInfo.qr);
this.$cookie.set("devState", this.deviceInfo.state);
this.$cookie.set("devEQState", this.deviceInfo.equipmentState);
this.$cookie.set("devBuyAmount", this.deviceInfo.buyAmount);
this.$cookie.set("devSaleAmount", this.deviceInfo.saleAmount);
this.$cookie.set("devNo", this.deviceInfo.no);
this.$cookie.set("devIsEmployee", this.deviceInfo.employee);
//this.$cookie.set('selectValue', this.deviceInfo.selectValue)
},
getDateCookie() {
this.deviceInfo.type = this.$cookie.get("strFirs");
this.deviceInfo.typeId = this.$cookie.get("idFirs");
this.deviceInfo.specType = this.$cookie.get("strThir");
this.deviceInfo.specId = this.$cookie.get("idThir");
this.deviceInfo.brandName = this.$cookie.get("strSec");
this.deviceInfo.brandId = this.$cookie.get("idSec");
this.deviceInfo.code = this.$cookie.get("qrCode");
this.deviceInfo.user = this.$cookie.get("userName");
this.deviceInfo.userId = this.$cookie.get("idUser");
this.deviceInfo.gmtInbound = this.$cookie.get("inputTime");
this.deviceInfo.gmtOutbound = this.$cookie.get("outTime");
this.deviceInfo.originalCode = this.$cookie.get("code");
this.deviceInfo.mark = this.$cookie.get("reamrk");
this.deviceInfo.id = this.$cookie.get("devId");
this.deviceInfo.num = this.$cookie.get("devNum");
this.deviceInfo.unit = this.$cookie.get("devUnit");
this.deviceInfo.owner = this.$cookie.get("devOwner");
this.deviceInfo.qr = this.$cookie.get("devQr");
this.deviceInfo.state = this.$cookie.get("devState");
this.deviceInfo.equipmentState = this.$cookie.get("devEQState");
this.deviceInfo.buyAmount = this.$cookie.get("devBuyAmount");
this.deviceInfo.saleAmount = this.$cookie.get("devSaleAmount");
this.deviceInfo.no = this.$cookie.get("devNo");
this.deviceInfo.employee = this.$cookie.get("devIsEmployee");
//this.deviceInfo.selectValue = this.$cookie.set('selectValue')
this.deviceInfo.selectValue = this.options[
this.deviceInfo.equipmentState
].value;
},
},
};
</script>
<style>
.el-row {
margin-bottom: 20px;
}
.el-col {
border-radius: 10px;
}
.bg-purple-dark {
background: #99a9bf;
}
.bg-purple {
background: #d3dce6;
}
.bg-purple-light {
background: #e5f2f1;
}
.grid-content {
border-radius: 4px;
min-height: 36px;
}
.row-bg {
padding: 10px 0;
background-color: #f9fafc;
}
.div_height {
height: 38px;
}
.div_width {
width: 100%;
}
.width_100 {
width: 100px;
}
.center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
padding: 1em;
}
.flex {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
border: 1px solid;
}
.flex_son {
width: 100%;
height: 100%;
border: 0x solid;
}
.zero_size {
width: 1px;
height: 1px;
}
</style>

View File

@ -0,0 +1,103 @@
<template>
<div>
<el-row>
<div>
<el-dropdown
placement="bottom"
trigger="click"
@command="batchOperate"
class="div_width div_height">
<el-button
type="primary"
class="div_width div_height">
资产回收
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="staff">人员</el-dropdown-item>
<el-dropdown-item command="depat">使用地/部门/库存</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</el-row>
<el-row>
<el-button type="warning" class="div_height div_width" @click="goto(1)">开始盘点</el-button>
</el-row>
</div>
</template>>
<script>
export default {
data () {
return{
value: ''
}
},
mounted () {
},
methods: {
batchOperate(command) {
switch (command) {
case 'staff':
//
this.$router.push({name: 'devicestaffdepat', query: {type: 3}})
break;
case "depat":
//
this.$router.push({name: 'devicestaffdepat', query: {type: 4}})
break;
}
},
goto (type) {
this.$router.push({name: 'devicedetail'})
}
}
}
</script>
<style>
.el-row {
margin-bottom: 20px;
}
.el-col {
border-radius: 10px;
}
.bg-purple-dark {
background: #99a9bf;
}
.bg-purple {
background: #d3dce6;
}
.bg-purple-light {
background: #e5f2f1;
}
.grid-content {
border-radius: 4px;
min-height: 36px;
}
.row-bg {
padding: 10px 0;
background-color: #f9fafc;
}
.div_height{
height: 60px;
}
.div_width{
width: 100%;
}
.zero_size{
width: 0px;
height: 0px;
}
.select_local{
top: 600px;
}
</style>

View File

@ -0,0 +1,102 @@
<template>
<div>
<el-input type="textarea"
v-model="mark"
placeholder="请输入备注"
rows="10"
class="div_width"></el-input>
<p/>
<el-button type="primary" class="div_width" @click="btnSave">确定</el-button>
</div>
</template>>
<script>
import * as dd from 'dingtalk-jsapi'
export default {
data () {
return{
mark:''
}
},
created () {
// this.handleGetImgCaptcha()
},
mounted () {
this.mark = this.$cookie.get('reamrk')
},
methods: {
btnSave(){
this.$cookie.set('reamrk', this.mark)
this.$router.replace({name: 'devicedetail', query:{type: 1}})
}
}
}
</script>
<style>
.el-row {
margin-bottom: 20px;
}
.el-col {
border-radius: 10px;
}
.bg-purple-dark {
background: #99a9bf;
}
.bg-purple {
background: #d3dce6;
}
.bg-purple-light {
background: #e5f2f1;
}
.grid-content {
border-radius: 4px;
min-height: 36px;
}
.row-bg {
padding: 10px 0;
background-color: #f9fafc;
}
.div_height{
height: 38px;
}
.div_width{
width: 100%;
}
.width_100{
width: 100px;
}
.center{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
padding: 1em;
}
.flex{
display:flex;
align-items: center;
justify-content:center;
width:100%;
height:100%;
border:1px solid;
}
.flex_son{
width:100%;
height:100%;
border:0x solid;
}
.zero_size{
width: 1px;
height: 1px;
}
</style>

View File

@ -0,0 +1,116 @@
<template>
<div>
<el-row>
<el-col :span="20"><div class="grid-content flex"><el-input v-model="qr" placeholder="请输入编码"></el-input></div>
</el-col>
<el-col :span="4"><div class="grid-content bg-purple-light"><el-button type="success" class="div_width div_height" @click="goScan">扫码</el-button></div>
</el-col>
</el-row>
<el-button type="primary" class="div_width" @click="btnSave">确定</el-button>
</div>
</template>>
<script>
import * as dd from 'dingtalk-jsapi'
export default {
data () {
return{
qr:''
}
},
created () {
// this.handleGetImgCaptcha()
},
mounted () {
this.qr = this.$cookie.get('devQr')
},
methods: {
goScan () {
this.scan()
},
scan () {
dd.biz.util.scan({
type: String , // type allqrCodebarCodeall
onSuccess: function(data) {
console.log(2)
console.log(data)
this.qr = data.text
}.bind(this),
onFail : function(err) {
}.bind(this)
})
},
btnSave(){
this.$cookie.set('devQr', this.qr)
this.$router.replace({name: 'devicedetail', query:{type: 1}})
}
}
}
</script>
<style>
.el-row {
margin-bottom: 20px;
}
.el-col {
border-radius: 10px;
}
.bg-purple-dark {
background: #99a9bf;
}
.bg-purple {
background: #d3dce6;
}
.bg-purple-light {
background: #e5f2f1;
}
.grid-content {
border-radius: 4px;
min-height: 36px;
}
.row-bg {
padding: 10px 0;
background-color: #f9fafc;
}
.div_height{
height: 38px;
}
.div_width{
width: 100%;
}
.width_100{
width: 100px;
}
.center{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
padding: 1em;
}
.flex{
display:flex;
align-items: center;
justify-content:center;
width:100%;
height:100%;
border:1px solid;
}
.flex_son{
width:100%;
height:100%;
border:0x solid;
}
.zero_size{
width: 1px;
height: 1px;
}
</style>

View File

@ -0,0 +1,180 @@
<template>
<div>
<el-row v-show="isShowSearch">
<el-col :span="20"><div class="grid-content flex"><el-input v-model="query.name" placeholder="请输入内容"></el-input></div>
</el-col>
<el-col :span="4"><div class="grid-content bg-purple-light"><el-button type="primary" class="div_width div_height" @click="btnSearch">搜索</el-button></div>
</el-col>
</el-row>
<el-table
v-loading='dataListLoading'
:data="query.list"
:show-header="showHeader"
style="width: 100%"
@row-click="rowClick">
<el-table-column v-if="isStaff"
prop="desc"
style="width: 100%">
</el-table-column>
<el-table-column v-if="isDepat"
prop="typeDesc"
style="width: 100%">
</el-table-column>
</el-table>
</div>
</template>>
<script>
import {apiFindStaff, apiFindDepat} from '@/api/api_equipment'
import * as dd from 'dingtalk-jsapi'
export default {
data () {
return{
isShowSearch: true,
data: [],
input: '',
dataListLoading: false,
typeIndex: 0,//01使
showHeader: false,
query:{
name: '',
pageSize: 20,
currPage: 0,
totalPage: 0,
list: []
},
isStaff: true,
isDepat: false
}
},
created () {
// this.handleGetImgCaptcha()
},
mounted () {
if(typeof this.$route.query.type == 'undefined'){
}else{
this.typeIndex = this.$route.query.type
if(this.typeIndex == 0 || this.typeIndex == 3){
this.isStaff = true
this.isDepat = false
}else{
this.isStaff = false
this.isDepat = true
}
}
},
methods: {
getData(){
console.log('获取数据')
console.log(this.name)
this.dataListLoading = true
if(this.typeIndex == 0 || this.typeIndex == 3){
apiFindStaff(this.query).then(data => {
console.log(data)
if(typeof data.data == 'undefined'){
}else{
this.query.currPage = data.data.currPage
this.query.totalPage = data.data.totalPage
this.query.list = data.data.list
}
this.dataListLoading = false
})
}else {
apiFindDepat(this.query).then(data => {
console.log(data)
if(typeof data.data == 'undefined'){
}else{
this.query.currPage = data.data.currPage
this.query.totalPage = data.data.totalPage
this.query.list = data.data.list
}
this.dataListLoading = false
})
}
},
btnSearch(){
this.getData()
},
rowClick(row, event, column){
if(this.typeIndex == 0){
this.$cookie.set('userName', row.name)
this.$cookie.set('idUser', row.id)
this.$router.replace({name: 'devicedetail', query:{type: 2}})
} else if(this.typeIndex == 1){
this.$cookie.set('userName', row.typeDesc)
this.$cookie.set('idUser', row.id)
this.$router.replace({name: 'devicedetail', query:{type: 3}})
}else {
this.$router.replace({name: 'devicestaff', query:{type: this.typeIndex, id: row.id}})
}
}
}
}
</script>
<style>
.el-row {
margin-bottom: 20px;
}
.el-col {
border-radius: 10px;
}
.bg-purple-dark {
background: #99a9bf;
}
.bg-purple {
background: #d3dce6;
}
.bg-purple-light {
background: #e5f2f1;
}
.grid-content {
border-radius: 4px;
min-height: 36px;
}
.row-bg {
padding: 10px 0;
background-color: #f9fafc;
}
.div_height{
height: 38px;
}
.div_width{
width: 100%;
}
.width_100{
width: 100px;
}
.center{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
padding: 1em;
}
.flex{
display:flex;
align-items: center;
justify-content:center;
width:100%;
height:100%;
border:1px solid;
}
.flex_son{
width:100%;
height:100%;
border:0x solid;
}
</style>

View File

@ -0,0 +1,224 @@
<template>
<div>
<el-button type="primary" class="div_width" @click="scan">扫码回收</el-button>
<div>
<el-table
v-loading="dataListLoading"
:data="findEqInfo.list"
:show-header="showHeader"
style="width: 100%"
>
<el-table-column prop="brandName" style="width: 100%"></el-table-column>
<el-table-column prop="code" style="width: 100%"></el-table-column>
<el-table-column prop="type" style="width: 100%"></el-table-column>
<el-table-column prop="specType" style="width: 100%"></el-table-column>
<slot></slot>
<template slot="append">
<!--
@infinite: 滚动事件回调函数,当滚动到距离滚动父元素底部特定距离的时候会被调用
distance: 这是滚动的临界值default: 100; 如果到滚动父元素的底部距离小于这个值那么 loadMore 回调函数就会被调用
spinner: 通过这个属性你可以选择一个你最喜爱旋转器作为加载动画
'default' | 'bubbles' | 'circles' | 'spiral' | 'waveDots'
direction: 如果你设置这个属性为top,那么这个组件将在你滚到顶部的时候调用on-infinite函数
'top' | 'bottom'
forceUseInfiniteWrapper: (boolean | string) 强制指定滚动容器使用CSS 选择器
identifier: 识别号改变时刷新
-->
<infinite-loading
@infinite="loadMore"
ref="infiniteLoading"
:distance="100"
spinner="circles"
:identifier="infiniteId"
>
<!-- orce-use-infinite-wrapper 属性在存在多个 el-table 需要更详细的css选择器 -->
<div class="no-more" slot="no-more">~是有底线的 ()</div>
<div class="no-more" slot="no-results">暂无结果 ԾԾ</div>
<div class="no-more" slot="error">出错了 ()</div>
</infinite-loading>
</template>
</el-table>
</div>
</div>
</template>>
<script>
import { apiFindStaffDevice } from "@/api/api_equipment";
import InfiniteLoading from "vue-infinite-loading";
import * as dd from "dingtalk-jsapi";
export default {
//
// vue https://cn.vuejs.org/v2/guide/custom-directive.html
components: {
InfiniteLoading
},
data() {
return {
isShowSearch: true,
data: [],
name: "",
categorys: "",
input: "",
dataListLoading: false,
strFirs: "",
strSec: "",
strThir: "",
idFirs: "",
idSec: "",
idThir: "",
typeIndex: 0, //01 12
showHeader: false,
findEqInfo: {
employee: false,
userId: 0,
currPage: 1,
pageSize: 20,
totalPage: 1,
list: []
},
infiniteId: new Date()
};
},
created() {
// this.handleGetImgCaptcha()
},
mounted() {
if (this.$route.query.type == 3) {
//
this.findEqInfo.employee = true;
} else if (this.$route.query.type == 4) {
//使
this.findEqInfo.employee = false;
}
this.findEqInfo.userId = this.$route.query.id;
this.getData();
},
methods: {
getData() {
console.log("获取数据");
console.log(this.name);
console.log(this.categorys);
this.dataListLoading = true;
apiFindStaffDevice(this.findEqInfo).then((data) => {
console.log(data);
if (data && data.code === 0) {
this.findEqInfo.list = [...this.findEqInfo.list, ...data.data.list]
this.findEqInfo.currPage = data.data.currPage
this.findEqInfo.totalPage = data.data.totalPage
console.log("currPage", this.findEqInfo.currPage)
console.log("totalPage", this.findEqInfo.totalPage)
if(this.findEqInfo.currPage == this.findEqInfo.totalPage){
this.$refs.infiniteLoading.$emit('$InfiniteLoading:complete')
}else{
this.$refs.infiniteLoading.$emit('$InfiniteLoading:loaded')
}
} else {
this.findEqInfo.list = []
this.findEqInfo.currPage = 1
this.findEqInfo.totalPage = 1
this.$refs.infiniteLoading.$emit('$InfiniteLoading:complete')
}
this.dataListLoading = false;
//this.$refs.InfiniteLoading.$emit("$infiniteLoading:loaded");
});
},
loadMore($state) {
console.log("loadMore")
console.log("currPage", this.findEqInfo.currPage)
console.log("totalPage", this.findEqInfo.totalPage)
if(this.findEqInfo.currPage < this.findEqInfo.totalPage){
this.findEqInfo.currPage++
this.getData()
/*apiFindStaffDevice(this.findEqInfo).then((data) => {
console.log(data);
if (data && data.code === 0) {
this.findEqInfo.list = [...this.findEqInfo.list, ...data.data.list]
this.findEqInfo.currPage = data.data.currPage
this.findEqInfo.totalPage = data.data.totalPage
console.log("currPage", this.findEqInfo.currPage)
console.log("totalPage", this.findEqInfo.totalPage)
if(this.findEqInfo.currPage == this.findEqInfo.totalPage){
$state.complete()//
}else{
$state.loaded()//
}
} else {
this.findEqInfo.list = []
this.findEqInfo.currPage = 1
this.findEqInfo.totalPage = 1
$state.complete()//
}
})*/
}
},
scan() {
this.$cookie.set('idUser', this.findEqInfo.userId)
this.$router.push({name: 'devicedetail', query: {type: 4}})
},
reset () {
this.findEqInfo.list = []
this.findEqInfo.currPage = 1
this.findEqInfo.totalPage = 1
this.infiniteId += 1
}
},
};
</script>
<style>
.el-row {
margin-bottom: 20px;
}
.el-col {
border-radius: 10px;
}
.bg-purple-dark {
background: #99a9bf;
}
.bg-purple {
background: #d3dce6;
}
.bg-purple-light {
background: #e5f2f1;
}
.grid-content {
border-radius: 4px;
min-height: 36px;
}
.row-bg {
padding: 10px 0;
background-color: #f9fafc;
}
.div_height {
height: 38px;
}
.div_width {
width: 100%;
}
.width_100 {
width: 100px;
}
.center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
padding: 1em;
}
.flex {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
border: 1px solid;
}
.flex_son {
width: 100%;
height: 100%;
border: 0x solid;
}
</style>

View File

@ -0,0 +1,223 @@
<template>
<div>
<el-row v-show="isShowSearch">
<el-col :span="20"><div class="grid-content flex"><el-input v-model="name" placeholder="请输入内容"></el-input></div>
</el-col>
<el-col :span="4"><div class="grid-content bg-purple-light"><el-button type="primary" class="div_width div_height" @click="btnSearch">搜索</el-button></div>
</el-col>
</el-row>
<el-row v-show="isShowType">
<el-col v-show="isShowFir" :span="8"><div class="grid-content flex"><el-button class="div_width div_height" @click="btnType(0)">{{strFirs}}<i class="el-icon-arrow-right el-icon--right"></i></el-button></div>
</el-col>
<el-col v-show="isShowSec" :span="8"><div class="grid-content flex"><el-button class="div_width div_height" @click="btnType(1)">{{strSec}}<i class="el-icon-arrow-right el-icon--right"></i></el-button></div>
</el-col>
<el-col v-show="isShowThir" :span="8"><div class="grid-content flex"><el-button class="div_width div_height" @click="btnType(2)">{{strThir}}<i class="el-icon-arrow-right el-icon--right"></i></el-button></div>
</el-col>
</el-row>
<el-table
v-loading='dataListLoading'
:data="data"
:show-header="showHeader"
style="width: 100%"
@row-click="rowClick">
<el-table-column
prop="desc"
style="width: 100%">
</el-table-column>
</el-table>
</div>
</template>>
<script>
import {apiFindEquipmentType} from '@/api/api_equipment'
import * as dd from 'dingtalk-jsapi'
export default {
data () {
return{
isShowSearch: true,
data: [],
name: '',
categorys: '',
input: '',
dataListLoading: false,
isShowType: true,
isShowFir: false,
isShowSec: false,
isShowThir: false,
strFirs: '',
strSec: '',
strThir: '',
idFirs: '',
idSec: '',
idThir: '',
typeIndex: 0,//01 12
showHeader: false
}
},
created () {
// this.handleGetImgCaptcha()
},
mounted () {
if(typeof this.$route.query.type == 'undefined'){//
} else if(this.$route.query.type == 1){//
this.strFirs = this.$cookie.get('strFirs')
this.idFirs = this.$cookie.get('idFirs')
console.log(this.strFirs)
this.btnType(0)
}else if(this.$route.query.type == 2){//
this.strFirs = this.$cookie.get('strFirs')
this.idFirs = this.$cookie.get('idFirs')
this.strSec = this.$cookie.get('strSec')
this.idSec = this.$cookie.get('idSec')
this.btnType(1)
}
},
methods: {
getData(){
console.log('获取数据')
console.log(this.name)
console.log(this.categorys)
this.dataListLoading = true
apiFindEquipmentType({
'name': this.name,
'categorys': this.categorys
}).then(data => {
console.log(data)
if (data && data.code === 0) {
this.data = data.data
} else {
this.data = []
}
this.dataListLoading = false
})
},
btnSearch(){
this.getData()
},
btnType(type){
if(type === 0){//
console.log('btnType=0')
this.typeIndex = 1
this.isShowFir = true
this.isShowSec = false
this.isShowThir = false
this.categorys = this.idFirs
this.name = ''
this.getData()
} else if(type === 1){//
console.log('btnType=1')
this.typeIndex = 2
this.isShowFir = true
this.isShowSec = true
this.isShowThir = false
this.categorys = this.idFirs + ',' + this.idSec
this.name = ''
this.getData()
}else{//
this.typeIndex = 3
this.isShowFir = true
this.isShowSec = true
this.isShowThir = true
}
},
rowClick(row, event, column){
if(this.typeIndex === 0){
console.log('点击一ji')
this.typeIndex = 1
this.isShowFir = true
this.idFirs = row.id
this.strFirs = row.desc
this.categorys = this.idFirs
this.name = ''
}else if (this.typeIndex === 1){
console.log('点击二ji')
this.typeIndex = 2
this.isShowSec = true
this.idSec = row.id
this.strSec = row.desc
this.categorys = this.idFirs + ',' + this.idSec
this.name = ''
}else {
console.log('点击三ji')
this.typeIndex = 3
this.isShowThir = true
this.idThir = row.id
this.strThir = row.desc
this.$cookie.set('strFirs', this.strFirs)
this.$cookie.set('idFirs', this.idFirs)
this.$cookie.set('strSec', this.strSec)
this.$cookie.set('idSec', this.idSec)
this.$cookie.set('strThir', this.strThir)
this.$cookie.set('idThir', this.idThir)
this.$router.replace({name: 'devicedetail', query:{type: 1}})
}
console.log('结束')
this.getData()
}
}
}
</script>
<style>
.el-row {
margin-bottom: 20px;
}
.el-col {
border-radius: 10px;
}
.bg-purple-dark {
background: #99a9bf;
}
.bg-purple {
background: #d3dce6;
}
.bg-purple-light {
background: #e5f2f1;
}
.grid-content {
border-radius: 4px;
min-height: 36px;
}
.row-bg {
padding: 10px 0;
background-color: #f9fafc;
}
.div_height{
height: 38px;
}
.div_width{
width: 100%;
}
.width_100{
width: 100px;
}
.center{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
padding: 1em;
}
.flex{
display:flex;
align-items: center;
justify-content:center;
width:100%;
height:100%;
border:1px solid;
}
.flex_son{
width:100%;
height:100%;
border:0x solid;
}
</style>