zouyu
2024-02-28 0177daf2022ff2b760e8cd00df8bba105f96db81
销售订单&原材料检验
已修改4个文件
已添加3个文件
366 ■■■■■ 文件已修改
src/api/accounting/personReport.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/plan/customerOrderInterrelated.js 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/quality/rawMaterial.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/accounting/jmreport/index.vue 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/plan/customerorder/index.vue 166 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/quality/processconfiguration/index.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/quality/rawMaterial/index.vue 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/accounting/personReport.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,9 @@
import request from '@/router/axios'
export function pageList(query) {
  return request({
    url: '/mes/product/personReport',
    method: 'get',
    params: query
  })
}
src/api/plan/customerOrderInterrelated.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,25 @@
import request from '@/router/axios'
export function interrelatedOrder(data) {
  return request({
    url: '/mes/customerOrderInterrelated/interrelatedOrder',
    method: 'post',
    data: data
  })
}
export function getInterrelatedOrder(id) {
  return request({
    url: '/mes/customerOrderInterrelated/getInterrelatedOrder/'+id,
    method: 'get',
  })
}
export function checkHanderOrder(orderId) {
    return request({
      url: '/mes/customerOrderInterrelated/checkHanderOrder/' + orderId,
      method: 'post',
    })
  }
src/api/quality/rawMaterial.js
@@ -8,6 +8,14 @@
  })
}
export function checkPutIFS(id,data) {
  return request({
    url: '/mes/rawInspect/check/'+id,
    method: 'post',
    data: data
  })
}
export function selectDevice() {
  return request({
    url: '/mes/rawInsProduct/selectDevice',
src/views/accounting/jmreport/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,82 @@
<template>
    <div class="mod-config">
        <basic-container>
            <ttable
                :table="table"
                @handleSelectionChange="handleSelectionChange"
                :prelang="prelang"
                :options="options"
                :ajaxFun="ajaxFun"
                ref="reportWorkTable">
                <template #toolbar></template>
            </ttable>
        </basic-container>
    </div>
</template>
<script>
import { mapGetters } from 'vuex'
import ttable from '@/views/common/ztt-table.vue'
import { pageList } from '@/api/accounting/personReport'
export default {
    components: {
        ttable
    },
    computed: {
        ...mapGetters(['permissions'])
    },
    data(){
        return {
            multipleSelection: [],
            ajaxFun: pageList,
            options: {
                height: 300, // é»˜è®¤é«˜åº¦-为了表头固定
                stripe: true, // æ˜¯å¦ä¸ºæ–‘马纹 table
                highlightCurrentRow: false, // æ˜¯å¦è¦é«˜äº®å½“前行
                border: true, // æ˜¯å¦æœ‰çºµå‘边框
                lazy: false, // æ˜¯å¦éœ€è¦æ‡’加载
                fit: true, // åˆ—的宽度是否自撑开
                multiSelect: true, //
                seqNo: true,
                isRefresh: true, // æ˜¯å¦æ˜¾ç¤ºåˆ·æ–°æŒ‰é’®
                isShowHide: true, // æ˜¯å¦æ˜¾ç¤ºæ˜¾å½±æŒ‰é’®H
                isSearch: true, // é«˜çº§æŸ¥è¯¢æŒ‰é’®
                defaultOrderBy: { column: 'createTime', direction: 'desc' },
                cancelRunCreated: true
            },
            table: {
                total: 0,
                currentPage: 1,
                pageSize: 20,
                data: [],
                // æ ‡é¢˜
                column: [
                    {
                        minWidth: '100',
                        width: '100px',
                        prop: 'contractNo',
                        label: '合同编号',
                        sort: true,
                        isTrue: true,
                        isSearch: true,
                        searchInfoType: 'text',
                    },
                ],
                toolbar: [],
                operator: null
            },
            prelang: "operation",
        }
    },
    methods:{
        // table自带事件
        handleSelectionChange(val) {
            this.multipleSelection = val
        },
    }
}
</script>
<style>
</style>
src/views/plan/customerorder/index.vue
@@ -8,6 +8,7 @@
        :prelang="prelang"
        :options="options"
        :ajaxFun="ajaxFun"
        :toolbarMaxLength="4"
        :paramArr="type"
        ref="customerOrderTable"
      >
@@ -241,10 +242,35 @@
        <el-button type="primary" @click="startSync">ç¡® å®š</el-button>
      </span>
    </el-dialog>
    <el-dialog
    title="已关联销售订单"
    :visible.sync="showInterrelatedOrderDialog"
    width="60%">
        <el-table border height="100" :data="interrelatedOrderData">
            <el-table-column type="index" align="center" label="序号"></el-table-column>
            <el-table-column prop="contractNo" show-overflow-tooltip align="center" label="合同编号"></el-table-column>
            <el-table-column prop="entityName" show-overflow-tooltip align="center" label="工程名称"></el-table-column>
            <el-table-column prop="sourceId" show-overflow-tooltip align="center" label="添加来源">
                <template scope="scope">
                    <el-tag v-if="scope.row.sourceId == 0" type="success">同步</el-tag>
                    <el-tag v-if="scope.row.sourceId == 1" type="info">手动</el-tag>
                </template>
            </el-table-column>
            <el-table-column prop="placeOrderDate" show-overflow-tooltip align="center" label="下单日期"></el-table-column>
            <el-table-column prop="customerName" show-overflow-tooltip align="center" label="客户名称"></el-table-column>
            <el-table-column prop="coState" min-width="100" show-overflow-tooltip align="center" label="销售订单状态"></el-table-column>
            <el-table-column prop="partNo" show-overflow-tooltip align="center" label="产品编号"></el-table-column>
            <el-table-column prop="productName" show-overflow-tooltip align="center" label="产品名称"></el-table-column>
            <el-table-column prop="productType" show-overflow-tooltip align="center" label="隶属品牌"></el-table-column>
            <el-table-column prop="otcUnit" show-overflow-tooltip align="center" label="单位"></el-table-column>
            <el-table-column prop="buyQtyDue" show-overflow-tooltip align="center" label="数量"></el-table-column>
        </el-table>
    </el-dialog>
  </div>
</template>
<script>
import {interrelatedOrder,getInterrelatedOrder,checkHanderOrder} from '@/api/plan/customerOrderInterrelated'
import ConfirmPullCustomerorder from './confirm-pull-customerorder'
import TableForm from './customerorder-form'
import TableFormDEesc from './customerorder-form-desc'
@@ -285,6 +311,9 @@
export default {
  data() {
    return {
      interrelatedOrderId: null,
      interrelatedOrderData: [],
      showInterrelatedOrderDialog: false,
      uniqueStateArr: [],
      dataForm: {
        selectTime: null,
@@ -400,7 +429,7 @@
        isRefresh: true, // æ˜¯å¦æ˜¾ç¤ºåˆ·æ–°æŒ‰é’®
        isShowHide: true, // æ˜¯å¦æ˜¾ç¤ºæ˜¾å½±æŒ‰é’®H
        isSearch: true, // é«˜çº§æŸ¥è¯¢æŒ‰é’®
        defaultOrderBy: { column: 'createTime', direction: 'desc' },
        defaultOrderBy: { column: 'placeOrderDate', direction: 'desc' },
        cancelRunCreated: true
      },
      table: {
@@ -497,7 +526,7 @@
          {
            minWidth: '120',
            prop: 'isAudit',
            label: '审核状态',
            label: 'PLM审核状态',
            sort: true,
            isTrue: true,
            isSearch: true,
@@ -507,15 +536,19 @@
              return this.isAuditList
            }
          },
          // {
          //   minWidth: '80',
          //   prop: 'sourceId',
          //   label: '订单来源',
          //   sort: true,
          //   isTrue: true,
          //   isSearch: true,
          //   searchInfoType: 'text'
          // },
          {
            minWidth: '120',
            prop: 'isPass',
            label: '审核通过状态',
            sort: true,
            isTrue: true,
            isSearch: true,
            searchInfoType: 'select',
            formatter: this.checkIsPass,
            optList: () => {
                return this.isPassList
            }
          },
          {
            minWidth: '120',
            width: '100px',
@@ -655,6 +688,25 @@
          //   fun: this.packageExportHandle
          // },
          {
            text: '审核',
            type: 'text',
            size: 'small',
            fun: this.checkHandOrder,
            showFun: (row)=>{return row.sourceId==='1'},
            show: {
              val: [
                false,
              ],
              key: 'isPass'
            }
          },
          {
            text: '已关联订单',
            type: 'text',
            size: 'small',
            fun: this.showInterrelatedOrder,
          },
          {
            text: '删除',
            type: 'text',
            size: 'small',
@@ -673,8 +725,8 @@
        operatorConfig: {
          fixed: 'right',
          label: '操作',
          width: 100,
          minWidth: 100
          width: 200,
          minWidth: 200
        }
      },
      addOrUpdateVisible: false,
@@ -780,7 +832,8 @@
        }
      ],
      showSalesPartBatch: false,
      addOrUpdateEescVisible: false
      addOrUpdateEescVisible: false,
      isPassList: [{label:'未通过',value: false},{label: '通过',value: true}]
    }
  },
  components: {
@@ -812,6 +865,17 @@
        }
      },
      immediate: true
    },
    interrelatedOrderId(newVal){
        if(newVal){
            getInterrelatedOrder(newVal).then(res=>{
                if(res.status===200){
                    this.interrelatedOrderData = res.data.data
                }
            }).catch(error=>{
                console.error(error)
            })
        }
    }
  },
  mounted() {
@@ -862,6 +926,13 @@
        fun: this.downloadWord,
        permitArr: ['03plan','04planed'],
    })
    this.table.toolbar.push({
        text: '关联订单',
        disabled: false,
        type: 'primary',
        fun: this.interrelatedOrderFun,
        permitArr: [],
    })
    if (this.permissions.customerorder_create_masterplan) {
      this.table.toolbar.push({
        text: '主生产计划',
@@ -872,6 +943,57 @@
    }
  },
  methods: {
    checkHandOrder(val){
        this.$confirm('确认审核通过该销售订单吗?', '提示', {
          confirmButtonText: '通过',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
            checkHanderOrder(val.id).then(res=>{
            if(res.status===200){
                this.$message.success("审核通过")
                this.getData()
            }
          }).catch(error=>{
            console.error(error)
          })
        }).catch(() => {});
    },
    interrelatedOrderFun(){
        if(this.multipleSelection.length!=2){
            this.$message.error("请选择两条销售订单")
            return
        }
        let autoId = null
        let handId = null
        this.multipleSelection.forEach(ele=>{
            if(ele.sourceId==0){
                autoId = ele.id
            }else if(ele.sourceId==1){
                handId = ele.id
            }
        })
        if(autoId==null || handId==null){
            this.$message.error("添加来源须为手动和同步")
            return
        }
        interrelatedOrder({
            customerOrderAutoId: autoId,
            customerOrderHandId: handId
        }).then(res=>{
            if(res.status===200){
                this.$message.success("关联成功")
            }
        }).catch(error=>{
            console.error(error)
        })
    },
    //展示已关联订单
    showInterrelatedOrder(currentOrder){
        this.interrelatedOrderId = currentOrder.id
        this.showInterrelatedOrderDialog = true
    },
    //下载word
    downloadWord(){
        let ids = this.multipleSelection.map(ele=>ele.id)
@@ -960,6 +1082,18 @@
      } else {
        this.$message.error('请选择销售订单')
      }
    },
    checkIsPass(row, column, cellValue){
        this.isPassList.forEach((obj) => {
            if (obj.value === cellValue) {
                if(obj.value){
                    cellValue = "<span style='color:#34BD66;'>"+obj.label+"</span>"
                }else{
                    cellValue = "<span style='color:#E84738;'>"+obj.label+"</span>"
                }
            }
        })
        return cellValue
    },
    formatDutyDate(row, column, cellValue) {
      if (cellValue) {
@@ -1404,6 +1538,10 @@
      } else {
        if (this.judgeCoState(this.multipleSelection)) {
          if (event == 'RELEVANCE') {
            if(!this.multipleSelection[0].isPass){
                this.$message.error("请先审核通过,再关联工艺文件")
                return
            }
            const firstPartNo = this.multipleSelection[0].partNo
            this.multipleSelection.forEach((item) => {
              if (item.isDocument) {
src/views/quality/processconfiguration/index.vue
@@ -322,7 +322,11 @@
            text: '审核结果',
            type: 'text',
            size: 'small',
            fun: this.AuditResult
            fun: this.AuditResult,
            show: {
                key: 'type',
                val: ['过程检验','产品检验','包装检验']
            }
          })
    }
    this.table.operator = arr.length>0 ? arr : null
src/views/quality/rawMaterial/index.vue
@@ -54,7 +54,7 @@
</template>
<script>
import ttable from '@/views/common/ztt-table.vue'
import { getRawInspectList,delObj,exportRawMaterial,getObj,downloadReport } from '@/api/quality/rawMaterial'
import { getRawInspectList,delObj,exportRawMaterial,getObj,downloadReport,checkPutIFS } from '@/api/quality/rawMaterial'
import RawMaterialForm from './rawMaterial-form'
import * as fecha from 'element-ui/lib/utils/date'
import { mapGetters } from 'vuex'
@@ -112,6 +112,18 @@
                        searchInfoType: 'select',
                        optList: () => {
                            return this.typeList
                        }
                    },
                    {
                        minWidth: '120',
                        prop: 'checkState',
                        label: '审核状态',
                        isTrue: true,
                        isSearch: true,
                        searchInfoType: 'select',
                        formatter: this.checkStateFormat,
                        optList: () => {
                            return this.checkStateList
                        }
                    },
                    {
@@ -237,6 +249,7 @@
            insStateList: [{label:'全部',value:''},{label:'已检测',value:'1'},{label:'未检测',value:'0'}],
            StateList: [{label:'全部',value:''},{label:'已合格',value:'1'},{label:'不合格',value:'0'}],
            typeList: [{label:'全部',value:''},{label:'首检',value:'首检'},{label:'返检',value:'返检'}],
            checkStateList: [{label:'未审核',value:'0'},{label:'审核通过',value:'1'},{label:'审核不通过',value:'2'}],
        }
    },
    components: {
@@ -262,13 +275,28 @@
            })
        }
        this.table.operator = [{
            text: '审核',
            type: 'text',
            size: 'small',
            fun: this.examineHandle,
            showFun: (row)=>{return row.type==='首检'},
            show: {
                key: 'checkState',
                val: ['0']
            }
        }]
        if(this.permissions.quality_rawMaterial_del){
            this.table.operator = [{
            this.table.operator.push({
                    text: '作废',
                    type: 'text',
                    size: 'small',
                    fun: this.deleteHandle
                }]
                    fun: this.deleteHandle,
                    show: {
                        key: 'judgeState',
                        val: ['',null]
                    }
                })
        }
     },
    computed: {
@@ -282,6 +310,32 @@
        }
    },
    methods:{
        examineHandle(val){
            this.$confirm('是否审核通过该检验项?', '提示', {
                distinguishCancelAndClose: true,
                confirmButtonText: '通过',
                cancelButtonText: '不通过',
                type: 'warning'
            }).then(() => {
                checkPutIFS(val.id,{result: 1}).then(res=>{
                    if(res.status===200){
                        console.log(res)
                    }
                }).catch(error=>{
                    console.error(error)
                })
            }).catch((action) => {
                if(action === 'cancel'){
                    checkPutIFS(val.id,{result: 2}).then(res=>{
                        if(res.status===200){
                            console.log(res)
                        }
                    }).catch(error=>{
                        console.error(error)
                    })
                }
            });
        },
        downloadReport(){
            let selection = this.multipleSelection
            if(!selection || selection.length < 1){
@@ -420,6 +474,14 @@
                return "<span style='color:#34BD66;'>合格</span>"
            }
        },
        checkStateFormat(row, column, cellValue){
            this.checkStateList.forEach((obj) => {
                if (obj.value === cellValue) {
                    cellValue = obj.label
                }
            })
            return cellValue
        },
        formatDateTime(row, column, cellValue) {
            return cellValue ? fecha.format(new Date(cellValue), 'yyyy-MM-dd') : ''
        },