Browse Source

首件鉴定页面

damon227 1 year ago
parent
commit
5fb929dc17
3 changed files with 433 additions and 0 deletions
  1. 10 0
      src/api/quality.js
  2. 129 0
      src/views/modules/quality/first-update.vue
  3. 294 0
      src/views/modules/quality/first.vue

+ 10 - 0
src/api/quality.js

@@ -0,0 +1,10 @@
+import request from '@/utils/httpRequest'
+
+// 首件鉴定列表
+export function getList (params) {
+  return request({
+    url: request.adornUrl(`/biz-service/first/list`),
+    method: 'get',
+    params: params
+  })
+}

+ 129 - 0
src/views/modules/quality/first-update.vue

@@ -0,0 +1,129 @@
+<template>
+  <div>
+    <div class="my-title">上传</div>
+    <el-form
+      :model="dataForm"
+      :rules="dataRule"
+      ref="dataForm"
+      @keyup.enter.native="dataFormSubmit()"
+      label-width="170px"
+    >
+      <el-row>
+        <el-col :span="8">
+          <el-form-item label="任务单编码" prop="orderCode">
+            <el-input
+              v-model="dataForm.orderCode"
+              disabled
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="物料名称" prop="productName">
+            <el-input
+              v-model="dataForm.productName"
+              disabled
+            ></el-input>
+          </el-form-item>
+        </el-col>
+         <el-col :span="8">
+          <el-form-item label="生产编号" prop="productNumber">
+            <el-input
+              v-model="dataForm.productNumber"
+              disabled
+            ></el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row>
+        <el-col :span="8">
+          <el-form-item label="首件生产流程记录表" prop="attachList1">
+            <upload-component :accept="'*'" v-model="dataForm.attachList1" />
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="首件生产过程原始记录" prop="attachList2">
+            <upload-component :accept="'*'" v-model="dataForm.attachList2" />
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="首件鉴定检验报告" prop="attachList3">
+            <upload-component :accept="'*'" v-model="dataForm.attachList3" />
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row>
+        <el-col :span="8">
+          <el-form-item label="首件鉴定审查报告" prop="attachList4">
+            <upload-component :accept="'*'" v-model="dataForm.attachList4" />
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="首件鉴定评审结论" prop="attachList5">
+            <upload-component :accept="'*'" v-model="dataForm.attachList5" />
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="onChose">取消</el-button>
+      <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
+    </span>
+  </div>
+</template>
+
+<script>
+import UploadComponent from '../common/upload-component-v2'
+export default {
+  name: 'quality-first-update',
+  components: {UploadComponent},
+  data () {
+    return {
+      dataForm: {},
+      dataRule: {
+        attachList1: [{required: true, message: '请上传文件', trigger: 'change'}],
+        attachList2: [{required: true, message: '请上传文件', trigger: 'change'}],
+        attachList3: [{required: true, message: '请上传文件', trigger: 'change'}],
+        attachList4: [{required: true, message: '请上传文件', trigger: 'change'}],
+        attachList5: [{required: true, message: '请上传文件', trigger: 'change'}]
+      }
+    }
+  },
+  mounted () {},
+  methods: {
+    init (item) {
+      this.dataForm = { ...item }
+    },
+    onChose () {
+      this.$emit('onChose')
+    },
+    dataFormSubmit () {
+      this.$refs['dataForm'].validate((valid) => {
+        if (valid) {
+          this.$http({
+            url: this.$http.adornUrl(`/biz-service/first/update`),
+            method: 'post',
+            data: this.$http.adornData({ ...this.dataForm, orgId: this.orgId })
+          }).then(({ data }) => {
+            if (data && data.code === '200') {
+              this.$message({
+                message: '操作成功',
+                type: 'success',
+                duration: 1500,
+                onClose: () => {
+                  this.onChose()
+                  this.$emit('refreshDataList')
+                }
+              })
+            } else {
+              this.$message.error(data.msg)
+            }
+          })
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+</style>

+ 294 - 0
src/views/modules/quality/first.vue

@@ -0,0 +1,294 @@
+<template>
+  <div>
+    <template v-if="!updateVisible">
+      <el-form :inline="true" :model="dataForm" @keyup.enter.native="search()">
+        <el-form-item label="物料名称">
+          <el-input
+            v-model="dataForm.productName"
+            placeholder="请输入物料名称"
+            clearable
+          />
+        </el-form-item>
+        <el-form-item label="生产批次号">
+          <el-input
+            v-model="dataForm.batchNumber"
+            placeholder="请输入编号"
+            clearable
+          />
+        </el-form-item>
+        <el-form-item>
+          <el-button @click="search()">查询</el-button>
+        </el-form-item>
+      </el-form>
+      <el-table
+        :data="dataList"
+        border
+        v-loading="dataListLoading"
+        style="width: 100%"
+      >
+        <el-table-column
+          label="序号"
+          type="index"
+          width="50"
+          align="center"
+        ></el-table-column>
+        <el-table-column
+          prop="authenticateCode"
+          header-align="center"
+          align="center"
+          :show-tooltip-when-overflow="true"
+          label="首件鉴定编码"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="orderCode"
+          header-align="center"
+          align="center"
+          :show-tooltip-when-overflow="true"
+          label="任务单编码"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="productName"
+          header-align="center"
+          align="center"
+          :show-tooltip-when-overflow="true"
+          label="物料名称"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="productNumber"
+          header-align="center"
+          align="center"
+          :show-tooltip-when-overflow="true"
+          label="物料编号"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="batchNumber"
+          header-align="center"
+          align="center"
+          :show-tooltip-when-overflow="true"
+          label="批次号"
+        >
+        </el-table-column>
+        <el-table-column
+          prop=""
+          header-align="center"
+          align="center"
+          :show-tooltip-when-overflow="true"
+          label="系统生产记录"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="attachList1"
+          header-align="center"
+          align="center"
+          :show-tooltip-when-overflow="true"
+          label="首件生产流程记录表"
+        >
+          <template slot-scope="scope">
+            <el-button
+              :disabled="
+                !scope.row.attachList1 || scope.row.attachList1.length === 0
+              "
+              type="text"
+              size="small"
+              @click="attachDetails(scope.row.attachList1)"
+              >查看</el-button
+            >
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="attachList2"
+          header-align="center"
+          align="center"
+          :show-tooltip-when-overflow="true"
+          label="首件生产过程原始记录"
+        >
+          <template slot-scope="scope">
+            <el-button
+              :disabled="
+                !scope.row.attachList2 || scope.row.attachList2.length === 0
+              "
+              type="text"
+              size="small"
+              @click="attachDetails(scope.row.attachList2)"
+              >查看</el-button
+            >
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="attachList3"
+          header-align="center"
+          align="center"
+          :show-tooltip-when-overflow="true"
+          label="首件鉴定检验报告"
+        >
+          <template slot-scope="scope">
+            <el-button
+              :disabled="
+                !scope.row.attachList3 || scope.row.attachList3.length === 0
+              "
+              type="text"
+              size="small"
+              @click="attachDetails(scope.row.attachList3)"
+              >查看</el-button
+            >
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="attachList4"
+          header-align="center"
+          align="center"
+          :show-tooltip-when-overflow="true"
+          label="首件鉴定审查报告"
+        >
+          <template slot-scope="scope">
+            <el-button
+              :disabled="
+                !scope.row.attachList4 || scope.row.attachList4.length === 0
+              "
+              type="text"
+              size="small"
+              @click="attachDetails(scope.row.attachList4)"
+              >查看</el-button
+            >
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="attachList5"
+          header-align="center"
+          align="center"
+          :show-tooltip-when-overflow="true"
+          label="首件鉴定评审结论"
+        >
+          <template slot-scope="scope">
+            <el-button
+              :disabled="
+                !scope.row.attachList5 || scope.row.attachList5.length === 0
+              "
+              type="text"
+              size="small"
+              @click="attachDetails(scope.row.attachList5)"
+              >查看</el-button
+            >
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="approveState"
+          header-align="center"
+          align="center"
+          :show-tooltip-when-overflow="true"
+          label="评审状态"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="approver"
+          header-align="center"
+          align="center"
+          :show-tooltip-when-overflow="true"
+          label="当前评审人"
+        >
+        </el-table-column>
+        <el-table-column
+          fixed="right"
+          header-align="center"
+          align="center"
+          width="150"
+          label="操作"
+        >
+          <template slot-scope="scope">
+            <el-button
+              v-if="isAuth('quality:first:update')"
+              type="text"
+              size="small"
+              @click="updateHandle(scope.row)"
+              >上传</el-button
+            >
+          </template>
+        </el-table-column>
+      </el-table>
+      <el-pagination
+        @size-change="sizeChangeHandle"
+        @current-change="currentChangeHandle"
+        :current-page="pageIndex"
+        :page-sizes="[10, 20, 50, 100]"
+        :page-size="pageSize"
+        :total="totalPage"
+        layout="total, sizes, prev, pager, next, jumper"
+      >
+      </el-pagination>
+    </template>
+    <quality-first-update ref="update" v-if="updateVisible" @onChose="onChose" />
+  </div>
+</template>
+
+<script>
+import {getList} from '@/api/quality'
+import QualityFirstUpdate from './first-update'
+export default {
+  name: 'quality-first',
+  components: {QualityFirstUpdate},
+  data () {
+    return {
+      updateVisible: false,
+      dataForm: {},
+      dataList: [{}],
+      pageIndex: 1,
+      pageSize: 10,
+      totalPage: 0,
+      dataListLoading: false
+    }
+  },
+  mounted () {},
+  methods: {
+    onChose () {
+      this.updateVisible = false
+    },
+    search () {
+      this.pageIndex = 1
+      this.getDataList()
+    },
+         // 每页数
+    sizeChangeHandle (val) {
+      this.pageSize = val
+      this.pageIndex = 1
+      this.getDataList()
+    },
+    // 当前页
+    currentChangeHandle (val) {
+      this.pageIndex = val
+      this.getDataList()
+    },
+    getDataList () {
+      this.dataListLoading = true
+      let param = {
+        current: this.pageIndex,
+        size: this.pageSize,
+        batchNumber: this.dataForm.batchNumber,
+        productName: this.dataForm.productName
+      }
+      getList(param).then(({ data }) => {
+        if (data && data.code === '200') {
+          this.dataList = data.data.records
+          this.totalPage = Number(data.data.total)
+        } else {
+          this.dataList = []
+          this.totalPage = 0
+        }
+        this.dataListLoading = false
+      })
+    },
+    updateHandle (item) {
+      this.updateVisible = true
+      this.$nextTick(() => {
+        this.$refs.update.init(item)
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+</style>