提交 b6562ed5 编写于 作者: 刘英杰's avatar 刘英杰

保存

上级 bb0cf43a
......@@ -16,7 +16,7 @@ export declare function getApiClassificationGetClassificationById(params: GetApi
title: {
field_id: string;
show_name: string;
show_type: number;
show_type: string;
width: number;
order_by_flag: number;
default_hide_flag: number;
......
......@@ -16,7 +16,7 @@ export declare function getApiCommonUserSelect(params: GetApiCommonUserSelectPar
title: {
field_id: string;
show_name: string;
show_type: number;
show_type: string;
width: number;
order_by_flag: number;
default_hide_flag: number;
......
......@@ -3,3 +3,4 @@ export * from "./getApiCommonUserSelect";
export * from "./postApiCommonUploadFile";
export * from "./postApiCommonGetDept";
export * from "./postApiCommonGetLog";
export * from "./postApiCommonParaTest";
......@@ -3,3 +3,4 @@ export * from "./getApiCommonUserSelect";
export * from "./postApiCommonUploadFile";
export * from "./postApiCommonGetDept";
export * from "./postApiCommonGetLog";
export * from "./postApiCommonParaTest";
......@@ -16,7 +16,7 @@ export declare function getApiMaterialAuditAuditList(params: GetApiMaterialAudit
title: {
field_id: string;
show_name: string;
show_type: number;
show_type: string;
width: number;
order_by_flag: number;
default_hide_flag: number;
......
......@@ -16,7 +16,7 @@ export declare function getApiMaterialAuditAuditPassedList(params: GetApiMateria
title: {
field_id: string;
show_name: string;
show_type: number;
show_type: string;
width: number;
order_by_flag: number;
default_hide_flag: number;
......
......@@ -16,7 +16,7 @@ export declare function getApiMaterialAuditAuditRejectList(params: GetApiMateria
title: {
field_id: string;
show_name: string;
show_type: number;
show_type: string;
width: number;
order_by_flag: number;
default_hide_flag: number;
......
......@@ -16,7 +16,7 @@ export declare function getApiConsumaMaterilaApplicationConsumaMaterilaApplicati
title: {
field_id: string;
show_name: string;
show_type: number;
show_type: string;
width: number;
order_by_flag: number;
default_hide_flag: number;
......
......@@ -16,7 +16,7 @@ export declare function getApiConsumaMaterilaApplicationPersonConsumaMaterilaApp
title: {
field_id: string;
show_name: string;
show_type: number;
show_type: string;
width: number;
order_by_flag: number;
default_hide_flag: number;
......
......@@ -16,7 +16,7 @@ export declare function getApiConsumaMeterialLendRecordList(params: GetApiConsum
title: {
field_id: string;
show_name: string;
show_type: number;
show_type: string;
width: number;
order_by_flag: number;
default_hide_flag: number;
......@@ -90,8 +90,11 @@ export declare function getApiConsumaMeterialLendRecordList(params: GetApiConsum
};
}, any>>;
export interface GetApiConsumaMeterialLendRecordListParams {
/** 查询开始时间 */
start_date?: string;
/** 查询结束时间 */
end_date?: string;
/** 关键字:领用人卡号/领用人名称 */
query?: string;
page_index?: number;
page_size?: number;
......
......@@ -16,7 +16,7 @@ export declare function getApiConsumaMeterialMaterialList(params: GetApiConsumaM
title: {
field_id: string;
show_name: string;
show_type: number;
show_type: string;
width: number;
order_by_flag: number;
default_hide_flag: number;
......
......@@ -16,7 +16,7 @@ export declare function getApiConsumaMeterialPersonalLendRecordList(params: GetA
title: {
field_id: string;
show_name: string;
show_type: number;
show_type: string;
width: number;
order_by_flag: number;
default_hide_flag: number;
......
......@@ -7,8 +7,12 @@ export * from "./postApiConsumaMeterialMaterialBatchAdd";
export * from "./postApiConsumaMeterialMaterialBatchUpdate";
export * from "./getApiConsumaMeterialMaterialBatchListInit";
export * from "./postApiConsumaMeterialMaterialBatchList";
export * from "./postApiConsumaMeterialMaterialBatchListExport";
export * from "./getApiConsumaMeterialMaterialBatchDelete";
export * from "./getApiConsumaMeterialPersonalLendRecordListInit";
export * from "./getApiConsumaMeterialPersonalLendRecordList";
export * from "./getApiConsumaMeterialLendRecordListInit";
export * from "./getApiConsumaMeterialLendRecordList";
export * from "./getApiConsumaMeterialLendRecordListOutPut";
export * from "./postApiConsumaMeterialMaterialBatchImport";
export * from "./getApiConsumaMeterialMaterialBatchImportBaseFile";
......@@ -7,8 +7,12 @@ export * from "./postApiConsumaMeterialMaterialBatchAdd";
export * from "./postApiConsumaMeterialMaterialBatchUpdate";
export * from "./getApiConsumaMeterialMaterialBatchListInit";
export * from "./postApiConsumaMeterialMaterialBatchList";
export * from "./postApiConsumaMeterialMaterialBatchListExport";
export * from "./getApiConsumaMeterialMaterialBatchDelete";
export * from "./getApiConsumaMeterialPersonalLendRecordListInit";
export * from "./getApiConsumaMeterialPersonalLendRecordList";
export * from "./getApiConsumaMeterialLendRecordListInit";
export * from "./getApiConsumaMeterialLendRecordList";
export * from "./getApiConsumaMeterialLendRecordListOutPut";
export * from "./postApiConsumaMeterialMaterialBatchImport";
export * from "./getApiConsumaMeterialMaterialBatchImportBaseFile";
......@@ -17,7 +17,7 @@ export declare function postApiConsumaMeterialMaterialBatchList(input?: Material
title: {
field_id: string;
show_name: string;
show_type: number;
show_type: string;
width: number;
order_by_flag: number;
default_hide_flag: number;
......
......@@ -16,7 +16,7 @@ export declare function getApiEquipmentAdminEquipmentLendList(params: GetApiEqui
title: {
field_id: string;
show_name: string;
show_type: number;
show_type: string;
width: number;
order_by_flag: number;
default_hide_flag: number;
......
......@@ -16,7 +16,7 @@ export declare function getApiEquipmentEquipmentLendLsit(params: GetApiEquipment
title: {
field_id: string;
show_name: string;
show_type: number;
show_type: string;
width: number;
order_by_flag: number;
default_hide_flag: number;
......
......@@ -16,7 +16,7 @@ export declare function getApiEquipmentEquipmentSelect(params: GetApiEquipmentEq
title: {
field_id: string;
show_name: string;
show_type: number;
show_type: string;
width: number;
order_by_flag: number;
default_hide_flag: number;
......
......@@ -14,3 +14,4 @@ export * from "./getApiEquipmentEquipmentSelect";
export * from "./getApiEquipmentEquipmentDelete";
export * from "./getApiEquipmentGetEquipmentClassificationTree";
export * from "./getApiEquipmentEquipmentNotReturnReminder";
export * from "./postApiEquipmentEquipmentLendToPdf";
......@@ -14,3 +14,4 @@ export * from "./getApiEquipmentEquipmentSelect";
export * from "./getApiEquipmentEquipmentDelete";
export * from "./getApiEquipmentGetEquipmentClassificationTree";
export * from "./getApiEquipmentEquipmentNotReturnReminder";
export * from "./postApiEquipmentEquipmentLendToPdf";
......@@ -16,7 +16,7 @@ export declare function postApiEquipmentEquipmentList(params: PostApiEquipmentEq
title: {
field_id: string;
show_name: string;
show_type: number;
show_type: string;
width: number;
order_by_flag: number;
default_hide_flag: number;
......
......@@ -17,7 +17,7 @@ export declare function postApiEquipmentEquipmentStoreInList(input?: EquipmentSt
title: {
field_id: string;
show_name: string;
show_type: number;
show_type: string;
width: number;
order_by_flag: number;
default_hide_flag: number;
......
......@@ -16,7 +16,7 @@ export declare function postApiEquipmentPersonalLendEquipmentList(params: PostAp
title: {
field_id: string;
show_name: string;
show_type: number;
show_type: string;
width: number;
order_by_flag: number;
default_hide_flag: number;
......
......@@ -16,7 +16,7 @@ export declare function getApiEquipmentApplicationApplicationList(params: GetApi
title: {
field_id: string;
show_name: string;
show_type: number;
show_type: string;
width: number;
order_by_flag: number;
default_hide_flag: number;
......
......@@ -16,7 +16,7 @@ export declare function getApiEquipmentApplicationPersonalApplicationList(params
title: {
field_id: string;
show_name: string;
show_type: number;
show_type: string;
width: number;
order_by_flag: number;
default_hide_flag: number;
......
......@@ -16,7 +16,7 @@ export declare function getApiEquipmentAuditAuditList(params: GetApiEquipmentAud
title: {
field_id: string;
show_name: string;
show_type: number;
show_type: string;
width: number;
order_by_flag: number;
default_hide_flag: number;
......
......@@ -16,7 +16,7 @@ export declare function getApiEquipmentAuditAuditPassList(params: GetApiEquipmen
title: {
field_id: string;
show_name: string;
show_type: number;
show_type: string;
width: number;
order_by_flag: number;
default_hide_flag: number;
......
......@@ -16,7 +16,7 @@ export declare function getApiEquipmentAuditAuditRejectList(params: GetApiEquipm
title: {
field_id: string;
show_name: string;
show_type: number;
show_type: string;
width: number;
order_by_flag: number;
default_hide_flag: number;
......
......@@ -16,7 +16,7 @@ export declare function getApiPermissionQuery(params: GetApiPermissionQueryParam
title: {
field_id: string;
show_name: string;
show_type: number;
show_type: string;
width: number;
order_by_flag: number;
default_hide_flag: number;
......
......@@ -2,3 +2,4 @@ export * from "./getApiRepairAddMiddleItem";
export * from "./getApiRepairQueryById";
export * from "./getApiRepairDeleteMiddleItem";
export * from "./getApiRepairRegisterRepair";
export * from "./getApiRepairRepairList";
......@@ -2,3 +2,4 @@ export * from "./getApiRepairAddMiddleItem";
export * from "./getApiRepairQueryById";
export * from "./getApiRepairDeleteMiddleItem";
export * from "./getApiRepairRegisterRepair";
export * from "./getApiRepairRepairList";
......@@ -16,7 +16,7 @@ export declare function getApiWarningWarningList(params: GetApiWarningWarningLis
title: {
field_id: string;
show_name: string;
show_type: number;
show_type: string;
width: number;
order_by_flag: number;
default_hide_flag: number;
......
......@@ -2,7 +2,7 @@ import { type Option } from "../../interface";
export interface TableTitle {
field_id?: string;
show_name?: string;
show_type?: number;
show_type?: string;
width?: number;
order_by_flag?: number;
default_hide_flag?: number;
......
......@@ -18,6 +18,8 @@ export * from "./apiTypes/VEcmsDept";
export * from "./apiTypes/VEcmsDeptMessageModel";
export * from "./apiTypes/EcmsLog";
export * from "./apiTypes/EcmsLogMessageModel";
export * from "./apiTypes/Para";
export * from "./apiTypes/ParaTestRequest";
export * from "./apiTypes/EcmsSysConfig";
export * from "./apiTypes/EcmsSysConfigMessageModel";
export * from "./apiTypes/MaterialNumViewModel";
......@@ -101,6 +103,9 @@ export * from "./apiTypes/AdminAddRequest";
export * from "./apiTypes/PermissionUpdateRequest";
export * from "./apiTypes/EcmsRepairMiddle";
export * from "./apiTypes/EcmsRepairMiddleMessageModel";
export * from "./apiTypes/RepairListResponse";
export * from "./apiTypes/RepairListResponsePageModel";
export * from "./apiTypes/RepairListResponsePageModelMessageModel";
export * from "./apiTypes/Int32MessageModel";
export * from "./apiTypes/StringInt32DictionaryMessageModel";
export * from "./apiTypes/GetMaterialUseCountResponse";
......
......@@ -18,6 +18,8 @@ export * from "./apiTypes/VEcmsDept";
export * from "./apiTypes/VEcmsDeptMessageModel";
export * from "./apiTypes/EcmsLog";
export * from "./apiTypes/EcmsLogMessageModel";
export * from "./apiTypes/Para";
export * from "./apiTypes/ParaTestRequest";
export * from "./apiTypes/EcmsSysConfig";
export * from "./apiTypes/EcmsSysConfigMessageModel";
export * from "./apiTypes/MaterialNumViewModel";
......@@ -101,6 +103,9 @@ export * from "./apiTypes/AdminAddRequest";
export * from "./apiTypes/PermissionUpdateRequest";
export * from "./apiTypes/EcmsRepairMiddle";
export * from "./apiTypes/EcmsRepairMiddleMessageModel";
export * from "./apiTypes/RepairListResponse";
export * from "./apiTypes/RepairListResponsePageModel";
export * from "./apiTypes/RepairListResponsePageModelMessageModel";
export * from "./apiTypes/Int32MessageModel";
export * from "./apiTypes/StringInt32DictionaryMessageModel";
export * from "./apiTypes/GetMaterialUseCountResponse";
......
......@@ -39,7 +39,7 @@
<template #action="{ row }">
<div class="action-btns">
<a href="javascript:;" @click="details(row)">详情</a>
<Divider v-if="row.audit_status === 0" type="vertical"/>
<Divider v-if="row.audit_status === 0" type="vertical"/>
<Poptip
v-if="row.audit_status === 0"
confirm
......@@ -162,10 +162,11 @@
>
<template #num="{row}">
<InputNumber @on-change="materialChange($event,row)" v-model="row.num" :min="1" controls-outside/>
<InputNumber @on-change="materialChange($event,row)" v-model="row.num" :min="1" controls-outside/>
</template>
<template #action="{row}">
<a href="javascript:;" @click="init.application.formData.material_num_list = init.application.formData.material_num_list.filter(cur=>cur.id !== row.id)">删除</a>
<a href="javascript:;"
@click="init.application.formData.material_num_list = init.application.formData.material_num_list.filter(cur=>cur.id !== row.id)">删除</a>
<!-- <Poptip
:transfer="true"
......@@ -179,15 +180,15 @@
</template>
</Table>
<div style="gap: 8px;width: 100%;display: flex;justify-content: center;">
<Button
style="width: 100%;"
icon="md-add"
type="dashed"
@click="showAddUser('选择耗材')"
>
选择耗材
</Button>
</div>
<Button
style="width: 100%;"
icon="md-add"
type="dashed"
@click="showAddUser('选择耗材')"
>
选择耗材
</Button>
</div>
</FormItem>
</Col>
......@@ -212,7 +213,6 @@
:before-upload="beforeUpload"
>
<Button icon="ios-cloud-upload-outline">上传附件</Button>
</Upload>
<div
......@@ -374,7 +374,7 @@ import CTable from '@/components/CTable.vue'
const DrawerDetails = defineAsyncComponent(() => import('@/components/drawerDetails'))
const init = reactive({
pageKey:'',
pageKey: '',
consumablesSelector: {
batchMaintenance: {
flag: 'add',
......@@ -768,13 +768,15 @@ const init = reactive({
},
rules: {
material_num_list: [
{ required: true, type: 'array', validator:(rule, value, callback)=>{
if(init.application.formData.material_num_list.length>0){
callback();
}else{
callback(new Error('请选择耗材'));
}
}, message: "请选择耗材", trigger: "change" }
{
required: true, type: 'array', validator: (rule, value, callback) => {
if (init.application.formData.material_num_list.length > 0) {
callback();
} else {
callback(new Error('请选择耗材'));
}
}, message: "请选择耗材", trigger: "change"
}
],
},
......@@ -859,7 +861,6 @@ const applyForDevices = () => {
}
// 耗材申请数量
const materialChange = (event, row) => {
init.application.formData.material_num_list.forEach((cur => {
if (cur.id === row.id) cur.num = event
}))
......@@ -878,28 +879,26 @@ const handleSubmitDevice = () => {
// })
// return
materialForm.value.validate(validate=>{
if(validate){
materialForm.value.validate(validate => {
if (validate) {
hooks.myEncapsulationFunction(() => {
return api.postApiConsumaMaterilaApplicationConsumaMaterilaApply({
usage: init.application.formData.usage,
file_list: init.application.formData.file_list.map(cur => cur.id).join(';'),
material_num_list: init.application.formData.material_num_list.map(cur => ({
"material_id": cur.id,
"num": cur.num
})),
}).then(res => {
if (res.code === 1) {
PersonalApplicationList()
init.application.show = false
}
})
}, false, '正在提交中...')
return api.postApiConsumaMaterilaApplicationConsumaMaterilaApply({
usage: init.application.formData.usage,
file_list: init.application.formData.file_list.map(cur => cur.id).join(';'),
material_num_list: init.application.formData.material_num_list.map(cur => ({
"material_id": cur.id,
"num": cur.num
})),
}).then(res => {
if (res.code === 1) {
PersonalApplicationList()
init.application.show = false
}
return res
})
}, false, '正在提交中...')
}
})
}
/**
......@@ -1258,7 +1257,7 @@ function closeDrawer() {
function cancelApplication(row) {
hooks.myEncapsulationFunction(() => {
return api.postApiConsumaMaterilaApplicationConcelApplication({
application_id:row.application_id
application_id: row.application_id
}).then(res => {
if (res.code === 1) {
PersonalApplicationList()
......
......@@ -12,7 +12,7 @@
@on-reset="handleReset"
/>
<div style="display: flex;">
<Button class="ivu-ml-8" type="primary" @click="init.importDuty.show = true">
<Button class="ivu-ml-8" type="primary" @click="importDutyFun">
<Icon type="ios-cloud-download-outline"/>
导出领用记录
</Button>
......@@ -51,6 +51,7 @@
<!-- 分页 -->
<div class="pagination">
<Page
:key="init.pageKey"
:transfer="true"
:total="init.myBorrowingRecord.total"
:current="init.myBorrowingRecord.params.page_index"
......@@ -216,6 +217,7 @@ const departmentOptions = ref([])
// 当前选中的角色
const currentRole = ref({})
const init = reactive({
pageKey:'',
importDuty: {
loading: false,
show: false,
......@@ -422,6 +424,7 @@ const handleReset = () => {
page_size: 10,
remark: "",
}
init.pageKey = Date.now()
PersonalLendRecordList()
}
// 分页改变
......@@ -541,17 +544,12 @@ function closeDrawer(){
function importDutyFun() {
//值班附件导出
init.importDuty.loading = true
let date = {
begin_time: dayjs(init.importDuty.date[0]).format('YYYY-MM-DD'),
end_time: dayjs(init.importDuty.date[1]).format('YYYY-MM-DD'),
}
return api.postApiActivityExport({...init.importDuty.formData, ...date}).then(res => {
window.location.href = res.response
init.importDuty.loading = false
}).finally(() => {
init.importDuty.loading = false
})
hooks.myEncapsulationFunction(()=>{
return api.getApiConsumaMeterialLendRecordListOutPut(init.myBorrowingRecord.params ).then(res => {
window.location.href = res.response
return res
})
},false,'正在导出...')
}
onMounted(() => {
......@@ -702,4 +700,4 @@ onMounted(() => {
.duty-dept-select {
margin-bottom: 16px;
}
</style>
\ No newline at end of file
</style>
......@@ -18,7 +18,7 @@
<template #right>
<div class="demo-split-pane-R">
<Card ref="card" dis-hover>
<!-- 搜索条件-->
<!--搜索条件-->
<initForm
ref="searchFormRef"
:searchCondList="init.searchList"
......@@ -26,13 +26,30 @@
@on-reset="handleReset"
/>
<Button type="primary" class="ivu-ml-8" :disabled="params.classification_id==''" @click="add">
<Icon type="md-add"/>
新增
</Button>
<div style="display: flex;gap: 10px;padding-top: 10px;">
<Button type="primary" class="ivu-ml-8" :disabled="params.classification_id==''" @click="add">
<Icon type="md-add"/>
新增
</Button>
<!-- 数据table -->
<Upload class="ivu-ml-8" :before-upload="beforeUpload">
<Button type="primary">
<Icon type="ios-cloud-upload-outline"/>
批量导入批次
</Button>
</Upload>
<Button class="ivu-ml-8" type="primary" @click="importDutyFun">
<Icon type="ios-cloud-download-outline"/>
导出批量批次模版
</Button>
</div>
<!--数据table -->
<CTable
:key="init.pageKey"
:tableBorder="true"
:tableColumns="tableColumns.filter(a => a.show)"
:tableData="tableData"
......@@ -42,7 +59,6 @@
:pageIndex="params.page_index"
:pageSize="params.page_size"
@switchChange="switchChange"
@onPageChange="onPageChange"
@onPageSizeChange="onPageSizeChange">
......@@ -69,8 +85,8 @@
<a type="text" @click="showBatchMaintenance(row)">批次维护</a>
<Divider type="vertical"/>
<!-- <a type="text" @click="showEarlyWarning(row)">耗材预警</a>-->
<!-- <Divider type="vertical"/>-->
<!-- <a type="text" @click="showEarlyWarning(row)">耗材预警</a>-->
<!-- <Divider type="vertical"/>-->
<a type="text" @click="handleEdit(row)">编辑</a>
<Divider type="vertical"/>
<Poptip confirm transfer title="是否确认删除?" @on-ok="handleDelete(row)">
......@@ -290,6 +306,10 @@
<Icon type="md-add"/>
新增
</Button>
<Button class="ivu-ml-8" type="primary" @click="exportNearExpiryList">
<Icon type="ios-cloud-download-outline"/>
导出近效期清单
</Button>
</div>
<Table
:loading="init.batchMaintenance.loading"
......@@ -597,6 +617,7 @@
<!-- 分页 -->
<div class="pagination" style="margin-top: 16px">
<Page
:total="init.earlyWarning.total"
:current="init.earlyWarning.params.page_index"
:page-size="init.earlyWarning.params.page_size"
......@@ -624,7 +645,7 @@
import CTable from '@/components/CTable.vue';
import CEditModal from '@/components/CEditModal.vue';
import SearchCondForm from '@/components/SearchCondForm.vue';
import {DatePicker, Divider, FormItem, Modal, Page, Tag} from "view-ui-plus";
import {DatePicker, Divider, FormItem, Modal, Page, Tag, Upload} from "view-ui-plus";
import * as api from '@/api/allApi/controller/index'
import * as hooks from '@/hook/index'
import initForm from "@/components/initForm";
......@@ -634,6 +655,7 @@ import {deviceProjectStore} from "@/store/deviceProjectStoree";
export default {
name: 'list',
components: {
Upload,
DatePicker,
Modal, Page,
FormItem, Tag,
......@@ -646,6 +668,7 @@ export default {
data() {
return {
init: {
pageKey: '',
earlyWarning: {
flag: 'add',
show: false,
......@@ -1074,7 +1097,7 @@ export default {
],
// 搜索条件
params: {
is_under_safe:'0',
is_under_safe: '0',
query: '',
page_index: 1,
page_size: 10,
......@@ -1200,7 +1223,6 @@ export default {
// 获取物资树
this.tableLoading = true
this.getTreeData().then(res => {
console.log("🚀🚀🚀,", res.response)
this.init.consumables.formData.parent_name = res.response[0].name
this.params.classification_id = res.response[0].id
this.getData()
......@@ -1212,8 +1234,8 @@ export default {
* 耗材预警
* @param {Object} row 当前行数据
*/
showEarlyWarning(){
this.init.earlyWarning.show = true
showEarlyWarning() {
this.init.earlyWarning.show = true
},
//提交批次
handleSubmitEarlyWarning() {
......@@ -1514,9 +1536,9 @@ export default {
"duty_tid": "",
"duty_tids": [
{
card_number:deviceProjectStore.state.userInfo.card,
name:deviceProjectStore.state.userInfo.name,
tid:deviceProjectStore.state.userInfo.tid,
card_number: deviceProjectStore.state.userInfo.card,
name: deviceProjectStore.state.userInfo.name,
tid: deviceProjectStore.state.userInfo.tid,
}
],
"storage_num": 0,
......@@ -1663,6 +1685,16 @@ export default {
this.init.batchMaintenance.loading = false;
});
},
//导出批次进效清单
exportNearExpiryList() {
//值班附件导出
hooks.myEncapsulationFunction(() => {
return api.postApiConsumaMeterialMaterialBatchListExport(this.init.batchMaintenance.params).then(res => {
window.location.href = res.response
return res
})
}, false, '正在导出...')
},
/**
* 设备借用记录
......@@ -1789,11 +1821,12 @@ export default {
handleReset() {
this.params = {
...this.params,
is_under_safe:'0',
is_under_safe: '0',
query: '',
page_index: 1,
page_size: 10,
}
this.init.pageKey = Date.now()
this.getData()
},
//提交分类
......@@ -1919,9 +1952,9 @@ export default {
//预警人员
this.init.consumables.formData.waring_person_tid_lists = [
{
card_number:deviceProjectStore.state.userInfo.card,
name:deviceProjectStore.state.userInfo.name,
tid:deviceProjectStore.state.userInfo.tid,
card_number: deviceProjectStore.state.userInfo.card,
name: deviceProjectStore.state.userInfo.name,
tid: deviceProjectStore.state.userInfo.tid,
}
]
this.init.consumables.flag = 'add'
......@@ -1981,6 +2014,29 @@ export default {
})
},
//导出批次模版
importDutyFun() {
//值班附件导出
hooks.myEncapsulationFunction(() => {
return api.getApiConsumaMeterialMaterialBatchImportBaseFile().then(res => {
window.location.href = res.response
return res
})
}, false, '正在导出...')
},
//批次导入附件上传
beforeUpload(file) {
let f = new FormData();
f.append('file', file)
hooks.myEncapsulationFunction(() => {
return api.postApiConsumaMeterialMaterialBatchImport(f, {headers: {'Content-Type': 'multipart/form-data'}}).then(res => {
this.getData()
return res
})
}, false, '正在导入...')
return false
}
}
}
</script>
......
......@@ -52,6 +52,7 @@
<!-- 分页 -->
<div class="pagination">
<Page
:key="init.pageKey"
:total="init.allBorrowingRecord.total"
:current="init.allBorrowingRecord.params.page_index"
:page-size="init.allBorrowingRecord.params.page_size"
......@@ -437,6 +438,7 @@ import {deviceProjectStore} from "@/store/deviceProjectStoree";
const DrawerDetails = defineAsyncComponent(() => import('@/components/drawerDetails'))
const init = reactive({
pageKey:'',
batchMaintenance: {
flag: 'add',
formDataShow: false,
......@@ -1365,6 +1367,7 @@ const handleReset = () => {
page_index: 1,
page_size: 10,
}
init.pageKey = Date.now()
ApplicationList()
}
// 分页改变
......
......@@ -51,6 +51,7 @@
<!-- 分页 -->
<div class="pagination">
<Page
:key="init.pageKey"
:total="init.allBorrowingRecord.total"
:current="init.allBorrowingRecord.params.page_index"
:page-size="init.allBorrowingRecord.params.page_size"
......@@ -281,6 +282,7 @@ const DrawerDetails = defineAsyncComponent(()=>import('@/components/drawerDetai
const init = reactive({
pageKey:'',
grid: {
xs: 24,
sm: 12,
......@@ -584,6 +586,7 @@ const handleReset = () => {
page_index: 1,
page_size: 10,
}
init.pageKey = Date.now();
ApplicationList()
}
// 分页改变
......
......@@ -17,6 +17,10 @@
<Icon type="md-add"/>
新增设备
</Button>
<Button @click="handleBatchNotify" type="success" style="margin-left: 5px">
下载出库单
</Button>
<!-- <Button class="ivu-ml-8" @click="handleImport"><Icon type="md-cloud-upload" /> 导入设备</Button>-->
<!-- <Button-->
......@@ -30,7 +34,10 @@
</div>
<!-- 设备表格 -->
<Table :loading="loading" :columns="userColumns" :data="userList" border>
<Table :loading="loading" :columns="userColumns" :data="userList" border
@on-selection-change="handleSelectionChange"
>
<template #action="{ row }">
<div class="action-btns" style="display: flex; align-items: center">
<a href="javascript:;" @click="handleSubmit(row, 'borrow')"
......@@ -88,6 +95,7 @@
<!-- 分页 -->
<div class="pagination">
<Page
:key="init.pageKey"
:total="init.devices.total"
:current="init.devices.params.page_index"
:page-size="init.devices.params.page_size"
......@@ -639,7 +647,7 @@
label-width="100"
>
<Row :gutter="16" type="flex" style="flex-wrap: wrap;">
<!-- 报修人 -->
<!--报修人-->
<Col :xs="24" :sm="12">
<FormItem label="报修人" prop="name">
<Input
......@@ -669,7 +677,6 @@
placeholder="请选择报修区域"
style="width: 100%;"
:clearable="true"
@on-change="handleAreaChange"
/>
</FormItem>
</Col>
......@@ -695,7 +702,6 @@
placeholder="请选择报修项目"
style="width: 100%;"
:clearable="true"
@on-change="handleItemChange"
/>
<Spin v-if="init.repair.loading"></Spin>
</div>
......@@ -876,6 +882,11 @@ const formValues = ref({});
// 用户表格列定义
const userColumns = computed(() => {
const columns = [
{
type: 'selection',
width: 60,
align: "center",
},
{
title: "#",
type: "index",
......@@ -973,6 +984,7 @@ const loading = ref(false);
const userList = ref([]);
const init = reactive({
pageKey: '',
//报修
repair: {
loading: true,
......@@ -1234,6 +1246,7 @@ const init = reactive({
list: [],
},
devices: {
deviceIdList:[],
flag: "add",
total: 0,
params: {
......@@ -1468,7 +1481,7 @@ function handleSubmit(row, type) {
* 报修细项同步
* */
//变更报修系统细项
bxApi.setAreaItemStatus({"id":[responseInfo.repair_item_id],"use_flag":0}).then(_res=>{
bxApi.setAreaItemStatus({"id": [responseInfo.repair_item_id], "use_flag": 0}).then(_res => {
//删除中间表对应关系
api.getApiRepairDeleteMiddleItem({classification_equipment_id: responseInfo.euqipment_id})
})
......@@ -1667,7 +1680,7 @@ const handleReset = () => {
page_index: 1,
page_size: 10,
};
init.pageKey = Date.now();
init.searchList.forEach((cur) => {
if (cur.code === "classification_id") {
searchFormRef.value.searchCondObj.classification_id = cur.options[0].id;
......@@ -2195,21 +2208,21 @@ function setPeopleColumnsData() {
function showRepair(row) {
getRepairAreaTree()
getRepairItemTree()
init.repair.formData ={
init.repair.formData = {
"name": "",
"area_id": "",
"area_text": "",
"areaDetail": "",
"item_id": "",
"item_text": "",
"itemDetail": "",
"phone": "",
"detail": "",
"file_list": [],
"relationContentId": "",
"contentLinkId": "",
"key_file_list": [],
"key_remark": ""
"area_id": "",
"area_text": "",
"areaDetail": "",
"item_id": "",
"item_text": "",
"itemDetail": "",
"phone": "",
"detail": "",
"file_list": [],
"relationContentId": "",
"contentLinkId": "",
"key_file_list": [],
"key_remark": ""
}
init.repair.title = row.name
......@@ -2219,8 +2232,6 @@ function showRepair(row) {
init.repair.loading = true
//获取报修系统细项id
api.getApiRepairQueryById({classification_equipment_id: row.id}).then(res => {
init.repair.formData.item_id = String(res.response.repair_item_id)
......@@ -2314,9 +2325,10 @@ function handleRepairSubmit() {
}).then(res => {
//
api.getApiRepairRegisterRepair({
repair_item_id: init.repair.formData.item_id,
repair_out_id: res.response}
).then(()=>{
repair_item_id: init.repair.formData.item_id,
repair_out_id: res.response
}
).then(() => {
init.repair.show = false
EquipmentList()
})
......@@ -2331,6 +2343,25 @@ function handleRepairSubmit() {
/**
* 设备报修
* */
//设备导出出库单
function handleSelectionChange(selection) {
init.devices.deviceIdList = selection.map(row => row.id);
}
//导出出库单
function handleBatchNotify() {
if (init.devices.deviceIdList.length === 0) {
Message.warning("请先选择设备");
return;
}
hooks.myEncapsulationFunction(()=>{
api.postApiEquipmentEquipmentLendToPdf(init.devices.deviceIdList).then(res=>{
EquipmentList();
init.devices.deviceIdList = []
})
},false, '正在导出中...')
}
onMounted(() => {
getRepairAreaTree()
getRepairItemTree()
......
......@@ -52,6 +52,7 @@
<!-- 分页 -->
<div class="pagination">
<Page
:key="init.pageKey"
:total="init.allBorrowingRecord.total"
:current="init.allBorrowingRecord.params.page_index"
:page-size="init.allBorrowingRecord.params.page_size"
......@@ -291,6 +292,7 @@ const DrawerDetails = defineAsyncComponent(()=>import('@/components/drawerDetai
const init = reactive({
pageKey:'',
grid: {
xs: 24,
sm: 12,
......@@ -587,6 +589,7 @@ const handleReset = () => {
page_index: 1,
page_size: 10,
}
init.pageKey = Date.now();
ApplicationList()
}
// 分页改变
......
......@@ -54,6 +54,7 @@
<!-- 分页 -->
<div class="pagination">
<Page
:key="init.pageKey"
:total="init.devices.total"
:current="init.devices.params.page_index"
:page-size="init.devices.params.page_size"
......@@ -695,8 +696,8 @@ const userColumns = computed(() => {
return h('span', params.row.storage_location || '-');
}
},
];
// 添加操作列
......@@ -712,6 +713,7 @@ const loading = ref(false);
const userList = ref([]);
const init = reactive({
pageKey:123 ,
// 借用记录相关数据
equipmentBorrowingStatus: {
itemData: {},
......@@ -1334,7 +1336,7 @@ const handleReset = () => {
page_index: 1,
page_size: 10,
};
init.pageKey = Date.now();
init.searchList.forEach((cur) => {
if (cur.code === "classification_id") {
searchFormRef.value.searchCondObj.classification_id = cur.options[0].id;
......
<template>
<Card dis-hover style="width: 100%;height: 100%;">
<!-- 右侧人员列表 -->
<div class="role-content">
<!-- 搜索和工具栏 -->
<div class="role-toolbar">
<initForm
ref="searchFormRef"
:searchCondList="init.searchList"
@on-submit="handleSearch"
@on-reset="handleReset"
/>
<div>
<Button type="primary" icon="md-add" @click="applyForDevices">分配权限</Button>
</div>
</div>
<!-- 人员表格 -->
<Table :loading="init.userRole.loading" :columns="init.userRole.columns" :data="init.userRole.data"
border>
<!-- 照片列 -->
<template #avatar="{ row }">
<div class="user-avatar">
<Avatar v-if="row.photo" size="large" :src="row.photo"/>
<Avatar v-else icon="ios-person" size="large"/>
</div>
</template>
<!-- 负责部门列 -->
<template #duty_dept="{ row }">
<Tag v-for="(item,index) in row.duty_dept" :key="index" color="blue" style="margin: 2px">{{item.dept_name}}</Tag>
</template>
<!-- 操作列 -->
<template #action="{ row }">
<div class="action-btns">
<a href="javascript:;" @click="edit(row)">编辑</a>
<Divider type="vertical"/>
<Poptip
confirm
transfer
title="确定要删除该设备吗?"
@on-ok="deleteRole(row)"
>
<a href="javascript:;">删除</a>
</Poptip>
</div>
<!-- 系统配置 -->
<div>
<div class="mainDiv">
<Card class="bigCard" title="活动时间提醒">
<Form label-colon>
<Row>
<Col span="24">
<FormItem label="活动开始前提醒">
<RadioGroup v-model="configData.before_activity">
<Radio label="5">5分钟</Radio>
<Radio label="15">15分钟</Radio>
<Radio label="30">30分钟</Radio>
</RadioGroup>
<span>自定义:</span>
<Input v-model="configData.before_activity" style="width: 60px;"/>&nbsp;
<span>分钟</span>
</FormItem>
</Col>
<Col span="24">
<FormItem label="活动结束前提醒">
<RadioGroup v-model="configData.before_end_activity">
<Radio label="5">5分钟</Radio>
<Radio label="15">15分钟</Radio>
<Radio label="30">30分钟</Radio>
</RadioGroup>
<span>自定义:</span>
<Input v-model="configData.before_end_activity" style="width: 60px;"/>&nbsp;
<span>分钟</span>
</FormItem>
</Col>
<Col span="24" style="text-align: right;">
<Button type="primary" @click="saveBt('before_activity', 'before_end_activity')">保存</Button>
</Col>
</Row>
</Form>
</Card>
<Card class="bigCard kjyyCard" title="评价快捷用语">
<template #extra>
<a @click="fastContentAdd"><Icon type="md-add" /></a>
</template>
</Table>
<!-- 分页 -->
<div class="pagination">
<Page
:transfer="true"
:total="init.userRole.total"
:current="init.userRole.params.page_index"
:page-size="init.userRole.params.page_size"
show-elevator
show-sizer
show-total
@on-change="handlePageChange"
@on-page-size-change="handlePageSizeChange"
/>
</div>
</div>
</Card>
<!-- 分配权限 -->
<Modal
v-model="init.userRole.show"
title="分配权限"
width="700"
:mask-closable="false"
>
<Form
ref="deviceForm"
:model="init.userRole.formData"
:rules="init.userRole.rules"
:label-width="100"
>
<Row>
<Col v-bind="init.grid">
<FormItem label="用户" prop="tid">
<Select
:disabled="init.userRole.flag == 'edit'"
filterable
clearable
:loading="addUserModal.loading"
v-model="init.userRole.formData.tid"
placeholder="请选择用户"
:remote-method="onQueryChange"
>
<Option v-for="(item,index) in init.userRole.formData.tids" :key="index" :value="item.tid" >{{item.name}}({{item.card_number}})</Option>
</Select>
</FormItem>
</Col>
<Col v-bind="init.grid">
<FormItem label="权限" prop="role">
<Select
clearable
v-model="init.userRole.formData.role"
placeholder="请输入申请原因"
>
<Option value="admin" label="管理员"></Option>
<Option value="dept" label="部门管理员"></Option>
</Select>
</FormItem>
</Col>
</Row>
<Row v-bind="init.grid">
<Col>
<FormItem label="部门信息" prop="duty_dept">
<CheckboxGroup v-model="init.userRole.formData.duty_dept">
<Checkbox v-for="(item,index) in init.userRole.duty_depts" :label="item.dept_id" :key="index">
{{ item.dept_name }}
</Checkbox>
</CheckboxGroup>
</FormItem>
</Col>
</Row>
</Form>
<template #footer>
<Button @click="init.userRole.show = false">取消</Button>
<Button type="primary" @click="handleSubmitDevice">确定</Button>
</template>
</Modal>
<!-- 用户数据对话框 -->
<Modal
v-model="addUserModal.show"
:title="'选择用户'"
width="700"
:mask-closable="false"
>
<div class="add-user-search">
<Input
v-model="addUserModal.keyword"
placeholder="输入用户名称搜索"
search
clearable
enter-button
@on-search="searchAvailableUsers"
/>
<Button style="margin-left: 10px" type="primary" @click="batchAddUser"
>批量添加
</Button
>
<p v-for="item in fastContentList" :key="item.id" name="fastCP">
<span>{{ item.content }}</span>
<span>
<a><Icon type="md-create" @click="fastContentEditRow(item)"/></a>
<Poptip confirm transfer title="是否确认删除?" @on-ok="fastContentDelRow(item)">
<a name="del"><Icon type="md-close"/></a>
</Poptip>
</span>
</p>
</Card>
<Card class="smallCard" title="加时配置">
<Form label-colon label-position="top">
<Row>
<Col span="24">
<FormItem label="允许加时时间段个数">
<RadioGroup v-model="configData.add_to">
<Radio label="1">1个</Radio>
<Radio label="2">2个</Radio>
<Radio label="3">3个</Radio>
<Radio label="4">4个</Radio>
<Radio label="5">5个</Radio>
</RadioGroup>
<span>自定义:</span>
<Input v-model="configData.add_to" style="width: 60px;"/>&nbsp;
<span>个</span>
</FormItem>
</Col>
<Col span="24">
<FormItem label="最多加时次数">
<RadioGroup v-model="configData.overtime_num">
<Radio label="1">1次</Radio>
<Radio label="2">2次</Radio>
<Radio label="3">3次</Radio>
<Radio label="4">4次</Radio>
<Radio label="5">5次</Radio>
</RadioGroup>
<span>自定义:</span>
<Input v-model="configData.overtime_num" style="width: 60px;"/>&nbsp;
<span>次</span>
</FormItem>
</Col>
<Col span="24" style="text-align: right;">
<Button type="primary" @click="saveBt('add_to', 'overtime_num')">保存</Button>
</Col>
</Row>
</Form>
</Card>
<Card class="smallCard cplhsCard" title="差评拉黑数">
<p>
<RadioGroup v-model="configData.black_num">
<Radio label="1">1个</Radio>
<Radio label="2">2个</Radio>
<Radio label="3">3个</Radio>
<Radio label="4">4个</Radio>
<Radio label="5">5个</Radio>
</RadioGroup>
</p>
<p>
<span>自定义:</span>
<Input v-model="configData.black_num" style="width: 60px;"/>&nbsp;
<span>个</span>
</p>
<p>&nbsp;</p>
<Button class="save-bt" type="primary" @click="saveBt('black_num')">保存</Button>
</Card>
<Card class="smallCard cplhsCard" title="活动邀请时间限制">
<p>
<RadioGroup v-model="configData.invite_time">
<Radio label="1">1小时</Radio>
<Radio label="2">2小时</Radio>
<Radio label="6">6小时</Radio>
<Radio label="12">12小时</Radio>
</RadioGroup>
</p>
<p>
<span>自定义:</span>
<Input v-model="configData.invite_time" style="width: 60px;"/>&nbsp;
<span>小时</span>
</p>
<p>&nbsp;</p>
<Button class="save-bt" type="primary" @click="saveBt('invite_time')">保存</Button>
</Card>
<Card class="smallCard" title="评价设置">
<Form label-colon>
<Row>
<Col span="24">
<FormItem label="自动好评时间">
<Input v-model="configData.auto_goodevaluate_day" style="width: 60px;"/>&nbsp;
<span>天</span>
</FormItem>
</Col>
<Col span="24">
<FormItem label="自动好评星数">
<Rate
v-model="configData.auto_goodevaluate_num"
allow-half
icon="md-star"/>
</FormItem>
</Col>
<Col span="24">
<FormItem label="催办评价时间">
<Input v-model="configData.urge_evaluate_day" style="width: 60px;"/>&nbsp;
<span>天</span>
</FormItem>
</Col>
<Col span="24" style="text-align: right;">
<Button type="primary" @click="saveBt('auto_goodevaluate_day', 'auto_goodevaluate_num', 'urge_evaluate_day')">保存</Button>
</Col>
</Row>
</Form>
</Card>
<Card class="smallCard cplhsCard" title="最多邀请次数">
<p style="text-align: center;">
<span>最多邀请</span>&nbsp;
<Input v-model="configData.invite_num" style="width: 60px;"/>&nbsp;
<span>次</span>
</p>
<p>&nbsp;</p>
<Button class="save-bt" type="primary" @click="saveBt('invite_num')">保存</Button>
</Card>
<Card class="smallCard cplhsCard" title="黑名单天数">
<p style="text-align: center;">
<span>黑名单</span>&nbsp;
<Input v-model="configData.black_day" style="width: 60px;"/>&nbsp;
<span>天</span>
</p>
<p>&nbsp;</p>
<Button class="save-bt" type="primary" @click="saveBt('black_day')">保存</Button>
</Card>
</div>
<!-- 可添加用户列表 -->
<Table
@on-selection-change="onSelectionChange"
:loading="addUserModal.loading"
:columns="addUserModal.availableUserColumns"
:data="addUserModal.userList"
border
>
<!-- 照片列 -->
<template #avatar="{ row }">
<div class="user-avatar">
<Avatar v-if="row.photo" size="large" :src="row.photo"/>
<Avatar v-else icon="ios-person" size="large"/>
</div>
</template>
<!-- 操作列 -->
<template #action="{ row }">
<div class="action-btns">
<Button type="primary" size="small" @click="confirmAddUser(row)"
>添加
</Button
>
</div>
</template>
</Table>
<!-- 分页 -->
<div class="pagination" style="margin-top: 16px">
<Page
:key="addUserModal.pageKey"
:total="addUserModal.total"
:current="addUserModal.params.page_index"
:page-size="addUserModal.params.page_size"
show-elevator
show-sizer
show-total
@on-change="handleAddUserPageChange"
@on-page-size-change="handleAddUserPageSizeChange"
/>
</div>
<template #footer>
<Button @click="addUserModal.show = false">关闭</Button>
</template>
</Modal>
<!-- 快捷用语新增修改Modal -->
<CEditModal
ref="ceditmodal"
v-model="fastContentModalShow"
:formItem="formItem"
:loading="fastContentModalLoading"
:formLabelWidth="100"
:width="800"
@onSubmit="fastContentSubmit"
@onClose="fastContentModalShow = false"></CEditModal>
</div>
</template>
<script setup>
import initForm from "@/components/initForm";
import {ref, onMounted, reactive, computed, nextTick, onBeforeUpdate} from 'vue'
import {
Checkbox,
CheckboxGroup,
FormItem,
Message,
Modal,
Modal as ModalConfirm,
Option,
Page,
Select,
Tag
} from 'view-ui-plus'
import * as api from "@/api/allApi/controller/index";
import * as hooks from "@/hook/index";
import dayjs from "dayjs";
<script>
import CEditModal from '@/components/CEditModal.vue'
import { cloneDeep } from 'lodash'
const init = reactive({
grid: {
xs: 24,
sm: 12,
md: 12,
lg: 12,
export default {
name: 'list',
components: {
CEditModal,
},
searchList: [],
userRole: {
flag:'add',
loading: false,
total: 0,
data: [],
columns: [
{
title: '#',
type: 'index',
width: 60,
fixed: 'left'
},
{
title: '工号',
key: 'card',
minWidth: 120,
render: (h, params) => {
return h('span', params.row.card || '-');
}
},
{
title: '用户姓名',
key: 'name',
minWidth: 120,
render: (h, params) => {
return h('span', params.row.name || '-');
}
data(){
return {
configData: {
// 允许加时时间段个数
add_to: '',
// 自动好评时间/天
auto_goodevaluate_day: '',
// 自动好评星数
auto_goodevaluate_num: 0,
// 活动开始前提醒/分钟
before_activity: '',
// 活动结束前提醒/分钟
before_end_activity: '',
// 黑名单天数/天
black_day: '',
// 差评拉黑数
black_num: '',
// 邀请次数/次
invite_num: '',
// 邀请限制时间/小时
invite_time: '',
// 是否申请占用
is_occupy: '',
// 最多加时次数
overtime_num: '',
// 催办评价时间/天
urge_evaluate_day: '',
},
{
title: '权限',
key: 'role',
minWidth: 100,
render: (h, params) => {
// 可根据实际role值做映射
const roleMap = {
'dept': '系部管理员',
'user': '普通用户',
'admin': '管理员'
};
return h('span', roleMap[params.row.role] || params.row.role || '-');
}
},
{
title: '所属部门',
slot: 'duty_dept',
minWidth: 180,
// 快捷用语
fastContentList: [],
// 快捷用语编辑Modal
fastContentModalShow: false,
fastContentModalLoading: false,
fastContentIsEdit: false,
// 新增编辑表单项
formItem: [
{ id: 'content', name: '快捷用语', type: 'input', disabled: false, require: false, optList: [] },
{ id: 'is_enable', name: '启用', type: 'switch', disabled: false, require: false, optList: [] },
],
defaultFormData: {
id: "",
content: "",
createby: "",
createtime: "",
is_enable: 0,
is_del: 0
},
{
title: '操作',
slot: 'action',
width: 120,
align: 'center',
fixed: 'right'
}
],
params: {
query: '',
role: '',
page_index: 1,
page_size: 10,
},
show: false,
file_id_lists: [],
equipment_id_lists: [],
equipmentOptions: [],
roles: [],
duty_depts: [],
formData: {
recordId:'',
tid: "",
tids: [],
role: "",
duty_dept: [],
}
},
computed: {},
created(){},
mounted(){
this.getData()
this.getFastContent()
},
methods: {
getData() {
this.asc.getApiSysConfigGetSysConfigAll().then(res => {
// console.log('获取系统配置', res)
res.response.forEach(a => {
this.configData[a.id] = a.value
})
})
},
rules: {
tid: [
{required: true, type: "string", message: "请选择用户", trigger: "change"},
],
duty_dept: [
{required: true, type: "array", message: "请选择部门", trigger: "change"},
],
role: [
{required: true, type: "string", message: "请选择权限", trigger: "change"},
],
// 获取快捷用语
getFastContent() {
this.asc.getApiSysConfigGetCommentContentList().then(res => {
// console.log('快捷用语', res)
this.fastContentList = res.response
})
},
},
downloadLoading: false
});
// 加载角色列表
const Query = () => {
init.userRole.loading = true
api.getApiPermissionQuery(init.userRole.params).then(res => {
init.userRole.data = res.response.data;
init.userRole.total = res.response.data_count
init.userRole.loading = false
}).finally(() => {
init.userRole.loading = false
})
}
// 搜索用户
const handleSearch = (value) => {
init.userRole.params = {
...init.userRole.params,
...value,
page_index: 1
}
Query()
}
const handleReset = () => {
init.userRole.params = {
query: '',
status: '',
audit_status: '0',
page_index: 1,
page_size: 10,
}
Query()
}
// 分页改变
const handlePageChange = (page) => {
init.userRole.params.page_index = page
Query()
}
// 页大小改变
const handlePageSizeChange = (size) => {
init.userRole.params.page_size = size
init.userRole.params.page_index = 1
Query()
}
// 申请申领
const applyForDevices = () => {
init.userRole.flag = 'add'
init.userRole.show = true
init.userRole.formData = {
...init.userRole.formData,
tid: "",
role: "",
duty_dept: [],
}
deviceForm.value.resetFields()
}
const deviceForm = ref();
// 提交权限
const handleSubmitDevice = () => {
console.log("🚀🚀🚀,",init.userRole.formData)
deviceForm.value.validate((validate) => {
if (validate) {
const strategy = {
'add':()=>{
hooks.myEncapsulationFunction(() => {
return api.postApiPermissionPermissionAdd({
tid:init.userRole.formData.tid,
role: init.userRole.formData.role,
duty_dept: init.userRole.formData.duty_dept.join(';')
}).then(res => {
if (res.code === 1) {
Query()
init.userRole.show = false
return res
}
})
}, false, '正在提交中...')
},
'edit':()=>{
hooks.myEncapsulationFunction(() => {
return api.postApiPermissionPermissionUpdate({
id:init.userRole.formData.recordId,
role: init.userRole.formData.role,
duty_dept: init.userRole.formData.duty_dept.join(';')
}).then(res => {
if (res.code === 1) {
Query()
init.userRole.show = false
return res
}
})
}, false, '正在提交中...')
// 保存按钮
async saveBt(...id) {
// console.log('保存按钮', id)
for (var i = 0; i < id.length; i++) {
let obj = {
id: id[i],
value: this.configData[id[i]],
}
const res = await this.asc.postApiSysConfigGetSysConfigSave(obj)
if (res.code != 1) {
this.$Message.error(res.msg_detail)
return
}
}
strategy[init.userRole.flag]()
}
})
}
//删除权限
function deleteRole(row){
hooks.myEncapsulationFunction(() => {
return api.getApiPermissionPermissionDelete({
id: row.id
}).then(res => {
if (res.code === 1) {
Query()
return res
}
})
}, false, '正在删除中...')
}
//编辑权限
async function edit(row) {
init.userRole.formData = {
...init.userRole.formData,
recordId: row.id,
tid: row.tid,
role: row.role,
duty_dept: row.duty_dept.map(cur => cur.dept_id),
tids: [{
...row,
card_number:row.card,
}]
}
console.log("🚀🚀🚀,", row)
init.userRole.flag = 'edit'
init.userRole.show = true;
}
/**人员选择器 */
// 人员选择器》添加用户对话框
const addUserModal = reactive({
flag: '',
pageKey: '',
params: {
page_index: 1,
page_size: 100,
query: "",
},
total: 0,
show: false,
loading: false,
keyword: "",
batchUserList: [],
userList: [],
dutyDepts: [],
availableUserColumns: [
{
align: "center",
type: "selection",
width: 60,
},
{
title: "照片",
slot: "avatar",
width: 80,
},
{
title: "工号",
key: "card_number",
width: 120,
this.$Message.success('修改成功')
},
{
title: "姓名",
key: "name",
minWidth: 120,
// 新增快捷用语
fastContentAdd() {
this.fastContentModalShow = true
this.fastContentIsEdit = false
this.$refs.ceditmodal.modalInit('add', this.defaultFormData)
},
{
title: "部门",
key: "dept_name",
minWidth: 150,
// 编辑快捷用语
fastContentEditRow(row) {
// console.log(row)
this.fastContentModalShow = true
this.fastContentIsEdit = true
this.$refs.ceditmodal.modalInit('edit', row)
},
{
title: "性别",
key: "gender",
width: 80,
// 保存快捷用语
fastContentSubmit(val) {
this.$Modal.confirm({
title: '提示',
content: '是否确认提交?',
loading: true,
onOk: () => {
this.asc.postApiSysConfigCommentContentSave(val).then(res => {
// console.log('保存快捷用语结果', res)
if (res.code == 1) {
this.$Message.success(res.response)
this.fastContentModalShow = false
this.getFastContent()
} else {
this.$Message.error(res.msg_detail)
}
}).finally(() => {
this.$Modal.remove()
})
}
})
},
// {
// title: '操作',
// slot: 'action',
// width: 80,
// align: 'center'
// }
],
});
// 部门列表
const departmentOptions = ref([]);
// 人员选择器》搜索可添加的用户
const searchAvailableUsers = async () => {
UserListSelect();
};
//弹出人员选择器
function showAddUser(key) {
addUserModal.flag = key
addUserModal.params = {
page_index: 1,
page_size: 10,
query: "",
}
addUserModal.pageKey = new Date();
addUserModal.show = true;
addUserModal.batchUserList = [];
UserListSelect()
}
//批量提交选中人员
function batchAddUser() {
const strategy = {
'选择用户': () => {
const dataId = init.userRole.formData.tids.map(cur => cur.tid)
let data = []
//选中但未提交的数据
addUserModal.batchUserList.forEach((cur, index) => {
//不包含
if (!dataId.includes(cur.tid)) {
data.push(cur)
// 删除快捷用语
fastContentDelRow(row) {
// console.log('删除快捷用语', row)
this.asc.getApiSysConfigCommentContentDel({id:row.id, is_del: 1}).then(res => {
// console.log('删除快捷用语结果', res)
if (res.code == 1) {
this.$Message.success(res.response)
this.getFastContent()
} else {
this.$Message.error(res.msg_detail)
}
})
init.userRole.formData.tids = init.userRole.formData.tids.concat(data);
addUserModal.show = false;
},
}
strategy[addUserModal.flag]()
}
//选中人员
function onSelectionChange(e) {
console.log('e', e)
addUserModal.batchUserList = e;
}
// 人员选择器》确认添加用户
const confirmAddUser = async (user) => {
try {
} catch (error) {
console.error("添加用户失败:", error);
Message.error("添加用户失败");
}
};
// 加载人员选择器用户
const UserListSelect = () => {
addUserModal.loading = true;
try {
api.getApiCommonUserSelect({
...addUserModal.params,
query: addUserModal.keyword,
})
.then((res) => {
addUserModal.userList = res.response.data || [];
addUserModal.total = res.response.data_count;
})
.catch((error) => {
console.error("获取角色用户列表失败:", error);
Message.error("获取角色用户列表失败");
})
.finally(() => {
addUserModal.loading = false;
});
} catch (error) {
console.error("获取角色用户列表失败:", error);
Message.error("获取角色用户列表失败");
addUserModal.loading = false;
}
};
// 分页改变
const handleAddUserPageChange = (page) => {
addUserModal.params.page_index = page;
UserListSelect()
};
// 页大小改变
const handleAddUserPageSizeChange = (size) => {
addUserModal.params.page_size = size;
addUserModal.params.page_index = 1;
UserListSelect()
};
/**人员选择器 */
//获取查询字段
function Permission() {
api.getApiPermissionInit().then(res => {
init.searchList = res.response
})
}
//获取部门
function GetDept() {
api.postApiCommonGetDept().then(res => {
init.userRole.duty_depts = res.response
})
}
//获取人员下拉框数据
function GetUserData() {
addUserModal.loading = true
return api.getApiCommonUserSelect(addUserModal.params).then(res => {
init.userRole.formData.tids = res.response.data
addUserModal.loading = false
return res
})
}
const timer = ref({})
//远程搜索
function onQueryChange(row) {
console.log("🚀🚀🚀,",row)
addUserModal.params.query =row
clearTimeout(timer.value)
timer.value = setTimeout(() => GetUserData(),100)
}
onMounted(() => {
GetUserData()
GetDept()
Permission()
Query()
})
</script>
<style scoped>
.role-container {
display: flex;
min-height: calc(100vh - 150px);
/* border: 1px solid #e8eaec; */
border-radius: 4px;
overflow: auto;
gap: 16px;
}
.role-sidebar {
width: 300px;
border-right: 1px solid #e8eaec;
background-color: #fff;
overflow-y: auto;
height: 200px;
}
.role-title {
padding: 16px;
font-size: 16px;
font-weight: bold;
border-bottom: 1px solid #e8eaec;
}
.role-list {
padding: 10px 0;
}
.role-item {
display: flex;
align-items: center;
padding: 12px 16px;
cursor: pointer;
transition: background-color 0.3s;
}
.role-item:hover {
background-color: #f0f0f0;
}
.role-item.active {
background-color: #e8f7ff;
color: #2d8cf0;
}
.role-item-icon {
width: 36px;
height: 36px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin-right: 12px;
color: #fff;
}
.role-admin {
background-color: #2d8cf0;
}
.role-party-office {
background-color: #19be6b;
}
.role-entrance-dept {
background-color: #ff9900;
}
.role-responsible-dept {
background-color: #ed4014;
}
.role-item-info {
flex: 1;
}
.role-name {
font-size: 14px;
margin-bottom: 4px;
}
.role-count {
font-size: 12px;
color: #808695;
}
.role-content {
display: flex;
flex-direction: column;
gap: 16px;
flex: 1;
}
.role-toolbar {
height: 100%;
display: flex;
flex-direction: column;
gap: 20px;
top: 0;
background-color: #fff;
z-index: 1;
}
.search-box {
width: 280px;
}
.pagination {
/* margin-top: 16px; */
text-align: center;
position: sticky;
bottom: 0;
background-color: #fff;
z-index: 1;
}
.action-btns {
display: flex;
justify-content: center;
}
.user-avatar {
display: flex;
justify-content: center;
align-items: center;
}
.user-avatar img {
<style scoped lang="less">
.mainDiv{
width: 100%;
height: 100%;
object-fit: cover;
}
.add-user-search {
margin-bottom: 16px;
display: flex;
}
flex-wrap: wrap;
justify-content: space-between;
.bigCard, .smallCard{
margin-bottom: 16px;
/deep/.ivu-card-body{
height: calc(~"100% - 51px");
.ivu-form-item{
margin-bottom: 12px;
}
}
}
.bigCard{
width: calc(~"(100% - 16px) / 2");
}
.smallCard{
width: calc(~"(100% - 32px) / 3");
// /deep/.ivu-card-body{
// height: calc(~"100% - 51px");
// }
}
.duty-dept-select {
margin-bottom: 16px;
/deep/.kjyyCard{
.ivu-card-body{
overflow: auto;
p[name=fastCP]{
display: flex;
justify-content: space-between;
a[name=del]{
color: #ed4014;
}
a[name=del]:hover{
color: #f16643;
}
a[name=del]:active{
color: #e13d13;
}
}
}
}
/deep/.cplhsCard{
.ivu-card-body{
// height: calc(~"100% - 51px");
display: flex;
flex-direction: column;
justify-content: space-evenly;
}
}
/deep/ .save-bt{
text-align: right;
position: absolute;
bottom: 16px;
right: 16px;
}
}
</style>
Markdown 格式
0% or
您添加了 0 人 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册 或