quwangxin 2 лет назад
Родитель
Сommit
311a8c2dc8

+ 33 - 0
src/api/aps/index.js

@@ -0,0 +1,33 @@
+import request from '@/utils/request';
+
+/**
+ * aps计划工单
+ */
+export async function getList (data) {
+  const res = await request.post('/aps/productionplan/page', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 工单发布
+ */
+export async function getDeviceList ({ productionId }) {
+  const res = await request.get(
+    `/aps/batchingworkorder/getDeviceList/${productionId}`
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 生产计划添加工单列表
+export async function getPlanDeviceList ({ productionId }) {
+  const res = await request.get(`/aps/workorder/getDeviceList/${productionId}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 32 - 0
src/api/produceOrder/index.js

@@ -0,0 +1,32 @@
+import request from '@/utils/request';
+
+/**
+ * 分页
+ */
+export async function getPage (params) {
+  const res = await request.get('/mes/workorder/page', { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 新增
+ */
+export async function save (data) {
+  const res = await request.post('/mes/workorder/save', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 修改
+ */
+export async function update (data) {
+  const res = await request.put('/mes/workorder/update', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 190 - 0
src/components/EquipmentDailog/equipment-dailog.vue

@@ -0,0 +1,190 @@
+<template>
+  <ele-modal
+    :visible.sync="visible"
+    title="添加工单-选择设备"
+    width="65vw"
+    append-to-body
+  >
+    <div class="search-box">
+      设备名称
+      <el-input placeholder="请输入" v-model="name"></el-input>
+    </div>
+    <!-- 数据表格 -->
+    <!-- :highlight-current-row="isSingle" -->
+    <ele-pro-table
+      ref="table"
+      :columns="columns"
+      @done="handleDone"
+      row-key="id"
+      :needPage="false"
+      :initLoad="false"
+      :selection.sync="selectionList"
+      :datasource="datasourceShow"
+      :current.sync="current"
+      highlight-current-row
+      height="45vh"
+      @row-click="choose"
+    >
+      <template v-slot:select="{ row }">
+        <el-radio class="radio" v-model="radio" :label="row.id"
+          ><i></i
+        ></el-radio>
+      </template>
+    </ele-pro-table>
+    <div class="footer" slot="footer">
+      <el-button @click="cancel">取消</el-button>
+      <el-button @click="confirm" type="primary">确定</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+  import { getDeviceList, getPlanDeviceList } from '@/api/aps/index';
+  export default {
+    props: ['produceVersionId'],
+    data () {
+      return {
+        visible: false,
+        current: null,
+        name: '',
+        selectionList: [],
+        memoList: [],
+        datasource: [],
+        isSingle: false,
+        callback: null,
+        radio: ''
+      };
+    },
+    computed: {
+      columns () {
+        const list = [
+          {
+            label: '设备编码',
+            prop: 'code'
+          },
+          {
+            label: '设备名称',
+            prop: 'name'
+          },
+          // {
+          //   label: '生产状态',
+          //   prop: 'status'
+          // },
+          {
+            label: '未完成工单数',
+            prop: 'incompleteOrderNum'
+          },
+          {
+            label: '预计完成时间',
+            prop: 'planCompleteDate'
+          },
+          {
+            label: '产能',
+            prop: 'capacityNum',
+            width: 200,
+            formatter: (row) =>
+              row.capacityNum + ' ' + row.capacityUnit + '/' + row.capacityTime
+          },
+          {
+            label: '末单牌号',
+            prop: 'lastOrderGrade'
+          }
+        ];
+
+        if (!this.isSingle) {
+          list.push({
+            slot: 'select',
+            prop: 'select',
+            label: '选择',
+            align: 'center'
+          });
+        }
+        return list;
+      },
+      datasourceShow () {
+        return this.datasource?.filter((item) => {
+          if (this.name) {
+            return item.name.includes(this.name);
+          }
+
+          return true;
+        });
+      }
+    },
+    methods: {
+      open (val, list = []) {
+        this.memoList = list;
+        this.isSingle = false;
+        this.visible = true;
+        this._getList(val);
+      },
+      openSingle (list = [], callback) {
+        this.memoList = list;
+        this.callback = callback;
+        this.isSingle = true;
+        this.visible = true;
+        this._getList();
+      },
+      handleDone ({ data }) {
+        if (this.memoList.length) {
+          this.$nextTick(() => {
+            if (this.isSingle) {
+              this.$refs.table.setCurrentRow(
+                data.find((item) => item.id == this.memoList[0].deviceId)
+              );
+            } else {
+              this.memoList.length &&
+                this.$refs.table.setSelectedRowKeys(
+                  this.memoList.map((i) => i.deviceId)
+                );
+            }
+          });
+        }
+      },
+      async _getList (val) {
+        const fn = val ? getPlanDeviceList : getDeviceList;
+        const data = await fn({
+          name: this.name,
+          productionId: this.produceVersionId
+        });
+        this.datasource = data || [];
+      },
+      confirm () {
+        if (this.isSingle) {
+          if (!this.current) return this.$message.error('请选择数据');
+
+          this.callback && this.callback(this.current);
+        } else {
+          if (!this.current) return this.$message.error('请选择数据');
+          this.$emit('success', [this.current]);
+        }
+
+        this.cancel();
+      },
+      cancel () {
+        this.$refs.table.clearSelection();
+        this.radio = '';
+        this.current = null;
+        this.visible = false;
+      },
+      // 单击获取id
+      choose (row) {
+        this.current = row;
+        this.radio = row.id;
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .search-box {
+    display: flex;
+    justify-content: flex-start;
+    align-items: center;
+    margin-bottom: 20px;
+    .el-input {
+      width: 220px;
+      margin: 0 32px;
+    }
+  }
+</style>

+ 157 - 0
src/views/produceOrder/components/apsPlanOrder.vue

@@ -0,0 +1,157 @@
+<template>
+  <ele-modal
+    :visible.sync="visible"
+    title="创建工单"
+    width="65vw"
+    append-to-body
+  >
+    <div class="search-box">
+      计划编号
+      <el-input placeholder="请输入" v-model="searchCode"></el-input>
+    </div>
+    <!-- 数据表格 -->
+    <ele-pro-table
+      ref="table"
+      :columns="columns"
+      @done="handleDone"
+      row-key="id"
+      :datasource="datasource"
+      :current.sync="current"
+      highlight-current-row
+      height="45vh"
+      @row-click="choose"
+    >
+    </ele-pro-table>
+    <div class="footer" slot="footer">
+      <el-button @click="cancel">取消</el-button>
+      <el-button @click="confirm" type="primary">确定</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+  import { getList } from '@/api/aps/index';
+  export default {
+    props: ['produceVersionId'],
+    data () {
+      return {
+        visible: false,
+        current: null,
+        searchCode: '',
+        isSingle: false,
+        callback: null,
+        radio: '',
+        planType: [
+          { label: '所有计划类型', value: null },
+          { label: '内销计划', value: '1' },
+          { label: '外销计划', value: '2' },
+          { label: '预制计划', value: '3' }
+        ]
+      };
+    },
+    computed: {
+      columns () {
+        const list = [
+          {
+            label: '计划编号',
+            prop: 'code'
+          },
+          {
+            label: '产品编号',
+            prop: 'productCode'
+          },
+          {
+            label: '牌号',
+            prop: 'brandNo'
+          },
+          {
+            label: '型号',
+            prop: 'model'
+          },
+          {
+            prop: 'productNum',
+            label: '计划数量',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'productWeight',
+            label: '计划重量',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'requiredFormingNum',
+            label: '要求成型数量',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'orderType',
+            label: '计划类型',
+            align: 'center',
+            showOverflowTooltip: true,
+            formatter: (row) => {
+              const obj = this.planType.find((i) => i.value == row.planType);
+              return obj && obj.label;
+            }
+          }
+        ];
+        return list;
+      }
+    },
+    methods: {
+      open (memo, callback) {
+        this.memo = memo;
+        this.callback = callback;
+        this.visible = true;
+      },
+      handleDone ({ data }) {
+        if (this.memo?.id) {
+          this.$nextTick(() => {
+            this.$refs.table.setCurrentRow(
+              data.find((item) => item.id == this.memo.id)
+            );
+          });
+        }
+      },
+      datasource ({ page, limit }) {
+        return getList({
+          pageNum: page,
+          size: limit,
+          code: this.searchCode
+        });
+      },
+      confirm () {
+        if (!this.current) return this.$message.error('请选择数据');
+
+        this.callback && this.callback(this.current);
+
+        this.cancel();
+      },
+      cancel () {
+        this.$refs.table.clearSelection();
+        this.searchCode = '';
+        this.current = null;
+        this.visible = false;
+      },
+      // 单击获取id
+      choose (row) {
+        this.current = row;
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .search-box {
+    display: flex;
+    justify-content: flex-start;
+    align-items: center;
+    margin-bottom: 20px;
+    .el-input {
+      width: 220px;
+      margin: 0 32px;
+    }
+  }
+</style>

+ 155 - 49
src/views/produceOrder/components/createDialog.vue

@@ -6,74 +6,173 @@
     custom-class="ele-dialog-form"
     :title="titleOpt[type]"
   >
-    <el-form :model="formData" label-width="0">
-      <el-descriptions title="" :column="2" border>
-        <el-descriptions-item>
-          <span slot="label" class="label-required">计划编号</span>
-          <el-form-item prop="code">
-            <el-input v-model="formData.code"></el-input>
-          </el-form-item>
-        </el-descriptions-item>
-        <el-descriptions-item label="产品编码">
-          <el-form-item prop="code">
-            <el-input v-model="formData.code"></el-input> </el-form-item
-        ></el-descriptions-item>
-        <el-descriptions-item label="产品名称"></el-descriptions-item>
-        <el-descriptions-item label="牌号|型号"> </el-descriptions-item>
-        <el-descriptions-item label="计划生产数量"
-          >江苏省苏州市吴中区吴中大道 1188 号</el-descriptions-item
-        >
-        <el-descriptions-item label="要求成型数量"
-          >江苏省苏州市吴中区吴中大道 1188 号</el-descriptions-item
-        >
-        <el-descriptions-item
-          label="成型数量"
-          label-class-name="produce-create-bg"
-          content-class-name="produce-create-bg"
-        >
-          <span slot="label" class="label-required">成型数量</span
-          ><el-input></el-input
-        ></el-descriptions-item>
-        <el-descriptions-item
-          label="计划开始时间"
-          label-class-name="produce-create-bg"
-          content-class-name="produce-create-bg"
-        >
-          <span slot="label" class="label-required">计划开始时间</span
-          ><el-input></el-input
-        ></el-descriptions-item>
-        <el-descriptions-item
-          label="设备编码/名称"
-          label-class-name="produce-create-bg"
-          content-class-name="produce-create-bg"
-        >
-          <span slot="label" class="label-required">设备编码/名称</span
-          ><el-input></el-input
-        ></el-descriptions-item>
-      </el-descriptions>
-    </el-form>
+    <div class="form-wrapper">
+      <el-form
+        :model="formData"
+        label-width="0"
+        :show-message="false"
+        ref="formRef"
+      >
+        <el-descriptions title="" :column="2" border>
+          <el-descriptions-item>
+            <span slot="label" class="label-required">计划编号</span>
+            <el-form-item prop="productionPlanCode" required>
+              <el-input
+                :value="formData.productionPlanCode"
+                placeholder="请选择"
+                @click.native="codeChoose"
+              ></el-input>
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item label="产品编码">
+            {{ formData.productCode }}</el-descriptions-item
+          >
+          <el-descriptions-item label="产品名称">{{
+            formData.productName
+          }}</el-descriptions-item>
+          <el-descriptions-item label="牌号|型号">
+            {{ formData.brandNo }}|{{ formData.model }}</el-descriptions-item
+          >
+          <el-descriptions-item label="计划生产数量">{{
+            formData.productNum
+          }}</el-descriptions-item>
+          <el-descriptions-item label="要求成型数量">{{
+            formData.requiredFormingNum
+          }}</el-descriptions-item>
+          <el-descriptions-item
+            label="成型数量"
+            label-class-name="produce-create-bg"
+            content-class-name="produce-create-bg"
+          >
+            <span slot="label" class="label-required">成型数量</span>
+            <el-form-item prop="formingNum" required>
+              <el-input v-model="formData.formingNum"></el-input>
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item
+            label="计划开始时间"
+            label-class-name="produce-create-bg"
+            content-class-name="produce-create-bg"
+          >
+            <span slot="label" class="label-required">计划开始时间</span>
 
+            <el-form-item prop="planStartTime" required class="w100">
+              <el-date-picker
+                class="w100"
+                v-model="formData.planStartTime"
+                type="date"
+                value-format="yyyy-MM-dd"
+              ></el-date-picker> </el-form-item
+          ></el-descriptions-item>
+          <el-descriptions-item
+            label="设备编码/名称"
+            label-class-name="produce-create-bg"
+            content-class-name="produce-create-bg"
+          >
+            <span slot="label" class="label-required">设备编码/名称</span>
+            <el-form-item prop="deviceName" required
+              ><el-input
+                @click.native="getEquip"
+                :value="
+                  formData.deviceName &&
+                  `${formData.deviceName}(${formData.deviceCode})`
+                "
+              ></el-input> </el-form-item
+          ></el-descriptions-item>
+        </el-descriptions>
+      </el-form>
+    </div>
     <div slot="footer">
-      <el-button plain>取消</el-button>
-      <el-button type="primary">确定</el-button>
+      <el-button plain @click="cancel">取消</el-button>
+      <el-button type="primary" @click="confirm">确定</el-button>
     </div>
+    <apsPlanOrder ref="apsPlanOrderRef" />
+    <equipmentDailog
+      ref="equipmentDailogRef"
+      :produceVersionId="produceVersionId"
+    />
   </ele-modal>
 </template>
 
 <script>
+  import { save, update } from '@/api/produceOrder/index.js';
+  import equipmentDailog from '@/components/EquipmentDailog/equipment-dailog';
+  import apsPlanOrder from './apsPlanOrder';
   export default {
+    components: { apsPlanOrder, equipmentDailog },
     data () {
       return {
         visible: false,
         titleOpt: ['创建工单'],
         type: 0,
-        formData: {}
+        produceVersionId: '',
+        formData: {
+          productionPlanCode: '',
+          deviceCode: '',
+          deviceName: '',
+          productCode: '',
+          productName: '',
+          formingNum: '',
+          brandNo: '',
+          model: '',
+          requiredFormingNum: '',
+          planStartTime: '',
+          productNum: ''
+        }
       };
     },
     methods: {
       open (type = 0) {
         this.type = type;
         this.visible = true;
+      },
+      codeChoose () {
+        this.$refs.apsPlanOrderRef.open(this.formData.productCode, (res) => {
+          if (this.formData.productCode != res.productCode) {
+            this.formData.deviceCode = '';
+            this.formData.deviceName = '';
+            this.formData.deviceId = '';
+          }
+
+          this.formData.productionPlanCode = res.code;
+          this.formData.productionPlanId = res.id;
+          this.formData.productCode = res.productCode;
+          this.formData.productName = res.productName;
+          this.formData.brandNo = res.brandNo;
+          this.formData.model = res.model;
+          this.formData.productNum = res.productNum;
+          this.formData.requiredFormingNum = res.requiredFormingNum;
+
+          this.produceVersionId = res.produceVersionId;
+        });
+      },
+      getEquip () {
+        if (!this.produceVersionId) {
+          return this.$message.error('请先选择计划');
+        }
+        this.$refs.equipmentDailogRef.openSingle(
+          [this.formData.deviceCode],
+          (res) => {
+            this.formData.deviceCode = res.code;
+            this.formData.deviceName = res.name;
+            this.formData.deviceId = res.id;
+          }
+        );
+      },
+      cancel () {
+        this.formData = {};
+        this.visible = false;
+      },
+      confirm () {
+        this.$refs.formRef.validate(async (value) => {
+          if (value) {
+            const res = await save(this.formData);
+
+            this.$message.success('操作成功!');
+            this.$emit('success');
+            this.cancel();
+          }
+        });
       }
     }
   };
@@ -87,6 +186,13 @@
       font-size: 1.2em;
     }
   }
+  .form-wrapper {
+    :deep(.el-form) {
+      .el-form-item {
+        margin-bottom: 0 !important;
+      }
+    }
+  }
 </style>
 <style lang="scss">
   .produce-create-bg {

+ 30 - 30
src/views/produceOrder/components/produceOrder-search.vue

@@ -16,7 +16,7 @@
         <el-form-item label="计划编码:">
           <el-input
             clearable
-            v-model="where.productCode"
+            v-model="where.productionPlanCode"
             placeholder="请输入"
           />
         </el-form-item>
@@ -40,29 +40,29 @@
       </el-col>
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
         <el-form-item label="生产版本:">
-          <el-select
+          <el-input
             clearable
-            v-model="where.planType"
-            placeholder="请选择"
-            class="w100"
-          >
-            <el-option
-              v-for="item in planType"
-              :label="item.label"
-              :value="item.value"
-              :key="item.value"
-            ></el-option>
-          </el-select>
+            v-model="where.produceVersionName"
+            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.brandNo" 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-form-item label="产品名称:">
-          <el-input clearable v-model="where.brandNo" placeholder="请输入" />
+          <el-input
+            clearable
+            v-model="where.productName"
+            placeholder="请输入"
+          />
         </el-form-item>
       </el-col>
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
@@ -75,7 +75,10 @@
           <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: 6, md: 12 } : { span: 6 }"
+        v-if="activeName == 'first'"
+      >
         <el-form-item label="状态:">
           <el-select v-model="where.status" placeholder="请选择" class="w100">
             <el-option
@@ -128,17 +131,14 @@
       // 默认表单数据
       const defaultWhere = {
         code: '',
+        productionPlanCode: '',
+        produceVersionName: '',
         productCode: '',
-        status: '',
-        model: '',
+        productName: '',
         brandNo: '',
+        model: '',
         planType: '',
-        createTime: [],
-        deliveryTime: [],
-        formingTime: [],
-        reqMoldTime: [],
-        planFormingTime: [],
-        executeUserName: ''
+        createTime: []
       };
       return {
         // 表单数据
@@ -170,14 +170,14 @@
       /* 搜索 */
       search () {
         const where = { ...this.where };
-        for (const key in where) {
-          if (Array.isArray(where[key])) {
-            where[`${key}End`] = where[key][1];
-            where[key] = where[key][0];
-          }
+
+        if (where.createTime?.length) {
+          where.createTimeStart = where.createTime[0];
+          where.createTimeEnd = where.createTime[1];
         }
+        delete where.createTime;
 
-        where.status = where.status.split(',');
+        // where.status = where.status.split(',');
 
         this.$emit('search', where);
       },

+ 37 - 34
src/views/produceOrder/index.vue

@@ -84,13 +84,13 @@
         </template>
       </ele-pro-table>
     </el-card>
-    <createDialog ref="createRef" />
+    <createDialog ref="createRef" @success="createSuccess" />
     <pickingDialog ref="PickingRef" />
   </div>
 </template>
 
 <script>
-  // import { getList, del } from '@/api/produceOrder/index.js';
+  import { getPage } from '@/api/produceOrder/index.js';
   import produceOrderSearch from './components/produceOrder-search.vue';
   import createDialog from './components/createDialog.vue';
   import pickingDialog from './components/pickingDialog.vue';
@@ -111,17 +111,12 @@
         isBindPlan: false,
         statusOpt: {
           first: [
-            { label: '所有状态', value: '3,2' },
-            { label: '待发布', value: '2' },
-            { label: '发布失败', value: '3' }
-          ],
-          second: [
-            { label: '所有状态', value: '7,4,5,6' },
+            { label: '所有状态', value: '5,4,7' },
             { label: '待生产', value: '4' },
             { label: '生产中', value: '5' },
-            { label: '已完成', value: '6' },
             { label: '已延期', value: '7' }
-          ]
+          ],
+          second: [{ label: '已完成', value: '6' }]
         },
         planType: [
           { label: '所有计划类型', value: null },
@@ -146,12 +141,12 @@
           ],
           second: [
             {
-              prop: 'formingTime',
+              prop: 'empty1111',
               label: '完成时间',
               align: 'center'
             },
             {
-              prop: 'formingTime',
+              prop: 'empty1111',
               label: '生产周期',
               align: 'center'
             }
@@ -169,21 +164,22 @@
             fixed: 'left'
           },
           {
-            prop: 'releaseTime',
+            prop: 'code',
             label: '生产工单号',
             align: 'center'
           },
           {
-            prop: 'planFormingTime',
+            prop: 'productionPlanCode',
             label: '计划编号',
             align: 'center'
           },
           {
-            prop: 'deliveryTime',
+            prop: 'planType',
             label: '计划类型',
             align: 'center'
           },
           {
+            prop: 'produceVersionName',
             label: '生产版本',
             align: 'center'
           },
@@ -193,55 +189,53 @@
             align: 'center'
           },
           {
-            prop: 'brandNo',
+            prop: 'productName',
             label: '产品名称',
             align: 'center'
           },
           {
-            prop: 'model',
+            prop: 'brandNo',
             label: '牌号',
-            align: 'center',
-            showOverflowTooltip: true
+            align: 'center'
           },
           {
             prop: 'model',
             label: '型号',
-            align: 'center',
-            showOverflowTooltip: true
+            align: 'center'
           },
           {
-            prop: 'productNum',
+            prop: 'formingNum',
             label: '要求成型数量',
             align: 'center',
             showOverflowTooltip: true
           },
           {
-            prop: 'productWeight',
+            prop: 'formingWeight',
             label: '要求成型重量',
             align: 'center',
             showOverflowTooltip: true
           },
           {
-            prop: 'requiredFormingNum',
+            prop: 'formedNum',
             label: '已成型数量',
             align: 'center',
             showOverflowTooltip: true
           },
           {
-            prop: 'requiredFormingNum',
+            prop: 'formedWeight',
             label: '已成型重量',
             align: 'center',
             showOverflowTooltip: true
           },
           {
-            prop: 'reqMoldTime',
+            prop: 'planStartTime',
             label: '计划开始时间',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110
           },
           {
-            prop: 'reqMoldTime1',
+            prop: 'startTime',
             label: '实际开始时间',
             align: 'center',
             showOverflowTooltip: true,
@@ -281,14 +275,23 @@
       }
     },
     methods: {
+      statusFormatter (status) {
+        const obj = this.statusOpt[this.activeName].find(
+          (i) => i.value == status
+        );
+
+        return obj && obj.label;
+      },
       /* 表格数据源 */
       datasource ({ page, limit, where }) {
-        return [];
-        // getList({
-        //   pageNum: page,
-        //   size: limit,
-        //   ...where
-        // });
+        return getPage({
+          pageNum: page,
+          size: limit,
+          ...where
+        });
+      },
+      createSuccess () {
+        this.reload();
       },
       handleCreate () {
         this.$refs.createRef.open(0);
@@ -318,7 +321,7 @@
       },
 
       /* 刷新表格 */
-      reload (where) {
+      reload (where = {}) {
         this.$nextTick(() => {
           this.$refs.table.reload({ page: 1, where });
         });

+ 2 - 2
vue.config.js

@@ -31,9 +31,9 @@ module.exports = {
     proxy: {
       // 当我们的本地的请求 有/api的时候,就会代理我们的请求地址向另外一个服务器发出请求
       '/api': {
-        target: 'http://192.168.3.51:18086', // 测试
+        // target: 'http://192.168.3.51:18086', // 测试
 
-        // target: 'http://192.168.3.35:8080', // kang杨威
+        target: 'http://192.168.3.35:8080', // kang杨威
         // target: 'http://192.168.3.25:8080', // 黄峥嵘
         // target: 'http://192.168.3.41:8080', // 何江鹏
         // target: 'http://192.168.3.33:8080', // 谢一平