|
|
@@ -52,6 +52,8 @@
|
|
|
import ActionUtils from '@/utils/action'
|
|
|
import { getFileType, getFileByUserId } from '@/api/permission/file'
|
|
|
import IbpsAttachment from '@/business/platform/file/attachment/selector'
|
|
|
+import curdPost from '@/business/platform/form/utils/custom/joinCURD.js'
|
|
|
+
|
|
|
export default {
|
|
|
components: {
|
|
|
'ibps-attachment': IbpsAttachment
|
|
|
@@ -69,13 +71,13 @@ export default {
|
|
|
typeData: [
|
|
|
{ id: '0', label: '质量管理手册(QM)' },
|
|
|
{ id: '1', label: '程序文件(QP)' },
|
|
|
- { id: '2', label: '[限] 生物安全手册(SWAQ)' },
|
|
|
- { id: '3', label: '[限] 行政管理制度(ZD)' },
|
|
|
- { id: '4', label: '[限] 检测类(JC-SOP)' },
|
|
|
- { id: '5', label: '[限] 仪器设备类(YQ-SOP)' },
|
|
|
- { id: '6', label: '[限] 期间核查类(HC-SOP)' },
|
|
|
- { id: '7', label: '[限] 环境设施类(HJ-SOP)' },
|
|
|
- { id: '8', label: '[限] 质量或技术管理类(ZQ-SOP)' },
|
|
|
+ { id: '2', label: '生物安全手册(SWAQ)' },
|
|
|
+ { id: '3', label: '行政管理制度(ZD)' },
|
|
|
+ { id: '4', label: '检测类(JC-SOP)' },
|
|
|
+ { id: '5', label: '仪器设备类(YQ-SOP)' },
|
|
|
+ { id: '6', label: '期间核查类(HC-SOP)' },
|
|
|
+ { id: '7', label: '环境设施类(HJ-SOP)' },
|
|
|
+ { id: '8', label: '[限] 技术管理类(ZQ-SOP)' },
|
|
|
{ id: '9', label: '技术记录表(FQ)' },
|
|
|
{ id: '10', label: '管理记录表(FQ)' }
|
|
|
],
|
|
|
@@ -88,7 +90,7 @@ export default {
|
|
|
{ id: '5', label: '仪器设备类(YQ-SOP)' },
|
|
|
{ id: '6', label: '期间核查类(HC-SOP)' },
|
|
|
{ id: '7', label: '环境设施类(HJ-SOP)' },
|
|
|
- { id: '8', label: '质量或技术管理类(ZQ-SOP)' },
|
|
|
+ { id: '8', label: '技术管理类(ZQ-SOP)' },
|
|
|
{ id: '9', label: '技术记录表(FQ)' },
|
|
|
{ id: '10', label: '管理记录表(FQ)' }
|
|
|
],
|
|
|
@@ -117,10 +119,10 @@ export default {
|
|
|
// 表格字段配置
|
|
|
columns: [
|
|
|
// { prop: 'zi_duan_yi_', label: '部门' },
|
|
|
- { prop: 'wen_jian_bian_hao', label: '文件编号', sortable: 'custom',width:150 },
|
|
|
+ { prop: 'wen_jian_bian_hao', label: '文件编号', sortable: 'custom', width: 150 },
|
|
|
{ prop: 'wen_jian_ming_che', label: '文件名称' },
|
|
|
- { prop: 'ban_ben_hao_', label: '版本号',width:150 },
|
|
|
- { prop: 'fa_bu_ri_qi_', label: '发布日期',width:150 },
|
|
|
+ { prop: 'ban_ben_hao_', label: '版本号', width: 150 },
|
|
|
+ { prop: 'fa_bu_ri_qi_', label: '发布日期', width: 150, sortable: 'custom' },
|
|
|
{ prop: 'wen_jian_id_', label: '查阅', slotName: "wenjinachayue" }
|
|
|
]
|
|
|
},
|
|
|
@@ -150,45 +152,62 @@ export default {
|
|
|
},
|
|
|
loadNode() {
|
|
|
this.loading = true
|
|
|
- // getFileType("内部文件").then(res => {
|
|
|
- // this.loading = false
|
|
|
- // for (let i in res.variables.data) {
|
|
|
- // let data = {}
|
|
|
- // data["id"] = i
|
|
|
- // data["label"] = res.variables.data[i]
|
|
|
- // this.typeData.push(data)
|
|
|
- // }
|
|
|
- // }).catch(res => {
|
|
|
- // this.loading = false
|
|
|
- // })
|
|
|
},
|
|
|
- refreshData() {
|
|
|
+ getDatas(sorts) {
|
|
|
this.tableData = []
|
|
|
- getFileByUserId(this.getSearcFormData()).then(res => {
|
|
|
+ let sql = ''
|
|
|
+ let wheres = ''
|
|
|
+ if (sorts.fileCode) {
|
|
|
+ wheres = wheres + ` and wen_jian_bian_hao like '%${sorts.fileCode}%'`
|
|
|
+ }
|
|
|
+
|
|
|
+ if (sorts.fileType) {
|
|
|
+ wheres = wheres + ` and wen_jian_lie_xing = '${sorts.fileType}'`
|
|
|
+ }
|
|
|
+
|
|
|
+ if (sorts.fileType == '技术管理类(ZQ-SOP)') {
|
|
|
+ if (sorts.fileName) {
|
|
|
+ wheres = wheres + ` and wj.wen_jian_ming_che like '%${sorts.fileName}%'`
|
|
|
+ }
|
|
|
+ if (sorts.sorts) {
|
|
|
+ if (JSON.stringify(sorts.sorts) !== "{}") {
|
|
|
+ wheres = wheres + ` order by ${Object.keys(sorts.sorts)} ${Object.values(sorts.sorts)}`
|
|
|
+ }
|
|
|
+ }
|
|
|
+ sql = `select wj.*,qx.yong_hu_id_ from t_wjcysqb qx left join t_wjgl wj ON qx.wen_jian_id_ = wj.id_ where qx.yong_hu_id_ = ${sorts.userId} ${wheres} `
|
|
|
+ } else {
|
|
|
+ if (sorts.fileName) {
|
|
|
+ wheres = wheres + ` and wen_jian_ming_che like '%${sorts.fileName}%'`
|
|
|
+ }
|
|
|
+ if (sorts.sorts) {
|
|
|
+ if (JSON.stringify(sorts.sorts) !== "{}") {
|
|
|
+ wheres = wheres + ` order by ${Object.keys(sorts.sorts)} ${Object.values(sorts.sorts)}`
|
|
|
+ }
|
|
|
+ }
|
|
|
+ sql = `select *FROM t_wjgl WHERE wen_jian_zhuang_t = '已发放' AND yi_gai_zuo_fei_='否' ${wheres} `
|
|
|
+ }
|
|
|
+ curdPost('sql', sql).then(res => {
|
|
|
this.tableData = res.variables.data
|
|
|
}).catch(res => {
|
|
|
this.loading = false
|
|
|
this.tableData = []
|
|
|
})
|
|
|
},
|
|
|
+ refreshData() {
|
|
|
+ this.tableData = []
|
|
|
+ this.getDatas(this.getSearcFormData())
|
|
|
+ },
|
|
|
|
|
|
handleNodeClick(data) {
|
|
|
+ this.oldorgId = data
|
|
|
this.show = 'detail'
|
|
|
if (this.oldorgId == data.id) {
|
|
|
return
|
|
|
} else {
|
|
|
- getFileByUserId({
|
|
|
- deptName: "",
|
|
|
- fileCode: "",
|
|
|
- fileName: "",
|
|
|
+ this.getDatas({
|
|
|
fileType: this.paramsTypeData[data.id].label,
|
|
|
- userId: this.$store.getters.userInfo.employee.id
|
|
|
- }).then(res => {
|
|
|
- this.oldorgId = data.id
|
|
|
- this.tableData = res.variables.data
|
|
|
- }).catch(res => {
|
|
|
- this.loading = false
|
|
|
- this.tableData = []
|
|
|
+ userId: this.$store.getters.userInfo.employee.id,
|
|
|
+ sorts: { 'wen_jian_bian_hao': 'desc' }
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
@@ -198,7 +217,7 @@ export default {
|
|
|
*/
|
|
|
getSearcFormData() {
|
|
|
const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
|
|
|
- params['fileType'] = this.paramsTypeData[this.oldorgId].label
|
|
|
+ params['fileType'] = this.paramsTypeData[this.oldorgId.id].label
|
|
|
params['userId'] = this.$store.getters.userInfo.employee.id
|
|
|
params['sorts'] = this.sorts
|
|
|
return params
|
|
|
@@ -220,12 +239,7 @@ export default {
|
|
|
*/
|
|
|
handleSortChange(sort) {
|
|
|
ActionUtils.setSorts(this.sorts, sort)
|
|
|
- getFileByUserId(this.getSearcFormData()).then(res => {
|
|
|
- this.tableData = res.variables.data
|
|
|
- }).catch(res => {
|
|
|
- this.loading = false
|
|
|
- this.tableData = []
|
|
|
- })
|
|
|
+ this.getDatas(this.getSearcFormData())
|
|
|
},
|
|
|
},
|
|
|
watch: {
|