Merge branch 'version_report' of http://gitlab.ldxinyong.com/enterpriseManagement/lz_management_vue into version_report

This commit is contained in:
杜建超 2020-09-22 11:33:11 +08:00
commit 2221e7aa96
23 changed files with 2508 additions and 67 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 })
}

18
src/api/api_role.js Normal file
View File

@ -0,0 +1,18 @@
import http from '../utils/http'
// 获取侧边菜单栏
export const apiGetRoleList = params => {
return http({url: '/lz_management/user/lzrecordrole/list', method: 'get', params})
}
export const apiSysMenuList = params => {
return http({url: '/lz_management/user/lzrecordrole/menu/list', method: 'get', params})
}
export const apiSysRoleInfo = (params, id) => {
return http({url: `/lz_management/user/lzrecordrole/info${id}`, method: 'get', params})
}
export const apiSysRoleConfirm = (data, type) => {
return http({ url: `/lz_management/user/lzrecordrole/updateOrAdd`, method: 'post', data })
}

26
src/api/api_staff_role.js Normal file
View File

@ -0,0 +1,26 @@
import http from '../utils/http'
// 获取侧边菜单栏
export const apiGetRoleList = params => {
return http({url: '/lz_management/user/lzstaffrole/list', method: 'get', params})
}
export const apiSysRoleInfo = params => {
return http({url: `/lz_management/user/lzstaffrole/info/${params}`, method: 'post'})
}
export const apiSysMenuList = params => {
return http({url: '/lz_management/user/lzstaffrole/menu/list', method: 'get', params})
}
export const apiSysRoleList = (params, id) => {
return http({url: `/lz_management/user/lzstaffrole/role/list/${id}`, method: 'get', params})
}
export const apiDelete = params => {
return http({url: `/lz_management/user/lzstaffrole/delete/${params}`, method: 'post'})
}
export const apiSysRoleConfirm = (data, type) => {
return http({url: `/lz_management/user/lzstaffrole/updateOrAdd`, 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>

View File

@ -24,7 +24,7 @@
<span slot="footer" class="dialog-footer">
<el-button type="primary" v-if="auth.approvelCommit === 1 && status !== 5 " @click="commitRecord(2)">通过</el-button>
<el-button type="primary" v-if="auth.waitCommit===1 && status !== 5 " @click="commitRecord(3)">待提交</el-button>
<el-button type="primary" v-if="auth.waitCommit===1 && status !== 5 " @click="commitRecord(3)">通过</el-button>
<el-button type="primary" v-if="status === 5 && auth.reject == 1" @click="commitRecord(5)">驳回</el-button>
</span>
</el-dialog>
@ -62,7 +62,6 @@ export default {
this.auth = auth
this.visible = true
this.status = status
this.$nextTick(async () => {
this.$refs['dataForm'].resetFields()
if (this.resultCommentEditor === null) {
@ -73,6 +72,7 @@ export default {
this.resultCommentEditor.customConfig.debug = true
this.resultCommentEditor.create()
}
this.resultCommentEditor.txt.html('<p></p>')
const data = await getResultComment(this.recordResultId)
if (data && data.code === 0) {
this.resultCommitId = data.resultComment.id

View File

@ -131,9 +131,9 @@ export default {
} else if (status === 1) {
return '审批中'
} else if (status === 2) {
return '审批'
return '审批'
} else if (status === 3) {
return '侍提交'
return '审批中'
} else if (status === 4) {
return '审批通过'
} else if (status === 5) {
@ -182,7 +182,7 @@ export default {
{value: '0', label: '新建'},
{value: '1', label: '审批中'},
{value: '2', label: '拒绝'},
{value: '3', label: '侍提交'},
{value: '3', label: '审批中'},
{value: '4', label: '审批通过'}
],
departmentList1: [],

View File

@ -35,7 +35,6 @@
</el-select>
</el-form-item>
<el-form-item label="姓名">
<el-input v-model="dataForm.name" placeholder="员工姓名" clearable></el-input>
</el-form-item>
@ -71,19 +70,29 @@
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
<el-button size="mini" type="primary" @click="getDataList()">查询</el-button>
</el-form-item>
<el-form-item label="">
<el-select v-model="dataForm.batchOpt" placeholder="批量操作" clearable filterable>
<el-option
v-for="item in batchOpts"
:key="item.id"
:label="item.opt"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button size="mini" type="primary" style="" @click="">提交</el-button>
</el-form-item>
</el-form>
<div>
<el-button type="primary" style="margin-bottom: 10px" @click="submitBt()" v-if="isHiden">批量提交</el-button>
</div>
<el-tabs type="border-card" v-model="tabValue" @tab-click="tabChange">
<el-tab-pane label="审批中" name="1,2,5"></el-tab-pane>
<el-tab-pane label="全部" name=""></el-tab-pane>
<el-tab-pane label="侍提交" name="3"></el-tab-pane>
<el-tab-pane label="全部" name="1,2,3,4,5"></el-tab-pane>
<el-tab-pane label="批量提交" name="3"></el-tab-pane>
<el-tab-pane label="审批通过" name="4"></el-tab-pane>
<el-table
@ -128,8 +137,6 @@
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
@ -139,12 +146,8 @@
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
</el-tabs>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
@ -173,7 +176,7 @@ export default {
} else if (status === 2) {
return '己审批'
} else if (status === 3) {
return '侍提交'
return '审批中'
} else if (status === 4) {
return '审批通过'
} else if (status === 5) {
@ -192,6 +195,13 @@ export default {
},
data () {
return {
batchOpts: [{
id: 1,
opt: '批量提交'
}, {
id: 2,
opt: '批量终止'
}],
Datalist: [{
Month: 1,
title: '近一个月'
@ -223,7 +233,7 @@ export default {
{value: '0', label: '新建'},
{value: '1', label: '审批中'},
{value: '2', label: '拒绝'},
{value: '3', label: '侍提交'},
{value: '3', label: '审批中'},
{value: '4', label: '审批通过'}
],
departmentList1: [],

View File

@ -57,7 +57,7 @@
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<el-button type="danger" @click="dataFormDelete()" >删除</el-button>
<el-button v-if="auth.deleteDetail == 1 " type="danger" @click="dataFormDelete()" >删除</el-button>
</span>
</el-dialog>
</template>
@ -248,7 +248,6 @@ export default {
const data = await apiDetailInfo(this.dataForm.id)
if (data && data.code === 0) {
this.dataForm = data.detailInfo
console.log(this.dataForm.keyResult37)
if (this.keyResultEditor !== null) {
this.keyResultEditor.txt.html(this.dataForm.keyResult || '')
}

View File

@ -27,25 +27,39 @@
<span >直属上级:<b>{{ superStaff }}</b></span>
<div class="titleBottom">
<div class="bottom" v-show="this.auth.commit == 1" >
<p> <el-button type="primary" @click="commitApprovalYes('你确认要提交审批吗?')">提交审批</el-button></p>
<div class="bottom" v-if="this.auth.commit == 1" >
<el-button size="mini" type="primary" @click="commitApprovalYes('你确认要提交审批吗?',2)">提交审批</el-button>
</div>
<div class="bottom" v-show="this.auth.approvel == 1">
<p>
<el-button type="primary" @click="commitApprovalAddOrUpdate(1)">
<label >审批</label>
</el-button>
</p>
<div class="bottom" v-if=" auth.add == 1 " >
<el-button size="mini" type="primary" style="margin-left:0px;" @click="handleAddOrUpdate(0,1)" >添加</el-button>
</div>
<div class="bottom" v-show="this.auth.confirmCommit == 1">
<p><el-button type="primary" style="" @click="commitApprovalYes('你要确认得分吗?')">确认得分</el-button></p>
<div class="bottom" v-if="this.auth.confirmCommit == 1">
<el-button size="mini" type="primary" style="" @click="commitApprovalYes('你要确认得分吗?',2)">确认得分</el-button>
</div>
<div class="bottom" v-if="this.auth.approvel == 1">
<el-button type="primary" size="mini" @click="commitApprovalAddOrUpdate(1)"><label >审批</label></el-button>
</div>
<div class="bottom" v-if="this.auth.dissatisfied == 1" >
<el-button type="primary" size="mini" @click="commitApprovalAddOrUpdate('你确定要申述吗?',6)"><label >申述</label></el-button>
</div>
<div class="bottom" v-if="this.auth.submited == 1" >
<el-button type="primary" size="mini" @click="commitApprovalYes('你确定要撤回吗?',7)"><label >撤回</label></el-button>
</div>
<div class="bottom" v-if="this.auth.submited == 1" >
<el-button type="primary" size="mini" @click="commitApprovalYes('你确定要催领导吗?',8)"><label >催办</label></el-button>
</div>
<div class="bottom" v-show="this.auth.reject === 1">
<p><el-button type="warning" @click="commitApprovalAddOrUpdate(5)" ><label >驳回</label></el-button></p>
<el-button size="mini" type="warning" @click="commitApprovalAddOrUpdate(5)" ><label >驳回</label></el-button>
</div>
<div class="bottom" v-show="this.auth.uploadFile === 1 ">
@ -55,6 +69,8 @@
<div class="bottom" >
<p><span @click="uploadDownFile(2)" ><label :class="'label bg-info my_pointer'">下载附件{{fileCount}}</label></span></p>
</div>
</div>
</div>
@ -81,21 +97,6 @@
</template>
</el-table-column>
<!--
<el-table-column label="3.5-考核标准" prop="keyResult35" align="left" width="280">
<template slot-scope="scope" >
<div v-html="scope.row.keyResult35" class="rich">
</div>
</template>
</el-table-column>
<el-table-column label="3.75-考核标准" prop="keyResult37" align="left" width="280">
<template slot-scope="scope" >
<div v-html="scope.row.keyResult37" class="rich">
</div>
</template>
</el-table-column>-->
<el-table-column label="考核权重" prop="checkWeight" align="center" >
<template slot-scope="scope">
<div class="conatnt-name">
@ -125,8 +126,8 @@
</el-table-column>
<el-table-column width="80" label="操作" v-if="(auth.add === 1 || auth.edit == 1) && hasOperator" align="center" fixed="right">
<template slot-scope="scope">
<el-button size="mini" type="primary" style="margin-left:0px;" @click="handleAddOrUpdate(0,scope.row.type )" v-if="scope.row.isAdd===1 && auth.add == 1 ">添加</el-button>
<el-button size="mini" style="margin-left:0px;" @click="handleAddOrUpdate(scope.row.id,scope.row.type)" v-if="scope.row.isEdit > 0 && auth.edit == 1">编辑</el-button>
<el-button size="mini" style="margin-left:0px;" @click="handleAddOrUpdate(scope.row.id,scope.row.type)" v-if="scope.row.isEdit > 0 && auth.edit == 1 && auth.editScore == 0">编辑</el-button>
<el-button size="mini" style="margin-left:0px;" @click="handleAddOrUpdate(scope.row.id,scope.row.type)" v-if="scope.row.isEdit > 0 && auth.editScore == 1">评分</el-button>
</template>
</el-table-column>
</el-table>
@ -147,7 +148,7 @@ import UploadAddOrUpdate from './upload-add-or-update.vue'
export default {
created () {
console.log(window.innerHeight)
this.clientHeight = window.innerHeight - 343
this.clientHeight = window.innerHeight - 50
console.log(this.clientHeight)
this.stepList.forEach(item => item.name = item.name.slice(-2))
},
@ -221,6 +222,7 @@ export default {
'recordType': this.recordType
}).then(data => {
if (data && data.code === 0) {
this.clientHeight = window.innerHeight - 50
this.tableData = data.list
this.yeJiCheckNum = data.yeJiCheckNum
this.wenHuaJiaZhiGuanNum = data.wenHuaJiaZhiGuanNum
@ -278,7 +280,7 @@ export default {
}, 500)
})
},
commitApprovalYes (msg = '确定要提交审批吗?') {
commitApprovalYes (msg = '确定要提交审批吗?', status) {
this.$confirm(msg, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
@ -286,7 +288,7 @@ export default {
}).then(() => {
commitApproval({
'recordResultId': this.recordResultId,
'status': 2
'status': status
}).then(data => {
if (data) {
if (data.code === 0) {
@ -352,8 +354,8 @@ export default {
if (rowIndex >= this.yeJiCheckNum + 1 && rowIndex < this.yeJiCheckNum + 1 + this.wenHuaJiaZhiGuanNum) {
if (columnIndex === 1) {
return [1, 4]
} else if (columnIndex === 2 || columnIndex === 3 || columnIndex === 4) {
return [1, 2]
} else if (columnIndex === 2) {
return [0, 0]
}
}

View File

@ -0,0 +1,154 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="handleConfirm()"
label-width="80px">
<el-form-item label="角色名称" prop="roleName">
<el-input v-model="dataForm.roleName" placeholder=""></el-input>
</el-form-item>
<el-form-item size="mini" label="授权">
<el-tree
:data="menuList"
:props="menuListTreeProps"
node-key="menuId"
ref="menuListTree"
:default-expand-all="true"
:default-checked-keys="defaultCheckedKeys"
:filter-node-method="filterNode"
show-checkbox
>
<span class="custom-tree-node" slot-scope="{ node, data }">
<span>{{ node.label }}</span>
</span>
</el-tree>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="handleConfirm()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
import {treeDataTranslate} from '@/utils'
import {apiSysMenuList, apiSysRoleInfo, apiSysRoleConfirm} from '@/api/api_role'
export default {
data () {
return {
visible: false,
menuList: [],
menuListTreeProps: {
label: 'name',
children: 'children'
},
tempKey: -666666, // key, tree. #
defaultCheckedKeys: [],
apiType: '', // api
dataForm: {
roleName: ''
},
dataRule: {
}
}
},
methods: {
async init (id) {
this.dataForm.id = id || 0
this.visible = true
this.dataForm = {}
if (id) {
await this.handleGetSysMenuList()
this.dataForm.id = id || 0
this.handleEdit()
this.apiType = '/update'
} else {
await this.handleGetSysMenuListAdd()
this.apiType = '/save'
}
},
//
async handleGetSysMenuList () {
let res = await apiSysMenuList({})
this.menuList = treeDataTranslate(res, 'menuId')
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
this.$refs.menuListTree.setCheckedKeys([])
})
},
//
async handleGetSysMenuListAdd () {
let res = await apiSysMenuList({})
this.menuList = treeDataTranslate(res, 'menuId')
this.visible = true
this.$nextTick(() => {
this.$refs.menuListTree.setCheckedKeys([])
})
},
filterNode (value, data) {
console.log('data: ', data)
console.log('value: ', value)
data.disabled = true
return value.includes(data.menuId)
},
//
handleEdit () {
apiSysRoleInfo({}, `/${this.dataForm.id}`).then(res => {
if (res && res.code === 0) {
this.dataForm = Object.assign({}, this.dataForm, res.role)
var idx = res.role.menuIdList.indexOf(this.tempKey)
if (idx !== -1) {
res.role.menuIdList.splice(idx, res.role.menuIdList.length - idx)
}
if (this.disable) {
this.$refs.menuListTree.filter(res.role.menuIdList)
}
this.defaultCheckedKeys = res.role.menuIdList
}
})
},
//
handleConfirm () {
if (this.disable) {
this.visible = false
return
}
this.$refs['dataForm'].validate((valid) => {
if (valid) {
let params = {
'roleId': this.dataForm.id || undefined,
'roleName': this.dataForm.roleName,
'remark': this.dataForm.remark,
'menuIdList': [].concat(this.$refs.menuListTree.getCheckedKeys(), [this.tempKey], this.$refs.menuListTree.getHalfCheckedKeys())
}
apiSysRoleConfirm(params, this.apiType).then(res => {
if (res && res.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(res.msg)
}
})
}
})
}
}
}
</script>

View File

@ -0,0 +1,174 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.name" placeholder="角色名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
<el-button v-if="isAuth('user:lzrecordrole:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="isAuth('user:lzrecordrole:delete')" type="danger" @click="deleteHandle()"
:disabled="dataListSelections.length <= 0">批量删除
</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="ID">
</el-table-column>
<el-table-column
prop="gmtCreate"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="gmtModified"
header-align="center"
align="center"
label="最后修改时间">
</el-table-column>
<el-table-column
prop="name"
header-align="center"
align="center"
label="角色名称">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './lzrecordrole-add-or-update'
import {apiGetRoleList} from '@/api/api_role'
export default {
data () {
return {
dataForm: {
name: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
getDataList () {
apiGetRoleList({
'page': this.pageIndex,
'limit': this.pageSize,
'name': this.dataForm.name
}).then(data => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/user/lzrecordrole/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

View File

@ -0,0 +1,225 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()"
label-width="80px">
<el-form-item label="员工姓名">
<el-select v-model="dataForm.staffId" prop="staffId" placeholder="请选择" clearable filterable>
<el-option
v-for="item in staffs"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="员工角色">
<el-select v-model="dataForm.departmentLevel" placeholder="请选择" clearable filterable>
<el-option
v-for="item in departmentLevels"
:key="item.id"
:label="item.departmentLevel"
:value="item.departmentLevel">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="审批目标角色">
<el-select v-model="dataForm.targetRole" placeholder="请选择" clearable filterable>
<el-option
v-for="item in targetRoles"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="审批业绩角色">
<el-select v-model="dataForm.resultRole" placeholder="请选择" clearable filterable>
<el-option
v-for="item in resultRoles"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item size="mini" label="授权">
<el-tree
:data="menuList"
:props="menuListTreeProps"
node-key="menuId"
ref="menuListTree"
:default-expand-all="true"
:default-checked-keys="defaultCheckedKeys"
:filter-node-method="filterNode"
show-checkbox
>
<span class="custom-tree-node" slot-scope="{ node, data }">
<span>{{ node.label }}</span>
</span>
</el-tree>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
import {apiSysRoleInfo, apiSysMenuList, apiSysRoleList, apiSysRoleConfirm} from '@/api/api_staff_role'
import {treeDataTranslate} from '@/utils'
export default {
data () {
return {
visible: false,
staffs: [],
targetRoles: [],
resultRoles: [],
departmentLevels: [{
id: 1,
departmentLevel: 'HR'
}, {
id: 2,
departmentLevel: 'BOSS'
}],
lzStaffRole: {},
menuList: [],
menuListTreeProps: {
label: 'name',
children: 'children'
},
tempKey: -666666, // key, tree. #
defaultCheckedKeys: [],
dataForm: {
staffId: '',
departmentLevel: '',
targetRole: '',
resultRole: ''
},
dataRule: {
staffId: [
{ required: true, message: '员工名称不能为空', trigger: 'blur' }
],
departmentLevel: [
{ required: true, message: '请选择HR或BOSS', trigger: 'blur' }
],
targetRole: [
{ required: true, message: '请选择目标角色', trigger: 'blur' }
],
resultRole: [
{ required: true, message: '请选择月未总结角色', trigger: 'blur' }
]
}
}
},
methods: {
async init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.dataForm.staffId = ''
this.dataForm.departmentLevel = ''
this.dataForm.targetRole = ''
this.dataForm.resultRole = ''
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getDataList()
}
})
await this.handleGetSysMenuList()
await this.handleEdit()
},
//
async getDataList () {
const data = await apiSysRoleInfo(this.dataForm.id)
if (data && data.code === 0) {
this.staffs = data.staffs
this.lzStaffRole = data.lzStaffRole
this.dataForm.staffId = data.lzStaffRole.staffId
this.dataForm.departmentLevel = data.lzStaffRole.departmentLevel
this.targetRoles = data.targetRoles
this.resultRoles = data.targetRoles
let d = JSON.parse(data.lzStaffRole.typeRoleIds)
this.dataForm.targetRole = d.type1
this.dataForm.resultRole = d.type2
}
},
//
async handleGetSysMenuList () {
let res = await apiSysMenuList({})
this.menuList = treeDataTranslate(res, 'menuId')
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
this.$refs.menuListTree.setCheckedKeys([])
})
},
filterNode (value, data) {
data.disabled = true
return value.includes(data.menuId)
},
//
handleEdit () {
apiSysRoleList({}, `/${this.dataForm.id}`).then(res => {
if (res && res.code === 0) {
this.dataForm = Object.assign({}, this.dataForm, res.role)
var idx = res.role.menuIdList.indexOf(this.tempKey)
if (idx !== -1) {
res.role.menuIdList.splice(idx, res.role.menuIdList.length - idx)
}
if (this.disable) {
this.$refs.menuListTree.filter(res.role.menuIdList)
}
this.defaultCheckedKeys = res.role.menuIdList
}
})
},
//
dataFormSubmit () {
if (this.disable) {
this.visible = false
return
}
this.$refs['dataForm'].validate((valid) => {
if (valid) {
let params = {
'id': this.dataForm.id,
'menuIdList': [].concat(this.$refs.menuListTree.getCheckedKeys(), [this.tempKey], this.$refs.menuListTree.getHalfCheckedKeys()),
'staffId': this.dataForm.staffId,
'departmentLevel': this.dataForm.departmentLevel,
'targetRole': this.dataForm.targetRole,
'resultRole': this.dataForm.resultRole
}
apiSysRoleConfirm(params, this.apiType).then(res => {
if (res && res.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(res.msg)
}
})
}
})
}
}
}
</script>

View File

@ -0,0 +1,176 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.name" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
<el-button v-if="isAuth('user:lzstaffrole:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="ID">
</el-table-column>
<el-table-column
prop="gmtModified"
header-align="center"
align="center"
label="修改时间">
</el-table-column>
<el-table-column
prop="staffName"
header-align="center"
align="center"
label="员工名称">
</el-table-column>
<el-table-column
prop="departmentLevel"
header-align="center"
align="center"
label="角色">
</el-table-column>
<el-table-column
prop="targetRole"
header-align="center"
align="center"
label="审批目标角色">
</el-table-column>
<el-table-column
prop="resultRole"
header-align="center"
align="center"
label="审批业绩角色">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './lzstaffrole-add-or-update'
import {apiGetRoleList,apiDelete} from '@/api/api_staff_role'
export default {
data () {
return {
dataForm: {
name: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
apiGetRoleList({
'page': this.pageIndex,
'limit': this.pageSize,
'name': this.dataForm.name
}).then(data => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
async deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const data = apiDelete(id)
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
}
})
}
}
}
</script>