s
王震
2023-11-01 ec8a0cdd8d529bd3354fd9204b42af622ac46905
s
已修改3个文件
381 ■■■■ 文件已修改
public/index.html 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/quality/unqualifiedprocess.js 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/quality/processconfiguration/index.vue 354 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/index.html
@@ -34,6 +34,8 @@
  </head>
  <body>
    <script src="https://cdn.staticfile.org/FileSaver.js/2014-11-29/FileSaver.min.js"></script>
<script src="https://cdn.staticfile.org/xlsx/0.18.2/xlsx.full.min.js"></script>
    <noscript>
      <strong
        >很抱歉,如果没有 JavaScript 支持,网站将不能正常工作。请启用浏览器的
@@ -57,6 +59,7 @@
      </div>
    </div>
    <!-- built files will be auto injected -->
    <script
      src="<%= BASE_URL %>cdn/axios/1.0.0/axios.min.js"
      charset="utf-8"
src/api/quality/unqualifiedprocess.js
@@ -1,5 +1,29 @@
import request from '@/router/axios'
export function UnqualifiedList(query) {
  return request({
    url: '/mes/qualityInspectUnaccepted/page',
    method: 'get',
    params: query
  })
}
export function pullInsUnapi(query) {
  return request({
    url: '/mes/qualityInspectUnaccepted/pullInsUn',
    method: 'post',
    params: query
  })
}
// export function pullInsi(query) {
//   return request({
//     url: '/mes/qualityInspectUnaccepted/getResult',
//     method: 'post',
//     params: query
//   })
// }
export function fetchListUnqualifiedProcess(query) {
  return request({
    url: '/mes/unqualifiedProcess/page',
src/views/quality/processconfiguration/index.vue
@@ -19,23 +19,47 @@
        ref="addOrUpdate"
        @refreshDataList="getData"
      ></table-form>
      <table></table>
    </basic-container>
    <div>
      <el-dialog title="最终处置意见" :visible.sync="dialogVisible" width="30%">
            <el-form label-width="120px">
                <div>
                    <el-form-item label="最终处置意见:">
                        <el-input type="textarea" :rows="3" placeholder="请输入内容"  v-model="WayIdea" />
                    </el-form-item>
                    <el-checkbox-group v-model="checkList">
                      <el-checkbox label="返修"></el-checkbox>
                      <el-checkbox label="换货"></el-checkbox>
                      <el-checkbox label="退货"></el-checkbox>
                      <el-checkbox label="作废"></el-checkbox>
                      <el-checkbox label="让步接收"></el-checkbox>
                      <el-checkbox label="降级使用"></el-checkbox>
                    </el-checkbox-group>
                </div>
            </el-form>
            <span slot="footer" >
                <el-button @click="dialogVisible = false">取 消</el-button>
                <el-button type="primary" @click="WaySure">确 定</el-button>
            </span>
        </el-dialog>
    </div>
  </div>
</template>
<script>
import {
  getqualityUnqualifiedConfiguration,
  delqualityUnqualifiedConfiguration
import { UnqualifiedList,pullInsUnapi,
} from '@/api/quality/unqualifiedprocess'
import TableForm from './table-form'
import { mapGetters } from 'vuex'
import { remote } from '@/api/admin/dict'
// import { remote } from '@/api/admin/dict'
import ttable from '@/views/common/ztt-table.vue'
export default {
  data() {
    return {
      ajaxFun: getqualityUnqualifiedConfiguration,
      checkList: [],
      WayIdea:'',
      ajaxFun: UnqualifiedList,
      addOrUpdateVisible: false,
      multipleSelection: [],
      typeOptions: [],
@@ -45,6 +69,7 @@
        isShow: false,
        url: ''
      },
      dialogVisible: false,
      prelang: 'operation',
      options: {
        height: 300, // 默认高度-为了表头固定
@@ -56,7 +81,7 @@
        multiSelect: true, //
        seqNo: true,
        isShowHide: true, // 是否显示显影按钮
        isSearch: false, // 高级查询按钮
        isSearch: true, // 高级查询按钮
        defaultOrderBy: { column: 'createTime', direction: 'desc' }
      },
      table: {
@@ -66,111 +91,280 @@
        data: [],
        // 标题
        column: [
          // 编号
          // 产品大类
          {
            minWidth: '140',
            prop: 'workShop',
            label: '车间',
            sort: true,
            prop: 'type',
            label: '检验类型',
            isTrue: true,
            isSearch: true,
            searchInfoType: 'select',
              formatter: this.materialTypeList,
              optList: () => {
                  return this.materialType
            // render: { fun: this.addOrUpdateHandle }
              }
          },
          // 产品名称
          {
            minWidth: '140',
            prop: 'material',
            label: '产品名称',
            isTrue: true,
            isSearch: true,
            searchInfoType: 'text',
            render: { fun: this.addOrUpdateHandle }
          },
          // 产品类型
          {
            minWidth: '120',
            prop: 'type',
            label: '产品类型',
            sort: true,
           // 规格型号
           {
            minWidth: '140',
            prop: 'specs',
            label: '规格型号',
            isTrue: true,
            isSearch: true,
            searchInfoType: 'select',
            formatter: this.formatType,
            optList: () => {
              return this.typeOptions
            }
            searchInfoType: 'text',
          },
          // 处理方式
          {
            minWidth: '200',
            prop: 'processMode',
            label: '处理方式',
            sort: true,
            isTrue: true,
            isSearch: true,
            searchInfoType: 'select',
            formatter: this.formatProcessMode,
            optList: () => {
              return this.processModeOptions
            }
          },
          // 发起人
          //   {
          //     minWidth: '200',
          //     prop: 'originator',
          //     label: '发起人',
          //     sort: true,
          //     isTrue: true,
          //     isSearch: true,
          //     searchInfoType: 'text'
          //   },
          // 审核人
          {
            minWidth: '140',
            prop: 'examiner',
            label: '审核人',
            sort: true,
            prop: 'materialCode',
            label: '产品编号',
            isTrue: true,
            isSearch: true,
            searchInfoType: 'text'
            searchInfoType: 'text',
          },
          // 处理人
          {
            minWidth: '120',
            prop: 'handler',
            label: '处理人',
            sort: true,
           // 不合格品数量
           {
            minWidth: '140',
            prop: 'number',
            label: '不合格品数量',
            isTrue: true,
            isSearch: true,
            searchInfoType: 'text'
          }
            searchInfoType: 'text',
          },
          {
            minWidth: '140',
            prop: 'reason',
            label: '现象描述',
            isTrue: true,
            isSearch: true,
            searchInfoType: 'text',
          },
            // 处理意见
            {
            minWidth: '140',
            prop: 'way',
            label: '处理意见',
            isTrue: true,
            isSearch: true,
            searchInfoType: 'text',
          },
            {
            minWidth: '120',
              prop: 'faultyMaterials',
              label: '是否瑕疵',
              isTrue: true,
              isSearch: true,
              searchInfoType: 'select',
              formatter: this.flaw,
              optList: () => {
                  return this.insStateList
              }
          },
          // 申请人
          {
            minWidth: '140',
            prop: 'createUser',
            label: '申请人',
            isTrue: true,
            isSearch: true,
            searchInfoType: 'text',
          },
           // 日期
          {
               minWidth: '130',
               width: '150',
               prop: 'dealTime',
               label: '审核时间',
               sort: true,
               isTrue: true,
               isSearch: true,
               searchInfoType: 'datetimerange',
               formatter: this.formatDateTime,
           },
          {
              minWidth: '120',
              prop: 'state',
              label: '状态',
              isTrue: true,
              isSearch: true,
              searchInfoType: 'select',
              formatter: this.formatInsState,
              optList: () => {
                  return this.StateList
              }
          },
          // {
          //   minWidth: '120',
          //   prop: '',
          //   label: '产品名称',
          //   sort: true,
          //   isTrue: true,
          //   isSearch: true,
          //   searchInfoType: 'select',
          //   formatter: this.formatType,
          //   optList: () => {
          //     return this.typeOptions
          //   }
          // },
          // 处理方式
          // {
          //   minWidth: '200',
          //   prop: 'processMode',
          //   label: '处理方式',
          //   sort: true,
          //   isTrue: true,
          //   isSearch: true,
          //   searchInfoType: 'select',
          //   formatter: this.formatProcessMode,
          //   optList: () => {
          //     return this.processModeOptions
          //   }
          // },
          //发起人
            // {
            //   minWidth: '200',
            //   prop: 'originator',
            //   label: '发起人',
            //   sort: true,
            //   isTrue: true,
            //   isSearch: true,
            //   searchInfoType: 'text'
            // },
          // 审核人
          // {
          //   minWidth: '140',
          //   prop: 'examiner',
          //   label: '审核人',
          //   sort: true,
          //   isTrue: true,
          //   isSearch: true,
          //   searchInfoType: 'text'
          // },
          // 处理人
          // {
          //   minWidth: '120',
          //   prop: 'handler',
          //   label: '处理人',
          //   sort: true,
          //   isTrue: true,
          //   isSearch: true,
          //   searchInfoType: 'text'
          // },
        ],
        toolbar: [
          {
            text: '新增',
            text: '导出',
            type: 'primary',
            fun: this.addOrUpdateHandle
          }
            // fun: this.addOrUpdateHandle
          },
        ],
        operator: [
          // {
          //   text: '删除',
          //   type: 'text',
          //   size: 'small',
          //   fun: this.deleteHandle
          // },
          {
            text: '删除',
            text: '提交审核',
            type: 'text',
            size: 'small',
            fun: this.deleteHandle
            fun: this.Submitreview
          },
          {
            text: '审核结果',
            type: 'text',
            size: 'small',
            fun: this.AuditResult
          }
        ],
        operatorConfig: {
          fixed: 'right',
          label: '操作',
          width: 100,
          width: 150,
          minWidth: 100
        }
      }
      },
      materialType: [{label:'原材料检验',value:'原材料检验'},{label:'过程检验',value:'过程检验'},{label:'质量检验',value:'质量检验'}],
      StateList: [{label:'全部',value:''},{label:'已提交审核',value:'1'},{label:'待处理',value:'0'},{label:'已处理',value:'2'}],
      insStateList: [{label:'其他',value:''},{label:'瑕疵',value:'1'}],
    }
  },
  components: {
    ttable,
    TableForm,
    ttable
  },
  computed: {
    ...mapGetters(['permissions'])
  },
  created() {
    this.getType()
    // this.getType()
  },
  methods: {
    //审核结果
    AuditResult(){
      this.dialogVisible = true
    },
    WaySure(row){
      let aa = this.checkList
       let bb = this.WayIdea
      console.log(aa,bb);
      this.dialogVisible = false
    },
    //提交审核
   Submitreview(row){
      console.log(row.id);
       pullInsUnapi({id:row.id}).then(res =>{
        console.log(res);
       })
    },
    //状态
    formatInsState(row, column, cellValue){
            if(cellValue != undefined || cellValue != null){
                if(cellValue == 0){
                    return "<span style='color:#E84738;'>待处理</span>"
                }
                if(cellValue == 1){
                  return "<span style='color:#34BD66;'>已提交审核</span>"
                }
                if(cellValue == 2){
                  return "<span style='color:#34BD66;'>已处理</span>"
                }
            }
        },
    flaw(row, column, cellValue){
        if(cellValue != undefined || cellValue != null){
            if(cellValue == 1){
                return "<span style='color:#E84738;'>瑕疵品</span>"
            }
            return "<span style='color:#34BD66;'></span>"
        }
    },
    // materialTypeList(row, column, cellValue){
    //         if(cellValue != undefined || cellValue != null){
    //             if(cellValue == 原材料检验){
    //                 return "<span style='color:#E84738;'>原材料检验</span>"
    //             }
    //             if(cellValue == 过程检验){
    //               return "<span style='color:#34BD66;'>过程检验</span>"
    //             }
    //             if(cellValue == 质量检验){
    //               return "<span style='color:#34BD66;'>质量检验</span>"
    //             }
    //         }
    //     },
    // 获取数据列表
    getData() {
      this.$refs.processconfiguration.getDataList()
@@ -202,18 +396,18 @@
      })
      return cellValue
    },
    getType() {
      remote('unqualified_handle_type').then((response) => {
        if (response.data.code === 0) {
          this.typeOptions = response.data.data
        }
      })
      remote('unqualified_process_mode').then((response) => {
        if (response.data.code === 0) {
          this.processModeOptions = response.data.data
        }
      })
    },
    // getType() {
    //   remote('unqualified_handle_type').then((response) => {
    //     if (response.data.code === 0) {
    //       this.typeOptions = response.data.data
    //     }
    //   })
    //   remote('unqualified_process_mode').then((response) => {
    //     if (response.data.code === 0) {
    //       this.processModeOptions = response.data.data
    //     }
    //   })
    // },
    // 删除
    deleteHandle(row) {
      this.$confirm('是否确认删除车间为:' + row.workShop, '提示', {