mirror of
https://gitee.com/elegant_wings/dbd-meeting-html.git
synced 2025-06-21 13:49:37 +08:00
修改了工单展示问题,新增了工单查询问题
This commit is contained in:
parent
40b3f02f3a
commit
d370007829
30
src/api/admin/repair/repairIo.js
Normal file
30
src/api/admin/repair/repairIo.js
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
import { axios } from '@/utils/request'
|
||||||
|
|
||||||
|
const api = {
|
||||||
|
repairFailureType: '/admin/repair/io'
|
||||||
|
}
|
||||||
|
|
||||||
|
export function exportTemplate () {
|
||||||
|
return axios({
|
||||||
|
url: api.repairFailureType + '/exportTemplate',
|
||||||
|
method: 'get',
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function exportRepair (parameter) {
|
||||||
|
return axios({
|
||||||
|
url: api.repairFailureType + '/exportRepair',
|
||||||
|
method: 'get',
|
||||||
|
params: parameter,
|
||||||
|
responseType: 'blob'
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function importData (data) {
|
||||||
|
return axios({
|
||||||
|
url: api.repairFailureType + '/importRepair',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
@ -58,6 +58,10 @@
|
|||||||
<span class="table-page-search-submitButtons">
|
<span class="table-page-search-submitButtons">
|
||||||
<a-button type="primary" @click="getRepairList()">查询</a-button>
|
<a-button type="primary" @click="getRepairList()">查询</a-button>
|
||||||
<a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button>
|
<a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button>
|
||||||
|
<a-button style="margin-left: 8px" type="primary" @click="exportRepair()">导出工单模板</a-button>
|
||||||
|
<a-button style="margin-left: 8px" type="primary" @click="exportRepairList()">导出工单模板</a-button>
|
||||||
|
<a-button style="margin-left: 8px" type="primary" @click="importDataVisible()">导入</a-button>
|
||||||
|
|
||||||
</span>
|
</span>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
@ -91,7 +95,21 @@
|
|||||||
</span>
|
</span>
|
||||||
</a-table>
|
</a-table>
|
||||||
<repair-modal ref="modal" @ok="handleOk" />
|
<repair-modal ref="modal" @ok="handleOk" />
|
||||||
|
|
||||||
|
<a-modal v-model="visible" title="导入用户">
|
||||||
|
<div style="display: flex">
|
||||||
|
<a-upload
|
||||||
|
accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
|
||||||
|
@change="customChange"
|
||||||
|
:customRequest="customRequest">
|
||||||
|
<a-button type="primary">导入用户数据</a-button>
|
||||||
|
</a-upload>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</a-modal>
|
||||||
</a-card>
|
</a-card>
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -102,6 +120,9 @@ import RepairModal from './modules/RepairModal.vue'
|
|||||||
import { checkPermission } from '@/utils/permissions'
|
import { checkPermission } from '@/utils/permissions'
|
||||||
import { getRepairDeviceList } from '@/api/admin/repair/repairDevice'
|
import { getRepairDeviceList } from '@/api/admin/repair/repairDevice'
|
||||||
import { getRepairTypeList } from '@/api/admin/repair/repairDeviceType'
|
import { getRepairTypeList } from '@/api/admin/repair/repairDeviceType'
|
||||||
|
import { exportRepair, exportTemplate, importData } from '@/api/admin/repair/repairIo'
|
||||||
|
import storage from 'store'
|
||||||
|
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'TableList',
|
name: 'TableList',
|
||||||
@ -121,6 +142,10 @@ export default {
|
|||||||
},
|
},
|
||||||
form: this.$form.createForm(this),
|
form: this.$form.createForm(this),
|
||||||
mdl: {},
|
mdl: {},
|
||||||
|
visible: false,
|
||||||
|
headers: {
|
||||||
|
Authorization: 'Bearer ' + storage.get(ACCESS_TOKEN)
|
||||||
|
},
|
||||||
// 高级搜索 展开/关闭
|
// 高级搜索 展开/关闭
|
||||||
advanced: false,
|
advanced: false,
|
||||||
// 查询参数
|
// 查询参数
|
||||||
@ -241,15 +266,77 @@ export default {
|
|||||||
this.selectType()
|
this.selectType()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
customChange () {
|
||||||
|
|
||||||
|
},
|
||||||
|
customRequest (file) {
|
||||||
|
// file 是上传的文件 其内容会在放在下面截图中
|
||||||
|
// 后端需要接受的参数是 formData数据,
|
||||||
|
// uploadFile 我自己的接口
|
||||||
|
const formData = new FormData()
|
||||||
|
formData.append('file', file.file)
|
||||||
|
console.log(file)
|
||||||
|
importData(formData).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
// 调用组件内方法, 设置为成功状态
|
||||||
|
file.onSuccess(res, file.file)
|
||||||
|
file.status = 'done'
|
||||||
|
this.visible = false
|
||||||
|
this.$message.success('导入成功')
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.msg)
|
||||||
|
file.onError()
|
||||||
|
file.status = 'error'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 导入工单
|
||||||
|
importDataVisible () {
|
||||||
|
this.visible = true
|
||||||
|
},
|
||||||
|
|
||||||
|
// 导出工单模板
|
||||||
|
exportRepair () {
|
||||||
|
exportTemplate().then(res => {
|
||||||
|
this.exportExcel('工单模板', res)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 导出工单
|
||||||
|
exportRepairList () {
|
||||||
|
exportRepair({ startDate: '2024-08-01', endDate: '2024-08-30' }).then(res => {
|
||||||
|
this.exportExcel('工单导出', res)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
exportExcel (filename, res) {
|
||||||
|
const link = document.createElement('a')
|
||||||
|
let blob = new Blob([res], { type: 'application/vnd.ms-excel;charset=UTF-8' })
|
||||||
|
link.style.display = 'none'
|
||||||
|
link.href = URL.createObjectURL(blob)
|
||||||
|
let num = ''
|
||||||
|
for (let i = 0; i < 10; i++) {
|
||||||
|
num += Math.ceil(Math.random() * 10)
|
||||||
|
}
|
||||||
|
link.setAttribute('download', filename + '.xls')
|
||||||
|
document.body.appendChild(link)
|
||||||
|
link.click()
|
||||||
|
document.body.removeChild(link)
|
||||||
|
},
|
||||||
|
|
||||||
|
// 切换时间
|
||||||
onChange (value, dateString) {
|
onChange (value, dateString) {
|
||||||
this.queryParam.startTime = dateString[0]
|
this.queryParam.startTime = dateString[0]
|
||||||
this.queryParam.endTime = dateString[1]
|
this.queryParam.endTime = dateString[1]
|
||||||
},
|
},
|
||||||
|
// 查询分类
|
||||||
selectType () {
|
selectType () {
|
||||||
getRepairTypeList().then(res => {
|
getRepairTypeList().then(res => {
|
||||||
this.typeList = res.rows
|
this.typeList = res.rows
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 查询设备
|
||||||
selectDevice (item) {
|
selectDevice (item) {
|
||||||
getRepairDeviceList({ 'typeId': item.key }).then(res => {
|
getRepairDeviceList({ 'typeId': item.key }).then(res => {
|
||||||
this.deviceList = res.rows
|
this.deviceList = res.rows
|
||||||
@ -262,6 +349,7 @@ export default {
|
|||||||
this.deviceName = item.label
|
this.deviceName = item.label
|
||||||
this.queryParam.deviceId = item.key
|
this.queryParam.deviceId = item.key
|
||||||
},
|
},
|
||||||
|
// 查询工单列表
|
||||||
getRepairList () {
|
getRepairList () {
|
||||||
if (this.$route.query.repairUserId != null) {
|
if (this.$route.query.repairUserId != null) {
|
||||||
oneWorkerList({ workerId: this.$route.query.repairUserId }).then(res => {
|
oneWorkerList({ workerId: this.$route.query.repairUserId }).then(res => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user