ソースを参照

add car maintain

master
lb 1年前
コミット
31b2cfcee6
4個のファイルの変更183行の追加0行の削除
  1. +2
    -0
      src/views/modules/pms/carHistory/config.js
  2. +144
    -0
      src/views/modules/pms/carMaintain/config.js
  3. +35
    -0
      src/views/modules/pms/carMaintain/index.vue
  4. +2
    -0
      src/views/modules/pms/currentCarLocation/config.js

+ 2
- 0
src/views/modules/pms/carHistory/config.js ファイルの表示

@@ -97,6 +97,8 @@ export default function () {
{ prop: "bomCode", label: "配方" },
{ prop: "shapeCode", label: "砖型" },
{ prop: "weight", label: "重量" },
{ width: 128, prop: "gas", label: "燃气用量(m³)" },
{ width: 144, prop: "gp", label: "燃气(m³)/砖(kg)" },
{ width: 80, prop: "qty", label: "订单数量" },
{ width: 72, prop: "goodqty", label: "合格数" },
{ width: 72, prop: "badqty", label: "废砖数" },


+ 144
- 0
src/views/modules/pms/carMaintain/config.js ファイルの表示

@@ -0,0 +1,144 @@
import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent";
import request from "@/utils/request";
import { timeFilter, dictFilter } from '@/utils/filters'
import { getDictDataList } from '@/utils'

export default function () {
const tableProps = [
{ type: 'index', label: '序号' },
{ prop: "code", label: "窑车号" },
{ prop: "typeDictValue", label: "维修类别", filter: dictFilter('carMain') },
{ prop: "description", label: "维修描述" },
{ prop: "remark", label: "备注" },
{ prop: "startTime", label: "开始时间", filter: timeFilter },
{ prop: "endTime", label: "结束时间", filter: timeFilter },
// { prop: "prtTag", label: "是否打印标签", filter: val => ({ yes: '是', no: '否' })[val] ?? '-' },
{ prop: "creatorName", label: "创建人" },
// { prop: "remark", label: "创建时间" },
{ prop: "createTime", label: "创建时间", filter: timeFilter },
{
prop: "operations",
name: "操作",
fixed: "right",
width: 90,
subcomponent: TableOperaionComponent,
options: [{ name: "edit", label: "编辑", icon: "edit-outline" }, { name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "pms:carMaintain:delete" }],
},
];

const now = new Date();
const [y, m, d] = [now.getFullYear(), now.getMonth(), now.getDate()];
const today = new Date(y, m, d, 0, 0, 0, 0).getTime();
const headFormFields = [
{
prop: 'code',
label: "窑车号",
input: true,
default: { value: "" },
bind: {
placeholder: '请输入窑车号'
}
},
{
timerange: true,
prop: "timerange",
label: "时间段",
bind: {
placeholder: "请选择时间段",
type: "datetimerange",
"start-placeholder": "开始时间",
"end-placeholder": "结束时间",
},
default: { value: [today - 24 * 7 * 1000 * 3600, today + 3600 * 24 * 1000] },
},
{
button: {
type: "primary",
name: "查询",
},
},
{
button: {
type: "primary",
name: "新增",
permission: "pms:carMaintain:save"
},
bind: {
plain: true,
}
},
];

/**
* dialog config 有两个版本,一个适用于 DialogWithMenu 组件,另一个适用于 DialogJustForm 组件
* 适用于 DialogWithMenu 组件的配置示例详见 blenderStep/config.js
* 此为后者的配置:
*/
const dialogJustFormConfigs = {
form: {
rows: [
[
{
input: true,
label: "窑车号",
prop: "code",
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入窑车号" },
},
{
select: true,
label: "维修类别",
prop: "typeDictValue",
options: getDictDataList('carMain').map(_ => ({ label: _.dictLabel, value: _.dictValue })),
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入维修类别" },
},
],
[
{
datetime: true,
label: "开始时间",
prop: "startTime",
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请选择开始时间", type: "datetime" },
},
{
datetime: true,
label: "结束时间",
prop: "endTime",
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请选择结束时间", type: "datetime" },
},
],
[{ textarea: true, label: "维修描述", prop: "description", elparams: { placeholder: "维修描述" } }],
[{ input: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } }],
],
operations: [
{ name: "add", label: "保存", type: "primary", permission: "pms:carMaintain:save", showOnEdit: false },
{ name: "update", label: "更新", type: "primary", permission: "pms:carMaintain:update", showOnEdit: true },
{ name: "reset", label: "重置", type: "warning", showAlways: true },
],
},
};
// 备注:弹窗弹出的时间和网速有关......

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/carMaintain",
page: "/pms/carMaintain/pageView",
pageIsPostApi: true
// subase: '/pms/blenderStepParam',
// subpage: '/pms/blenderStepParam/page',
// more...
},
};
}

+ 35
- 0
src/views/modules/pms/carMaintain/index.vue ファイルの表示

@@ -0,0 +1,35 @@
<template>
<ListViewWithHead
:table-config="tableConfig"
:head-config="headFormConfigs"
:dialog-configs="dialogConfigs" />
</template>

<script>
import initConfig from "./config";
import ListViewWithHead from "@/views/atomViews/ListViewWithHead.vue";

export default {
name: "ProductionLineView",
components: { ListViewWithHead },
provide() {
return {
urls: this.allUrls,
};
},
data() {
const { tableConfig, headFormConfigs, urls, dialogConfigs } = initConfig.call(this);
return {
tableConfig,
headFormConfigs,
allUrls: urls,
dialogConfigs,
};
},
created() {},
mounted() {},
methods: {},
};
</script>

<style scoped></style>

+ 2
- 0
src/views/modules/pms/currentCarLocation/config.js ファイルの表示

@@ -90,6 +90,8 @@ export default function () {
{ prop: "brand", label: "配方" },
{ prop: "shapeCode", label: "砖型" },
{ prop: "weight", label: "重量" },
{ width: 128, prop: "gas", label: "燃气用量(m³)" },
{ width: 144, prop: "gp", label: "燃气(m³)/砖(kg)" },
{ width: 80, prop: "qty", label: "订单数量" },
{ width: 72, prop: "goodqty", label: "合格数" },
{ width: 72, prop: "badqty", label: "废砖数" },


読み込み中…
キャンセル
保存