Browse Source

2024.10.29 审批业务类型

java8
yuejiayang 1 year ago
parent
commit
3b6d643952
  1. 22
      package-lock.json
  2. 6
      package.json
  3. 2
      src/api/auth/auth.js
  4. 2
      src/api/inquiry/inquiryDetail.js
  5. 17
      src/api/oss/oss.js
  6. 1
      src/router/index.js
  7. 48
      src/views/common/previewFile.vue
  8. 77
      src/views/modules/auth/authGroup.vue
  9. 91
      src/views/modules/auth/authRule.vue
  10. 74
      src/views/modules/inquiry/inquiryApplication.vue
  11. 525
      src/views/modules/inquiry/inquiryDetail.vue
  12. 360
      src/views/modules/oss/ossComponents.vue

22
package-lock.json

@ -27,6 +27,21 @@
"integrity": "sha512-7NQmHra/JILCd1QqpSzl8+mJRc8ZHz3uDm8YV1Ks9IhK0epEiTw8aIErbvH9PI+6XbqhyIQy3462nEsn7UVzjQ==", "integrity": "sha512-7NQmHra/JILCd1QqpSzl8+mJRc8ZHz3uDm8YV1Ks9IhK0epEiTw8aIErbvH9PI+6XbqhyIQy3462nEsn7UVzjQ==",
"dev": true "dev": true
}, },
"@vue-office/docx": {
"version": "1.6.2",
"resolved": "https://mirrors.cloud.tencent.com/npm/@vue-office/docx/-/docx-1.6.2.tgz",
"integrity": "sha512-OHAoUHeY8nHjhWvwDhlPx+/rmRkxmqLpvPgtfCEOZ4H1c1LCdJ6eDbdV3152ww8dcdZ7fgGQu3fmSSaI7JwdpQ=="
},
"@vue-office/excel": {
"version": "1.7.11",
"resolved": "https://mirrors.cloud.tencent.com/npm/@vue-office/excel/-/excel-1.7.11.tgz",
"integrity": "sha512-LF3R9IV573Sf4qTu6Ik5Ee8UMfkrsZQ6HEQE25/2m1c0CMcHX6KanIy6Cz0b0Q+FrLH3TjIsLTm6oPcqAbDGSA=="
},
"@vue/composition-api": {
"version": "1.7.2",
"resolved": "https://mirrors.cloud.tencent.com/npm/@vue/composition-api/-/composition-api-1.7.2.tgz",
"integrity": "sha512-M8jm9J/laYrYT02665HkZ5l2fWTK4dcVg3BsDHm/pfz+MjDYwX+9FUaZyGwEyXEDonQYRCo0H7aLgdklcIELjw=="
},
"abab": { "abab": {
"version": "1.0.4", "version": "1.0.4",
"resolved": "https://registry.npmjs.org/abab/-/abab-1.0.4.tgz", "resolved": "https://registry.npmjs.org/abab/-/abab-1.0.4.tgz",
@ -10107,7 +10122,7 @@
}, },
"moment": { "moment": {
"version": "2.30.1", "version": "2.30.1",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz",
"resolved": "https://mirrors.cloud.tencent.com/npm/moment/-/moment-2.30.1.tgz",
"integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==" "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how=="
}, },
"move-concurrently": { "move-concurrently": {
@ -19185,6 +19200,11 @@
"tiny-cookie": "^1.0" "tiny-cookie": "^1.0"
} }
}, },
"vue-demi": {
"version": "0.14.10",
"resolved": "https://mirrors.cloud.tencent.com/npm/vue-demi/-/vue-demi-0.14.10.tgz",
"integrity": "sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg=="
},
"vue-hot-reload-api": { "vue-hot-reload-api": {
"version": "2.3.3", "version": "2.3.3",
"resolved": "https://registry.npmjs.org/vue-hot-reload-api/-/vue-hot-reload-api-2.3.3.tgz", "resolved": "https://registry.npmjs.org/vue-hot-reload-api/-/vue-hot-reload-api-2.3.3.tgz",

6
package.json

@ -14,7 +14,9 @@
"build": "gulp" "build": "gulp"
}, },
"dependencies": { "dependencies": {
"qrcode": "^1.5.3",
"@vue-office/docx": "^1.6.2",
"@vue-office/excel": "^1.7.11",
"@vue/composition-api": "^1.7.2",
"axios": "0.17.1", "axios": "0.17.1",
"babel-plugin-component": "0.10.1", "babel-plugin-component": "0.10.1",
"babel-polyfill": "6.26.0", "babel-polyfill": "6.26.0",
@ -32,11 +34,13 @@
"node-sass": "4.13.1", "node-sass": "4.13.1",
"npm": "^6.9.0", "npm": "^6.9.0",
"pubsub-js": "^1.9.3", "pubsub-js": "^1.9.3",
"qrcode": "^1.5.3",
"sass-loader": "6.0.6", "sass-loader": "6.0.6",
"svg-sprite-loader": "3.7.3", "svg-sprite-loader": "3.7.3",
"v-viewer": "^1.6.4", "v-viewer": "^1.6.4",
"vue": "2.6.10", "vue": "2.6.10",
"vue-cookie": "1.1.4", "vue-cookie": "1.1.4",
"vue-demi": "^0.14.10",
"vue-i18n": "^8.25.0", "vue-i18n": "^8.25.0",
"vue-json-excel": "^0.3.0", "vue-json-excel": "^0.3.0",
"vue-pdf": "^4.3.0", "vue-pdf": "^4.3.0",

2
src/api/auth/auth.js

@ -33,3 +33,5 @@ export const authRuleStepSave = data => createAPI(`auth/authRuleStepSave`,'post'
export const authRuleStepDelete = data => createAPI(`auth/authRuleStepDelete`,'post',data) export const authRuleStepDelete = data => createAPI(`auth/authRuleStepDelete`,'post',data)
export const authRuleStepEdit = data => createAPI(`auth/authRuleStepEdit`,'post',data) export const authRuleStepEdit = data => createAPI(`auth/authRuleStepEdit`,'post',data)
export const getBusinessTypeList = data => createAPI(`auth/getBusinessTypeList`,'post',data)

2
src/api/inquiry/inquiryDetail.js

@ -14,3 +14,5 @@ export const updateInquiryPartItemList = data => createAPI(`/inquiry/inquiryDeta
export const searchInquiryDetailHeaderInfo = data => createAPI(`/inquiry/inquiryDetail/searchInquiryDetailHeaderInfo`,'post',data) export const searchInquiryDetailHeaderInfo = data => createAPI(`/inquiry/inquiryDetail/searchInquiryDetailHeaderInfo`,'post',data)
export const searchQuotationRecordInfo = data => createAPI(`/inquiry/inquiryDetail/searchQuotationRecordInfo`,'post',data)

17
src/api/oss/oss.js

@ -1,3 +1,20 @@
import { createAPI } from "@/utils/httpRequest.js"; import { createAPI } from "@/utils/httpRequest.js";
export const updateOssRef = data => createAPI(`/sys/oss/updateOssRef`,'post',data) export const updateOssRef = data => createAPI(`/sys/oss/updateOssRef`,'post',data)
/**
* 文件上传
* @param data
* @returns {*}
*/
export const uploadFile = data => createAPI(`/base/uploadFile`,'post',data)
export const ossUpload = (data) => createAPI(`/oss/upload`,'post',data)
export const queryOss = (data) => createAPI(`/oss`,'post',data)
export const removeOss = (data) => createAPI(`/oss/remove`,'post',data)
export const previewOssFileById = (data) => createAPI(`/oss/${data.id}`,'post',777)

1
src/router/index.js

@ -20,6 +20,7 @@ const _import = require('./import-' + process.env.NODE_ENV)
const globalRoutes = [ const globalRoutes = [
{ path: '/404', component: _import('common/404'), name: '404', meta: { title: '404未找到' } }, { path: '/404', component: _import('common/404'), name: '404', meta: { title: '404未找到' } },
{ path: '/login', component: _import('common/login'), name: 'login', meta: { title: '登录' } }, { path: '/login', component: _import('common/login'), name: 'login', meta: { title: '登录' } },
{ path: '/pre', component: _import('common/previewFile'), name: 'pre', meta: { title: '文件预览' } },
{ path: '/login-token', component: _import('common/login-token'), name: 'login', meta: { title: '登录' } }, { path: '/login-token', component: _import('common/login-token'), name: 'login', meta: { title: '登录' } },
] ]

48
src/views/common/previewFile.vue

@ -0,0 +1,48 @@
<script>
import VueOfficeExcel from '@vue-office/excel'
//VueOfficeDocx
import VueOfficeDocx from '@vue-office/docx'
import '@vue-office/docx/lib/index.css'
//
import '@vue-office/excel/lib/index.css'
export default {
name: "previewFile",
components:{
VueOfficeExcel,VueOfficeDocx
},
data() {
return {
src: "",
type: "",
loading: true
}
},
created() {
if (this.$route.query.src){
this.src = this.$route.query.src;
this.type = this.$route.query.type;
}else {
this.$message.error('错误路径')
this.$router.back();
}
},
methods:{
rendered(){
this.loading = false
}
}
}
</script>
<template>
<div v-loading="loading">
<vue-office-excel v-if="type === 'xls'" :options="{xls:true}" :src="src" @rendered="rendered" style="height: 100vh"/>
<vue-office-excel v-if="type === 'xlsx'" :src="src" @rendered="rendered" style="height: 100vh"/>
<vue-office-docx v-if="type === 'docx'" :src="src" @rendered="rendered" style="height: 100vh"/>
</div>
</template>
<style scoped>
</style>

77
src/views/modules/auth/authGroup.vue

@ -17,6 +17,17 @@
<el-form-item :label="'审批组名称'"> <el-form-item :label="'审批组名称'">
<el-input v-model="searchData.groupDesc" clearable style="width: 120px"></el-input> <el-input v-model="searchData.groupDesc" clearable style="width: 120px"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="业务类型">
<!-- <el-input style="width: 135px;" v-model="saveAuditRuleData.recordTypeDb"></el-input>-->
<el-select v-model="searchData.recordType" clearable style="width: 120px;">
<el-option
v-for="(item,index) in businessTypeSelectList"
:key="index"
:label="item.roleDesc"
:value="item.roleItemNo">
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="'状态'"> <el-form-item :label="'状态'">
<el-select clearable v-model="searchData.active" style="width: 120px"> <el-select clearable v-model="searchData.active" style="width: 120px">
<el-option label="启用" value="Y"></el-option> <el-option label="启用" value="Y"></el-option>
@ -89,10 +100,6 @@
:key = "i.buNo" :key = "i.buNo"
:label = "i.buDesc" :label = "i.buDesc"
:value = "i.buNo"> :value = "i.buNo">
<span style="float: left;width: 100px">{{ i.sitename }}</span>
<span style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;width: 60px">
{{ i.buDesc }}
</span>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -107,6 +114,18 @@
<el-form-item label="邮箱" prop="groupEmailAddress" :rules="rules.groupEmailAddress"> <el-form-item label="邮箱" prop="groupEmailAddress" :rules="rules.groupEmailAddress">
<el-input v-model="modalData.groupEmailAddress" style="width: 210px"></el-input> <el-input v-model="modalData.groupEmailAddress" style="width: 210px"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="业务类型" prop="recordType" :rules="rules.recordType">
<!-- <el-input style="width: 135px;" v-model="saveAuditRuleData.recordTypeDb"></el-input>-->
<el-select v-model="modalData.recordType" placeholder=
"请选择" style="width: 110px;">
<el-option
v-for="(item,index) in businessTypeSelectList"
:key="index"
:label="item.roleDesc"
:value="item.roleItemNo">
</el-option>
</el-select>
</el-form-item>
</el-form> </el-form>
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;"> <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
<el-form-item label="备注"> <el-form-item label="备注">
@ -225,7 +244,8 @@ import {
authGroupSearch, // authGroupSearch, //
authGroupSave, // authGroupSave, //
authGroupEdit, // authGroupEdit, //
authGroupDelete //
authGroupDelete, //
getBusinessTypeList, //
} from '@/api/auth/auth' } from '@/api/auth/auth'
import {getSiteAndBuByUserName} from "@/api/eam/eam.js" import {getSiteAndBuByUserName} from "@/api/eam/eam.js"
import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
@ -387,6 +407,24 @@ export default {
fixed: '', fixed: '',
columnWidth: 300 columnWidth: 300
}, },
{
userId: this.$store.state.user.name,
functionId: 601005,
serialNumber: '601005Table1RoleDesc',
tableId: '601005Table1',
tableName: '审批组表',
columnProp: 'roleDesc',
headerAlign: 'center',
align: 'center',
columnLabel: '业务类型',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 170
},
{ {
functionId: 601005, functionId: 601005,
serialNumber: '601005Table1Active', serialNumber: '601005Table1Active',
@ -530,8 +568,16 @@ export default {
message: ' ', message: ' ',
trigger: 'change' trigger: 'change'
} }
]
],
recordType:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
}, },
businessTypeSelectList: [],
// ======== ======== // ======== ========
authSearch: false, authSearch: false,
authSave: false, authSave: false,
@ -560,6 +606,7 @@ export default {
this.getTableUserColumn(this.$route.meta.menuId+'table1',1) this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
// //
this.getDataList() this.getDataList()
this.getBusinessRoleList()
}, },
methods: { methods: {
@ -613,6 +660,7 @@ export default {
buNo: '', buNo: '',
groupNo: '', groupNo: '',
groupDesc: '', groupDesc: '',
recordType: '',
active: 'Y', active: 'Y',
createBy: this.$store.state.user.name, createBy: this.$store.state.user.name,
} }
@ -643,6 +691,8 @@ export default {
updateBy: this.$store.state.user.name, updateBy: this.$store.state.user.name,
updateDate: '' updateDate: ''
} }
// recordTypeINT
this.modalData.recordType = parseInt(row.recordType)
this.modalDisableFlag = true this.modalDisableFlag = true
this.modalFlag = true this.modalFlag = true
}, },
@ -672,6 +722,10 @@ export default {
this.$message.warning('请填写邮箱!') this.$message.warning('请填写邮箱!')
return return
} }
if (this.modalData.recordType === '' || this.modalData.recordType == null) {
this.$message.warning('请选择业务类型!')
return
}
if (this.modalData.flag === '1') { if (this.modalData.flag === '1') {
this.modalData.buNo = this.modalData.bu.split('_')[1] this.modalData.buNo = this.modalData.bu.split('_')[1]
this.modalData.site = this.$store.state.user.site this.modalData.site = this.$store.state.user.site
@ -838,6 +892,17 @@ export default {
selectFlag () { selectFlag () {
return true return true
}, },
getBusinessRoleList() {
let queryData = {
active: 'Y'
}
this.businessTypeSelectList = []
getBusinessTypeList(queryData).then(({data}) => {
if (data.code == 0) {
this.businessTypeSelectList = data.rows
}
})
},
// //
async getTableUserColumn(tableId, columnId) { async getTableUserColumn(tableId, columnId) {
let queryTableUser = { let queryTableUser = {

91
src/views/modules/auth/authRule.vue

@ -17,6 +17,17 @@
<el-form-item :label="'审批规则描述'"> <el-form-item :label="'审批规则描述'">
<el-input v-model="searchData.ruleDesc" clearable style="width: 120px"></el-input> <el-input v-model="searchData.ruleDesc" clearable style="width: 120px"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="业务类型">
<!-- <el-input style="width: 135px;" v-model="saveAuditRuleData.recordTypeDb"></el-input>-->
<el-select v-model="searchData.recordType" clearable style="width: 120px;">
<el-option
v-for="(item,index) in businessTypeSelectList"
:key="index"
:label="item.roleDesc"
:value="item.roleItemNo">
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="'状态'"> <el-form-item :label="'状态'">
<el-select clearable v-model="searchData.active" style="width: 120px"> <el-select clearable v-model="searchData.active" style="width: 120px">
<el-option label="启用" value="Y"></el-option> <el-option label="启用" value="Y"></el-option>
@ -179,7 +190,7 @@
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<el-dialog :title="modalData.title" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="600px">
<el-dialog :title="modalData.title" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="560px">
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;"> <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
<el-form-item label="审批规则编码" prop="ruleNo" :rules="rules.ruleNo"> <el-form-item label="审批规则编码" prop="ruleNo" :rules="rules.ruleNo">
<el-input v-model="modalData.ruleNo" :disabled="modalDisableFlag" style="width: 110px"></el-input> <el-input v-model="modalData.ruleNo" :disabled="modalDisableFlag" style="width: 110px"></el-input>
@ -188,7 +199,7 @@
<el-input v-model="modalData.ruleDesc" :disabled="modalDisableFlag" style="width: 315px"></el-input> <el-input v-model="modalData.ruleDesc" :disabled="modalDisableFlag" style="width: 315px"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="BU" prop="bu" :rules="rules.bu"> <el-form-item label="BU" prop="bu" :rules="rules.bu">
<el-select v-model="modalData.bu" placeholder="请选择" :disabled="modalDisableFlag" style="width: 110px">
<el-select v-model="modalData.bu" placeholder="请选择" :disabled="modalDisableFlag" style="width: 70px">
<el-option <el-option
v-for = "i in userBuList" v-for = "i in userBuList"
:key = "i.buNo" :key = "i.buNo"
@ -212,23 +223,37 @@
<el-option label="3" value = 3></el-option> <el-option label="3" value = 3></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="active" :rules="rules.active">
<el-select v-model="modalData.active" :disabled="!modalDisableFlag" style="width: 110px">
<el-option label="启用" value="Y"></el-option>
<el-option label="禁用" value="N"></el-option>
</el-select>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
<el-form-item label="业务类型" prop="recordType" :rules="rules.recordType">
<!-- <el-input style="width: 135px;" v-model="saveAuditRuleData.recordTypeDb"></el-input>-->
<el-select v-model="modalData.recordType" placeholder=
"请选择" style="width: 110px;">
<el-option
v-for="(item,index) in businessTypeSelectList"
:key="index"
:label="item.roleDesc"
:value="item.roleItemNo">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="启用日期" prop="phaseInDate" :rules="rules.phaseInDate"> <el-form-item label="启用日期" prop="phaseInDate" :rules="rules.phaseInDate">
<el-date-picker v-model="modalData.phaseInDate" type="date" placeholder="选择日期" style="width: 110px"></el-date-picker>
<el-date-picker v-model="modalData.phaseInDate" type="date" placeholder="选择日期" style="width: 150px"></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="停用日期" prop="phaseOutDate"> <el-form-item label="停用日期" prop="phaseOutDate">
<el-date-picker v-model="modalData.phaseOutDate" type="date" :disabled="!modalDisableFlag" placeholder="选择日期" style="width: 110px"></el-date-picker>
<el-date-picker v-model="modalData.phaseOutDate" type="date" :disabled="!modalDisableFlag" placeholder="选择日期" style="width: 150px"></el-date-picker>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;"> <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
<el-form-item label="备注"> <el-form-item label="备注">
<el-input v-model="modalData.remark" style="width: 439px"></el-input> <el-input v-model="modalData.remark" style="width: 439px"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="active" :rules="rules.active">
<el-select v-model="modalData.active" :disabled="!modalDisableFlag" style="width: 110px">
<el-option label="启用" value="Y"></el-option>
<el-option label="禁用" value="N"></el-option>
</el-select>
</el-form-item>
</el-form> </el-form>
<el-footer style="height:30px;margin-top: 5px;text-align:center"> <el-footer style="height:30px;margin-top: 5px;text-align:center">
<el-button type="primary" @click="saveData">保存</el-button> <el-button type="primary" @click="saveData">保存</el-button>
@ -316,6 +341,7 @@ import {
authRuleStepSave, // authRuleStepSave, //
authRuleStepEdit, // authRuleStepEdit, //
authRuleStepDelete, // authRuleStepDelete, //
getBusinessTypeList, //
} from '@/api/auth/auth' } from '@/api/auth/auth'
import Chooselist from '@/views/modules/common/Chooselist_eam' import Chooselist from '@/views/modules/common/Chooselist_eam'
import {authBusinessSearch, authGroupSearch} from "../../../api/auth/auth"; import {authBusinessSearch, authGroupSearch} from "../../../api/auth/auth";
@ -468,6 +494,24 @@ export default {
fixed: '', fixed: '',
columnWidth: 180 columnWidth: 180
}, },
{
userId: this.$store.state.user.name,
functionId: 601005,
serialNumber: '601005Table1RoleDesc',
tableId: '601005Table1',
tableName: '审批规则表',
columnProp: 'roleDesc',
headerAlign: 'center',
align: 'center',
columnLabel: '业务类型',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 170
},
{ {
functionId: 601005, functionId: 601005,
serialNumber: '601005Table1Active', serialNumber: '601005Table1Active',
@ -930,6 +974,13 @@ export default {
trigger: 'change' trigger: 'change'
} }
], ],
recordType:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
userDisplay:[ userDisplay:[
{ {
required: true, required: true,
@ -952,6 +1003,7 @@ export default {
} }
], ],
}, },
businessTypeSelectList: [],
// ======== ======== // ======== ========
authSearch: false, authSearch: false,
authSave: false, authSave: false,
@ -994,6 +1046,7 @@ export default {
this.getSiteAndBuByUserName(); this.getSiteAndBuByUserName();
// //
this.getDataList() this.getDataList()
this.getBusinessRoleList()
}, },
methods: { methods: {
// bu // bu
@ -1185,6 +1238,8 @@ export default {
updateBy: this.$store.state.user.name, updateBy: this.$store.state.user.name,
updateDate: '' updateDate: ''
} }
// recordTypeINT
this.modalData.recordType = parseInt(row.recordType)
this.modalDisableFlag = true this.modalDisableFlag = true
this.modalFlag = true this.modalFlag = true
}, },
@ -1248,6 +1303,10 @@ export default {
this.$message.warning('请选择状态!') this.$message.warning('请选择状态!')
return return
} }
if (this.modalData.recordType === '' || this.modalData.recordType == null) {
this.$message.warning('请选择业务类型!')
return
}
if (this.modalData.flag === '1') { if (this.modalData.flag === '1') {
this.modalData.buNo = this.modalData.bu.split('_')[1] this.modalData.buNo = this.modalData.bu.split('_')[1]
this.modalData.site = this.$store.state.user.site this.modalData.site = this.$store.state.user.site
@ -1472,6 +1531,18 @@ export default {
this.ruleStepModalData.groupDesc = '' this.ruleStepModalData.groupDesc = ''
}, },
getBusinessRoleList() {
let queryData = {
active: 'Y'
}
this.businessTypeSelectList = []
getBusinessTypeList(queryData).then(({data}) => {
if (data.code == 0) {
this.businessTypeSelectList = data.rows
}
})
},
authUserNoBlur () { authUserNoBlur () {
let params = { let params = {
username: this.ruleStepModalData.authUserNo, username: this.ruleStepModalData.authUserNo,

74
src/views/modules/inquiry/inquiryApplication.vue

@ -89,21 +89,21 @@
<el-form-item :label="' '"> <el-form-item :label="' '">
<el-button @click="getDataList()">查询</el-button> <el-button @click="getDataList()">查询</el-button>
<el-button type="primary" @click="addModal()">新增</el-button> <el-button type="primary" @click="addModal()">新增</el-button>
<!-- <el-button type="primary" icon="el-icon-upload" @click="handleImportQuotation()">导入</el-button>-->
<!-- <download-excel-->
<!-- :fields="fields()"-->
<!-- :data="exportData"-->
<!-- type="xls"-->
<!-- :name="exportName"-->
<!-- :header="exportHeader"-->
<!-- :footer="exportFooter"-->
<!-- :fetch="createExportData"-->
<!-- :before-generate="startDownload"-->
<!-- :before-finish="finishDownload"-->
<!-- worksheet="导出信息"-->
<!-- class="el-button el-button&#45;&#45;primary el-button&#45;&#45;medium">-->
<!-- {{ "导出" }}-->
<!-- </download-excel>-->
<el-button type="primary" icon="el-icon-upload" @click="handleImportQuotation()">导入</el-button>
<download-excel
:fields="fields()"
:data="exportData"
type="xls"
:name="exportName"
:header="exportHeader"
:footer="exportFooter"
:fetch="createExportData"
:before-generate="startDownload"
:before-finish="finishDownload"
worksheet="导出信息"
class="el-button el-button--primary el-button--medium">
{{ "导出" }}
</download-excel>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -356,7 +356,7 @@
</el-dialog> </el-dialog>
<el-dialog title="询价产品属性维护" v-drag :visible.sync="inquiryPartItemModalFlag" :close-on-click-modal="false" <el-dialog title="询价产品属性维护" v-drag :visible.sync="inquiryPartItemModalFlag" :close-on-click-modal="false"
width="690px" style="height: 100%;" class="customer-dialog">
width="690px" style="height: 100%;margin-top: -60px" class="customer-dialog">
<el-container style="height: 100%;"> <el-container style="height: 100%;">
<el-form :inline="true" label-position="top" label-width="80px"> <el-form :inline="true" label-position="top" label-width="80px">
<!-- 第一行 --> <!-- 第一行 -->
@ -386,7 +386,7 @@
</div> </div>
<div class="rq "> <div class="rq ">
<el-table <el-table
:height="height - 250"
:height="height - 78"
:data="inquiryPartItemDataList" :data="inquiryPartItemDataList"
border border
style="width: 100%;margin-top: 5px"> style="width: 100%;margin-top: 5px">
@ -437,15 +437,18 @@
</fieldset> </fieldset>
</el-form> </el-form>
</el-container> </el-container>
<el-footer style="height:20px;margin-top: -10px;padding-bottom:5px;text-align:center">
<el-footer style="height:30px;margin-top: 10px;padding-bottom:5px;text-align:center">
<!-- <el-button type="primary" @click="saveInquiryPartData()">保存</el-button>--> <!-- <el-button type="primary" @click="saveInquiryPartData()">保存</el-button>-->
<!-- <el-button type="primary" @click="inquiryPartModalFlag = false">关闭</el-button>-->
<el-button type="primary" @click="inquiryPartItemModalFlag = false">关闭</el-button>
</el-footer> </el-footer>
</el-dialog> </el-dialog>
<!-- chooseList模态框 --> <!-- chooseList模态框 -->
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
<!-- 导入 -->
<quotationUpload ref="quotationUpload" @refreshPageTables="getDataList()" v-drag></quotationUpload>
</div> </div>
</template> </template>
@ -460,6 +463,7 @@ import {queryCustomerList} from "@/api/customer/customer";
import {verifyData} from "@/api/part/partInformation"; import {verifyData} from "@/api/part/partInformation";
import {EventBus} from "../../../main"; import {EventBus} from "../../../main";
import {partInformationSearch} from "../../../api/part/partInformation"; import {partInformationSearch} from "../../../api/part/partInformation";
import quotationUpload from "../quote/quotation_upload.vue";
export default { export default {
computed: { computed: {
@ -477,6 +481,7 @@ export default {
// }, // },
}, },
components: { components: {
quotationUpload,
DictDataSelect, DictDataSelect,
Chooselist Chooselist
}, },
@ -1525,7 +1530,13 @@ export default {
remark: row.remark, remark: row.remark,
updateBy: this.$store.state.user.name updateBy: this.$store.state.user.name
} }
this.modalDisableFlag = true
if(this.modalData.buNo === null || this.modalData.buNo === ''){
this.modalData.buDesc = ''
this.modalData.bu = ''
this.modalDisableFlag = false
}else {
this.modalDisableFlag = true
}
this.modalFlag = true this.modalFlag = true
}, },
@ -1973,11 +1984,8 @@ export default {
searchInquiryDetailInfo(tempData).then(({data}) => { searchInquiryDetailInfo(tempData).then(({data}) => {
if (data.code === 0) { if (data.code === 0) {
this.inquiryPartDataList = data.page.list this.inquiryPartDataList = data.page.list
this.pageIndex = data.page.currPage
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
// //
if (this.totalPage > 0) {
if (this.inquiryPartDataList != null && this.inquiryPartDataList.length > 0) {
// //
this.$refs.secondaryTable.setCurrentRow(this.inquiryPartDataList[0]) this.$refs.secondaryTable.setCurrentRow(this.inquiryPartDataList[0])
} }
@ -2300,12 +2308,24 @@ export default {
async createExportData() { async createExportData() {
this.searchData.limit = -1 this.searchData.limit = -1
this.searchData.page = 1 this.searchData.page = 1
await quotationInformationSearch(this.searchData).then(({data}) => {
await searchInquiryApplicationInfo(this.searchData).then(({data}) => {
this.resultList = data.page.list this.resultList = data.page.list
// dataList - // dataList -
this.resultList.forEach((item) => { this.resultList.forEach((item) => {
item.projectManagerName = item.projectManager.split('-')[1]
item.projectOwnerName = item.projectOwner.split('-')[1]
if (item.status === 'A') {
item.status = '已报价'
} else if (item.status === 'B') {
item.status = '已下达'
} else if (item.status === 'C') {
item.status = '草稿'
}
if (item.priorityLevel === 'A') {
item.priorityLevel = '普通'
} else if (item.priorityLevel === ' B') {
item.priorityLevel = '重要'
} else if (item.priorityLevel === ' C') {
item.priorityLevel = '紧急'
}
}) })
}) })
return this.resultList return this.resultList

525
src/views/modules/inquiry/inquiryDetail.vue

@ -96,20 +96,20 @@
<el-form-item :label="' '"> <el-form-item :label="' '">
<el-button @click="getDataList()">查询</el-button> <el-button @click="getDataList()">查询</el-button>
<!-- <el-button type="primary" icon="el-icon-upload" @click="handleImportQuotation()">导入</el-button>--> <!-- <el-button type="primary" icon="el-icon-upload" @click="handleImportQuotation()">导入</el-button>-->
<!-- <download-excel-->
<!-- :fields="fields()"-->
<!-- :data="exportData"-->
<!-- type="xls"-->
<!-- :name="exportName"-->
<!-- :header="exportHeader"-->
<!-- :footer="exportFooter"-->
<!-- :fetch="createExportData"-->
<!-- :before-generate="startDownload"-->
<!-- :before-finish="finishDownload"-->
<!-- worksheet="导出信息"-->
<!-- class="el-button el-button&#45;&#45;primary el-button&#45;&#45;medium">-->
<!-- {{ "导出" }}-->
<!-- </download-excel>-->
<download-excel
:fields="fields()"
:data="exportData"
type="xls"
:name="exportName"
:header="exportHeader"
:footer="exportFooter"
:fetch="createExportData"
:before-generate="startDownload"
:before-finish="finishDownload"
worksheet="导出信息"
class="el-button el-button--primary el-button--medium">
{{ "导出" }}
</download-excel>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -282,9 +282,49 @@
</el-tab-pane> </el-tab-pane>
<!-- 询价明细 相关文档 --> <!-- 询价明细 相关文档 -->
<el-tab-pane label="相关文档" name="inquiryPartDocument"> <el-tab-pane label="相关文档" name="inquiryPartDocument">
<oss-components label="申请单号" style="margin-top: 5px" height="44vh" :columns="ossColumns" :order-ref1="inquiryPartCurrentRow.site" :order-ref2="inquiryPartCurrentRow.id"
:order-ref3="inquiryPartCurrentRow.testPartId" :rfq-no="inquiryPartCurrentRow.rfqNo"
:part-no="inquiryPartCurrentRow.partNo" :part-desc="inquiryPartCurrentRow.partDesc">
</oss-components>
</el-tab-pane> </el-tab-pane>
<!-- 询价明细 报价记录页签 --> <!-- 询价明细 报价记录页签 -->
<el-tab-pane label="报价记录" name="inquiryPartQuotation"> <el-tab-pane label="报价记录" name="inquiryPartQuotation">
<el-table
:height="height - 300"
:data="inquiryQuotationDataList"
border
style="width: 100%;">
<el-table-column
v-for="(item,index) in columnQuotationList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<div v-if="item.columnProp !== 'textValue' && item.columnProp !== 'numValue'">
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
</div>
<div v-else>
{{ scope.row.textValue ? scope.row.textValue : scope.row.numValue }}
</div>
</template>
</el-table-column>
<el-table-column
fixed="left"
header-align="center"
align="center"
width="80"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="handleQuotationRequest(scope.row)">报价详情</a>
</template>
</el-table-column>
</el-table>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
@ -298,16 +338,20 @@ import Chooselist from '@/views/modules/common/Chooselist_eam'
import {getSiteAndBuByUserName} from "../../../api/qc/qc"; import {getSiteAndBuByUserName} from "../../../api/qc/qc";
import {searchInquiryApplicationInfo,addInquiryApplicationInfo,updateInquiryApplicationInfo,deleteInquiryApplicationInfo} from "@/api/inquiry/inquiryApplication"; import {searchInquiryApplicationInfo,addInquiryApplicationInfo,updateInquiryApplicationInfo,deleteInquiryApplicationInfo} from "@/api/inquiry/inquiryApplication";
import {searchInquiryDetailInfo,addInquiryDetailInfo,updateInquiryDetailInfo,deleteInquiryDetailInfo} from "@/api/inquiry/inquiryDetail"; import {searchInquiryDetailInfo,addInquiryDetailInfo,updateInquiryDetailInfo,deleteInquiryDetailInfo} from "@/api/inquiry/inquiryDetail";
import {getItemListByInquiryPartAndCodeNo,updateInquiryPartItemList,searchInquiryDetailHeaderInfo} from "@/api/inquiry/inquiryDetail";
import {getItemListByInquiryPartAndCodeNo,updateInquiryPartItemList,searchInquiryDetailHeaderInfo,searchQuotationRecordInfo} from "@/api/inquiry/inquiryDetail";
import DictDataSelect from "../sys/dict-data-select.vue"; import DictDataSelect from "../sys/dict-data-select.vue";
import OssComponents from "../oss/ossComponents.vue";
import {queryCustomerList} from "@/api/customer/customer"; import {queryCustomerList} from "@/api/customer/customer";
import {verifyData} from "@/api/part/partInformation"; import {verifyData} from "@/api/part/partInformation";
import {EventBus} from "../../../main"; import {EventBus} from "../../../main";
import TableColumn from "../../common/table.vue";
export default { export default {
components: { components: {
TableColumn,
DictDataSelect, DictDataSelect,
Chooselist
Chooselist,
OssComponents
}, },
computed: { computed: {
statusDisplay() { statusDisplay() {
@ -319,6 +363,12 @@ export default {
}, },
data() { data() {
return { return {
//
exportData: [],
exportName: '询价明细' + this.dayjs().format('YYYYMMDDHHmmss'),
exportHeader: ['询价明细'],
exportFooter: [],
resultList: [],
userBuList: [], userBuList: [],
// ======== ======== // ======== ========
pageIndex: 1, pageIndex: 1,
@ -352,6 +402,7 @@ export default {
// ======== ======== // ======== ========
dataList: [], dataList: [],
inquiryPartItemDataList: [], inquiryPartItemDataList: [],
inquiryQuotationDataList: [],
// ======== ======== // ======== ========
columnList: [ columnList: [
{ {
@ -815,6 +866,370 @@ export default {
// columnWidth: 70, // columnWidth: 70,
// }, // },
], ],
columnQuotationList: [
{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table1BuDesc',
tableId: '5011Table1',
tableName: '报价信息表',
columnProp: 'buDesc',
headerAlign: 'center',
align: 'center',
columnLabel: 'BU',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table1QuoteVersionNo',
tableId: '5011Table1',
tableName: '报价信息表',
columnProp: 'quoteVersionNo',
headerAlign: 'center',
align: 'center',
columnLabel: '报价单号',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 180
},
{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table1QuoteDate',
tableId: '5011Table1',
tableName: '报价信息表',
columnProp: 'quoteDate',
headerAlign: 'center',
align: 'center',
columnLabel: '报价日期',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table1CustomerNo',
tableId: '5011Table1',
tableName: '报价信息表',
columnProp: 'customerNo',
headerAlign: 'center',
align: 'center',
columnLabel: '客户编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table1CustomerDesc',
tableId: '5011Table1',
tableName: '报价信息表',
columnProp: 'customerDesc',
headerAlign: 'center',
align: 'left',
columnLabel: '客户名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table1QuoterName',
tableId: '5011Table1',
tableName: '报价信息表',
columnProp: 'quoterName',
headerAlign: 'center',
align: 'left',
columnLabel: '报价专员',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table1PurchaseName',
tableId: '5011Table1',
tableName: '报价信息表',
columnProp: 'purchaseName',
headerAlign: 'center',
align: 'left',
columnLabel: '采购专员',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table1Currency',
tableId: '5011Table1',
tableName: '报价信息表',
columnProp: 'currency',
headerAlign: 'center',
align: 'center',
columnLabel: '货币',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table1Status',
tableId: '5011Table1',
tableName: '报价信息表',
columnProp: 'status',
headerAlign: 'center',
align: 'center',
columnLabel: '状态',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table1CustomerInquiryNo',
tableId: '5011Table1',
tableName: '报价信息表',
columnProp: 'customerInquiryNo',
headerAlign: 'center',
align: 'center',
columnLabel: '客户报价单号',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table1InsideInquiryNo',
tableId: '5011Table1',
tableName: '报价信息表',
columnProp: 'insideInquiryNo',
headerAlign: 'center',
align: 'center',
columnLabel: '内部询价单号',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table1CreateBy',
tableId: '5011Table1',
tableName: '报价信息表',
columnProp: 'createBy',
headerAlign: 'center',
align: 'center',
columnLabel: '创建人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table1CreateDate',
tableId: '5011Table1',
tableName: '报价信息表',
columnProp: 'createDate',
headerAlign: 'center',
align: 'center',
columnLabel: '创建时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 130
},
{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table1UpdateBy',
tableId: '5011Table1',
tableName: '报价信息表',
columnProp: 'updateBy',
headerAlign: 'center',
align: 'center',
columnLabel: '更新人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table1UpdateDate',
tableId: '5011Table1',
tableName: '报价信息表',
columnProp: 'updateDate',
headerAlign: 'center',
align: 'center',
columnLabel: '更新时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 130
},
],
ossColumns:[
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table2FileName',
tableId: '103001Table2',
tableName: '文件信息表',
columnProp: 'fileName',
headerAlign: 'center',
align: 'center',
columnLabel: '文件名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 140
},
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table2FileRemark',
tableId: '103001Table2',
tableName: '文件信息表',
columnProp: 'fileRemark',
headerAlign: 'center',
align: 'center',
columnLabel: '备注',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 240
},
// {
// userId: this.$store.state.user.name,
// functionId: 103001,
// serialNumber: '103001Table2OrderRef3',
// tableId: '103001Table2',
// tableName: '',
// columnProp: 'orderRef3',
// headerAlign: 'center',
// align: 'center',
// columnLabel: '',
// columnHidden: false,
// columnImage: false,
// columnSortable: false,
// sortLv: 0,
// status: true,
// fixed: '',
// columnWidth: 120
// },
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table2CreateDate',
tableId: '103001Table2',
tableName: '文件信息表',
columnProp: 'createDate',
headerAlign: 'center',
align: 'center',
columnLabel: '上传时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 140
},
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table2CreatedBy',
tableId: '103001Table2',
tableName: '文件信息表',
columnProp: 'createdBy',
headerAlign: 'center',
align: 'center',
columnLabel: '上传人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 140
}
],
// ======== ======== // ======== ========
inquiryPartCurrentRow: {}, inquiryPartCurrentRow: {},
} }
@ -914,6 +1329,9 @@ export default {
if (this.activeTable === 'inquiryPartItem') { if (this.activeTable === 'inquiryPartItem') {
this.getItemListByInquiryPartAndCodeNo() this.getItemListByInquiryPartAndCodeNo()
} }
if (this.activeTable === 'inquiryPartQuotation') {
this.getQuotationDataList()
}
}, },
// ======== chooseList ======== // ======== chooseList ========
@ -1070,11 +1488,86 @@ export default {
}) })
}, },
getQuotationDataList(){
let inData = {
site : this.inquiryPartCurrentRow.site,
rfqNo : this.inquiryPartCurrentRow.rfqNo,
testPartId : this.inquiryPartCurrentRow.testPartId
}
searchQuotationRecordInfo(inData).then(({data}) => {
if (data && data.code === 0) {
this.inquiryQuotationDataList = data.rows;
} else {
this.$message.warning(data.msg)
}
}).catch((error) => {
this.$message.error(error)
})
},
handleQuotationRequest(row) {
// array
let ids = [row.id]
this.$router.push({
name:'quote-index',
params:{
ids:ids
}
})
},
rowStyle({row}) { rowStyle({row}) {
if (this.inquiryPartCurrentRow.id === row.id) { if (this.inquiryPartCurrentRow.id === row.id) {
return {'background-color': '#E8F7F6', cursor: 'pointer'}; return {'background-color': '#E8F7F6', cursor: 'pointer'};
} }
}, },
// ======== ========
/**
* 导出excel
*/
async createExportData() {
this.searchData.limit = -1
this.searchData.page = 1
await searchInquiryDetailHeaderInfo(this.searchData).then(({data}) => {
this.resultList = data.page.list
// dataList -
this.resultList.forEach((item) => {
if (item.status === 'A') {
item.status = '已报价'
} else if (item.status === 'B') {
item.status = '已下达'
} else if (item.status === 'C') {
item.status = '草稿'
}
if (item.priorityLevel === 'A') {
item.priorityLevel = '普通'
} else if (item.priorityLevel === ' B') {
item.priorityLevel = '重要'
} else if (item.priorityLevel === ' C') {
item.priorityLevel = '紧急'
}
})
})
return this.resultList
},
startDownload() {
},
finishDownload() {
},
fields() {
let json = '{'
this.columnList.forEach((item, index) => {
if (index == this.columnList.length - 1) {
json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"'
} else {
json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"' + ','
}
})
json += '}'
let s = eval('(' + json + ')')
return s
},
} }
} }

360
src/views/modules/oss/ossComponents.vue

@ -0,0 +1,360 @@
<script>
import {ossUpload, previewOssFileById, queryOss, removeOss} from "../../../api/oss/oss";
export default {
name: "ossComponents",
props:{
orderRef1:{
type:String,
default:''
},
orderRef2:{
type:[Number,String],
default:''
},
orderRef3:{
type:String,
default:''
},
rfqNo:{
type:String,
default:''
},
partNo:{
type:String,
default:''
},
partDesc:{
type:String,
default:''
},
columns:{
type:Array,
required:true
},
height:{
type:[String,Number],
default:'35vh'
},
title:{
type:String,
default:'附件信息'
},
label:{
type:String,
default:'单号'
},
disabled:{
type:Boolean,
default:false
},
},
data(){
return{
dataList:[],
queryLoading:false,
uploadLoading:false,
selectionDataList:[],
ossVisible:false,
ossForm:{
orderRef2:'',
orderRef3:'',
rfqNo:'',
partNo:'',
partDesc:'',
remark:''
},
fileList:[],
}
},
methods:{
handleSelectionChange(val){
this.selectionDataList = val
},
handleQuery(){
if (!this.params.orderRef1 && !this.params.orderRef2){
return;
}
let params = {
...this.params,
}
this.queryLoading = true;
queryOss(params).then(({data})=>{
if (data && data.code === 0){
this.dataList = data.rows;
}else {
this.$message.warning(data.msg);
}
this.queryLoading = false;
}).catch((error)=>{
this.$message.error(error);
this.queryLoading = false;
})
},
handleUpload(){
this.$nextTick(()=>{
if (this.$refs.upload){
this.$refs.upload.clearFiles();
}
})
this.fileList = [];
this.ossForm.remark = '';
this.ossVisible = true
},
onRemoveFile(file, fileList){
this.fileList = fileList
},
onChangeFile(file, fileList){
this.fileList = fileList
},
handleUploadFiles(){
if (this.fileList.length === 0){
this.$message.error('请选择文件');
return;
}
let formData = new FormData();
for (let i = 0; i < this.fileList.length; i++) {
formData.append('file', this.fileList[i].raw);
}
formData.append('orderRef1', this.orderRef1);
formData.append('orderRef2', this.ossForm.orderRef2);
formData.append('orderRef3', this.orderRef3);
formData.append('createdBy', this.$store.state.user.name);
formData.append('fileRemark', this.ossForm.remark);
this.uploadLoading = true;
ossUpload(formData).then(({data})=>{
if (data && data.code === 0){
this.$message.success(data.msg);
this.handleQuery();
this.ossVisible = false;
}else {
this.$message.warning(data.msg);
}
this.uploadLoading = false;
}).catch((error)=>{
this.$message.error(error);
this.uploadLoading = false;
})
},
handleRemove(row){
this.$confirm('确认删除吗?', '提示').then(() => {
let ids = [row.id]
removeOss(ids).then(({data})=>{
if (data && data.code === 0){
this.$message.success(data.msg);
this.handleQuery();
}else {
this.$message.warning(data.msg);
}
}).catch((error)=>{
this.$message.error(error);
})
}).catch(()=>{
})
},
previewFile(row){
console.log(row)
//
let type = '';
let image = ['jpg', 'jpeg', 'png', 'gif', 'bmp'];
if (image.includes(row.fileType.toLowerCase())){
type = 'image/' + row.fileType;
}
let video = ['mp4', 'avi', 'mov', 'wmv', 'flv'];
if (video.includes(row.fileType.toLowerCase())){
type = 'video/' + row.fileType;
}
let txt = ['txt'];
if (txt.includes(row.fileType.toLowerCase())){
type = 'text/plain;charset=utf-8';
}
let office = ['doc', 'ppt', 'pptx'];
if (office.includes(row.fileType.toLowerCase())){
this.$message.warning(`该文件格式暂不支持预览`)
return
}
let excel = ['xlsx','xls'];
if (excel.includes(row.fileType.toLowerCase())){
type = row.fileType.toLowerCase();
}
let word = ['docx'];
if (word.includes(row.fileType.toLowerCase())){
type = 'docx'
}
let pdf = ['pdf'];
if (pdf.includes(row.fileType.toLowerCase())){
type = 'application/pdf;charset-UTF-8';
}
if (type === ''){
this.$message.warning(`该文件格式暂不支持预览`)
return;
}
let params = {
id:row.id,
}
previewOssFileById(params).then(({data}) => {
const blob = new Blob([data], { type: type });
// URL
const fileURL = URL.createObjectURL(blob);
if (type === 'xls' || type === 'docx' || type === 'xlsx'){
const { href } = this.$router.resolve({
name: 'pre',
query:{
src: fileURL,
type:type
}
})
window.open(href, '_blank')
}else {
//
const newTab = window.open(fileURL, '_blank');
}
});
},
handleDownload(){
if (this.selectionDataList.length === 0){
this.$message.warning('请选择要下载的附件');
return;
}
for (let i = 0; i < this.selectionDataList.length; i++) {
let params = {
id:this.selectionDataList[i].id,
}
previewOssFileById(params).then((response) => {
const blob = new Blob([response.data], { type: response.headers['content-type'] });
const link = document.createElement('a');
link.href = URL.createObjectURL(blob);
link.setAttribute('download', this.selectionDataList[i].fileName);
link.target = '_blank'; //
link.click();
URL.revokeObjectURL(link.href);
this.$refs.table.clearSelection();
});
}
}
},
computed:{
params:{
get(){
return{
orderRef1:this.orderRef1,
orderRef2:this.orderRef2,
orderRef3:this.orderRef3,
}
}
}
},
watch:{
params:{
handler(){
this.ossForm.orderRef2 = this.orderRef2;
this.ossForm.orderRef3 = this.orderRef3;
this.ossForm.rfqNo = this.rfqNo;
this.ossForm.partNo = this.partNo;
this.ossForm.partDesc = this.partDesc;
this.dataList = [];
this.handleQuery();
}
}
}
}
</script>
<template>
<div>
<el-button type="primary" v-if="this.orderRef1 && this.orderRef2 && !disabled" @click="handleUpload">上传附件</el-button>
<el-button type="primary" @click="handleDownload">下载</el-button>
<el-table
:height="height"
:data="dataList"
ref="table"
v-loading="queryLoading"
border
@selection-change="handleSelectionChange"
style="width: 100%;margin-top: 5px">
<el-table-column type="selection" label="序号" align="center"/>
<el-table-column
v-for="(item,index) in columns" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed===''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="120"
label="操作">
<template slot-scope="{row,$index}">
<el-link style="cursor:pointer;" v-if="!disabled" @click="handleRemove(row)">删除</el-link>
<el-link style="cursor:pointer;" @click="previewFile(row)">预览</el-link>
</template>
</el-table-column>
</el-table>
<el-dialog :title="title" :visible.sync="ossVisible" v-drag width="400px" append-to-body :close-on-click-modal="false">
<el-form ref="form" :model="ossForm" label-width="80px" label-position="top">
<el-row :gutter="10">
<el-col :span="8">
<el-form-item label="询价单号">
<el-input v-model="ossForm.rfqNo" readonly></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="产品编码">
<el-input v-model="ossForm.partNo" readonly></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="产品描述">
<el-input v-model="ossForm.partDesc" readonly></el-input>
</el-form-item>
</el-col>
<slot></slot>
<el-col :span="24">
<el-form-item label=" " class="auto">
<el-upload drag :file-list="fileList"
action="#" ref="upload"
:on-remove="onRemoveFile"
:on-change="onChangeFile"
multiple
:auto-upload="false">
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
</el-upload>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" class="auto">
<el-input type="textarea" v-model="ossForm.remark" resize="none" :autosize="{minRows: 3, maxRows: 3}"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" :loading="uploadLoading" @click="handleUploadFiles">确定</el-button>
<el-button @click="ossVisible = false">关闭</el-button>
</span>
</el-dialog>
</div>
</template>
<style scoped>
.auto /deep/ .el-form-item__content{
height: auto;
line-height: 1.5;
}
</style>
Loading…
Cancel
Save