常熟吴彦祖 3 weeks ago
parent
commit
3d00ea6650
  1. 5
      .gitignore
  2. 9
      src/api/abnormal.js
  3. 88
      src/views/modules/Abnormal/AbnormalFeedBack.vue
  4. 13
      src/views/modules/common/Chooselist.vue
  5. 26
      src/views/modules/common/Chooselist_eam.vue

5
.gitignore

@ -15,3 +15,8 @@ node_modules/
*.ntvs* *.ntvs*
*.njsproj *.njsproj
*.sln *.sln
.gitnexus
.claude/
package-lock.json
AGENTS.md
CLAUDE.md

9
src/api/abnormal.js

@ -1,4 +1,5 @@
import { createAPI } from "@/utils/httpRequest.js"; import { createAPI } from "@/utils/httpRequest.js";
import http from "@/utils/httpRequest.js";
export const getAbnormalCodeList = data => createAPI(`abnormal/getAbnormalCodeList`,'post',data) export const getAbnormalCodeList = data => createAPI(`abnormal/getAbnormalCodeList`,'post',data)
export const getShopOrderData = data => createAPI(`abnormal/getShopOrderData`,'post',data) export const getShopOrderData = data => createAPI(`abnormal/getShopOrderData`,'post',data)
@ -11,3 +12,11 @@ export const saveAbnormalDetail= data => createAPI(`abnormal/saveAbnormalDetail`
export const closeFeedBack= data => createAPI(`abnormal/closeFeedBack`,'post',data) export const closeFeedBack= data => createAPI(`abnormal/closeFeedBack`,'post',data)
export const openFeedBack= data => createAPI(`abnormal/openFeedBack`,'post',data) export const openFeedBack= data => createAPI(`abnormal/openFeedBack`,'post',data)
// 下载责任认定书(docx)- rqrq
export const printResponsibilityBook = data => http({
url: http.adornUrl('/abnormal/printResponsibilityBook'),
method: 'post',
responseType: 'blob',
data: http.adornData(data, false)
})

88
src/views/modules/Abnormal/AbnormalFeedBack.vue

@ -193,13 +193,14 @@
fixed="right" fixed="right"
header-align="center" header-align="center"
align="center" align="center"
width="340"
width="400"
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<a type="text" size="small" v-if="(searchData.userId==='admin'||searchData.userId==='E0002')&&scope.row.status!='已完结'" @click="updateModel(scope.row)">修改</a> <a type="text" size="small" v-if="(searchData.userId==='admin'||searchData.userId==='E0002')&&scope.row.status!='已完结'" @click="updateModel(scope.row)">修改</a>
<a type="text" size="small" @click="getFileModel(scope.row)">整改文件</a> <a type="text" size="small" @click="getFileModel(scope.row)">整改文件</a>
<a type="text" size="small" @click="getDetailModel(scope.row)">查看</a> <a type="text" size="small" @click="getDetailModel(scope.row)">查看</a>
<a type="text" size="small" @click="doPrint(scope.row)">打印</a> <a type="text" size="small" @click="doPrint(scope.row)">打印</a>
<a type="text" size="small" @click="printResponsibilityBook(scope.row)">导出责任书</a>
<a type="text" size="small" v-if="scope.row.status!='已完结'" @click="getDetailModel2(scope.row)">紧急处理方式</a> <a type="text" size="small" v-if="scope.row.status!='已完结'" @click="getDetailModel2(scope.row)">紧急处理方式</a>
<a type="text" size="small" v-if="scope.row.status!='已完结'" @click="getDetailModel3(scope.row)">长久处理方式</a> <a type="text" size="small" v-if="scope.row.status!='已完结'" @click="getDetailModel3(scope.row)">长久处理方式</a>
<a type="text" size="small" v-if="scope.row.status!='已录入'&&scope.row.status!='已完结'&&isAuth('sys:abnormal:close')" @click="closeFeedBack(scope.row)">结束</a> <a type="text" size="small" v-if="scope.row.status!='已录入'&&scope.row.status!='已完结'&&isAuth('sys:abnormal:close')" @click="closeFeedBack(scope.row)">结束</a>
@ -312,6 +313,16 @@
<span style="font-size: 12px">异常原因:</span> <span style="font-size: 12px">异常原因:</span>
<el-input v-model="abnormalFeedBackData.abnormalDesc" disabled style="width: 180px"></el-input> <el-input v-model="abnormalFeedBackData.abnormalDesc" disabled style="width: 180px"></el-input>
</el-form> </el-form>
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: 0px;">
<el-form-item>
<span slot="label" @click="openResponsibleChooseList('main')"><a herf="#">主要责任人</a></span>
<el-input v-model="abnormalFeedBackData.mainResponsibleDesc" readonly @click.native="openResponsibleChooseList('main')" style="width: 180px"></el-input>
</el-form-item>
<el-form-item>
<span slot="label" @click="openResponsibleChooseList('secondary')"><a herf="#">次要责任人</a></span>
<el-input v-model="abnormalFeedBackData.secondaryResponsibleDesc" readonly @click.native="openResponsibleChooseList('secondary')" style="width: 180px"></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: 0px;"> <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: 0px;">
<el-form-item label="异常情况描述"> <el-form-item label="异常情况描述">
<el-input v-model="abnormalFeedBackData.abnormalRemark" type="textarea" :disabled="disableFlag1" :rows="3" resize='none' style="width: 562px"></el-input> <el-input v-model="abnormalFeedBackData.abnormalRemark" type="textarea" :disabled="disableFlag1" :rows="3" resize='none' style="width: 562px"></el-input>
@ -499,6 +510,7 @@
<el-button type="primary" @click="upLoadModalFlag = false">取消</el-button> <el-button type="primary" @click="upLoadModalFlag = false">取消</el-button>
</el-footer> </el-footer>
</el-dialog> </el-dialog>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div> </div>
</template> </template>
@ -512,6 +524,7 @@
saveAbnormalDetail, saveAbnormalDetail,
openFeedBack, openFeedBack,
closeFeedBack, closeFeedBack,
printResponsibilityBook as printResponsibilityBookApi,
} from "@/api/abnormal.js" } from "@/api/abnormal.js"
import { import {
getSOScheduleRoutingDataForShiyanshi, getSOScheduleRoutingDataForShiyanshi,
@ -522,8 +535,12 @@
printABLabel, printABLabel,
} from "@/views/modules/print/print_Abnormal_label.js" } from "@/views/modules/print/print_Abnormal_label.js"
import {ossListForOther} from '@/api/ftp/oss.js' import {ossListForOther} from '@/api/ftp/oss.js'
import Chooselist from '@/views/modules/common/Chooselist'
export default { export default {
name: 'AbnormalFeedBack', name: 'AbnormalFeedBack',
components: {
Chooselist,
},
data () { data () {
return { return {
upLoadModalFlag:false, upLoadModalFlag:false,
@ -638,6 +655,8 @@
disableFlag1:false, disableFlag1:false,
disableFlag2:false, disableFlag2:false,
disableFlag3:false, disableFlag3:false,
tagNo: '',
chooseOperatorType: '',
abnormalList:[], abnormalList:[],
abnormalFeedBackData:{ abnormalFeedBackData:{
@ -722,6 +741,37 @@
this.abnormalList = data.rows; this.abnormalList = data.rows;
}) })
}, },
// 26- rqrq
getBaseList (val, type) {
this.tagNo = val
this.chooseOperatorType = type
this.$nextTick(() => {
let strVal = ''
if (val === 26) {
strVal = type === 'main' ? this.abnormalFeedBackData.mainResponsibleDesc : this.abnormalFeedBackData.secondaryResponsibleDesc
}
this.$refs.baseList.init(val, strVal)
})
},
/* 快捷查询回调(通过 type 区分主/次责任人)- rqrq */
getBaseData (val) {
if (this.tagNo === 26) {
if (this.chooseOperatorType === 'main') {
this.abnormalFeedBackData.mainResponsible = val.OperatorID
this.abnormalFeedBackData.mainResponsibleDesc = val.OperatorName
} else if (this.chooseOperatorType === 'secondary') {
this.abnormalFeedBackData.secondaryResponsible = val.OperatorID
this.abnormalFeedBackData.secondaryResponsibleDesc = val.OperatorName
}
}
},
openResponsibleChooseList (type) {
// / - rqrq
if (!this.disableFlag4) {
return
}
this.getBaseList(26, type)
},
search(){ search(){
getAbnormalFeedBackList(this.searchData).then(({data}) => { getAbnormalFeedBackList(this.searchData).then(({data}) => {
this.tableData = data.rows; this.tableData = data.rows;
@ -872,6 +922,12 @@
if(this.abnormalFeedBackData.status=='已录入'){ if(this.abnormalFeedBackData.status=='已录入'){
this.abnormalFeedBackData.status='已填写紧急处理' this.abnormalFeedBackData.status='已填写紧急处理'
} }
// - rqrq
if((this.abnormalFeedBackData.mainResponsible==null||this.abnormalFeedBackData.mainResponsible==='') &&
this.abnormalFeedBackData.operatorId!=null&&this.abnormalFeedBackData.operatorId!==''){
this.abnormalFeedBackData.mainResponsible=this.abnormalFeedBackData.operatorId
this.abnormalFeedBackData.mainResponsibleDesc=this.abnormalFeedBackData.operatorDesc
}
this.disableFlag1=true; this.disableFlag1=true;
this.disableFlag2=false; this.disableFlag2=false;
this.disableFlag3=true; this.disableFlag3=true;
@ -883,6 +939,12 @@
if(this.abnormalFeedBackData.status=='已录入'||this.abnormalFeedBackData.status=='已填写紧急处理'){ if(this.abnormalFeedBackData.status=='已录入'||this.abnormalFeedBackData.status=='已填写紧急处理'){
this.abnormalFeedBackData.status='已填写长久处理' this.abnormalFeedBackData.status='已填写长久处理'
} }
// - rqrq
if((this.abnormalFeedBackData.mainResponsible==null||this.abnormalFeedBackData.mainResponsible==='') &&
this.abnormalFeedBackData.operatorId!=null&&this.abnormalFeedBackData.operatorId!==''){
this.abnormalFeedBackData.mainResponsible=this.abnormalFeedBackData.operatorId
this.abnormalFeedBackData.mainResponsibleDesc=this.abnormalFeedBackData.operatorDesc
}
this.disableFlag1=true; this.disableFlag1=true;
this.disableFlag2=true; this.disableFlag2=true;
this.disableFlag3=false; this.disableFlag3=false;
@ -1028,6 +1090,30 @@
printABLabel(data.rows); printABLabel(data.rows);
}) })
}, },
printResponsibilityBook(row){
if(row.treatment==null||row.treatment.trim()==''){
this.$alert("请先填写长久处理方式,才能打印责任书", '错误', {
confirmButtonText: '确定'
})
return false
}
printResponsibilityBookApi({id:row.id}).then(({data}) => {
const blob = new Blob([data], {type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'})
const fileName = "生产异常_批量报废责任认定书_" + (row.seqNo||row.id) + ".docx"
const linkNode = document.createElement('a')
linkNode.download = fileName
linkNode.style.display = 'none'
linkNode.href = URL.createObjectURL(blob)
document.body.appendChild(linkNode)
linkNode.click()
URL.revokeObjectURL(linkNode.href)
document.body.removeChild(linkNode)
}).catch(() => {
this.$alert("打印责任书失败,请稍后重试", '错误', {
confirmButtonText: '确定'
})
})
},
downloadFile(row){ downloadFile(row){
downLoadProjectFile(row) downLoadProjectFile(row)

13
src/views/modules/common/Chooselist.vue

@ -98,11 +98,22 @@ export default {
} }
}, },
methods: { methods: {
// null/undefined/null "null" - rqrq
normalizeQuickParam (val) {
if (val === null || val === undefined) {
return ''
}
const str = String(val).trim()
if (str.toLowerCase() === 'null' || str.toLowerCase() === 'undefined') {
return ''
}
return str
},
// //
init(tagNo,param) { init(tagNo,param) {
this.visible = true; this.visible = true;
this.param = param
this.param = this.normalizeQuickParam(param)
// tagNo // tagNo
getChooselist({"tagNo": tagNo}).then(({data}) => { getChooselist({"tagNo": tagNo}).then(({data}) => {
this.columnList = [] this.columnList = []

26
src/views/modules/common/Chooselist_eam.vue

@ -130,13 +130,35 @@ export default {
} }
}, },
methods: { methods: {
// null/undefined/null "null" - rqrq
normalizeQuickParam (val) {
if (val === null || val === undefined) {
return ''
}
const str = String(val).trim()
if (str.toLowerCase() === 'null' || str.toLowerCase() === 'undefined') {
return ''
}
return str
},
// SQL- rqrq
normalizeConSql (val) {
if (val === null || val === undefined) {
return ''
}
const str = String(val)
if (str.trim().toLowerCase() === 'null' || str.trim().toLowerCase() === 'undefined') {
return ''
}
return str
},
// //
init (tagNo, param, conSql) { init (tagNo, param, conSql) {
this.tagNo = tagNo this.tagNo = tagNo
this.visible = true this.visible = true
this.param = param
this.conSql = conSql ? conSql : ''
this.param = this.normalizeQuickParam(param)
this.conSql = this.normalizeConSql(conSql)
// tagNo // tagNo
getChooselistEam({"tagNo": tagNo}).then(({data}) => { getChooselistEam({"tagNo": tagNo}).then(({data}) => {
this.columnList = [] this.columnList = []

Loading…
Cancel
Save