Browse Source

与后台对接厂家系统认款,完善相关功能

master
yunuo970428 3 years ago
parent
commit
2fbef7ad14
  1. 1
      anrui-scm/anrui-scm-ui/src/api/Common/Upload.js
  2. 21
      anrui-scm/anrui-scm-ui/src/api/supplychain/manufacturers.js
  3. 242
      anrui-scm/anrui-scm-ui/src/components/uploadFileimg/upload.vue
  4. 159
      anrui-scm/anrui-scm-ui/src/views/supplychain/changjiaxitong/manufacturers.vue

1
anrui-scm/anrui-scm-ui/src/api/Common/Upload.js

@ -8,3 +8,4 @@ export function imageUpload(data){
headers:{'Content-Type':'multipart/form-data'}
})
}
export const uploadFile = '/api/base/v1/basemanufactorsubscription/pictureUpload'

21
anrui-scm/anrui-scm-ui/src/api/supplychain/manufacturers.js

@ -0,0 +1,21 @@
import request from '@/utils/request'
export default {
// 查询分页列表
listPage: function(data) {
return request({
url: '/base/v1/basemanufactorsubscription/listPage',
method: 'post',
data: data,
headers: { 'Content-Type': 'application/json' }
})
},
adopt: function(data, sid, remarks) {
return request({
url: '/base/v1/basemanufactorsubscription/adopt/' + sid + '/' + remarks,
method: 'post',
data: data,
headers: { 'Content-Type': 'application/json' }
})
},
}

242
anrui-scm/anrui-scm-ui/src/components/uploadFileimg/upload.vue

@ -0,0 +1,242 @@
<template>
<div><!---->
<el-upload class="upload-demo" :headers="accessToken" :action="uploadFile" :accept="accept" :data="uploadData"
:on-success="uploadImgSuccess_FuJian" :on-remove="handleRemove" :file-list="fileList_FuJian"
:on-preview="handlePictureCardPreview" :show-file-list="false">
<el-button size="mini" type="primary">上传</el-button>
</el-upload>
</div>
</template>
<script>
import { uploadFile } from '@/api/Common/Upload'
import { getStorage } from '@/utils/auth.js' //token
import {
SaveList
} from '@/api/cheliang/basevehiclemodel'
import { mapGetters } from 'vuex'
export default {
model: {
prop: 'name',
event: 'change'
},
props: {
placeholder: {
type: String,
default: ''
},
bucket: {
type: String,
default: 'abc'
},
//
width: {
type: String,
default: '270px'
},
limit: {
type: Number,
default: 1
},
accept: {
type: String,
default:
'.jpg,.jpeg,.png,.bmp,.pdf,.JPG,.JPEG,.BMP,.PDF,.xls,.docx,.xlsx,.ppt,.pptx'
},
//
name: {
type: Array,
required: true
},
uploadData: {
type: Object,
default: {}
}
},
data() {
return {
dialogImageUrl: '',
dialogVisible: false,
accessToken: null,
uploadFile: uploadFile,
fileList_FuJian: [],
enclosure: '',
file_add: '',
file_catch: '',
files: [],
files_list: [],
filedUrl: '',
// fileUrl: fileUrl,
// showpicture:false,
isview: false,
nameArr: '',
loadding: false,
stateName: '',
/* uploadData: { modelSid: '' },*/
sid: ''
}
},
computed: {
...mapGetters([
'id',
'departmentCode',
'departmentLevel',
'departmentType',
'token'
])
},
watch: {
name: {
deep: true,
immediate: true,
handler(newVal, oldVal) {
console.log('aaaa1', newVal)
this.files = newVal
console.log('aaaa2', this.files)
}
}
},
mounted() {
this.$nextTick(() => {
this.Init()
})
},
created() {
this.uploadFile = uploadFile //
this.accessToken = {
token: getStorage()
}
},
methods: {
view() {
// window.open(this.filedUrl)
},
showImg(sid) {
// this.uploadData.sid = sid
},
//
Init() {
if (this.name !== undefined) {
this.files = []
for (var i = 0; i < this.name.length; i++) {
this.files.push({
name: this.name[i],
url: this.name[i]
})
}
}
},
// --
uploadImgSuccess_FuJian(response, file, fileList) {
let _this = this
console.log('您选择的file:', file)
// console.log('data:', _this.uploadData)
if (file.response.code === '200') {
this.loadding = false
//
this.filedUrl = this.fileUrl + file.response.data
// var uid = file.response.data
this.files.push({
name: file.response.data.sourceFileName,
url: file.response.data.fullUrl,
size: file.response.data.size
})
this.$emit('change', this.files)
this.$emit('eett', this.files)
// this.getUrl()
// SaveList(this.tempInfo).then(response => {
// if (response.success) {
// }
// })
}
},
removeImage(file, ImageFileList) {
this.files.splice(this.files.indexOf(file), 1)
const imgFiles = []
this.files.forEach((o) => {
imgFiles.push(o.url)
})
this.$emit('fileChange', this.files)
},
handleRemove(file, fileList) {
console.log('file:' + JSON.stringify(file))
console.log('fileList:' + JSON.stringify(fileList))
this.enclosure = ''
// 1. id(this.file_add)
this.getNewFileId(fileList)
// 2. id(this.file_catch)
this.getCatchFileId(file)
// 3. id
this.getFileId()
// 4. id
this.$emit('change', this.enclosure)
},
// this.file_add(id)
getNewFileId(fileList) {
// debugger
this.file_add = ''
for (var i = 0; i < fileList.length; i++) {
if (fileList[i].response && fileList[i].response.code === '200') {
this.file_add = this.file_add + fileList[i].response.data + ','
}
}
if (this.file_add !== '') {
this.file_add = this.file_add.substring(0, this.file_add.length - 1)
}
// console.log('1. this.file_add: ' + this.file_add)
},
// this.file_catchid
getCatchFileId(file) {
for (var i = 0; i < this.files_list.length; i++) {
if (this.file_catch !== '') {
// 1. id
if (this.files_list[i].name === file.name) {
// 2. file_catchfils_arry
var fils_arry = this.file_catch.split(',')
// 3. fils_arry this.files_list[i].id
var arry = []
fils_arry.forEach((element) => {
//
if (element !== this.files_list[i].id) {
arry.push(element)
}
})
// 4. file_catch
this.file_catch = arry.join(',')
}
}
}
// console.log('2. this.file_catch:' + this.file_catch)
},
// id
getFileId() {
// console.log('3. this.file_catch:' + this.file_catch + ',this.file_add:' + this.file_add)
if (this.file_catch !== '') {
if (this.file_add !== '') {
this.enclosure = this.file_catch + ',' + this.file_add
} else {
this.enclosure = this.file_catch
}
} else {
this.enclosure = this.file_add
}
},
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url
},
//
uploadError() {
this.loadding = false
},
uploadProgrees(event, file, fileList) {
if (Number(event.percent) > 0) {
this.loadding = true
}
}
}
}
</script>
<style lang="scss" scoped></style>

159
anrui-scm/anrui-scm-ui/src/views/supplychain/changjiaxitong/manufacturers.vue

@ -9,26 +9,26 @@
<div v-show="isSearchShow" class="search">
<el-form ref="listQueryform" :inline="true" :model="listQuery" label-width="100px" class="tab-header">
<el-form-item label="状态">
<el-select v-model="listQuery.params.vehicleType" placeholder="请选择" clearable class="addinputw">
<el-option v-for="item in vehicleFunction_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/>
<el-select v-model="listQuery.params.state" placeholder="请选择" clearable class="addinputw">
<el-option v-for="item in state_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/>
</el-select>
</el-form-item>
<el-form-item label="打款状态">
<el-select v-model="listQuery.params.productLine" placeholder="请选择" clearable class="addinputw">
<el-option v-for="item in productLine_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/>
<el-select v-model="listQuery.params.paymentState" placeholder="请选择" clearable class="addinputw">
<el-option v-for="item in paymentState_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/>
</el-select>
</el-form-item>
<el-form-item label="入库时间">
<div class="block" style="float: left;">
<el-date-picker v-model="listQuery.params.warehousingStartTime" type="date" clearable value-format="yyyy-MM-dd" placeholder="选择日期"/>
<el-date-picker v-model="listQuery.params.subscriptionStartDate" type="date" clearable value-format="yyyy-MM-dd" placeholder="选择日期"/>
</div>
<div style="float: left;margin: 0px 10px"></div>
<div class="block" style="float: left;">
<el-date-picker v-model="listQuery.params.warehousingEndTime" type="date" clearable value-format="yyyy-MM-dd" placeholder="选择日期"/>
<el-date-picker v-model="listQuery.params.subscriptionEndDate" type="date" clearable value-format="yyyy-MM-dd" placeholder="选择日期"/>
</div>
</el-form-item>
<el-form-item label="排产申请编号">
<el-input v-model="listQuery.params.mNum" placeholder="请输入排产申请编号" clearable/>
<el-input v-model="listQuery.params.proSchAppNo" placeholder="请输入排产申请编号" clearable/>
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
@ -46,39 +46,39 @@
<el-table-column width="80px" label="序号" type="index" :index="indexMethod" align="center"/>
<el-table-column label="操作" width="100px" align="center">
<template slot-scope="scope">
<el-button type="success" size="mini">通过</el-button>
<el-button type="success" size="mini" v-show="scope.row.isShowAdopt == 1" @click="handPass(scope.row)">通过</el-button>
</template>
</el-table-column>
<el-table-column label="状态" width="140px" align="center">
<template slot-scope="scope">
<span>{{ scope.row.vehicleVersion }}</span>
<span>{{ scope.row.state == '0' ? '未认款' : '已认款' }}</span>
</template>
</el-table-column>
<el-table-column label="排产申请编号" align="center">
<el-table-column label="排产申请编号" align="center" width="150px">
<template slot-scope="scope">
<span>{{ scope.row.engineTypeValue }}</span>
<span>{{ scope.row.proSchAppNo }}</span>
</template>
</el-table-column>
<el-table-column label="打款状态" align="center" width="150px">
<template slot-scope="scope">
<span>{{ scope.row.vehicleTypeCode }}</span>
<span>{{ scope.row.paymentState == '0' ? '未打款' : scope.row.paymentState == '1' ? '已打款' : '无需打款'}}</span>
</template>
</el-table-column>
<el-table-column label="认款日期" align="center" width="180px">
<template slot-scope="scope">
<span>{{ scope.row.vehicleTypeCode }}</span>
<span>{{ scope.row.subscriptionDate }}</span>
</template>
</el-table-column>
<el-table-column label="认款人" align="center" width="130px">
<template slot-scope="scope">
<span>{{ scope.row.vehicleTypeCode }}</span>
<span>{{ scope.row.subscriptionPeo }}</span>
</template>
</el-table-column>
<el-table-column label="见证材料" align="center" width="180px" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="primary" @click="handleGetCheck(scope.row)">查看</el-button>
<div class="upload_img">
<upload ref="uploadMoreImg" v-model="imgList" :limit="1" bucket="map" @eett="getList" :upload-data="{type:'0001',modelSid: scope.row.sid}"></upload>
<div class="upload_img" v-show="scope.row.isShowAdopt == 1">
<upload ref="uploadMoreImg" v-model="imgList" :limit="1" bucket="map" @eett="getList" :upload-data="{type:'0001',sid: scope.row.sid}"></upload>
</div>
</template>
</el-table-column>
@ -97,18 +97,19 @@
</div>
<!-- End 列表页面 -->
<!-- 照片弹窗 -->
<el-dialog title="查看" :visible.sync="dialogImgVisible">
<el-image v-for="item in srcList" style="width: 100px; height: 100px" :src="item" :preview-src-list="srcList"></el-image>
<el-dialog :append-to-body="true" :visible.sync="dialogImgVisible">
<img :src="dialogImageUrl" alt="" />
</el-dialog>
</div>
</template>
<script>
import { pagerList, pullDown } from '@/api/cheliang/basevehiclemodel'
import req from '@/api/supplychain/manufacturers'
import { getPathSidByUserSid } from '@/api/cheliang/dictcommons'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import ButtonBar from '@/components/ButtonBar'
import upload from '@/components/uploadFile/upload_chexing'
import upload from '@/components/uploadFileimg/upload'
export default {
name: 'changjiaxitongrenkuan',
@ -133,34 +134,51 @@ export default {
isSearchShow: false,
searchxianshitit: '显示查询条件',
dialogImgVisible: false,
dialogFileVisible: false,
// -----------
tableKey: 0,
list: [],
srcList: [],
vehicleFunction_list: [], //
productLine_list: [], //
state_list: [
{
dictKey: 0,
dictValue: '未认款'
},
{
dictKey: 1,
dictValue: '已认款'
}
],
paymentState_list: [
{
dictKey: 0,
dictValue: '未打款'
},
{
dictKey: 1,
dictValue: '已打款'
},
{
dictKey: 2,
dictValue: '无需打款'
}
],
FormLoading: false,
listLoading: false,
listQuery: {
params: {
carBrand: '',
vehicleType: '',
productLine: '',
driveForm: '',
power: '',
vehicleVersion: '',
fuelType: '',
vehicleTypeCode: '',
gearboxType: '',
emissionStandard: '',
engineType: '',
marketSegments: '',
specifications: ''
state: 0,
paymentState: '',
subscriptionStartDate: '',
subscriptionEndDate: '',
proSchAppNo: '',
createOrgSid: ''
},
current: 1,
size: 10,
total: 0
},
dialogImageUrl: '',
imgList: [],
rules: {}
}
@ -168,8 +186,7 @@ export default {
created() {
//
this.init()
//
this.getList()
// this.getList()
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
@ -187,21 +204,6 @@ export default {
btnHandle(btnKey) {
console.log('XXXXXXXXXXXXXXX ' + btnKey)
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'toEdit':
this.toEdit()
break
case 'doDel':
this.doDel()
break
case 'doImport':
this.doImport()
break
case 'doExport':
this.doExport()
break
case 'doClose':
this.doClose()
break
@ -210,22 +212,11 @@ export default {
}
},
init() {
// -
pullDown({
type: 'vehicleFunction'
}).then((res) => {
if (res.code === '200') {
this.vehicleFunction_list = res.data
console.log('下拉框请求功能', res.data)
}
})
// -
pullDown({
type: 'driver'
}).then((res) => {
if (res.code === '200') {
this.driveForm_list = res.data
console.log('下拉框请求驱动', res.data)
getPathSidByUserSid({ userSid: window.sessionStorage.getItem('userSid') }).then((res) => {
if (res.success) {
this.listQuery.params.createOrgSid = res.data
this.getList()
console.log(this.listQuery.params.createOrgSid)
}
})
},
@ -238,7 +229,7 @@ export default {
//
getList() {
this.listLoading = true
pagerList(this.listQuery).then((response) => {
req.listPage(this.listQuery).then((response) => {
console.log('列表查询结果:', response)
this.listLoading = false
if (
@ -262,28 +253,30 @@ export default {
handleReset() {
this.listQuery = {
params: {
carBrand: '',
vehicleType: '',
productLine: '',
driveForm: '',
power: '',
vehicleVersion: '',
fuelType: '',
vehicleTypeCode: '',
gearboxType: '',
emissionStandard: '',
engineType: '',
marketSegments: '',
specifications: ''
state: 0,
paymentState: '',
subscriptionStartDate: '',
subscriptionEndDate: '',
proSchAppNo: '',
createOrgSid: ''
},
current: 1,
size: 10,
total: 0
}
this.getList()
this.init()
},
handPass(row) {
req.adopt({ sid: row.sid, remarks: row.remarks }, row.sid, row.remarks).then((res) => {
if (res.success) {
this.init()
this.$message({ showClose: true, type: 'success', message: '操作成功' })
}
})
},
handleGetCheck(row) {
this.dialogImgVisible = true
this.dialogImageUrl = row.witMatUrl
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)

Loading…
Cancel
Save