add 压机报工
This commit is contained in:
		
							
								
								
									
										231
									
								
								src/views/modules/pms/carOrderReport/config.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										231
									
								
								src/views/modules/pms/carOrderReport/config.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,231 @@
 | 
			
		||||
import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent";
 | 
			
		||||
// import switchBtn from "@/components/noTemplateComponents/switchBtn";
 | 
			
		||||
import QuillRichInput from "@/components/noTemplateComponents/richInput";
 | 
			
		||||
import request from "@/utils/request";
 | 
			
		||||
import { timeFilter } from "@/utils/filters";
 | 
			
		||||
 | 
			
		||||
export default function () {
 | 
			
		||||
  const tableProps = [
 | 
			
		||||
    // 多选框
 | 
			
		||||
    // { type: 'index', label: '序号' },
 | 
			
		||||
    { width: 128, prop: "createTime", label: "添加时间", filter: timeFilter },
 | 
			
		||||
    { width: 128, prop: "updaterName", label: "更改人" },
 | 
			
		||||
    { width: 128, prop: "code", label: "窑车号" },
 | 
			
		||||
    { width: 128, prop: "orderCode", label: "订单号" },
 | 
			
		||||
    { width: 128, prop: "orderCate", label: "订单子号" },
 | 
			
		||||
    { width: 128, prop: "shapeCode", label: "砖型" },
 | 
			
		||||
    { width: 128, prop: "brand", label: "配方" },
 | 
			
		||||
    { width: 128, prop: "goodqty", label: "合格数量" },
 | 
			
		||||
    { width: 128, prop: "badqty", label: "报废数量" },
 | 
			
		||||
    // { prop: "typeDictValue", label: "过渡车", filter: val => ['否', '是'][val] },
 | 
			
		||||
    // { prop: "enabled", label: "状态", subcomponent: switchBtn }, // subcomponent
 | 
			
		||||
    { width: 128, prop: "team", label: "班次", filter: (val) => (val != null ? ["早班", "中班", "晚班"][val] : "-") },
 | 
			
		||||
    { width: 128, prop: "report", label: "报工", filter: (val) => (val != null ? ["未报工", "已报工"][val] : "-") },
 | 
			
		||||
    { width: 128, prop: "rtime", 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:carOrderReport:delete",
 | 
			
		||||
        // },
 | 
			
		||||
      ],
 | 
			
		||||
    },
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
  const headFormFields = [
 | 
			
		||||
    {
 | 
			
		||||
      prop: "orderCode",
 | 
			
		||||
      label: "订单号",
 | 
			
		||||
      input: true,
 | 
			
		||||
      default: { value: "" },
 | 
			
		||||
      bind: {
 | 
			
		||||
        placeholder: "请输入订单号",
 | 
			
		||||
      },
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      prop: "carCode",
 | 
			
		||||
      label: "窑车号",
 | 
			
		||||
      input: true,
 | 
			
		||||
      default: { value: "" },
 | 
			
		||||
      bind: {
 | 
			
		||||
        placeholder: "请输入窑车号",
 | 
			
		||||
      },
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      prop: "team",
 | 
			
		||||
      label: "班次",
 | 
			
		||||
      select: [
 | 
			
		||||
        { label: "早班", value: "0" },
 | 
			
		||||
        { label: "中班", value: "1" },
 | 
			
		||||
        { label: "晚班", value: "2" },
 | 
			
		||||
      ],
 | 
			
		||||
      default: { value: "" },
 | 
			
		||||
      bind: {
 | 
			
		||||
        placeholder: "请输入班次",
 | 
			
		||||
      },
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      prop: "report",
 | 
			
		||||
      label: "报工",
 | 
			
		||||
      select: [
 | 
			
		||||
        { label: "未报工", value: "0" },
 | 
			
		||||
        { label: "已报工", value: "1" },
 | 
			
		||||
      ],
 | 
			
		||||
      default: { value: "0" },
 | 
			
		||||
      bind: {
 | 
			
		||||
        placeholder: "请输入班次",
 | 
			
		||||
      },
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      timerange: true,
 | 
			
		||||
      prop: "timerange",
 | 
			
		||||
      label: "时间段",
 | 
			
		||||
      bind: {
 | 
			
		||||
        placeholder: "请选择时间段",
 | 
			
		||||
        type: "datetimerange",
 | 
			
		||||
        "start-placeholder": "开始时间",
 | 
			
		||||
        "end-placeholder": "结束时间",
 | 
			
		||||
      },
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      button: {
 | 
			
		||||
        type: "primary",
 | 
			
		||||
        name: "查询",
 | 
			
		||||
      },
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      button: {
 | 
			
		||||
        type: "primary",
 | 
			
		||||
        name: "报工",
 | 
			
		||||
        permission: "pms:carOrderReport:report",
 | 
			
		||||
      },
 | 
			
		||||
      bind: {
 | 
			
		||||
        plain: true,
 | 
			
		||||
      },
 | 
			
		||||
    },
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * dialog config 有两个版本,一个适用于 DialogWithMenu 组件,另一个适用于 DialogJustForm 组件
 | 
			
		||||
   * 适用于 DialogWithMenu 组件的配置示例详见 blenderStep/config.js
 | 
			
		||||
   * 此为后者的配置:
 | 
			
		||||
   */
 | 
			
		||||
  const dialogJustFormConfigs = {
 | 
			
		||||
    clickModalToClose: false,
 | 
			
		||||
    form: {
 | 
			
		||||
      rows: [
 | 
			
		||||
        [
 | 
			
		||||
          {
 | 
			
		||||
            forceDisabled: true,
 | 
			
		||||
            label: "窑车号",
 | 
			
		||||
            prop: "code",
 | 
			
		||||
            // rules: { required: true, message: "必填项不能为空", trigger: "blur" },
 | 
			
		||||
            elparams: { placeholder: "请输入窑车号" },
 | 
			
		||||
          },
 | 
			
		||||
        ],
 | 
			
		||||
        [
 | 
			
		||||
          {
 | 
			
		||||
            forceDisabled: true,
 | 
			
		||||
            label: "订单号",
 | 
			
		||||
            prop: "orderCode",
 | 
			
		||||
            // rules: { required: true, message: "必填项不能为空", trigger: "blur" },
 | 
			
		||||
            elparams: { placeholder: "请输入订单号" },
 | 
			
		||||
          },
 | 
			
		||||
        ],
 | 
			
		||||
        [
 | 
			
		||||
          {
 | 
			
		||||
            forceDisabled: true,
 | 
			
		||||
            label: "订单子号",
 | 
			
		||||
            prop: "orderCate",
 | 
			
		||||
            // rules: { required: true, message: "必填项不能为空", trigger: "blur" },
 | 
			
		||||
            elparams: { placeholder: "请输入订单子号" },
 | 
			
		||||
          },
 | 
			
		||||
        ],
 | 
			
		||||
        [
 | 
			
		||||
          {
 | 
			
		||||
            input: true,
 | 
			
		||||
            label: "合格数量",
 | 
			
		||||
            prop: "goodqty",
 | 
			
		||||
            rules: [
 | 
			
		||||
              { required: true, message: "必填项不能为空", trigger: "blur" },
 | 
			
		||||
              {
 | 
			
		||||
                type: "number",
 | 
			
		||||
                message: "请输入正确的数字类型",
 | 
			
		||||
                trigger: "blur",
 | 
			
		||||
                transform: (val) => Number(val),
 | 
			
		||||
              },
 | 
			
		||||
            ],
 | 
			
		||||
            elparams: { placeholder: "请输入合格数量" },
 | 
			
		||||
          },
 | 
			
		||||
        ],
 | 
			
		||||
        [
 | 
			
		||||
          {
 | 
			
		||||
            input: true,
 | 
			
		||||
            label: "报废数量",
 | 
			
		||||
            prop: "badqty",
 | 
			
		||||
            rules: [
 | 
			
		||||
              { required: true, message: "必填项不能为空", trigger: "blur" },
 | 
			
		||||
              {
 | 
			
		||||
                type: "number",
 | 
			
		||||
                message: "请输入正确的数字类型",
 | 
			
		||||
                trigger: "blur",
 | 
			
		||||
                transform: (val) => Number(val),
 | 
			
		||||
              },
 | 
			
		||||
            ],
 | 
			
		||||
            elparams: { placeholder: "请输入报废数量" },
 | 
			
		||||
          },
 | 
			
		||||
        ],
 | 
			
		||||
        [
 | 
			
		||||
          {
 | 
			
		||||
            richInput: true,
 | 
			
		||||
            label: "描述信息",
 | 
			
		||||
            prop: "description",
 | 
			
		||||
          },
 | 
			
		||||
        ],
 | 
			
		||||
        [{ input: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } }],
 | 
			
		||||
      ],
 | 
			
		||||
      operations: [
 | 
			
		||||
        {
 | 
			
		||||
          name: "add",
 | 
			
		||||
          label: "保存",
 | 
			
		||||
          type: "primary",
 | 
			
		||||
          permission: "pms:carOrderReport:save",
 | 
			
		||||
          showOnEdit: false,
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          name: "update",
 | 
			
		||||
          label: "更新",
 | 
			
		||||
          type: "primary",
 | 
			
		||||
          permission: "pms:carOrderReport: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/carOrderReport",
 | 
			
		||||
      page: "/pms/carOrderReport/pageView",
 | 
			
		||||
    },
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										32
									
								
								src/views/modules/pms/carOrderReport/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								src/views/modules/pms/carOrderReport/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,32 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<ListViewWithHead :table-config="tableConfig" :head-config="headFormConfigs" :dialog-configs="dialogConfigs" :listQueryExtra="['name']" />
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import initConfig from './config';
 | 
			
		||||
import ListViewWithHead from '@/views/atomViews/ListViewWithHead.vue';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'CarView',
 | 
			
		||||
	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>
 | 
			
		||||
		Reference in New Issue
	
	Block a user