解决页面插槽使用不规范问题

This commit is contained in:
BianLzhaoMin 2024-05-30 10:39:59 +08:00
parent 2a453c8f14
commit 72919c2ffa
4 changed files with 379 additions and 382 deletions

View File

@ -41,8 +41,8 @@ const user = {
// 登录
Login({ commit }, userInfo) {
const username = userInfo.username.trim()
// const password = encrypt(userInfo.password)
const password = userInfo.password
const password = encrypt(userInfo.password)
// const password = userInfo.password
const code = userInfo.code
const uuid = userInfo.uuid
return new Promise((resolve, reject) => {

View File

@ -88,7 +88,7 @@
width="80"
type="index"
>
<template scope="scope">
<template slot-scope="scope">
<span>{{
(queryParams.pageNum - 1) * 10 + scope.$index + 1
}}</span>
@ -317,7 +317,7 @@
width="80"
type="index"
>
<template scope="scope">
<template slot-scope="scope">
<span>{{
(codeQuery.pageNum - 1) * 10 + scope.$index + 1
}}</span>

View File

@ -449,7 +449,7 @@
width="80"
type="index"
>
<template scope="scope">
<template slot-scope="scope">
<span>{{
(dialogQuery.pageNum - 1) * 10 + scope.$index + 1
}}</span>

View File

@ -344,7 +344,7 @@
width="80"
type="index"
>
<template scope="scope">
<template slot-scope="scope">
<span>{{
(queryParams.pageNum - 1) * 10 + scope.$index + 1
}}</span>
@ -440,392 +440,389 @@
</template>
<script>
import {
listType,
getType,
delType,
addType,
updateType,
refreshCache,
} from '@/api/system/dict/type'
import {
getRepairedList,
getRepairedDetailList,
inputByType,
getTypeList,
} from '@/api/store/warehousing'
import { equipmentTypeTree } from '@/api/store/tools'
import {
listType,
getType,
delType,
addType,
updateType,
refreshCache,
} from '@/api/system/dict/type'
import {
getRepairedList,
getRepairedDetailList,
inputByType,
getTypeList,
} from '@/api/store/warehousing'
import { equipmentTypeTree } from '@/api/store/tools'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default {
name: 'RepairWarehousing',
dicts: ['sys_normal_disable'],
components: {
Treeselect,
},
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
dialogTotal: 0,
//
typeList: [],
modelList: [],
//
tableList: [],
detailTableList: [],
//
title: '',
//
open: false,
showHandle: true,
//
dateRange: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
dictName: undefined,
dictType: undefined,
status: undefined,
keyWord: '',
wxTime: '',
deviceTypeId: '',
},
query: {
pageNum: 1,
pageSize: 10,
keyWord: '',
typeId: '',
},
//
form: {},
//
rules: {
dictName: [
{
required: true,
message: '字典名称不能为空',
trigger: 'blur',
},
],
dictType: [
{
required: true,
message: '字典类型不能为空',
trigger: 'blur',
},
],
},
equipmentTypeList: [],
}
},
created() {
this.getList()
this.getTypeList()
this.equipmentType()
},
methods: {
getTypeList() {
getTypeList({ level: '3' }).then((response) => {
this.typeList = response.data
})
getTypeList({ level: '4' }).then((response) => {
this.modelList = response.data
})
export default {
name: 'RepairWarehousing',
dicts: ['sys_normal_disable'],
components: {
Treeselect,
},
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
dialogTotal: 0,
//
typeList: [],
modelList: [],
//
tableList: [],
detailTableList: [],
//
title: '',
//
open: false,
showHandle: true,
//
dateRange: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
dictName: undefined,
dictType: undefined,
status: undefined,
keyWord: '',
wxTime: '',
deviceTypeId: '',
},
/** 查询字典类型列表 */
getList() {
this.loading = true
getRepairedList(this.queryParams).then((response) => {
this.tableList = response.rows
this.total = response.total
this.loading = false
})
query: {
pageNum: 1,
pageSize: 10,
keyWord: '',
typeId: '',
},
getDialogTable() {
this.loading = true
getRepairedDetailList(this.query).then((response) => {
this.detailTableList = response.rows
this.dialogTotal = response.total
this.loading = false
})
},
//
cancel() {
this.open = false
this.reset()
},
//
reset() {
this.form = {
dictId: undefined,
dictName: undefined,
dictType: undefined,
status: '0',
remark: undefined,
}
this.resetForm('form')
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 搜索按钮操作 */
handleDialogQuery() {
this.query.pageNum = 1
this.getDialogTable()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm('queryForm')
this.queryParams.keyWord = ''
this.handleQuery()
},
/** 新增按钮操作 */
handleAdd() {
// this.reset();
this.open = true
this.title = '添加字典类型'
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item)
this.single = selection.length != 1
this.multiple = !selection.length
},
/** 修改按钮操作 */
handleUpdate(row) {
// this.reset();
this.query.keyWord = ''
this.query.taskId = row.id
this.getDialogTable()
this.open = true
this.showHandle = true
this.title = '审核'
},
//
handleView(row) {
this.query.keyWord = ''
this.query.taskId = row.id
this.getDialogTable()
this.open = true
this.showHandle = false
this.title = '查看'
},
pass(row) {
console.log(row)
console.log(this.query.taskId)
row.taskId = this.query.taskId
let obj = {
taskId: this.query.taskId,
id: row.id,
checkType: '1', //1 2 -
type: row.manageType, //0. 1.
maId: row.maId,
typeId: row.typeId,
remark: row.remark,
repairNum: row.repairNum,
}
let param = {
params: JSON.stringify([obj]),
}
console.log(param)
inputByType(param).then((response) => {
if (response.code == 200) {
this.$modal.msgSuccess('审批成功')
this.getDialogTable()
this.getList()
} else {
this.$modal.msgSuccess('审批失败')
}
})
},
passAll() {
console.log(this.query.taskId)
console.log(this.ids)
this.ids.forEach((item) => {
item.taskId = this.query.taskId
item.checkType = '1'
item.type = item.manageType //0. 1.
})
let param = {
params: JSON.stringify(this.ids),
}
inputByType(param).then((response) => {
if (response.code == 200) {
this.$modal.msgSuccess('审批成功')
this.getDialogTable()
this.getList()
} else {
this.$modal.msgSuccess('审批失败')
}
})
},
refused(row) {
console.log(row)
console.log(this.query.taskId)
row.taskId = this.query.taskId
let obj = {
taskId: this.query.taskId,
id: row.id,
checkType: '2', //1 2 -
type: row.manageType, //0. 1.
maId: row.maId,
typeId: row.typeId,
remark: row.remark,
repairNum: row.repairNum,
}
let param = {
params: JSON.stringify([obj]),
}
inputByType(param).then((response) => {
if (response.code == 200) {
this.$modal.msgSuccess('审批成功')
this.getDialogTable()
this.getList()
} else {
this.$modal.msgSuccess('审批失败')
}
})
},
refusedAll() {
console.log(this.query.taskId)
console.log(this.ids)
this.ids.forEach((item) => {
item.taskId = this.query.taskId
item.checkType = '2'
item.type = item.manageType
})
let param = {
params: JSON.stringify(this.ids),
}
inputByType(param).then((response) => {
if (response.code == 200) {
this.$modal.msgSuccess('审批成功')
this.getDialogTable()
this.getList()
} else {
this.$modal.msgSuccess('审批失败')
}
})
},
/** 提交按钮 */
submitForm: function () {
this.$refs['form'].validate((valid) => {
if (valid) {
if (this.form.dictId != undefined) {
updateType(this.form).then((response) => {
this.$modal.msgSuccess('修改成功')
this.open = false
this.getList()
})
} else {
addType(this.form).then((response) => {
this.$modal.msgSuccess('新增成功')
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
// const dictIds = row.dictId || this.ids;
// this.$modal.confirm('"' + dictIds + '"').then(function() {
// return delType(dictIds);
// }).then(() => {
// this.getList();
// this.$modal.msgSuccess("");
// }).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
'material/RepairTestInput/export',
//
form: {},
//
rules: {
dictName: [
{
...this.queryParams,
required: true,
message: '字典名称不能为空',
trigger: 'blur',
},
`修试入库_${new Date().getTime()}.xlsx`,
)
},
/** 刷新缓存按钮操作 */
handleRefreshCache() {
refreshCache().then(() => {
this.$modal.msgSuccess('刷新成功')
this.$store.dispatch('dict/cleanDict')
})
},
//
equipmentType() {
equipmentTypeTree().then((response) => {
this.equipmentTypeList = response.data
this.equipmentTypeList.forEach((item, index) => {
if (item.children && item.children.length > 0) {
item.children.forEach((item2, index2) => {
if (
item2.children &&
item2.children.length > 0
) {
item2.children.forEach((item3) => {
if (
item3.children &&
item3.children.length > 0
) {
item3.children.forEach((item4) => {
item4.machineTypeName =
item3.typeName
item4.specificationType =
item4.typeName
// this.$set(item4, 'purchasePrice', 0);
// this.$set(item4, 'purchaseNum', 1);
})
}
})
}
})
}
})
})
],
dictType: [
{
required: true,
message: '字典类型不能为空',
trigger: 'blur',
},
],
},
equipmentTypeList: [],
}
},
created() {
this.getList()
this.getTypeList()
this.equipmentType()
},
methods: {
getTypeList() {
getTypeList({ level: '3' }).then((response) => {
this.typeList = response.data
})
getTypeList({ level: '4' }).then((response) => {
this.modelList = response.data
})
},
watch: {
$route: {
handler(to) {
if (to.query.keyWord) {
this.queryParams.keyWord = to.query.keyWord
this.getList()
/** 查询字典类型列表 */
getList() {
this.loading = true
getRepairedList(this.queryParams).then((response) => {
this.tableList = response.rows
this.total = response.total
this.loading = false
})
},
getDialogTable() {
this.loading = true
getRepairedDetailList(this.query).then((response) => {
this.detailTableList = response.rows
this.dialogTotal = response.total
this.loading = false
})
},
//
cancel() {
this.open = false
this.reset()
},
//
reset() {
this.form = {
dictId: undefined,
dictName: undefined,
dictType: undefined,
status: '0',
remark: undefined,
}
this.resetForm('form')
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 搜索按钮操作 */
handleDialogQuery() {
this.query.pageNum = 1
this.getDialogTable()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm('queryForm')
this.queryParams.keyWord = ''
this.handleQuery()
},
/** 新增按钮操作 */
handleAdd() {
// this.reset();
this.open = true
this.title = '添加字典类型'
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item)
this.single = selection.length != 1
this.multiple = !selection.length
},
/** 修改按钮操作 */
handleUpdate(row) {
// this.reset();
this.query.keyWord = ''
this.query.taskId = row.id
this.getDialogTable()
this.open = true
this.showHandle = true
this.title = '审核'
},
//
handleView(row) {
this.query.keyWord = ''
this.query.taskId = row.id
this.getDialogTable()
this.open = true
this.showHandle = false
this.title = '查看'
},
pass(row) {
console.log(row)
console.log(this.query.taskId)
row.taskId = this.query.taskId
let obj = {
taskId: this.query.taskId,
id: row.id,
checkType: '1', //1 2 -
type: row.manageType, //0. 1.
maId: row.maId,
typeId: row.typeId,
remark: row.remark,
repairNum: row.repairNum,
}
let param = {
params: JSON.stringify([obj]),
}
console.log(param)
inputByType(param).then((response) => {
if (response.code == 200) {
this.$modal.msgSuccess('审批成功')
this.getDialogTable()
this.getList()
} else {
this.$modal.msgSuccess('审批失败')
}
})
},
passAll() {
console.log(this.query.taskId)
console.log(this.ids)
this.ids.forEach((item) => {
item.taskId = this.query.taskId
item.checkType = '1'
item.type = item.manageType //0. 1.
})
let param = {
params: JSON.stringify(this.ids),
}
inputByType(param).then((response) => {
if (response.code == 200) {
this.$modal.msgSuccess('审批成功')
this.getDialogTable()
this.getList()
} else {
this.$modal.msgSuccess('审批失败')
}
})
},
refused(row) {
console.log(row)
console.log(this.query.taskId)
row.taskId = this.query.taskId
let obj = {
taskId: this.query.taskId,
id: row.id,
checkType: '2', //1 2 -
type: row.manageType, //0. 1.
maId: row.maId,
typeId: row.typeId,
remark: row.remark,
repairNum: row.repairNum,
}
let param = {
params: JSON.stringify([obj]),
}
inputByType(param).then((response) => {
if (response.code == 200) {
this.$modal.msgSuccess('审批成功')
this.getDialogTable()
this.getList()
} else {
this.$modal.msgSuccess('审批失败')
}
})
},
refusedAll() {
console.log(this.query.taskId)
console.log(this.ids)
this.ids.forEach((item) => {
item.taskId = this.query.taskId
item.checkType = '2'
item.type = item.manageType
})
let param = {
params: JSON.stringify(this.ids),
}
inputByType(param).then((response) => {
if (response.code == 200) {
this.$modal.msgSuccess('审批成功')
this.getDialogTable()
this.getList()
} else {
this.$modal.msgSuccess('审批失败')
}
})
},
/** 提交按钮 */
submitForm: function () {
this.$refs['form'].validate((valid) => {
if (valid) {
if (this.form.dictId != undefined) {
updateType(this.form).then((response) => {
this.$modal.msgSuccess('修改成功')
this.open = false
this.getList()
})
} else {
addType(this.form).then((response) => {
this.$modal.msgSuccess('新增成功')
this.open = false
this.getList()
})
}
},
deep: true,
immediate: true,
},
}
})
},
}
/** 删除按钮操作 */
handleDelete(row) {
// const dictIds = row.dictId || this.ids;
// this.$modal.confirm('"' + dictIds + '"').then(function() {
// return delType(dictIds);
// }).then(() => {
// this.getList();
// this.$modal.msgSuccess("");
// }).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
'material/RepairTestInput/export',
{
...this.queryParams,
},
`修试入库_${new Date().getTime()}.xlsx`,
)
},
/** 刷新缓存按钮操作 */
handleRefreshCache() {
refreshCache().then(() => {
this.$modal.msgSuccess('刷新成功')
this.$store.dispatch('dict/cleanDict')
})
},
//
equipmentType() {
equipmentTypeTree().then((response) => {
this.equipmentTypeList = response.data
this.equipmentTypeList.forEach((item, index) => {
if (item.children && item.children.length > 0) {
item.children.forEach((item2, index2) => {
if (item2.children && item2.children.length > 0) {
item2.children.forEach((item3) => {
if (
item3.children &&
item3.children.length > 0
) {
item3.children.forEach((item4) => {
item4.machineTypeName =
item3.typeName
item4.specificationType =
item4.typeName
// this.$set(item4, 'purchasePrice', 0);
// this.$set(item4, 'purchaseNum', 1);
})
}
})
}
})
}
})
})
},
},
watch: {
$route: {
handler(to) {
if (to.query.keyWord) {
this.queryParams.keyWord = to.query.keyWord
this.getList()
}
},
deep: true,
immediate: true,
},
},
}
</script>
<style lang="scss" scoped>
::v-deep.el-table .fixed-width .el-button--mini {
width: 60px !important;
margin-bottom: 10px;
}
::v-deep.el-table .fixed-width .el-button--mini {
width: 60px !important;
margin-bottom: 10px;
}
</style>