update 压机报工的search logic
This commit is contained in:
		@@ -7,7 +7,7 @@ import { timeFilter } from "@/utils/filters";
 | 
			
		||||
export default function () {
 | 
			
		||||
  const tableProps = [
 | 
			
		||||
    // 多选框
 | 
			
		||||
    // { type: 'index', label: '序号' },
 | 
			
		||||
    { type: "selection", width: 60, align: "center" },
 | 
			
		||||
    { width: 128, prop: "createTime", label: "添加时间", filter: timeFilter },
 | 
			
		||||
    { width: 128, prop: "updaterName", label: "更改人" },
 | 
			
		||||
    { width: 128, prop: "code", label: "窑车号" },
 | 
			
		||||
@@ -19,8 +19,18 @@ export default function () {
 | 
			
		||||
    { 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: "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",
 | 
			
		||||
@@ -41,6 +51,7 @@ export default function () {
 | 
			
		||||
    },
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
  const now = new Date().getTime();
 | 
			
		||||
  const headFormFields = [
 | 
			
		||||
    {
 | 
			
		||||
      prop: "orderCode",
 | 
			
		||||
@@ -89,6 +100,7 @@ export default function () {
 | 
			
		||||
      timerange: true,
 | 
			
		||||
      prop: "timerange",
 | 
			
		||||
      label: "时间段",
 | 
			
		||||
      default: { value: [now - 3600 * 24 * 7 * 1000, now] },
 | 
			
		||||
      bind: {
 | 
			
		||||
        placeholder: "请选择时间段",
 | 
			
		||||
        type: "datetimerange",
 | 
			
		||||
@@ -226,6 +238,7 @@ export default function () {
 | 
			
		||||
    urls: {
 | 
			
		||||
      base: "/pms/carOrderReport",
 | 
			
		||||
      page: "/pms/carOrderReport/pageView",
 | 
			
		||||
      pageIsPostApi: true,
 | 
			
		||||
    },
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,31 +1,45 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<ListViewWithHead :table-config="tableConfig" :head-config="headFormConfigs" :dialog-configs="dialogConfigs" :listQueryExtra="['name']" />
 | 
			
		||||
  <ListViewWithHead
 | 
			
		||||
    :table-config="tableConfig"
 | 
			
		||||
    :head-config="headFormConfigs"
 | 
			
		||||
    :dialog-configs="dialogConfigs"
 | 
			
		||||
    :listQueryExtra="['carCode', 'orderCode', 'team', { report: 0, startTime: now[0], endTime: now[1] }]" />
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import initConfig from './config';
 | 
			
		||||
import ListViewWithHead from '@/views/atomViews/ListViewWithHead.vue';
 | 
			
		||||
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: {},
 | 
			
		||||
  name: "CarView",
 | 
			
		||||
  components: { ListViewWithHead },
 | 
			
		||||
  provide() {
 | 
			
		||||
    return {
 | 
			
		||||
      urls: this.allUrls,
 | 
			
		||||
    };
 | 
			
		||||
  },
 | 
			
		||||
  data() {
 | 
			
		||||
    const { tableConfig, headFormConfigs, urls, dialogConfigs } = initConfig.call(this);
 | 
			
		||||
    return {
 | 
			
		||||
      tableConfig,
 | 
			
		||||
      headFormConfigs,
 | 
			
		||||
      allUrls: urls,
 | 
			
		||||
      dialogConfigs,
 | 
			
		||||
    };
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
  computed: {
 | 
			
		||||
    now() {
 | 
			
		||||
      const curr = this.headFormConfigs.fields.find((item) => item.prop == "timerange").default.value;
 | 
			
		||||
	  const start = new Date(curr[0]);
 | 
			
		||||
	  const end = new Date(curr[1]);
 | 
			
		||||
	  return [
 | 
			
		||||
		start.toLocaleString().replace(' ', 'T').replace(/\//g, '-'),
 | 
			
		||||
		end.toLocaleString().replace(' ', 'T').replace(/\//g, '-'),
 | 
			
		||||
	  ]
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
  methods: {},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user