|
|
|
|
@ -1,15 +1,25 @@ |
|
|
|
|
<template> |
|
|
|
|
<div class="app-container"> |
|
|
|
|
<div class="search-box number-search"> |
|
|
|
|
<el-form :inline="true" :model="searchForm" ref="searchForm"> |
|
|
|
|
<el-form-item label="序列号编号" prop="seqCode"> |
|
|
|
|
<el-form |
|
|
|
|
:inline="true" |
|
|
|
|
:model="searchForm" |
|
|
|
|
ref="searchForm" |
|
|
|
|
> |
|
|
|
|
<el-form-item |
|
|
|
|
label="序列号编号" |
|
|
|
|
prop="seqCode" |
|
|
|
|
> |
|
|
|
|
<el-input |
|
|
|
|
v-model="searchForm.seqCode" |
|
|
|
|
placeholder="请输入序列号编号" |
|
|
|
|
clearable |
|
|
|
|
></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="序列号类型" prop="seqType"> |
|
|
|
|
<el-form-item |
|
|
|
|
label="序列号类型" |
|
|
|
|
prop="seqType" |
|
|
|
|
> |
|
|
|
|
<el-select |
|
|
|
|
v-model="searchForm.seqType" |
|
|
|
|
placeholder="请选择" |
|
|
|
|
@ -25,7 +35,10 @@ |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-button type="primary" @click="onSearch">搜索</el-button> |
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
@click="onSearch" |
|
|
|
|
>搜索</el-button> |
|
|
|
|
<el-button @click="resetForm('searchForm')">重置</el-button> |
|
|
|
|
<!-- <el-button @click="onExport">导出</el-button> --> |
|
|
|
|
</el-form-item> |
|
|
|
|
@ -34,8 +47,14 @@ |
|
|
|
|
|
|
|
|
|
<div class="opt-box"> |
|
|
|
|
<div class="opt-box-right"> |
|
|
|
|
<el-button type="primary" @click="onAdd">新增</el-button> |
|
|
|
|
<el-button type="primary" @click="onSave">保存</el-button> |
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
@click="onAdd" |
|
|
|
|
>新增</el-button> |
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
@click="onSave" |
|
|
|
|
>保存</el-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<el-form |
|
|
|
|
@ -49,6 +68,9 @@ |
|
|
|
|
<heavy-table |
|
|
|
|
class="heavy-table tablem" |
|
|
|
|
highlight-current-row |
|
|
|
|
@current-change="handleCurrentChange" |
|
|
|
|
:paging="paging" |
|
|
|
|
:loading="loading" |
|
|
|
|
:data="tableForm.numberList" |
|
|
|
|
:config="tableConfig.config" |
|
|
|
|
@del="onDel" |
|
|
|
|
@ -80,7 +102,10 @@ |
|
|
|
|
:prop="`numberList.${scope.row.index}.seqType`" |
|
|
|
|
:rules="tableConfig.rules.seqType" |
|
|
|
|
> |
|
|
|
|
<el-select v-model="scope.row.seqType" placeholder="请选择"> |
|
|
|
|
<el-select |
|
|
|
|
v-model="scope.row.seqType" |
|
|
|
|
placeholder="请选择" |
|
|
|
|
> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in dict.type.seqType" |
|
|
|
|
:key="item.value" |
|
|
|
|
@ -118,7 +143,10 @@ |
|
|
|
|
:prop="`numberList.${scope.row.index}.seqDate`" |
|
|
|
|
:rules="tableConfig.rules.seqDate" |
|
|
|
|
> |
|
|
|
|
<el-select v-model="scope.row.seqDate" placeholder="请选择"> |
|
|
|
|
<el-select |
|
|
|
|
v-model="scope.row.seqDate" |
|
|
|
|
placeholder="请选择" |
|
|
|
|
> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in dict.type.seq_date_dict" |
|
|
|
|
:key="item.value" |
|
|
|
|
@ -168,56 +196,61 @@ |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import { tableConfig } from "./config.js"; |
|
|
|
|
import { |
|
|
|
|
getNumberList, |
|
|
|
|
numberExport, |
|
|
|
|
numberSaveOrUpdate, |
|
|
|
|
numberRemove, |
|
|
|
|
} from "@/api/basicData/number"; |
|
|
|
|
import { dealEmptyQueryCondition, downloadFile } from "@/utils/index"; |
|
|
|
|
import { Throttle } from "@/utils/index"; |
|
|
|
|
import { tableConfig } from './config.js' |
|
|
|
|
import { getNumberList, numberExport, numberSaveOrUpdate, numberRemove } from '@/api/basicData/number' |
|
|
|
|
import { dealEmptyQueryCondition, downloadFile } from '@/utils/index' |
|
|
|
|
import { Throttle } from '@/utils/index' |
|
|
|
|
export default { |
|
|
|
|
name: "Number", |
|
|
|
|
dicts: ["seqType", "seq_date_dict"], |
|
|
|
|
name: 'Number', |
|
|
|
|
dicts: ['seqType', 'seq_date_dict'], |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
loading: false, |
|
|
|
|
searchForm: {}, |
|
|
|
|
tableConfig: {}, |
|
|
|
|
typeList: [], |
|
|
|
|
tableForm: { |
|
|
|
|
numberList: [], |
|
|
|
|
numberList: [] |
|
|
|
|
}, |
|
|
|
|
paging: { |
|
|
|
|
page: 1, // 当前页 |
|
|
|
|
size: 10, // 页面大小 |
|
|
|
|
total: 0, // 总条数 |
|
|
|
|
pagerCount: 7, // 设置最大页码数 |
|
|
|
|
oldPage: 1 // 上一次记录的页数 |
|
|
|
|
}, |
|
|
|
|
handleSelect: [], |
|
|
|
|
handleSelectId: [], |
|
|
|
|
}; |
|
|
|
|
handleSelectId: [] |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
async created() { |
|
|
|
|
this.onSearch(); |
|
|
|
|
this.tableConfig = await this.getTableHeaderCom( |
|
|
|
|
"sys_seq_mana", |
|
|
|
|
tableConfig.call(this) |
|
|
|
|
); |
|
|
|
|
this.onSearch() |
|
|
|
|
this.tableConfig = await this.getTableHeaderCom('sys_seq_mana', tableConfig.call(this)) |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
async onSearch() { |
|
|
|
|
const request = { ...this.searchForm }; |
|
|
|
|
dealEmptyQueryCondition(request); |
|
|
|
|
const { rows } = await getNumberList(request); |
|
|
|
|
this.tableForm.numberList = rows; |
|
|
|
|
const request = { |
|
|
|
|
...this.searchForm, |
|
|
|
|
pageSize: this.paging.size, |
|
|
|
|
pageNum: this.paging.page |
|
|
|
|
} |
|
|
|
|
dealEmptyQueryCondition(request) |
|
|
|
|
const { rows } = await getNumberList(request) |
|
|
|
|
this.tableForm.numberList = rows |
|
|
|
|
this.paging.total = total |
|
|
|
|
}, |
|
|
|
|
resetForm(formName) { |
|
|
|
|
this.$refs[formName].resetFields(); |
|
|
|
|
this.onSearch(); |
|
|
|
|
this.$refs[formName].resetFields() |
|
|
|
|
this.onSearch() |
|
|
|
|
}, |
|
|
|
|
onAdd() { |
|
|
|
|
this.tableForm.numberList.unshift({}); |
|
|
|
|
this.tableForm.numberList.unshift({}) |
|
|
|
|
}, |
|
|
|
|
downloadFile, |
|
|
|
|
onExport() { |
|
|
|
|
numberExport(this.searchForm).then((res) => { |
|
|
|
|
this.downloadFile(res); |
|
|
|
|
}); |
|
|
|
|
this.downloadFile(res) |
|
|
|
|
}) |
|
|
|
|
// this.download( |
|
|
|
|
// "/wms/seqMana/export", |
|
|
|
|
// { |
|
|
|
|
@ -228,38 +261,54 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 删除 |
|
|
|
|
onDel({ id, index }) { |
|
|
|
|
this.$confirm("是否确认删除所选明细?", "提示", { |
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
type: "warning", |
|
|
|
|
this.$confirm('是否确认删除所选明细?', '提示', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning' |
|
|
|
|
}).then(async () => { |
|
|
|
|
if (id) { |
|
|
|
|
await numberRemove([id]); |
|
|
|
|
await numberRemove([id]) |
|
|
|
|
} |
|
|
|
|
this.tableForm.numberList.splice(index, 1); |
|
|
|
|
}); |
|
|
|
|
this.tableForm.numberList.splice(index, 1) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
onSave: Throttle(function () { |
|
|
|
|
this.$refs["tableForm"].validate(async (valid) => { |
|
|
|
|
this.$refs['tableForm'].validate(async (valid) => { |
|
|
|
|
if (valid) { |
|
|
|
|
await numberSaveOrUpdate(this.tableForm.numberList); |
|
|
|
|
await numberSaveOrUpdate(this.tableForm.numberList) |
|
|
|
|
|
|
|
|
|
this.$message({ |
|
|
|
|
message: "保存成功!", |
|
|
|
|
type: "success", |
|
|
|
|
}); |
|
|
|
|
this.onSearch(); |
|
|
|
|
message: '保存成功!', |
|
|
|
|
type: 'success' |
|
|
|
|
}) |
|
|
|
|
this.onSearch() |
|
|
|
|
} else { |
|
|
|
|
this.$message("请填写完整数据!"); |
|
|
|
|
this.$message('请填写完整数据!') |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
}), |
|
|
|
|
handleselection(data) { |
|
|
|
|
this.handleSelect = data; |
|
|
|
|
this.handleSelectId = data.map((ele) => ele.id); |
|
|
|
|
// 点击分页 |
|
|
|
|
handleCurrentChange(val) { |
|
|
|
|
this.$confirm('此操作会清空当前页编辑过的数据, 是否继续?', '提示', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning' |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
this.paging.page = val |
|
|
|
|
this.paging.oldPage = val |
|
|
|
|
this.onSearch() |
|
|
|
|
}) |
|
|
|
|
.catch(() => { |
|
|
|
|
this.paging.page = this.paging.oldPage |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
handleselection(data) { |
|
|
|
|
this.handleSelect = data |
|
|
|
|
this.handleSelectId = data.map((ele) => ele.id) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style lang="scss"> |
|
|
|
|
|