Browse Source

生产计划

quwangxin 3 years ago
parent
commit
77b4f16b97

+ 1 - 1
.env

@@ -1,2 +1,2 @@
-VUE_APP_NAME=生产系统
+VUE_APP_NAME=排程系统
 VUE_APP_API_BASE_URL=/api

+ 141 - 0
src/views/productionPlan/components/productionPlan-search.vue

@@ -0,0 +1,141 @@
+<!-- 搜索表单 -->
+<template>
+  <el-form
+    label-width="80px"
+    class="ele-form-search"
+    @keyup.enter.native="search"
+    @submit.native.prevent
+  >
+    <el-row :gutter="15">
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="计划编码:">
+          <el-input clearable v-model="where.code" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="产品编码:">
+          <el-input clearable v-model="where.code" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="牌号:" label-width="80px">
+          <el-input clearable v-model="where.code" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="型号:" label-width="80px">
+          <el-input clearable v-model="where.code" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="计划类型:" label-width="80px">
+          <el-input clearable v-model="where.code" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="计划状态:" label-width="80px">
+          <el-input clearable v-model="where.code" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 12, md: 12 } : { span: 12 }">
+        <el-form-item label="交货日期:">
+          <el-date-picker
+            v-model="where.time"
+            type="daterange"
+            range-separator="至"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            :default-time="['00:00:00', '23:59:59']"
+          >
+          </el-date-picker>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 12, md: 12 } : { span: 12 }">
+        <el-form-item label="发布日期:">
+          <el-date-picker
+            v-model="where.time"
+            type="daterange"
+            range-separator="至"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            :default-time="['00:00:00', '23:59:59']"
+          >
+          </el-date-picker>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 12, md: 12 } : { span: 12 }">
+        <div class="ele-form-actions">
+          <el-button
+            type="primary"
+            icon="el-icon-search"
+            class="ele-btn-icon"
+            @click="search"
+            size="small"
+          >
+            查询
+          </el-button>
+          <el-button
+            @click="reset"
+            icon="el-icon-refresh-left"
+            size="small"
+            type="primary"
+            >重置</el-button
+          >
+        </div>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+  export default {
+    data () {
+      // 默认表单数据
+      const defaultWhere = {
+        staus: '',
+        code: '',
+        time: [],
+        executeUserName: ''
+      };
+      return {
+        // 表单数据
+        where: { ...defaultWhere },
+        treeData: []
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive () {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    created () {},
+    methods: {
+      /* 搜索 */
+      search () {
+        const where = this.where;
+
+        if (where.time?.length) {
+          where.startTime = where.time[0];
+          where.endTime = where.time[1];
+        }
+
+        this.$emit('search', where);
+      },
+      /*  重置 */
+      reset () {
+        this.where = { ...this.defaultWhere };
+        this.search();
+      }
+    }
+  };
+</script>
+<style lang="scss" scoped>
+  .ele-form-actions {
+    display: flex;
+    align-items: center;
+    justify-content: flex-end;
+  }
+</style>

+ 248 - 1
src/views/productionPlan/index.vue

@@ -1 +1,248 @@
-<template></template>
+<template>
+  <div class="ele-body">
+    <el-card shadow="never" v-loading="loading">
+      <productionPlan-search @search="reload" ref="searchRef">
+      </productionPlan-search>
+      <el-tabs v-model="activeName" type="card" @tab-click="handleTabChange">
+        <el-tab-pane label="未发布" name="first"></el-tab-pane>
+        <el-tab-pane label="已发布" name="second"></el-tab-pane>
+      </el-tabs>
+      <!-- 数据表格 -->
+      <ele-pro-table
+        ref="table"
+        :key="activeName"
+        :columns="columns"
+        :datasource="datasource"
+        :cache-key="`${activeName}ProductionPlanTable`"
+      >
+        <!-- 操作列 -->
+        <template v-slot:action="{ row }">
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-truck"
+            @click="handleOrderPublish(row)"
+          >
+            发布工单
+          </el-link>
+          <el-link type="primary" :underline="false" icon="el-icon-truck">
+            重新发布
+          </el-link>
+          <el-link type="primary" :underline="false" icon="el-icon-edit">
+            修改计划
+          </el-link>
+          <el-link type="primary" :underline="false" icon="el-icon-edit">
+            删除
+          </el-link>
+        </template>
+      </ele-pro-table>
+    </el-card>
+  </div>
+</template>
+
+<script>
+  import productionPlanSearch from './components/productionPlan-search.vue';
+  export default {
+    components: {
+      productionPlanSearch
+    },
+    data () {
+      return {
+        activeName: 'first',
+
+        // 加载状态
+        loading: false,
+        pageType: 'add',
+        dialogTitle: '',
+        isBindPlan: false
+      };
+    },
+    computed: {
+      // 表格列配置
+      columns () {
+        return [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'code',
+            label: '计划编号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'planCode',
+            label: '产品编号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'planName',
+            label: '牌号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'equiCode',
+            label: '型号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'equiName',
+            label: '计划数量',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'executeUserName',
+            label: '计划重量',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'planFinishTime',
+            label: '要求成型数量',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'acceptTime',
+            label: '已成型数量',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'finishTime',
+            label: '要求成型日期',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'sj',
+            label: '预测成型日期',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'status',
+            label: '实际成型日期',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'status',
+            label: '交货日期',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'status',
+            label: '预测交货日期',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          ...(this.activeName === 'second'
+            ? [
+                {
+                  prop: 'code',
+                  label: '实际交货日期',
+                  align: 'center',
+                  showOverflowTooltip: true,
+                  minWidth: 110
+                }
+              ]
+            : []),
+          {
+            prop: 'status',
+            label: '计划类型',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'status',
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'status',
+            label: '状态',
+            fixed: this.activeName === 'second' ? 'right' : false,
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          ...(this.activeName === 'first'
+            ? [
+                {
+                  columnKey: 'action',
+                  label: '操作',
+                  width: 350,
+                  align: 'center',
+                  resizable: false,
+                  fixed: 'right',
+                  slot: 'action',
+                  showOverflowTooltip: true
+                }
+              ]
+            : [])
+        ];
+      }
+    },
+    methods: {
+      /* 表格数据源 */
+      datasource ({ page, limit, where, order }) {
+        return [{}];
+        // return getWorkOrderList({
+        //   pageNum: page,
+        //   size: limit,
+        //   ...where,
+        //   type: 3
+        // });
+      },
+      // 发布工单
+      handleOrderPublish (row) {
+        this.$router.push({
+          path: '/productionPlan/workOrderPublish'
+        });
+      },
+      handleTabChange () {
+        this.$refs.searchRef.reset();
+      },
+
+      /* 刷新表格 */
+      reload (where) {
+        this.$refs.table.reload({ page: 1, where });
+      },
+
+      goDetail (row) {
+        row.title = '工单详情';
+        row.tabLabel = '工单信息';
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped></style>

+ 75 - 0
src/views/productionPlan/workOrderPublish.vue

@@ -0,0 +1,75 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never">
+      <HeaderTitle title="发布工单" />
+
+      <el-descriptions title="" direction="vertical" :column="6" border>
+        <el-descriptions-item label="计划编号"
+          >kooriookami</el-descriptions-item
+        >
+        <el-descriptions-item label="计划类型"
+          >18100000000</el-descriptions-item
+        >
+        <el-descriptions-item label="产品编码">苏州市</el-descriptions-item>
+        <el-descriptions-item label="牌号">苏州市</el-descriptions-item>
+        <el-descriptions-item label="型号">苏州市</el-descriptions-item>
+        <el-descriptions-item label="生产版本">苏州市</el-descriptions-item>
+        <el-descriptions-item label="工艺路线名称">苏州市</el-descriptions-item>
+        <el-descriptions-item label="工艺路线版本">苏州市</el-descriptions-item>
+        <el-descriptions-item label="产品数量">苏州市</el-descriptions-item>
+        <el-descriptions-item label="产品重量">苏州市</el-descriptions-item>
+        <el-descriptions-item label="要求成型数量">苏州市</el-descriptions-item>
+        <el-descriptions-item label="要求成型重量">苏州市</el-descriptions-item>
+      </el-descriptions>
+
+      <div class="rules-box">
+        <div class="rule-label">工单生成规则</div>
+        <div class="rule-wrapper">
+          <div class="content">
+            <el-row></el-row>
+          </div>
+          <div class="btn-box">
+            <el-tooltip
+              placement="top-start"
+              title="标题"
+              width="200"
+              trigger="hover"
+              content="这是一段内容,这是一段内容,这是一段内容,这是一段内容。"
+            >
+              <el-button type="text" icon="el-icon-question"></el-button>
+            </el-tooltip>
+            <el-button type="primary" plain>一键生成方案</el-button>
+          </div>
+        </div>
+      </div>
+    </el-card>
+  </div>
+</template>
+
+<style lang="scss" scoped>
+  .rules-box {
+    padding: 20px 0;
+    display: flex;
+    justify-content: space-between;
+    .rule-label {
+      font-size: 18px;
+      font-weight: bold;
+    }
+    .rule-wrapper {
+      flex: 1;
+      display: flex;
+      justify-content: space-between;
+
+      .content {
+        flex: 1;
+      }
+
+      .btn-box {
+        display: flex;
+        justify-content: space-between;
+
+        width: 200px;
+      }
+    }
+  }
+</style>