@@ -94,7 +94,7 @@ export default { | |||
if ("enable" in opt && typeof opt.enable === "function") { | |||
shouldDisabled = !opt.enable(this.injectData); | |||
} | |||
console.log('should disabled', shouldDisabled) | |||
// console.log('should disabled', shouldDisabled) | |||
btns.push( | |||
h( | |||
"el-button", | |||
@@ -106,7 +106,7 @@ export default { | |||
}, | |||
}, | |||
activated() { | |||
console.log("list view with ehad activated.........."); | |||
console.log("list view with ehad activated..........", this.triggerUpdate); | |||
this.refreshLayoutKey = this.layoutTable(); | |||
}, | |||
watch: { | |||
@@ -131,7 +131,7 @@ export default { | |||
size: 20, // 默认20 | |||
dataList: [], | |||
tableLoading: false, | |||
refreshLayoutKey: null, | |||
refreshLayoutKey: null | |||
}; | |||
}, | |||
inject: ["urls"], | |||
@@ -438,18 +438,23 @@ export default { | |||
case "新增": | |||
this.openDialog(); | |||
break; | |||
case "手动添加": { | |||
return; | |||
} | |||
case "查询": { | |||
const params = {}; | |||
/** 处理 payload 里的数据 */ | |||
if (typeof payload === "object") { | |||
// BaseSearchForm 给这个组件传递了数据 | |||
Object.assign(params, payload); | |||
if ("timerange" in params && !!params.timerange) { | |||
const [startTime, endTime] = params["timerange"]; | |||
if ("timerange" in params) { | |||
if (!!params.timerange) { | |||
const [startTime, endTime] = params["timerange"]; | |||
params.startTime = moment(startTime).format("YYYY-MM-DDTHH:mm:ss"); | |||
params.endTime = moment(endTime).format("YYYY-MM-DDTHH:mm:ss"); | |||
} | |||
delete params.timerange; | |||
params.startTime = moment(startTime).format("YYYY-MM-DDTHH:mm:ss"); | |||
params.endTime = moment(endTime).format("YYYY-MM-DDTHH:mm:ss"); | |||
} | |||
} | |||
@@ -471,6 +476,7 @@ export default { | |||
this.getList(params); | |||
break; | |||
} | |||
case "同步": | |||
this.$http.post(this.urls.syncUrl).then(({ data: res }) => { | |||
if (res.code === 0) { | |||
@@ -36,14 +36,8 @@ export default { | |||
triggerUpdateKey: "", | |||
}; | |||
}, | |||
watch: { | |||
$route: { | |||
handler: function (route) { | |||
this.triggerUpdateKey = Math.random().toString(); | |||
}, | |||
immediate: true, | |||
deep: true, | |||
}, | |||
activated() { | |||
this.triggerUpdateKey = Math.random().toString(); | |||
}, | |||
}; | |||
</script> | |||
@@ -6,6 +6,7 @@ | |||
:list-query-extra="[ | |||
/** { pos: [] } **/ | |||
]" | |||
:trigger-update="triggerUpdateKey" | |||
/> | |||
</template> | |||
@@ -28,11 +29,15 @@ export default { | |||
headFormConfigs, | |||
allUrls: urls, | |||
dialogConfigs, | |||
triggerUpdateKey: "", | |||
}; | |||
}, | |||
created() {}, | |||
mounted() {}, | |||
methods: {}, | |||
activated() { | |||
this.triggerUpdateKey = Math.random().toString(); | |||
}, | |||
}; | |||
</script> | |||
@@ -0,0 +1,109 @@ | |||
import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent"; | |||
import request from "@/utils/request"; | |||
import { timeFilter } from '@/utils/filters' | |||
export default function () { | |||
const tableProps = [ | |||
{ type: 'index', label: '序号' }, | |||
{ prop: "createTime", label: "添加时间", filter: timeFilter }, | |||
{ prop: "code", label: "窑车号" }, | |||
{ prop: "stateDictValue", label: "状态", filter: v => (v !== null && v !== undefined) ? ['没有数据', '正常', '判废', '过渡'][v] : '-' }, // subcomponent | |||
{ prop: "orderCode", label: "订单号" }, | |||
{ prop: "posCode", label: "位置" }, | |||
{ prop: "startTime", label: "开始时间", filter: timeFilter }, | |||
{ prop: "endTime", label: "结束时间", filter: timeFilter }, | |||
{ | |||
prop: "operations", | |||
name: "操作", | |||
fixed: "right", | |||
width: 90, | |||
subcomponent: TableOperaionComponent, | |||
options: [ | |||
{ name: "to-car-payload", label: "装载详情", icon: 'document' } | |||
], | |||
}, | |||
]; | |||
const headFormFields = [ | |||
// { | |||
// prop: 'code', | |||
// label: "窑车号", | |||
// input: true, | |||
// default: { value: "" }, | |||
// bind: { | |||
// placeholder: '请输入窑车号' | |||
// } | |||
// }, | |||
{ | |||
timerange: true, | |||
prop: "timerange", | |||
label: "时间段", | |||
bind: { | |||
placeholder: "选择日期时间", | |||
type: "datetimerange", | |||
"start-placeholder": "开始时间", | |||
"end-placeholder": "结束时间", | |||
}, | |||
}, | |||
{ | |||
button: { | |||
type: "primary", | |||
name: "查询", | |||
}, | |||
}, | |||
{ | |||
button: { | |||
type: "primary", | |||
name: "手动添加", | |||
permission: "" | |||
}, | |||
bind: { | |||
plain: true, | |||
} | |||
}, | |||
]; | |||
const dialogJustFormConfigs = { | |||
carPayloadDialog: true, | |||
clickModalToClose: true, | |||
tableConfig: { | |||
table: null, | |||
column: [ | |||
// 窑车的 装载详情 | |||
// tableProps | |||
{ type: "index", label: "序号" }, | |||
{ prop: "orderCode", label: "订单号" }, | |||
{ prop: "bomCode", label: "配方号" }, | |||
{ prop: "shapeCode", label: "砖型编码" }, | |||
{ width: 160, prop: "qty", label: "订单对应数量" }, | |||
{ prop: "goodqty", label: "合格数量" }, | |||
{ prop: "badqty", label: "废砖数量" }, | |||
{ prop: "startTime", label: "开始时间" }, | |||
{ prop: "endTime", label: "结束时间" }, | |||
// { prop: "remark", label: "备注" }, | |||
], | |||
}, | |||
}; | |||
return { | |||
dialogConfigs: dialogJustFormConfigs, | |||
tableConfig: { | |||
table: null, // 此处可省略,el-table 上的配置项 | |||
column: tableProps, // el-column-item 上的配置项 | |||
}, | |||
headFormConfigs: { | |||
rules: null, // 名称是由 BaseSearchForm.vue 组件固定的 | |||
fields: headFormFields, // 名称是由 BaseSearchForm.vue 组件固定的 | |||
}, | |||
urls: { | |||
base: "/pms/carHandle", | |||
page: "/pms/carHandle/pageHis", | |||
pageIsPostApi: true | |||
// subase: '/pms/blenderStepParam', | |||
// subpage: '/pms/blenderStepParam/page', | |||
// more... | |||
}, | |||
}; | |||
} |
@@ -0,0 +1,46 @@ | |||
<template> | |||
<ListViewWithHead | |||
:table-config="tableConfig" | |||
:head-config="headFormConfigs" | |||
:dialog-configs="dialogConfigs" | |||
:listQueryExtra="[{ pos: [1, 7] }]" | |||
:trigger-update="triggerUpdateKey" | |||
key="pallet" | |||
/> | |||
<!-- attach-list-query-data="code" --> | |||
</template> | |||
<script> | |||
import initConfig from "./config"; | |||
import ListViewWithHead from "@/views/atomViews/ListViewWithHead.vue"; | |||
export default { | |||
name: "PalletizingLineView", | |||
components: { ListViewWithHead }, | |||
provide() { | |||
return { | |||
urls: this.allUrls, | |||
}; | |||
}, | |||
computed: { | |||
code() { | |||
return this.$route.query.code || ""; | |||
}, | |||
}, | |||
data() { | |||
const { tableConfig, headFormConfigs, urls, dialogConfigs } = initConfig.call(this); | |||
return { | |||
tableConfig, | |||
headFormConfigs, | |||
allUrls: urls, | |||
dialogConfigs, | |||
triggerUpdateKey: "", | |||
}; | |||
}, | |||
activated() { | |||
this.triggerUpdateKey = Math.random().toString(); | |||
}, | |||
}; | |||
</script> | |||
<style scoped></style> |