quwangxin %!s(int64=2) %!d(string=hai) anos
pai
achega
4ef536d916

+ 2 - 2
src/api/productionPlan/index.js

@@ -1,9 +1,9 @@
 import request from '@/utils/request';
 
 /**
- * 登录
+ * 列表
  */
-export async function login (data) {
+export async function getList (data) {
   const res = await request.get('/aps/productionplan/page', data);
   if (res.data.code == 0) {
     return res.data;

+ 121 - 27
src/views/productionPlan/components/productionPlan-search.vue

@@ -7,40 +7,108 @@
     @submit.native.prevent
   >
     <el-row :gutter="15">
-      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+      <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 5 }">
         <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-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 5 }">
         <el-form-item label="产品编码:">
-          <el-input clearable v-model="where.code" placeholder="请输入" />
+          <el-input
+            clearable
+            v-model="where.productCode"
+            placeholder="请输入"
+          />
         </el-form-item>
       </el-col>
-      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+      <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 5 }">
         <el-form-item label="牌号:" label-width="80px">
-          <el-input clearable v-model="where.code" placeholder="请输入" />
+          <el-input clearable v-model="where.brandNo" placeholder="请输入" />
         </el-form-item>
       </el-col>
-      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+      <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 5 }">
         <el-form-item label="型号:" label-width="80px">
-          <el-input clearable v-model="where.code" placeholder="请输入" />
+          <el-input clearable v-model="where.model" placeholder="请输入" />
         </el-form-item>
       </el-col>
-      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+      <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 5 }">
         <el-form-item label="计划类型:" label-width="80px">
-          <el-input clearable v-model="where.code" placeholder="请输入" />
+          <el-select clearable v-model="where.orderType" placeholder="请选择">
+            <el-option
+              v-for="item in planType"
+              :label="item.label"
+              :value="item.value"
+              :key="item.value"
+            ></el-option>
+          </el-select>
         </el-form-item>
       </el-col>
-      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+      <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 5 }">
         <el-form-item label="计划状态:" label-width="80px">
-          <el-input clearable v-model="where.code" placeholder="请输入" />
+          <el-select clearable v-model="where.status" placeholder="请选择">
+            <el-option
+              v-for="item in statusOpt[activeName]"
+              :label="item.label"
+              :value="item.value"
+              :key="item.value"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 9, md: 12 } : { span: 9 }">
+        <el-form-item label-width="100px">
+          <template slot="label">
+            <el-select
+              v-model="deliveryVal"
+              @change="
+                () => {
+                  where.deliveryTime = [];
+                  where.formingTime = [];
+                }
+              "
+            >
+              <el-option label="预测交货日期" value="deliveryTime"></el-option>
+              <el-option label="实际交货日期" value="formingTime"></el-option>
+            </el-select>
+          </template>
+          <el-date-picker
+            v-model="where[deliveryVal]"
+            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-col v-bind="styleResponsive ? { lg: 7, md: 12 } : { span: 7 }">
+        <el-form-item label="">
+          <template slot="label">
+            <el-select
+              v-model="shapeVal"
+              @change="
+                () => {
+                  where.requiredFormingTime = [];
+                  where.planFormingTime = [];
+                  where.formingTime = [];
+                }
+              "
+            >
+              <el-option
+                label="要求成型日期"
+                value="requiredFormingTime"
+              ></el-option>
+              <el-option
+                label="预测成型日期"
+                value="planFormingTime"
+              ></el-option>
+              <el-option label="实际成型日期" value="formingTime"></el-option>
+            </el-select>
+          </template>
           <el-date-picker
-            v-model="where.time"
+            v-model="where[shapeVal]"
             type="daterange"
             range-separator="至"
             start-placeholder="开始日期"
@@ -51,10 +119,10 @@
           </el-date-picker>
         </el-form-item>
       </el-col>
-      <el-col v-bind="styleResponsive ? { lg: 12, md: 12 } : { span: 12 }">
-        <el-form-item label="发布日期:">
+      <el-col v-bind="styleResponsive ? { lg: 7, md: 12 } : { span: 7 }">
+        <el-form-item label="工单发布时间:">
           <el-date-picker
-            v-model="where.time"
+            v-model="where.releaseTime"
             type="daterange"
             range-separator="至"
             start-placeholder="开始日期"
@@ -65,22 +133,17 @@
           </el-date-picker>
         </el-form-item>
       </el-col>
-      <el-col v-bind="styleResponsive ? { lg: 12, md: 12 } : { span: 12 }">
+      <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 5 }">
         <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 @click="reset" icon="el-icon-refresh-left" type="primary"
             >重置</el-button
           >
         </div>
@@ -91,18 +154,49 @@
 
 <script>
   export default {
+    props: ['activeName'],
     data () {
       // 默认表单数据
       const defaultWhere = {
-        staus: '',
         code: '',
-        time: [],
+        productCode: '',
+        status: '',
+        model: '',
+        brandNo: '',
+        orderType: '',
+        releaseTime: [],
+        deliveryTime: [],
+        formingTime: [],
+        requiredFormingTime: [],
+        planFormingTime: [],
         executeUserName: ''
       };
       return {
         // 表单数据
+        deliveryVal: '',
+        shapeVal: '',
         where: { ...defaultWhere },
-        treeData: []
+        treeData: [],
+        statusOpt: {
+          first: [
+            { label: '所有状态', value: '1,2' },
+            { label: '待发布', value: '1' },
+            { label: '发布状态', value: '2' }
+          ],
+          second: [
+            { label: '所有状态', value: '0,3,4,5,6' },
+            { label: '待排产', value: '0' },
+            { label: '待生产', value: '3' },
+            { label: '生产中', value: '4' },
+            { label: '已完成', value: '5' },
+            { label: '已延期', value: '6' }
+          ]
+        },
+        planType: [
+          { label: '所有计划类型', value: '0,1' },
+          { label: '内销计划', value: '0' },
+          { label: '外销计划', value: '1' }
+        ]
       };
     },
     computed: {

+ 76 - 54
src/views/productionPlan/index.vue

@@ -41,6 +41,7 @@
 </template>
 
 <script>
+  import { getList } from '@/api/productionPlan/index.js';
   import productionPlanSearch from './components/productionPlan-search.vue';
   export default {
     components: {
@@ -60,6 +61,48 @@
     computed: {
       // 表格列配置
       columns () {
+        const opt = {
+          first: [
+            {
+              prop: 'deliveryTime',
+              label: '预测交货日期',
+              align: 'center',
+              showOverflowTooltip: true,
+              minWidth: 110
+            }
+          ],
+          second: [
+            // {
+            //   prop: 'formingTime',
+            //   label: '实际成型日期',
+            //   align: 'center',
+            //   showOverflowTooltip: true,
+            //   minWidth: 110
+            // },
+            {
+              prop: 'releaseTime',
+              label: '工单发布日期',
+              align: 'center',
+              showOverflowTooltip: true,
+              minWidth: 110
+            },
+            {
+              prop: 'deliveryTime',
+              label: '预测交货日期',
+              align: 'center',
+              showOverflowTooltip: true,
+              minWidth: 110
+            },
+            {
+              prop: 'formingTime',
+              label: '实际交货日期',
+              align: 'center',
+              showOverflowTooltip: true,
+              minWidth: 110
+            }
+          ]
+        };
+
         return [
           {
             columnKey: 'index',
@@ -71,129 +114,110 @@
             fixed: 'left'
           },
           {
+            slot: 'code',
             prop: 'code',
+            action: 'code',
             label: '计划编号',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110
           },
           {
-            prop: 'planCode',
+            prop: 'productCode',
             label: '产品编号',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110
           },
           {
-            prop: 'planName',
+            prop: 'brandNo',
             label: '牌号',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110
           },
           {
-            prop: 'equiCode',
+            prop: 'model',
             label: '型号',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110
           },
           {
-            prop: 'equiName',
+            prop: 'productNum',
             label: '计划数量',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110
           },
           {
-            prop: 'executeUserName',
+            prop: 'productWeight',
             label: '计划重量',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110
           },
           {
-            prop: 'planFinishTime',
+            prop: 'requiredFormingNum',
             label: '要求成型数量',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110
           },
+          // {
+          //   prop: '',
+          //   label: '已成型数量',
+          //   align: 'center',
+          //   showOverflowTooltip: true,
+          //   minWidth: 110
+          // },
           {
-            prop: 'acceptTime',
-            label: '已成型数量',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'finishTime',
+            prop: 'requiredFormingTime',
             label: '要求成型日期',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110
           },
           {
-            prop: 'sj',
+            prop: 'planFormingTime',
             label: '预测成型日期',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110
           },
+          ...opt[this.activeName],
+
           {
-            prop: 'status',
-            label: '实际成型日期',
+            prop: 'orderType',
+            label: '计划类型',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110
           },
           {
-            prop: 'status',
-            label: '交货日期',
+            prop: 'createTime',
+            label: '创建时间',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110
           },
           {
-            prop: 'status',
-            label: '预测交货日期',
+            prop: 'planStatus',
+            label: '状态',
             align: 'center',
-            showOverflowTooltip: true,
             minWidth: 110
           },
           ...(this.activeName === 'second'
             ? [
                 {
-                  prop: 'code',
-                  label: '实际交货日期',
+                  prop: 'releaseTime',
+                  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'
             ? [
                 {
@@ -213,14 +237,12 @@
     },
     methods: {
       /* 表格数据源 */
-      datasource ({ page, limit, where, order }) {
-        return [{}];
-        // return getWorkOrderList({
-        //   pageNum: page,
-        //   size: limit,
-        //   ...where,
-        //   type: 3
-        // });
+      datasource ({ page, limit, where }) {
+        return getList({
+          pageNum: page,
+          size: limit,
+          ...where
+        });
       },
       // 发布工单
       handleOrderPublish (row) {