|
@@ -255,8 +255,8 @@
|
|
|
} from 'vuex'
|
|
} from 'vuex'
|
|
|
import api from '@/api/oilsupplier/goodsaptitude'
|
|
import api from '@/api/oilsupplier/goodsaptitude'
|
|
|
import setapi from '@/api/oilsupplier/oilclassorgset'
|
|
import setapi from '@/api/oilsupplier/oilclassorgset'
|
|
|
- import FileSaver from "file-saver";
|
|
|
|
|
- import XLSX from "xlsx";
|
|
|
|
|
|
|
+ import FileSaver from 'file-saver';
|
|
|
|
|
+ import XLSX from 'xlsx';
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
computed: {
|
|
computed: {
|
|
@@ -266,7 +266,7 @@
|
|
|
},
|
|
},
|
|
|
name: 'oilgoodsaptitude',
|
|
name: 'oilgoodsaptitude',
|
|
|
|
|
|
|
|
- data() {
|
|
|
|
|
|
|
+ data () {
|
|
|
return {
|
|
return {
|
|
|
codeeditshow: false,
|
|
codeeditshow: false,
|
|
|
classid: '',
|
|
classid: '',
|
|
@@ -299,7 +299,7 @@
|
|
|
Code3: '',
|
|
Code3: '',
|
|
|
Name3: '',
|
|
Name3: '',
|
|
|
Code4: '',
|
|
Code4: '',
|
|
|
- Name4: '',
|
|
|
|
|
|
|
+ Name4: ''
|
|
|
},
|
|
},
|
|
|
// 查询时间
|
|
// 查询时间
|
|
|
CreateOn: [],
|
|
CreateOn: [],
|
|
@@ -490,10 +490,10 @@
|
|
|
AuditStepOptions: []
|
|
AuditStepOptions: []
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- created() {
|
|
|
|
|
|
|
+ created () {
|
|
|
// 查询条件初始值备份
|
|
// 查询条件初始值备份
|
|
|
Object.assign(this.searchFormReset, this.searchForm)
|
|
Object.assign(this.searchFormReset, this.searchForm)
|
|
|
- //初始化部分表头
|
|
|
|
|
|
|
+ // 初始化部分表头
|
|
|
this.initTableHeader()
|
|
this.initTableHeader()
|
|
|
|
|
|
|
|
// 查询列表
|
|
// 查询列表
|
|
@@ -502,19 +502,19 @@
|
|
|
this.getDictOptions()
|
|
this.getDictOptions()
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- Name1Change(val) {
|
|
|
|
|
|
|
+ Name1Change (val) {
|
|
|
this.formData.Code2 = this.formData.Code2.replace(/^(\w{0})\w{2}(.*)$/, '$1' + val + '$2')
|
|
this.formData.Code2 = this.formData.Code2.replace(/^(\w{0})\w{2}(.*)$/, '$1' + val + '$2')
|
|
|
this.formData.Code3 = this.formData.Code3.replace(/^(\w{0})\w{2}(.*)$/, '$1' + val + '$2')
|
|
this.formData.Code3 = this.formData.Code3.replace(/^(\w{0})\w{2}(.*)$/, '$1' + val + '$2')
|
|
|
this.formData.Code4 = this.formData.Code4.replace(/^(\w{0})\w{2}(.*)$/, '$1' + val + '$2')
|
|
this.formData.Code4 = this.formData.Code4.replace(/^(\w{0})\w{2}(.*)$/, '$1' + val + '$2')
|
|
|
},
|
|
},
|
|
|
- Name2Change(val) {
|
|
|
|
|
|
|
+ Name2Change (val) {
|
|
|
this.formData.Code3 = this.formData.Code3.replace(/^(\w{0})\w{4}(.*)$/, '$1' + val + '$2')
|
|
this.formData.Code3 = this.formData.Code3.replace(/^(\w{0})\w{4}(.*)$/, '$1' + val + '$2')
|
|
|
this.formData.Code4 = this.formData.Code4.replace(/^(\w{0})\w{4}(.*)$/, '$1' + val + '$2')
|
|
this.formData.Code4 = this.formData.Code4.replace(/^(\w{0})\w{4}(.*)$/, '$1' + val + '$2')
|
|
|
},
|
|
},
|
|
|
- Name3Change(val) {
|
|
|
|
|
|
|
+ Name3Change (val) {
|
|
|
this.formData.Code4 = this.formData.Code4.replace(/^(\w{0})\w{6}(.*)$/, '$1' + val + '$2')
|
|
this.formData.Code4 = this.formData.Code4.replace(/^(\w{0})\w{6}(.*)$/, '$1' + val + '$2')
|
|
|
},
|
|
},
|
|
|
- CodeNameEdit(val) {
|
|
|
|
|
|
|
+ CodeNameEdit (val) {
|
|
|
this.myclassid = val.ClassId
|
|
this.myclassid = val.ClassId
|
|
|
this.$axios.get('goodsaptitudeclass/getcodename/' + val.Code, {})
|
|
this.$axios.get('goodsaptitudeclass/getcodename/' + val.Code, {})
|
|
|
.then(res => {
|
|
.then(res => {
|
|
@@ -526,59 +526,59 @@
|
|
|
console.log(err)
|
|
console.log(err)
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- codeedit() {
|
|
|
|
|
|
|
+ codeedit () {
|
|
|
api.updateCodeEntity(this.myclassid, this.formData, this.$axios).then(res => {
|
|
api.updateCodeEntity(this.myclassid, this.formData, this.$axios).then(res => {
|
|
|
if (res.data.code === 0) {
|
|
if (res.data.code === 0) {
|
|
|
- //保存成功后,初始化数据,变成修改
|
|
|
|
|
|
|
+ // 保存成功后,初始化数据,变成修改
|
|
|
this.codeeditshow = false
|
|
this.codeeditshow = false
|
|
|
- this.initDatas();
|
|
|
|
|
- this.$message({
|
|
|
|
|
|
|
+ this.initDatas()
|
|
|
|
|
+ this.$message({
|
|
|
type: 'success',
|
|
type: 'success',
|
|
|
message: res.data.message
|
|
message: res.data.message
|
|
|
- });
|
|
|
|
|
|
|
+ })
|
|
|
|
|
|
|
|
- } else {
|
|
|
|
|
|
|
+ } else {
|
|
|
this.$message({
|
|
this.$message({
|
|
|
type: 'warning',
|
|
type: 'warning',
|
|
|
message: res.data.message
|
|
message: res.data.message
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
}).catch(err => {
|
|
}).catch(err => {
|
|
|
console.error(err)
|
|
console.error(err)
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
- exportExcel() {
|
|
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ exportExcel () {
|
|
|
/* generate workbook object from table */
|
|
/* generate workbook object from table */
|
|
|
- let table = document.querySelector("#rebateSetTable").cloneNode(true); //克隆备份(原table不动)
|
|
|
|
|
- // 因为element-ui的表格的fixed属性导致多出一个table,会下载重复内容,这里删除掉
|
|
|
|
|
- table.removeChild(table.querySelector(".el-table__fixed-right")) //删掉备份的子节点
|
|
|
|
|
|
|
+ let table = document.querySelector('#rebateSetTable').cloneNode(true) //克隆备份(原table不动)
|
|
|
|
|
+ // 因为element-ui的表格的fixed属性导致多出一个table,会下载重复内容,这里删除掉
|
|
|
|
|
+ table.removeChild(table.querySelector('.el-table__fixed-right')) // 删掉备份的子节点
|
|
|
let wb = XLSX.utils.table_to_book(table, {
|
|
let wb = XLSX.utils.table_to_book(table, {
|
|
|
raw: true
|
|
raw: true
|
|
|
- });
|
|
|
|
|
- /* get binary string as output */
|
|
|
|
|
- let wbout = XLSX.write(wb, {
|
|
|
|
|
- bookType: "xlsx",
|
|
|
|
|
|
|
+ })
|
|
|
|
|
+ /* get binary string as output */
|
|
|
|
|
+ let wbout = XLSX.write(wb, {
|
|
|
|
|
+ bookType: 'xlsx',
|
|
|
bookSST: true,
|
|
bookSST: true,
|
|
|
- type: "array"
|
|
|
|
|
- });
|
|
|
|
|
- try {
|
|
|
|
|
|
|
+ type: 'array'
|
|
|
|
|
+ })
|
|
|
|
|
+ try {
|
|
|
FileSaver.saveAs(
|
|
FileSaver.saveAs(
|
|
|
new Blob([wbout], {
|
|
new Blob([wbout], {
|
|
|
- type: "application/octet-stream"
|
|
|
|
|
|
|
+ type: 'application/octet-stream'
|
|
|
}),
|
|
}),
|
|
|
- "Goods.xlsx"
|
|
|
|
|
- );
|
|
|
|
|
- } catch (e) {
|
|
|
|
|
- if (typeof console !== "undefined") console.log(e, wbout);
|
|
|
|
|
- }
|
|
|
|
|
- return wbout;
|
|
|
|
|
- },
|
|
|
|
|
- initTableHeader() {
|
|
|
|
|
|
|
+ 'Goods.xlsx'
|
|
|
|
|
+ )
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ if (typeof console !== 'undefined') console.log(e, wbout)
|
|
|
|
|
+ }
|
|
|
|
|
+ return wbout
|
|
|
|
|
+ },
|
|
|
|
|
+ initTableHeader () {
|
|
|
setapi.initGoodTableHeader(this.$axios).then(res => {
|
|
setapi.initGoodTableHeader(this.$axios).then(res => {
|
|
|
this.dynamicTableColumns = res.data.items
|
|
this.dynamicTableColumns = res.data.items
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- saveApprovalDept() {
|
|
|
|
|
|
|
+ saveApprovalDept () {
|
|
|
let organizeids = []
|
|
let organizeids = []
|
|
|
let organize = this.$refs.operationOriganizeTree.getCheckedNodes()
|
|
let organize = this.$refs.operationOriganizeTree.getCheckedNodes()
|
|
|
organize.forEach(row => {
|
|
organize.forEach(row => {
|
|
@@ -603,7 +603,7 @@
|
|
|
console.log(err)
|
|
console.log(err)
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- deptSet(val) {
|
|
|
|
|
|
|
+ deptSet (val) {
|
|
|
let stcode = this.setForm.SupplierTypeCode
|
|
let stcode = this.setForm.SupplierTypeCode
|
|
|
this.deptsetVisible = true
|
|
this.deptsetVisible = true
|
|
|
this.selecteclassid = val.Id
|
|
this.selecteclassid = val.Id
|
|
@@ -623,13 +623,14 @@
|
|
|
console.log(err)
|
|
console.log(err)
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- initDatas() {
|
|
|
|
|
|
|
+ initDatas () {
|
|
|
// 分页及列表条件
|
|
// 分页及列表条件
|
|
|
let params = {
|
|
let params = {
|
|
|
_currentPage: this.currentPage,
|
|
_currentPage: this.currentPage,
|
|
|
_size: this.size,
|
|
_size: this.size,
|
|
|
Order: this.Column.Order,
|
|
Order: this.Column.Order,
|
|
|
- Prop: this.Column.Prop
|
|
|
|
|
|
|
+ Prop: this.Column.Prop,
|
|
|
|
|
+ Edition: '1'
|
|
|
}
|
|
}
|
|
|
let myCreateOn = []
|
|
let myCreateOn = []
|
|
|
// 解析时间
|
|
// 解析时间
|
|
@@ -652,7 +653,7 @@
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- getDictOptions() {
|
|
|
|
|
|
|
+ getDictOptions () {
|
|
|
api.getDictList(this.$axios).then(res => {
|
|
api.getDictList(this.$axios).then(res => {
|
|
|
this.AuditStepOptions = res.data.items['AuditStep']
|
|
this.AuditStepOptions = res.data.items['AuditStep']
|
|
|
// this.dictOptions.customerList = res.data.items['customerList']
|
|
// this.dictOptions.customerList = res.data.items['customerList']
|
|
@@ -662,9 +663,7 @@
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- MoreCmdClick(cmd) {
|
|
|
|
|
|
|
+ MoreCmdClick (cmd) {
|
|
|
if (cmd.Command === 'Set') {
|
|
if (cmd.Command === 'Set') {
|
|
|
this.deptSet(cmd.row)
|
|
this.deptSet(cmd.row)
|
|
|
} else if (cmd.Command === 'Delete') {
|
|
} else if (cmd.Command === 'Delete') {
|
|
@@ -673,14 +672,14 @@
|
|
|
this.CodeNameEdit(cmd.row)
|
|
this.CodeNameEdit(cmd.row)
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- GetCommand(cmdType, row) {
|
|
|
|
|
|
|
+ GetCommand (cmdType, row) {
|
|
|
let cmd = {}
|
|
let cmd = {}
|
|
|
cmd.Command = cmdType
|
|
cmd.Command = cmdType
|
|
|
cmd.row = row
|
|
cmd.row = row
|
|
|
return cmd
|
|
return cmd
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- searchCommand(command) {
|
|
|
|
|
|
|
+ searchCommand (command) {
|
|
|
if (command === 'search') {
|
|
if (command === 'search') {
|
|
|
this.dialogVisible = true
|
|
this.dialogVisible = true
|
|
|
} else if (command === 'clear') {
|
|
} else if (command === 'clear') {
|
|
@@ -688,7 +687,7 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
// 列表排序功能
|
|
// 列表排序功能
|
|
|
- orderby(column) {
|
|
|
|
|
|
|
+ orderby (column) {
|
|
|
if (column.order === 'ascending') {
|
|
if (column.order === 'ascending') {
|
|
|
this.Column.Order = 'asc'
|
|
this.Column.Order = 'asc'
|
|
|
} else if (column.order === 'descending') {
|
|
} else if (column.order === 'descending') {
|
|
@@ -697,27 +696,27 @@
|
|
|
this.Column.Prop = column.prop
|
|
this.Column.Prop = column.prop
|
|
|
this.initDatas()
|
|
this.initDatas()
|
|
|
},
|
|
},
|
|
|
- clearSearch() {
|
|
|
|
|
|
|
+ clearSearch () {
|
|
|
Object.assign(this.searchForm, this.searchFormReset)
|
|
Object.assign(this.searchForm, this.searchFormReset)
|
|
|
// this.searchForm = this.searchFormReset;
|
|
// this.searchForm = this.searchFormReset;
|
|
|
this.CreateOn = ''
|
|
this.CreateOn = ''
|
|
|
this.initDatas()
|
|
this.initDatas()
|
|
|
},
|
|
},
|
|
|
- handleSearch() {
|
|
|
|
|
|
|
+ handleSearch () {
|
|
|
this.currentPage = 1
|
|
this.currentPage = 1
|
|
|
this.dialogVisible = false
|
|
this.dialogVisible = false
|
|
|
this.initDatas()
|
|
this.initDatas()
|
|
|
},
|
|
},
|
|
|
- handleCurrentChange(value) {
|
|
|
|
|
|
|
+ handleCurrentChange (value) {
|
|
|
this.currentPage = value
|
|
this.currentPage = value
|
|
|
this.initDatas()
|
|
this.initDatas()
|
|
|
},
|
|
},
|
|
|
- handleSizeChange(value) {
|
|
|
|
|
|
|
+ handleSizeChange (value) {
|
|
|
this.size = value
|
|
this.size = value
|
|
|
this.currentPage = 1
|
|
this.currentPage = 1
|
|
|
this.initDatas()
|
|
this.initDatas()
|
|
|
},
|
|
},
|
|
|
- deleteEntity(row) {
|
|
|
|
|
|
|
+ deleteEntity (row) {
|
|
|
// row.deleteConfirmFlag = false
|
|
// row.deleteConfirmFlag = false
|
|
|
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
|
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
confirmButtonText: '确定',
|
|
@@ -745,7 +744,7 @@
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- transferStr(val) {
|
|
|
|
|
|
|
+ transferStr (val) {
|
|
|
if (val === '1') {
|
|
if (val === '1') {
|
|
|
return '是'
|
|
return '是'
|
|
|
}
|
|
}
|
|
@@ -756,7 +755,7 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- jstimehandle(val) {
|
|
|
|
|
|
|
+ jstimehandle (val) {
|
|
|
if (val === '') {
|
|
if (val === '') {
|
|
|
return '----'
|
|
return '----'
|
|
|
} else if (val === '0001-01-01T08:00:00+08:00') {
|
|
} else if (val === '0001-01-01T08:00:00+08:00') {
|
|
@@ -769,7 +768,7 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- formatDateTime(date) {
|
|
|
|
|
|
|
+ formatDateTime (date) {
|
|
|
var y = date.getFullYear()
|
|
var y = date.getFullYear()
|
|
|
var m = date.getMonth() + 1
|
|
var m = date.getMonth() + 1
|
|
|
m = m < 10 ? ('0' + m) : m
|
|
m = m < 10 ? ('0' + m) : m
|
|
@@ -782,7 +781,6 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
<style>
|