| | |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // 重新提交并且推送oa |
| | | export function reSubmitPushOa(data) { |
| | | return request({ |
| | | url: "/unqualifiedHandler/reSubmitPushOa", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | // 查询不合格样品数据 |
| | | export function pageInsUnPass(data) { |
| | | return request({ |
| | |
| | | :disabled="o.disabled ? o.disabled(scope.row) : false" :icon="iconFn(o)" :plain="o.plain" |
| | | :style="{ color: o.name === '删除' ? '#f56c6c' : o.color }" :type="o.type | typeFn(scope.row)" |
| | | @click="o.clickFun(scope.row)" :key="key"> |
| | | {{ o.name }} |
| | | {{ typeof o.name === 'function'? o.name(scope.row) : o.name }} |
| | | </el-button> |
| | | <el-upload :action="javaApi + o.url + '?id=' + (o.uploadIdFun ? o.uploadIdFun(scope.row) : scope.row.id)" |
| | | :key="uploadKeys[scope.$index]" |
| | |
| | | <template> |
| | | <div> |
| | | <el-dialog title="新增不合格处理" :visible.sync="isShow" width="740px" :show-close="false" :close-on-click-modal="false" |
| | | <el-dialog :title="type==='view'?'不合格处理详情':'不合格处理提交'" :visible.sync="isShow" width="740px" :show-close="false" :close-on-click-modal="false" |
| | | :close-on-press-escape="false"> |
| | | <div class="search"> |
| | | <el-form :inline="true" :model="unPassForm" :rules="unPassFormRules" ref="unPassForm" class="form-inline" |
| | |
| | | <el-input clearable v-model="unPassForm.feedbackUser" disabled size="small" placeholder="请输入"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="反馈时间:" prop="feedbackTime"> |
| | | <el-date-picker v-model="unPassForm.feedbackTime" :disabled="type === 'view'" format="yyyy-MM-dd" |
| | | value-format="yyyy-MM-dd HH:mm:ss" size="small" style="width: 175px" type="date" placeholder="选择日期"> |
| | | <el-date-picker :picker-options="{ disabledDate: this.disabledDate }" v-model="unPassForm.feedbackTime" :disabled="type === 'view'" format="yyyy-MM-dd" |
| | | value-format="yyyy-MM-dd" size="small" style="width: 175px" type="date" placeholder="选择日期"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="分类:" prop="classification"> |
| | |
| | | style="width: 484px" size="small" placeholder="请输入"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-upload v-if="type === 'add'" ref="upload" :action="action2" :on-change="beforeUpload" :on-error="onError" |
| | | <el-upload v-if="type !== 'view'" ref="upload" :action="action2" :on-change="beforeUpload" :on-error="onError" |
| | | :on-remove="handleRemoveFile" :on-success="getUnpassUrl" :headers="uploadHeader" :file-list="unPassFilesList"> |
| | | <el-button size="small" type="primary" style="text-align: left">附件上传</el-button> |
| | | <el-button icon="el-icon-upload" size="small" type="primary" style="text-align: left">附件上传</el-button> |
| | | </el-upload> |
| | | <div v-if="type !== 'add'"> |
| | | <div style="padding-left: 40px;margin-bottom: 4px">附件:</div> |
| | | <div style="padding-left: 40px;margin-bottom: 4px" v-for="item in unqualifiedHandlerFiles"> |
| | | <div v-if="type!=='add'"> |
| | | <div style="margin:4px 0px;font-weight: bold">附件:</div> |
| | | <div style="padding-left: 20px;margin-bottom: 4px" v-for="item in unqualifiedHandlerFiles"> |
| | | <span>{{ item.fileName }}</span><el-link type="primary" style="margin-left: 20px;vertical-align: top" |
| | | :underline="false" @click="handleDown(item)">下载</el-link> |
| | | </div> |
| | |
| | | <el-button @click="$emit('resetForm')">取 消</el-button> |
| | | <el-button type="primary" @click="handlunPass" :loading="handlunPassLoading" v-if="type === 'add'">确 |
| | | 定</el-button> |
| | | <el-button type="primary" @click="reSubmitPushOa" :loading="handlunPassLoading" v-if="type === 'resubmit'">重新提交</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getInsOrder, getUnqualifiedHandler, downFile, addUnqualifiedHandler } from '@/api/business/unpass.js' |
| | | import { getInsOrder, getUnqualifiedHandler, downFile, addUnqualifiedHandler,reSubmitPushOa } from '@/api/business/unpass.js' |
| | | import {mapGetters} from "vuex"; |
| | | export default { |
| | | name: "unPassDialog", |
| | |
| | | }, |
| | | // 方法集合 |
| | | methods: { |
| | | disabledDate(time){ |
| | | return time < new Date().getTime() - 86400000 |
| | | }, |
| | | getInsOrder(type, row) { |
| | | this.type = type |
| | | if (type === 'add') { |
| | |
| | | orderId: this.orderId |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | this.unPassForm.headline = `No.0005-中天耐丝-外购品不合格反馈评审及纠正预防流程(正式版)-${this.nickName}-${new Date().toISOString().substring(0, 10)}` // 标题 |
| | | this.unPassForm.feedbackTime = new Date().toISOString().substring(0, 10) // 报检时间 |
| | | if(res.data.insOrder && res.data.insOrder.contract==='ZTNS'){ |
| | | this.unPassForm.headline = `No.0005-中天耐丝-外购品不合格反馈评审及纠正预防流程(正式版)-${this.nickName}-${this.unPassForm.feedbackTime}` // 标题 |
| | | }else{ |
| | | this.unPassForm.headline = `No.0017-中天科技-外购品不合格反馈评审及纠正预防流程(正式版)-${this.nickName}-${this.unPassForm.feedbackTime}` // 标题 |
| | | } |
| | | this.unPassForm.feedbackUser = this.nickName // 反馈人 |
| | | this.unPassForm.insOrderId = res.data.insOrder.id // 订单id |
| | | this.unPassForm.materialName = res.data.insOrder.sampleType // 物料名称 |
| | |
| | | } |
| | | }) |
| | | } else { |
| | | this.getInfo(row.handlerId) |
| | | this.unPassForm = { ...row } |
| | | this.getInfo(row.id) |
| | | console.log(row) |
| | | this.unPassForm = { ...row,unqualifiedHandlerFiles:[] } |
| | | } |
| | | }, |
| | | getInfo(handlerId) { |
| | |
| | | }) |
| | | this.handlunPassLoading = true |
| | | addUnqualifiedHandler(this.unPassForm).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('提交成功') |
| | | this.$emit('resetForm') |
| | | } |
| | | this.handlunPassLoading = false |
| | | }) |
| | | } else { |
| | | console.log('error submit!!'); |
| | | return false; |
| | | } |
| | | }); |
| | | }, |
| | | //重新提交并且推送oa |
| | | reSubmitPushOa(){ |
| | | this.$refs['unPassForm'].validate((valid) => { |
| | | if (valid) { |
| | | if(this.unPassForm.unqualifiedHandlerFiles){ |
| | | this.unPassForm.unqualifiedHandlerFiles.forEach(item => { |
| | | delete item.orderBy |
| | | }) |
| | | } |
| | | this.handlunPassLoading = true |
| | | reSubmitPushOa(this.unPassForm).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('提交成功') |
| | | this.$emit('resetForm') |
| | |
| | | ...mapGetters(["nickName"]), |
| | | action2() { |
| | | return this.javaApi + '/unqualifiedHandler/uploadFileByUnqualified' |
| | | } |
| | | }, |
| | | }, |
| | | } |
| | | </script> |
| | |
| | | data() { |
| | | return { |
| | | handlerId: null, |
| | | contract:null, |
| | | entity: { |
| | | contract: null, |
| | | sample: null, |
| | |
| | | dataType: 'action', |
| | | fixed: 'right', |
| | | label: '操作', |
| | | width: '180px', |
| | | width: '220px', |
| | | operation: [ |
| | | { |
| | | name: '提交OA', |
| | | name: (row)=>{ |
| | | return row.requestId !== null && row.operation==='退回' ? '重新提交' : '提交OA' |
| | | }, |
| | | type: 'text', |
| | | clickFun: (row) => { |
| | | this.openOA(row); |
| | | }, |
| | | disabled: (row, index) => { |
| | | return row.requestId !== null // 有requestId说明已经提交过OA,不可再次提交 |
| | | return row.requestId !== null && row.operation!=='退回' // 有requestId说明已经提交过OA,不可再次提交 |
| | | } |
| | | }, |
| | | { |
| | |
| | | this.deleteOA(row); |
| | | }, |
| | | disabled: (row, index) => { |
| | | return row.requestId !== null // 有requestId说明已经提交过OA,不可再次提交 |
| | | return row.requestId !== null && row.operation!=='退回' // 有requestId说明已经提交过OA,不可再次提交 |
| | | } |
| | | }, |
| | | ] |
| | |
| | | ], |
| | | page: { |
| | | total: 0, |
| | | size: 10, |
| | | size: 20, |
| | | current: 1 |
| | | }, |
| | | statusList: [], |
| | |
| | | resetForm1 () { |
| | | this.$refs.unPassDialog.$refs['unPassForm'].resetFields(); |
| | | this.unPassDialog = false |
| | | this.$nextTick(()=>{ |
| | | this.refreshTable('page') |
| | | }) |
| | | }, |
| | | // 打开删除OA确认弹框 |
| | | deleteOA (row) { |
| | |
| | | // 查看提交OA的数据 |
| | | openOA (row) { |
| | | this.handlerId = row.handlerId |
| | | this.dialogVisible = true |
| | | this.contract = row.contract |
| | | if(row && row.requestId !== null ){ |
| | | // 重新提交OA,打开编辑弹框 |
| | | this.unPassDialog = true |
| | | this.$nextTick(() => { |
| | | this.$refs.unPassDialog.getInsOrder('resubmit', row) |
| | | }) |
| | | }else{ |
| | | this.dialogVisible = true |
| | | } |
| | | }, |
| | | // 查看OA流程 |
| | | OAView (row) { |
| | |
| | | submitOA(row) { |
| | | // 提交OA |
| | | this.submitOALoading = true |
| | | pushOA({handlerId: this.handlerId,}).then(res => { |
| | | pushOA({handlerId: this.handlerId,contract:this.contract}).then(res => { |
| | | this.submitOALoading = false |
| | | if (res.code === 200) { |
| | | this.dialogVisible = false |
| | |
| | | } |
| | | }, |
| | | lineColors: ['#91A0FC'], |
| | | barColors: ['#9fe080', '#ff994d'], // 合格绿 / 不合格红 |
| | | barColors: ['#5b9bd5', '#ed7d31'], // 合格绿 / 不合格红 |
| | | barColors2: ['#A4EEDA'], |
| | | pieTooltip: { |
| | | trigger: 'item' |
| | |
| | | length2: 40 |
| | | }, |
| | | data: [ |
| | | { value: 0, name: '不合格数量', itemStyle: {color: '#ff994d'} }, |
| | | { value: 0, name: '合格数量', itemStyle: { color: '#9fe080' } } |
| | | { value: 0, name: '不合格数量', itemStyle: {color: '#ed7d31'} }, |
| | | { value: 0, name: '合格数量', itemStyle: { color: '#5b9bd5' } } |
| | | ] |
| | | } |
| | | ], |
| | |
| | | length2: 40, |
| | | }, |
| | | data: [ |
| | | { value: 0, name: '不合格数量', itemStyle: { color: '#ff994d' } }, |
| | | { value: 0, name: '合格数量', itemStyle: { color: '#9fe080' } }, |
| | | { value: 0, name: '不合格数量', itemStyle: { color: '#ed7d31' } }, |
| | | { value: 0, name: '合格数量', itemStyle: { color: '#5b9bd5' } }, |
| | | ] |
| | | } |
| | | ], |
| | |
| | | length2: 40, |
| | | }, |
| | | data: [ |
| | | { value: 0, name: '不合格数量', itemStyle: { color: '#ff994d' } }, |
| | | { value: 0, name: '合格数量', itemStyle: { color: '#9fe080' } }, |
| | | { value: 0, name: '不合格数量', itemStyle: { color: '#ed7d31' } }, |
| | | { value: 0, name: '合格数量', itemStyle: { color: '#5b9bd5' } }, |
| | | ] |
| | | } |
| | | ], |