更新生产基础
This commit is contained in:
@@ -114,17 +114,6 @@ export default {
|
||||
placeholder: '工厂名称',
|
||||
param: 'name',
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '创建时间',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'createTime',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '搜索',
|
||||
@@ -173,7 +162,6 @@ export default {
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.name = val.name;
|
||||
this.listQuery.code = val.code;
|
||||
this.listQuery.createTime = val.createTime;
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'reset':
|
||||
|
||||
@@ -318,9 +318,9 @@ export default {
|
||||
if (raw.type === 'delete') {
|
||||
this.$confirm(
|
||||
`确定对${
|
||||
val.data.name
|
||||
? '[名称=' + val.data.name + ']'
|
||||
: '[序号=' + val.data._pageIndex + ']'
|
||||
raw.data.name
|
||||
? '[名称=' + raw.data.name + ']'
|
||||
: '[序号=' + raw.data._pageIndex + ']'
|
||||
}进行删除操作?`,
|
||||
'提示',
|
||||
{
|
||||
@@ -330,7 +330,7 @@ export default {
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
deleteProductAttr(val.data.id).then(({ data }) => {
|
||||
deleteProductAttr(raw.data.id).then(({ data }) => {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
v-loading="dataListLoading"
|
||||
v-loading="dataListLoading"
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.pageNo"
|
||||
:limit="listQuery.pageSize"
|
||||
@@ -40,12 +40,14 @@
|
||||
<script>
|
||||
import AddOrUpdate from './add-or-updata';
|
||||
import basicPage from '../../mixins/basic-page';
|
||||
import codeFilter from '../../mixins/code-filter';
|
||||
import { parseTime } from '../../mixins/code-filter';
|
||||
import {
|
||||
deleteProductionLine,
|
||||
getProductionLinePage,
|
||||
exportProductionLineExcel
|
||||
} from "@/api/core/base/productionLine";
|
||||
deleteProductionLine,
|
||||
getProductionLinePage,
|
||||
exportProductionLineExcel,
|
||||
getStatus,
|
||||
} from '@/api/core/base/productionLine';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
@@ -63,6 +65,17 @@ const tableProps = [
|
||||
label: '工厂',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
prop: 'externalCode',
|
||||
label: '额外编码',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
prop: 'status',
|
||||
label: '当前状态',
|
||||
align: 'center',
|
||||
filter: codeFilter('lineStatus'),
|
||||
},
|
||||
{
|
||||
prop: 'description',
|
||||
label: '描述',
|
||||
@@ -98,13 +111,13 @@ export default {
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:production-line:delete`)
|
||||
this.$auth.hasPermi(`base:production-line:delete`)
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v)=>v),
|
||||
].filter((v) => v),
|
||||
tableData: [],
|
||||
formConfig: [
|
||||
{
|
||||
@@ -131,7 +144,9 @@ export default {
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:production-line:create') ? 'button' : '',
|
||||
type: this.$auth.hasPermi('base:production-line:create')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
@@ -154,6 +169,28 @@ export default {
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.dataListLoading = true;
|
||||
this.urlOptions.getDataListURL(this.listQuery).then((response) => {
|
||||
this.total = response.data.total;
|
||||
this.getStatus(response.data.list);
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
getStatus(list) {
|
||||
const ids = list.map((i) => {
|
||||
return i.id;
|
||||
});
|
||||
getStatus(ids).then((response) => {
|
||||
response.forEach((a) => {
|
||||
list.forEach((b) => {
|
||||
if (b.id === a.id) b.status = a.status;
|
||||
});
|
||||
});
|
||||
this.tableData = list;
|
||||
});
|
||||
},
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
|
||||
Reference in New Issue
Block a user