lucw 6 ماه پیش
والد
کامیت
60c8169759

+ 2 - 2
src/views/batchRecord/components/plan.vue

@@ -118,14 +118,14 @@
           },
           {
             prop: 'code',
-            label: '计划配置单号',
+            label: '计划单号',
             align: 'center',
             minWidth: 160,
             slot: 'code'
           },
           {
             prop: 'name',
-            label: '计划配置名称',
+            label: '计划名称',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110

+ 1 - 1
src/views/batchRecord/components/programRulesDialog.vue

@@ -994,7 +994,7 @@
       },
       // 获取自动生成的单号
       async getOrderCode() {
-        const data = await getCode('record_rules_plan_config_code');
+        const data = await getCode('record_rules_plan_code');
         this.addForm.code = data;
       },
       // 选择记录规则

+ 171 - 0
src/views/produce/components/qualityInspection/index.vue

@@ -0,0 +1,171 @@
+<template>
+  <el-dialog
+    title="首件两检报工"
+    :visible.sync="dialogVisible"
+    width="60%"
+    :before-close="handleClose"
+  >
+    <div>
+      <!-- <el-button type="primary" plain round @click="openMaintenancePlan">
+        设备保养计划
+      </el-button> -->
+      <div
+        v-if="loading || ruleRecordsList.length > 0"
+        class="step-list"
+        v-loading="loading"
+      >
+        <ele-pro-table
+          ref="table"
+          row-key="id"
+          :columns="columns"
+          :datasource="ruleRecordsList"
+          cache-key="mes-ruleRecordsList-2511172018"
+          autoAmendPage
+          :need-page="false"
+          @refresh="getData"
+        >
+          <template v-slot:action="{ row }">
+            <el-button
+              :type="row.executeStatus == 0 ? 'primary' : 'default'"
+              class="status-btn"
+              @click="openMaintenancePlan(row)"
+            >
+              {{ executeStatusTest(row.executeStatus) }}
+            </el-button>
+          </template>
+        </ele-pro-table>
+      </div>
+      <el-empty v-else></el-empty>
+    </div>
+    <template #footer>
+      <el-button @click="handleUpdate" type="primary" :loading="butLoad"
+        >更新</el-button
+      >
+
+      <el-button @click="handleClose">关闭</el-button>
+    </template>
+  </el-dialog>
+</template>
+
+<script>
+  import {
+    getLastRuleRecords,
+    getProduceTaskInstanceId
+  } from '@/api/producetaskrulerecord/index.js';
+
+  import dictMixins from '@/mixins/dictMixins';
+  import tableColumnsMixin from '@/mixins/tableColumnsMixin';
+
+  export default {
+    mixins: [dictMixins, tableColumnsMixin],
+    components: {},
+    data() {
+      return {
+        dialogVisible: false,
+        loading: true
+      };
+    },
+    computed: {
+      columns() {
+        return [
+          {
+            width: 50,
+            type: 'index',
+            columnKey: 'index',
+            label: '序号',
+            align: 'center'
+          },
+          {
+            prop: 'produceTaskName',
+            label: '名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 150,
+            formatter: (row) => {
+              return row.ruleName || row.itemTaskName || row.planConfigName;
+            }
+          },
+          {
+            prop: 'executeMethod',
+            label: '执行方式',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 150,
+            formatter: (row) => {
+              return this.getDictValue('记录规则执行方式', row.executeMethod);
+            }
+          },
+          {
+            prop: 'reportUserName',
+            label: '报工人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 150
+          },
+          {
+            prop: 'finishTime',
+            label: '报工时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 150
+          },
+          {
+            prop: 'duration',
+            label: '工时',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 150,
+            formatter: (row) => {
+              // 毫秒转小时
+              return row.duration
+                ? (row.duration / 1000 / 60 / 60).toFixed(2) + ' 时'
+                : '';
+            }
+          },
+          // 操作
+          {
+            label: '操作',
+            align: 'center',
+            width: 130,
+            fixed: 'right',
+            slot: 'action'
+          }
+        ];
+      }
+    },
+    methods: {
+      open() {
+        this.dialogVisible = true;
+      },
+      executeStatusTest(status) {
+        switch (status) {
+          case 0:
+            return '未报工';
+          case 1:
+            return '执行中';
+          default:
+            return '已报工';
+        }
+      },
+      // 获取数据
+      async getData() {},
+      handleClose() {
+        this.dialogVisible = false;
+        this.$emit('close');
+      },
+      async handleUpdate() {
+        try {
+          this.butLoad = true;
+          await this.getData();
+          // 更新逻辑
+          this.$message.success('已更新');
+          this.butLoad = false;
+        } catch (error) {
+          this.butLoad = false;
+        }
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped></style>

+ 13 - 11
src/views/produceOrder/components/recordRules/recordRules.vue

@@ -5,7 +5,6 @@
       :datasource="datasource"
       cacheKey="mes-recordRules-25113-031018"
       ref="tableRef"
-      :need-page="false"
     >
       <template v-slot:toolbar>
         <el-select
@@ -49,7 +48,7 @@
   import tableColumnsMixin from '@/mixins/tableColumnsMixin';
   import dictMixins from '@/mixins/dictMixins';
   import {
-    getLastRuleRecords,
+    producetaskrulerecordPage,
     getProduceTaskInstanceId
   } from '@/api/producetaskrulerecord/index.js';
   import taskDialog from '@/views/produce/components/prenatalExamination/taskDialog.vue';
@@ -155,27 +154,30 @@
     },
     methods: {
       datasource({ page, limit, where }) {
-        return this.getList();
+        return this.getList(page, limit);
       },
-      async getList() {
-        const [list, produceTaskInstanceInfo] = await Promise.all([
-          getLastRuleRecords({
-            workOrderId: this.workOrderInfo.id,
+      async getList(pageNum, pageSize) {
+        const [data, produceTaskInstanceInfo] = await await Promise.all([
+          producetaskrulerecordPage({
+            workOrderCode: this.workOrderInfo.code,
             produceTaskId: this.produceTaskId,
             reportWorkType: this.reportWorkType,
-            isTempRecord: 0
+            isTempRecord: 0,
+            pageNum,
+            pageSize
           }),
           getProduceTaskInstanceId(this.workOrderInfo.id, this.produceTaskId)
         ]);
 
-        list.map((i) => {
+        data.list = data.list.map((i) => {
           // 工序名称
           i.produceTaskName = produceTaskInstanceInfo.name;
           i.produceTaskInstanceId = produceTaskInstanceInfo.id;
           return i;
         });
-        console.log('list', list);
-        return list;
+
+        console.log('list', data.list);
+        return data.list;
       },
       reload() {
         this.$refs.tableRef.reload();

+ 1 - 1
vue.config.js

@@ -36,7 +36,7 @@ module.exports = {
         // target: 'http://192.168.1.251:18086',
         // target: 'http://192.168.1.251:18086',
         // target: 'http://192.168.1.125:18086',
-        // target: 'http://192.168.1.116:18086', // 赵沙金
+        target: 'http://192.168.1.116:18086', // 赵沙金
         // target: 'http://192.168.1.251:18086', // 开发环境
         // target: 'http://192.168.1.103:18086',192.168.1.116
         // target: 'http://192.168.1.144:18086',