Browse Source

聚水潭接口部分数据提交 LR

master
DOUDOU 3 years ago
parent
commit
143e8e565e
  1. 4
      src/api/jst/com_sales_order_upload_file.js
  2. 10
      src/api/jst/sales_order_brand.js
  3. 6
      src/api/jst/sales_order_exception.js
  4. 16
      src/api/jst/sales_order_item_upload.js
  5. 16
      src/api/jst/sales_order_warehouse.js
  6. 16
      src/api/jst/shop_store.js
  7. 44
      src/utils/httpRequest.js
  8. 138
      src/views/modules/jst/com_add_update_brand.vue
  9. 180
      src/views/modules/jst/com_add_update_shop_store.vue
  10. 137
      src/views/modules/jst/com_add_update_warehouse.vue
  11. 117
      src/views/modules/jst/com_sales_order_upload_file.vue
  12. 228
      src/views/modules/jst/sales_order_brand.vue
  13. 229
      src/views/modules/jst/sales_order_exception.vue
  14. 475
      src/views/modules/jst/sales_order_item_upload.vue
  15. 233
      src/views/modules/jst/sales_order_warehouse.vue
  16. 347
      src/views/modules/jst/shop_store.vue

4
src/api/jst/com_sales_order_upload_file.js

@ -0,0 +1,4 @@
import { createAPI } from '@/utils/httpRequest.js'
// 获取产品列表
export const uploadSalesOrderFile = data => createAPI('/jst/uploadSalesOrderFile', 'post', data)

10
src/api/jst/sales_order_brand.js

@ -0,0 +1,10 @@
import { createAPI } from "@/utils/httpRequest.js";
// 查询
export const getSalesOrderBrand = data => createAPI('/jst/getSalesOrderBrand', 'post', data)
// 新增
export const insertSalesOrderBrand = data => createAPI('/jst/insertSalesOrderBrand', 'post', data)
//修改
export const saveSalesOrderBrand = data => createAPI('/jst/saveSalesOrderBrand', 'post', data)

6
src/api/jst/sales_order_exception.js

@ -0,0 +1,6 @@
import { createAPI } from "@/utils/httpRequest.js";
// 获取产品列表
export const getExceptionList = data => createAPI('/jst/getExceptionList', 'post', data)

16
src/api/jst/sales_order_item_upload.js

@ -0,0 +1,16 @@
import { createAPI } from "@/utils/httpRequest.js";
// 获取文件的列表
export const getSaleOrderFileHist = data => createAPI('/jst/getSaleOrderFileHist', 'post', data)
// 导入销售单明细
export const batchInsertSalesOrderItems = data => createAPI('/jst/batchInsertSalesOrderItems', 'post', data)
//检查销售单的信息
export const checkSalesOrderException = data => createAPI('/jst/checkSalesOrderException', 'post', data)
//检查销售单的信息
export const downSalesOrder = data => createAPI('/jst/downSalesOrder', 'post', data)

16
src/api/jst/sales_order_warehouse.js

@ -0,0 +1,16 @@
import { createAPI } from "@/utils/httpRequest.js";
// 获取文件的列表
export const getSalesOrderWarehouse = data => createAPI('/jst/getSalesOrderWarehouse', 'post', data)
//新增
export const insertSalesOrderWarehouse = data => createAPI('/jst/insertSalesOrderWarehouse', 'post', data)
//修改
export const saveSalesOrderWarehouse = data => createAPI('/jst/saveSalesOrderWarehouse', 'post', data)
//检查销售单的信息
export const downSalesOrder = data => createAPI('/jst/downSalesOrder', 'post', data)

16
src/api/jst/shop_store.js

@ -0,0 +1,16 @@
import { createAPI } from "@/utils/httpRequest.js";
// 获取文件的列表
export const getShopStores = data => createAPI('/jst/getShopStores', 'post', data)
// 导入销售单明细
export const insertShopStore = data => createAPI('/jst/insertShopStore', 'post', data)
//检查销售单的信息
export const saveShopStore = data => createAPI('/jst/saveShopStore', 'post', data)
//检查销售单的信息
export const deleteShopStore = data => createAPI('/jst/deleteShopStore', 'post', data)

44
src/utils/httpRequest.js

@ -6,7 +6,7 @@ import merge from 'lodash/merge'
import { clearLoginInfo } from '@/utils'
const http = axios.create({
timeout: 1000 * 300,
timeout: 1000 * 600,
withCredentials: true,
headers: {
'Content-Type': 'application/json; charset=utf-8'
@ -112,6 +112,40 @@ instance.interceptors.response.use(response => {
})
// ============================= 下载功能的请求 =============================
const instance2 = axios.create({
baseURL: (process.env.NODE_ENV !== 'production' && process.env.OPEN_PROXY ? '/proxyApi/' : window.SITE_CONFIG.baseUrl),
timeout: 10000 * 300,
withCredentials: true,
responseType: 'blob',
headers: {
'Content-Type': 'application/json; charset=utf-8'
}
})
/**
* 请求拦截
*/
instance2.interceptors.request.use(config => {
config.headers['token'] = Vue.cookie.get('token') // 请求头带上token
return config
}, error => {
return Promise.reject(error)
})
/**
* 响应拦截
*/
instance2.interceptors.response.use(response => {
if (response.data && response.data.code === 401) { // 401, token失效
clearLoginInfo()
router.push({name: 'login'})
}
return response
}, error => {
return Promise.reject(error)
})
export const createAPI = (url, method, data) => {
@ -121,6 +155,14 @@ export const createAPI = (url, method, data) => {
} else {
config.data = data
}
if (data === 'download'){ // 下载功能的请求
return instance2({
url,
method,
...config
})
}
return instance({
url,
method,

138
src/views/modules/jst/com_add_update_brand.vue

@ -0,0 +1,138 @@
<template>
<div class="customer-css">
<el-dialog :title="titleCon" v-drag :close-on-click-modal="false" :visible.sync="visible"
width="240px" style="height: 680px;" class="customer-dialog">
<el-form :inline="true" label-position="top" style="height: 10px;"
label-width="80px">
<!-- 当前卷 -->
<el-row>
<el-col :span="20">
<el-form-item class="customer-item" label='品牌名称:'>
<el-input v-model="pageData.brandName" :readonly=!this.addFlag style="width: 200px;" ></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item class="customer-item" label='品牌域:'>
<el-input v-model="pageData.brandContract" style="width: 200px;"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer" style="margin-top: -20px;">
<el-button type="primary" @click="saveBrand()">保存</el-button>
<el-button type="primary" @click="closeDialog">关闭</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import {
insertSalesOrderBrand,
saveSalesOrderBrand,
} from "@/api/jst/sales_order_brand.js";
var functionId = 'C10000008';
export default {
data() {
return {
titleCon: '品牌维护',
visible: false,
addFlag: true,
pageData: {
brandName: '',
brandContract: '',
},
}
},
methods: {
//
init(currentRow, addFlag) {
//
if('N' === addFlag){
this.pageData = JSON.parse(JSON.stringify(currentRow));
this.addFlag = false;
}else{
this.pageData = {};
this.addFlag = true;
}
//modal
this.visible = true;
},
/*关闭modal*/
closeDialog(){
//
this.$emit('refreshPageTables');
//
this.visible = false;
},
/*保存店铺的相关的信息*/
saveBrand(){
//
if(true === this.addFlag){
insertSalesOrderBrand(this.pageData).then(({data}) => {
//
if(data.code === 200){
this.$message.success(data.msg);
this.closeDialog();
}else{
this.$message.error(data.msg);
}
});
}else{
saveSalesOrderBrand(this.pageData).then(({data}) => {
//
if(data.code === 200){
this.$message.success(data.msg);
this.closeDialog();
}else{
this.$message.error(data.msg);
}
});
}
},
},
created() {
// this.factoryList()
// this.getLanguageList()
}
}
</script>
<style scoped lang="scss">
/*调节页面button和input的上下间距*/
.customer-css .customer-button{
margin-top: 25px;
}
/*调节fieldset下的样式*/
.customer-fieldset .customer-item{
margin-top: -15px;
}
/*fieldset下table的样式*/
.customer-fieldset /deep/ .el-table__header th.is-leaf{
line-height: 16px;
}
/deep/ .customer-tab .el-tabs__content{
padding: 0px !important;
}
</style>

180
src/views/modules/jst/com_add_update_shop_store.vue

@ -0,0 +1,180 @@
<template>
<div class="customer-css">
<el-dialog :title="titleCon" v-drag :close-on-click-modal="false" :visible.sync="visible"
width="480px" style="height: 680px;" class="customer-dialog">
<el-form :inline="true" label-position="top" style="height: 100px;"
label-width="80px">
<!-- 当前卷 -->
<el-row>
<el-col :span="8">
<el-form-item class="customer-item" label='店铺站点:'>
<el-input v-model="pageData.shopSite" style="width: 120px;" ></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="customer-item" label='店铺名称:'>
<el-input v-model="pageData.shopName" style="width: 120px;"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="customer-item" label="店铺编号:">
<el-input v-model="pageData.shopId" style="width: 120px;"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item class="customer-item" label='域:'>
<el-input v-model="pageData.contract" style="width: 120px;" ></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="customer-item" label='客户编号:'>
<el-input v-model="pageData.customerNo" style="width: 120px;"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="customer-item" label="订单类型:">
<el-input v-model="pageData.orderType" style="width: 120px;"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item class="customer-item" label='区分纯电商:'>
<el-input v-model="pageData.pureCustom" style="width: 120px;" ></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="customer-item" label='区分客户:'>
<el-input v-model="pageData.distinguishCustom" style="width: 120px;"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="customer-item" label="区分寄售:">
<el-input v-model="pageData.consignmentFlag" style="width: 120px;"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer" style="margin-top: -20px;">
<el-button type="primary" @click="saveShopStore()">保存</el-button>
<el-button type="primary" @click="closeDialog">关闭</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import {
insertShopStore,
saveShopStore,
} from "@/api/jst/shop_store.js";
var functionId = 'C10000006';
export default {
data() {
return {
titleCon: '店铺维护',
visible: false,
addFlag: '',
pageData: {
contract: '',
shopSite: '',
shopId: '',
shopName: '',
customerNo: '',
pureCustom: '',
distinguishCustom: '',
consignmentFlag: '',
orderType: '',
},
}
},
methods: {
//
init(currentRow, addFlag) {
this.addFlag = addFlag;
//
if('N' === addFlag){
this.pageData = JSON.parse(JSON.stringify(currentRow));
}else{
this.pageData = {};
}
//modal
this.visible = true;
},
/*关闭modal*/
closeDialog(){
//
this.$emit('refreshPageTables');
//
this.visible = false;
},
/*保存店铺的相关的信息*/
saveShopStore(){
//
if('Y' === this.addFlag){
insertShopStore(this.pageData).then(({data}) => {
//
if(data.code === 200){
this.$message.success(data.msg);
this.closeDialog();
}else{
this.$message.error(data.msg);
}
});
}else{
saveShopStore(this.pageData).then(({data}) => {
//
if(data.code === 200){
this.$message.success(data.msg);
this.closeDialog();
}else{
this.$message.error(data.msg);
}
});
}
},
},
created() {
// this.factoryList()
// this.getLanguageList()
}
}
</script>
<style scoped lang="scss">
/*调节页面button和input的上下间距*/
.customer-css .customer-button{
margin-top: 25px;
}
/*调节fieldset下的样式*/
.customer-fieldset .customer-item{
margin-top: -15px;
}
/*fieldset下table的样式*/
.customer-fieldset /deep/ .el-table__header th.is-leaf{
line-height: 16px;
}
/deep/ .customer-tab .el-tabs__content{
padding: 0px !important;
}
</style>

137
src/views/modules/jst/com_add_update_warehouse.vue

@ -0,0 +1,137 @@
<template>
<div class="customer-css">
<el-dialog :title="titleCon" v-drag :close-on-click-modal="false" :visible.sync="visible"
width="240px" style="height: 680px;" class="customer-dialog">
<el-form :inline="true" label-position="top" style="height: 10px;"
label-width="80px">
<!-- 当前卷 -->
<el-row>
<el-col :span="20">
<el-form-item class="customer-item" label='仓库名称:'>
<el-input v-model="pageData.warehouseName" :readonly=!this.addFlag style="width: 200px;" ></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item class="customer-item" label='仓库类型:'>
<el-input v-model="pageData.warehouseType" style="width: 200px;"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer" style="margin-top: -20px;">
<el-button type="primary" @click="saveWarehouse()">保存</el-button>
<el-button type="primary" @click="closeDialog">关闭</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import {
insertSalesOrderWarehouse,
saveSalesOrderWarehouse,
} from "@/api/jst/sales_order_warehouse.js";
var functionId = 'C10000007';
export default {
data() {
return {
titleCon: '仓库维护',
visible: false,
addFlag: true,
pageData: {
warehouseName: '',
warehouseType: '',
},
}
},
methods: {
//
init(currentRow, addFlag) {
//
if('N' === addFlag){
this.pageData = JSON.parse(JSON.stringify(currentRow));
this.addFlag = false;
}else{
this.pageData = {};
this.addFlag = true;
}
//modal
this.visible = true;
},
/*关闭modal*/
closeDialog(){
//
this.$emit('refreshPageTables');
//
this.visible = false;
},
/*保存店铺的相关的信息*/
saveWarehouse(){
//
if(true === this.addFlag){
insertSalesOrderWarehouse(this.pageData).then(({data}) => {
//
if(data.code === 200){
this.$message.success(data.msg);
this.closeDialog();
}else{
this.$message.error(data.msg);
}
});
}else{
saveSalesOrderWarehouse(this.pageData).then(({data}) => {
//
if(data.code === 200){
this.$message.success(data.msg);
this.closeDialog();
}else{
this.$message.error(data.msg);
}
});
}
},
},
created() {
// this.factoryList()
// this.getLanguageList()
}
}
</script>
<style scoped lang="scss">
/*调节页面button和input的上下间距*/
.customer-css .customer-button{
margin-top: 25px;
}
/*调节fieldset下的样式*/
.customer-fieldset .customer-item{
margin-top: -15px;
}
/*fieldset下table的样式*/
.customer-fieldset /deep/ .el-table__header th.is-leaf{
line-height: 16px;
}
/deep/ .customer-tab .el-tabs__content{
padding: 0px !important;
}
</style>

117
src/views/modules/jst/com_sales_order_upload_file.vue

@ -0,0 +1,117 @@
<template>
<div class="customer-css">
<el-dialog :title="titleCon" :close-on-click-modal="false" :visible.sync="visible" width="420px" style="height: 520px;" class="customer-dialog">
<el-form :inline="true" label-position="top" label-width="80px">
<el-row>
<el-col :span="24">
<el-upload class="customer-upload"
drag
action="javascript:void(0);" ref="uploadFile" :limit="1"
:before-upload="beforeUploadHandle" :on-change="onChange"
accept=".xlsx,.pdf,.PDF" :auto-upload="false"
style="text-align: left;">
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
</el-upload>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="saveUploadFile()">保存</el-button>
<el-button type="primary" @click="closeDialog">关闭</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import {
uploadSalesOrderFile,
} from '@/api/jst/com_sales_order_upload_file.js';
/* 引入组件 */
var functionId = 'C10000002';
export default {
data() {
return {
titleCon: '文件上传',
folder: 'salesOrder',
visible: false,
userId: this.$store.state.user.name,
fileList: [],
pageData: {
fileRemark: '',
},
dataListLoading: false,
}
},
methods: {
//
init() {
//
this.visible = true;
//
this.pageData.username = this.userId;
//
//this.titleCon = this.labels.titleCon;
},
//
beforeUploadHandle (file) {
if (file.type !== "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" && file.type !== "application/vnd.ms-excel") {
this.$message.error('只支持xls、xlsx、格式的文件!')
return false;
}
},
/*选择上传文件时*/
onChange(file){
this.fileList.push(file);
},
/*关闭modal*/
closeDialog(){
//
this.$emit('refreshPageTables');
//
this.visible = false;
},
/*保修当前的数据*/
saveUploadFile(){
/*判断文件是否上传*/
if(null == this.fileList || 0 == this.fileList.length){
this.$message.error("请先上传文件!");
return false;
}
const formData = new FormData();
//
formData.append("file", this.fileList[0].raw);
formData.append("folder", this.folder);
uploadSalesOrderFile(formData).then(({data}) => {
if (data.code === 200) {
this.$message.success(data.msg);
//
this.$refs.uploadFile.clearFiles();
//
this.closeDialog();
}else {
this.$message.warning(data.msg);
}
})
}
},
created() {
// this.factoryList()
// this.getLanguageList()
}
}
</script>
<style scoped lang="scss">
</style>

228
src/views/modules/jst/sales_order_brand.vue

@ -0,0 +1,228 @@
<template>
<div class="mod-config">
<el-form v-model="searchData">
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 5px;" >
<el-form-item :label="'仓库名称:'">
<el-input v-model="searchData.brandName" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="' '">
<el-button @click="refreshPageTables()" style="margin-left: 0px" type="primary">查询</el-button>
<el-button @click="addOrUpdateModal('Y')" style="margin-left: 14px" type="primary">新增</el-button>
<el-button @click="addOrUpdateModal('N')" style="margin-left: 14px" type="primary">修改</el-button>
</el-form-item>
<el-form-item :label="' '">
<download-excel
:fields="fields()"
type="xls"
:name="exportName"
:fetch="createExportData"
worksheet="导出信息"
class="el-button el-button--primary el-button--medium">
{{ '导出' }}
</download-excel>
</el-form-item>
</el-form>
</el-form>
<el-table
:height="height"
:data="tableData"
ref="fileTable"
highlight-current-row
@row-click="setCurrentRow"
@current-change="changeCurrentRow"
border
style="width: 100%">
<el-table-column
v-for="(item,index) in columnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
header-align="center"
: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>
<!--新增或者修改-->
<comAddUpdateBrand ref="comAddUpdateBrand" @refreshPageTables="refreshPageTables" v-drag></comAddUpdateBrand>
</div>
</template>
<script>
import comAddUpdateBrand from "./com_add_update_brand";
import {
getSalesOrderBrand,
} from '@/api/jst/sales_order_brand.js'
import Vue from 'vue'
export default {
name: 'salesOrder',
data () {
return {
// + start
exportData: [],
exportName: '品牌表' + this.getStrDate(),
columnList: [
{
tableId: 'brandHist',
tableName: this.$route.meta.title,
columnProp: 'brandName',
columnLabel: '品牌名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 30,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'left'
},
{
tableId: 'brandHist',
tableName: this.$route.meta.title,
columnProp: 'brandContract',
columnLabel: '品牌域',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 60,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'left'
},
{
tableId: 'brandHist',
tableName: this.$route.meta.title,
columnProp: 'createdDate',
columnLabel: '创建时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 60,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'left'
},
],
currentRow:{},
visible: false,
// end
height: 200,
tableData: [],
searchData: {
brandName: '',
},
}
},
components: {
comAddUpdateBrand,/*新增或修改*/
},
mounted () {
this.$nextTick(() => {
this.height = window.innerHeight - 150
})
},
methods: {
refreshPageTables () {
getSalesOrderBrand(this.searchData).then(({data}) => {
this.tableData = data.rows;
if(data.total > 0){
//
this.$refs.fileTable.setCurrentRow(this.tableData[0]);
}
})
},
/*设置工艺的行*/
setCurrentRow(row, column, event) {
this.currentRow = row;
},
//
/*当前值发生变化的时候修改*/
changeCurrentRow(row, oldRow){
//
if(row){
this.currentRow = JSON.parse(JSON.stringify(row));
}
},
// +
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 += '}'
return eval('(' + json + ')')
},
createExportData () {
// ,,
return this.tableData
},
getStrDate () {
let dd = new Date()
let Y = dd.getFullYear()
let M = (dd.getMonth() + 1) < 10 ? '0' + (dd.getMonth() + 1) : (dd.getMonth() + 1)// 100
let D = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate()// 100
let H = dd.getHours() < 10 ? '0' + dd.getHours() : dd.getHours()
let MM = dd.getMinutes() < 10 ? '0' + dd.getMinutes() : dd.getMinutes()
let S = dd.getSeconds() < 10 ? '0' + dd.getSeconds() : dd.getSeconds()
return Y + M + D + H + MM + S
},
/*新增或修改的modal*/
addOrUpdateModal(addFlag){
//
this.$nextTick(() => {
//
if('Y' === addFlag){
this.$refs.comAddUpdateBrand.init({}, addFlag);
}else{
this.$refs.comAddUpdateBrand.init(this.currentRow, addFlag);
}
})
},
},
created() {
this.refreshPageTables();
// this.getLanguageList()
}
}
</script>
<style scoped>
</style>

229
src/views/modules/jst/sales_order_exception.vue

@ -0,0 +1,229 @@
<template>
<div class="mod-config">
<el-form inline="true" v-model="searchData">
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 5px;" >
<el-form-item :label="'异常分类:'">
<el-input v-model="searchData.orderNo" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'异常描述:'">
<el-input v-model="searchData.exceptionDesc" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'异常信息:'">
<el-input v-model="searchData.exceptionData" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="' '">
<el-button @click="searchException()" style="margin-left: 0px" type="primary">查询</el-button>
</el-form-item>
<el-form-item :label="' '">
<download-excel
:fields="fields()"
type="xls"
:name="exportName"
:fetch="createExportData"
worksheet="导出信息"
class="el-button el-button--primary el-button--medium">
{{ '导出' }}
</download-excel>
</el-form-item>
</el-form>
</el-form>
<el-table
:height="height"
:data="tableData"
border
style="width: 100%">
<el-table-column
v-for="(item,index) in columnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
header-align="center"
: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>
<!--文件上传-->
<comSalesOrderUploadFile ref="comSalesOrderUploadFile" v-drag></comSalesOrderUploadFile>
</div>
</template>
<script>
import comSalesOrderUploadFile from "./com_sales_order_upload_file";/*上传文件的組件*/
import {
getExceptionList,
} from '@/api/jst/sales_order_exception.js'
export default {
name: 'salesOrder',
data () {
return {
// + start
exportData: [],
userDev: this.$store.state.user.userDev,
exportName: '异常记录表' + this.getStrDate(),
columnList: [
{
tableId: 'ExceptionDataHist',
tableName: this.$route.meta.title,
columnProp: 'exceptionType',
columnLabel: '异常类型',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 60,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'left'
},
{
tableId: 'ExceptionDataHist',
tableName: this.$route.meta.title,
columnProp: 'exceptionDesc',
columnLabel: '异常描述',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 120,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'left'
},
{
tableId: 'ExceptionDataHist',
tableName: this.$route.meta.title,
columnProp: 'exceptionData',
columnLabel: '异常信息',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 180,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'left'
},
{
tableId: 'ExceptionDataHist',
tableName: this.$route.meta.title,
columnProp: 'exceptionTime',
columnLabel: '异常记录时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 120,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'left'
}
],
visible: false,
// end
height: 200,
tableData: [],
searchData: {
exceptionType: '',
exceptionDesc: '',
exceptionData: ''
},
}
},
components: {
comSalesOrderUploadFile,/*文件上传的组件*/
},
mounted () {
this.$nextTick(() => {
this.height = window.innerHeight - 150
})
},
methods: {
searchException () {
getExceptionList(this.searchData).then(({data}) => {
this.tableData = data.rows
})
},
checkSalesOrder () {
checkSalesOrder().then(({data}) => {
this.$message.success('操作成功')
})
},
// +
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 += '}'
return eval('(' + json + ')')
},
createExportData () {
// ,,
return this.tableData
},
getStrDate () {
let dd = new Date()
let Y = dd.getFullYear()
let M = (dd.getMonth() + 1) < 10 ? '0' + (dd.getMonth() + 1) : (dd.getMonth() + 1)// 100
let D = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate()// 100
let H = dd.getHours() < 10 ? '0' + dd.getHours() : dd.getHours()
let MM = dd.getMinutes() < 10 ? '0' + dd.getMinutes() : dd.getMinutes()
let S = dd.getSeconds() < 10 ? '0' + dd.getSeconds() : dd.getSeconds()
return Y + M + D + H + MM + S
},
userSetting () {
this.visible = true
this.$nextTick(() => {
this.$refs.column.init(this.queryTable)
})
},
/*新增文件的modal*/
addUploadFileModal(){
//
this.$nextTick(() => {
this.$refs.comSalesOrderUploadFile.init();
})
},
}
}
</script>
<style scoped>
</style>

475
src/views/modules/jst/sales_order_item_upload.vue

@ -0,0 +1,475 @@
<template>
<div class="mod-config">
<el-form v-model="searchData">
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 5px;" >
<el-form-item :label="'文件名:'">
<el-input v-model="searchData.fileName" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'文件状态:'">
<el-select v-model="searchData.status" style="width: 120px">
<el-option label="已上传" value="uploaded"></el-option>
<el-option label="已导入" value="inserted" el-selected></el-option>
<el-option label="已检查" value="checked"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="' '">
<el-button @click="refreshPageTables()" style="margin-left: 0px" type="primary">查询</el-button>
<el-button @click="addUploadFileModal()" style="margin-left: 14px" type="primary">销售明细上传</el-button>
<el-button @click="insertSalesOrderItems()" style="margin-left: 14px" type="primary">销售明细导入</el-button>
<el-button @click="checkSalesOrder()" style="margin-left: 0px" type="primary">开始检查</el-button>
<el-button @click="exportSalesOrder()" style="margin-left: 0px" type="primary">导出销售明细</el-button>
</el-form-item>
<el-form-item :label="' '">
<download-excel
:fields="fields()"
type="xls"
:name="exportName"
:fetch="createExportData"
worksheet="导出信息"
class="el-button el-button--primary el-button--medium">
{{ '导出' }}
</download-excel>
</el-form-item>
</el-form>
</el-form>
<el-table
:height="height"
:data="tableData"
ref="fileTable"
highlight-current-row
@row-click="setCurrentRow"
@current-change="changeCurrentRow"
border
style="width: 100%">
<el-table-column
v-for="(item,index) in columnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
header-align="center"
: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>
<!--文件上传-->
<comSalesOrderUploadFile ref="comSalesOrderUploadFile" @refreshPageTables="refreshPageTables" v-drag></comSalesOrderUploadFile>
</div>
</template>
<script>
import comSalesOrderUploadFile from "./com_sales_order_upload_file";/*上传文件的組件*/
import axios from "axios";
import {
getSaleOrderFileHist,
batchInsertSalesOrderItems,
checkSalesOrderException,
downSalesOrder,
} from '@/api/jst/sales_order_item_upload.js'
import Vue from 'vue'
export default {
name: 'salesOrder',
data () {
return {
// + start
exportData: [],
userDev: this.$store.state.user.userDev,
exportName: '上传记录表' + this.getStrDate(),
columnList: [
{
tableId: 'salesOrderHist',
tableName: this.$route.meta.title,
columnProp: 'fileName',
columnLabel: '文件名',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 120,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'left'
},
{
tableId: 'salesOrderHist',
tableName: this.$route.meta.title,
columnProp: 'status',
columnLabel: '状态',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 60,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'left'
},
{
tableId: 'salesOrderHist',
tableName: this.$route.meta.title,
columnProp: 'uploadBy',
columnLabel: '上传人',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 60,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'left'
},
{
tableId: 'salesOrderHist',
tableName: this.$route.meta.title,
columnProp: 'uploadDate',
columnLabel: '上传时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 120,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'left'
},
{
tableId: 'salesOrderHist',
tableName: this.$route.meta.title,
columnProp: 'insertBy',
columnLabel: '导入人',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 60,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'left'
},
{
tableId: 'salesOrderHist',
tableName: this.$route.meta.title,
columnProp: 'insertDate',
columnLabel: '导入时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 120,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'left'
},
{
tableId: 'salesOrderHist',
tableName: this.$route.meta.title,
columnProp: 'checkBy',
columnLabel: '检查人',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 60,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'left'
},
{
tableId: 'salesOrderHist',
tableName: this.$route.meta.title,
columnProp: 'checkDate',
columnLabel: '检查时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 120,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'left'
},
{
tableId: 'salesOrderHist',
tableName: this.$route.meta.title,
columnProp: 'itemCount',
columnLabel: '当前明细数量',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 80,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'right'
},
],
currentRow:{},
visible: false,
// end
height: 200,
tableData: [],
searchData: {
fileName: '',
status: 'uploaded',
},
}
},
components: {
comSalesOrderUploadFile,/*文件上传的组件*/
},
mounted () {
this.$nextTick(() => {
this.height = window.innerHeight - 150
})
},
methods: {
refreshPageTables () {
getSaleOrderFileHist(this.searchData).then(({data}) => {
this.tableData = data.rows;
if(data.total > 0){
//
this.$refs.fileTable.setCurrentRow(this.tableData[0]);
}
})
},
//excel
insertSalesOrderItems(){
batchInsertSalesOrderItems(this.currentRow).then(({data}) =>{
if(data.code === 200){
this.$message.success('操作成功!');
//
this.refreshPageTables();
}else{
this.$message.error(data.msg)
}
});
},
checkSalesOrder () {
checkSalesOrderException().then(({data}) => {
if(data.code === 200){
this.$message.success('操作成功!');
//
this.refreshPageTables();
}else{
this.$message.error(data.msg)
}
})
},
/*设置工艺的行*/
setCurrentRow(row, column, event) {
this.currentRow = row;
},
//
/*当前值发生变化的时候修改*/
changeCurrentRow(row, oldRow){
//
if(row){
this.currentRow = JSON.parse(JSON.stringify(row));
}
},
// +
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 += '}'
return eval('(' + json + ')')
},
createExportData () {
// ,,
return this.tableData
},
getStrDate () {
let dd = new Date()
let Y = dd.getFullYear()
let M = (dd.getMonth() + 1) < 10 ? '0' + (dd.getMonth() + 1) : (dd.getMonth() + 1)// 100
let D = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate()// 100
let H = dd.getHours() < 10 ? '0' + dd.getHours() : dd.getHours()
let MM = dd.getMinutes() < 10 ? '0' + dd.getMinutes() : dd.getMinutes()
let S = dd.getSeconds() < 10 ? '0' + dd.getSeconds() : dd.getSeconds()
return Y + M + D + H + MM + S
},
userSetting () {
this.visible = true
this.$nextTick(() => {
this.$refs.column.init(this.queryTable)
})
},
/*新增文件的modal*/
addUploadFileModal(){
//
this.$nextTick(() => {
this.$refs.comSalesOrderUploadFile.init();
})
},
/*导出销售单明细的数据*/
exportSalesOrder(){
downSalesOrder('download').then(({data}) => {
//
const blob = new Blob([data], {type: 'application/octet-stream;charset=utf-8'})
//
const fileName = '销售单明细.xlsx';
// a
const linkNode = document.createElement('a')
linkNode.download = fileName // adownload
linkNode.style.display = 'none'
linkNode.href = URL.createObjectURL(blob) // Blob URL
console.log(linkNode)
// if(val == 'Y'){
// this.pdfVisible = true
// this.pdfUrl = linkNode.href
// }else {
document.body.appendChild(linkNode)
linkNode.click() //
URL.revokeObjectURL(linkNode.href) // URL
document.body.removeChild(linkNode)
})
/*axios.get('/proxyApi/jst/downSalesOrder?remark=', {
responseType: 'blob',
headers: {
'Content-Type': 'application/json',
'token': Vue.cookie.get('token')
}
}).then(({data}) => {
//
const blob = new Blob([data], {type: "application/octet-stream"})
//
const fileName = "销售明细.xlsx"
console.info(fileName);
// a
const linkNode = document.createElement('a')
linkNode.download = fileName // adownload
linkNode.style.display = 'none'
linkNode.href = URL.createObjectURL(blob) // Blob URL
debugger;
document.body.appendChild(linkNode)
linkNode.click() //
URL.revokeObjectURL(linkNode.href) // URL
document.body.removeChild(linkNode)
// }
})*/
/*let url = '/api/ftp/file//downSalesOrder'
let token = Vue.cookie.get('token');
axios.get(url,{
headers: {
'Content-Type': 'application/json',
'token': token
},
responseType: 'blob',//
}).then(function (res) {
if (!res) return
let blob = new Blob([res.data], {type: 'application/vnd.ms-excel;charset=utf8'})
var downloadElement = documentcreateElement('a');
var href = window.URL.createObjectURL(blob); //
downloadElement.href = href;
downloadElement.download = '销售明细导出.xlsx'; //
document.body.appendChild(downloadElement);
downloadElement.click(); //
document.body.removeChild(downloadElement); //
window.URL.revokeobjectURL(href); //blob
}).catch(function (error){
console.log(error)
})*/
/*let url = '/proxyApi/jst/downSalesOrder?remark=';
const xhr = new XMLHttpRequest()
xhr.open('get', url)
xhr.responseType = 'blob'//
xhr.setRequestHeader('token', Vue.cookie.get('token')) // token
xhr.onreadystatechange = function() {
if (this.readyState === 4 && this.status === 200) {
const name = '销售明细';
// IE
if (window.navigator && window.navigator.msSaveOrOpenBlob) {
window.navigator.msSaveOrOpenBlob(this.response, name)
return
}
const href = window.URL.createObjectURL(this.response)
const link = document.createElement('a')
link.style.display = 'none'
link.href = href
link.setAttribute('download', name)
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
window.URL.revokeObjectURL(href) // blob
}
}
xhr.send();*/
},
},
created() {
this.refreshPageTables();
// this.getLanguageList()
}
}
</script>
<style scoped>
</style>

233
src/views/modules/jst/sales_order_warehouse.vue

@ -0,0 +1,233 @@
<template>
<div class="mod-config">
<el-form v-model="searchData">
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 5px;" >
<el-form-item :label="'仓库名称:'">
<el-input v-model="searchData.warehouseName" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="' '">
<el-button @click="refreshPageTables()" style="margin-left: 0px" type="primary">查询</el-button>
<el-button @click="addOrUpdateModal('Y')" style="margin-left: 14px" type="primary">新增</el-button>
<el-button @click="addOrUpdateModal('N')" style="margin-left: 14px" type="primary">修改</el-button>
</el-form-item>
<el-form-item :label="' '">
<download-excel
:fields="fields()"
type="xls"
:name="exportName"
:fetch="createExportData"
worksheet="导出信息"
class="el-button el-button--primary el-button--medium">
{{ '导出' }}
</download-excel>
</el-form-item>
</el-form>
</el-form>
<el-table
:height="height"
:data="tableData"
ref="fileTable"
highlight-current-row
@row-click="setCurrentRow"
@current-change="changeCurrentRow"
border
style="width: 100%">
<el-table-column
v-for="(item,index) in columnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
header-align="center"
: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>
<!--新增或者修改-->
<comAddUpdateWarehouse ref="comAddUpdateWarehouse" @refreshPageTables="refreshPageTables" v-drag></comAddUpdateWarehouse>
</div>
</template>
<script>
import comAddUpdateWarehouse from "./com_add_update_warehouse";
import {
getSalesOrderWarehouse,
} from '@/api/jst/sales_order_warehouse.js'
import Vue from 'vue'
export default {
name: 'salesOrder',
data () {
return {
// + start
exportData: [],
exportName: '发货仓表' + this.getStrDate(),
columnList: [
{
tableId: 'warehouseHist',
tableName: this.$route.meta.title,
columnProp: 'warehouseName',
columnLabel: '仓库名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 30,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'left'
},
{
tableId: 'warehouseHist',
tableName: this.$route.meta.title,
columnProp: 'warehouseType',
columnLabel: '仓库类型',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 60,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'left'
},
{
tableId: 'warehouseHist',
tableName: this.$route.meta.title,
columnProp: 'createdDate',
columnLabel: '创建时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 60,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'left'
},
],
currentRow:{},
visible: false,
// end
height: 200,
tableData: [],
searchData: {
warehouseName: '',
},
}
},
components: {
comAddUpdateWarehouse,/*新增或修改*/
},
mounted () {
this.$nextTick(() => {
this.height = window.innerHeight - 150
})
},
methods: {
refreshPageTables () {
getSalesOrderWarehouse(this.searchData).then(({data}) => {
this.tableData = data.rows;
if(data.total > 0){
//
this.$refs.fileTable.setCurrentRow(this.tableData[0]);
}
})
},
/*设置工艺的行*/
setCurrentRow(row, column, event) {
this.currentRow = row;
},
//
/*当前值发生变化的时候修改*/
changeCurrentRow(row, oldRow){
//
if(row){
this.currentRow = JSON.parse(JSON.stringify(row));
}
},
// +
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 += '}'
return eval('(' + json + ')')
},
createExportData () {
// ,,
return this.tableData
},
getStrDate () {
let dd = new Date()
let Y = dd.getFullYear()
let M = (dd.getMonth() + 1) < 10 ? '0' + (dd.getMonth() + 1) : (dd.getMonth() + 1)// 100
let D = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate()// 100
let H = dd.getHours() < 10 ? '0' + dd.getHours() : dd.getHours()
let MM = dd.getMinutes() < 10 ? '0' + dd.getMinutes() : dd.getMinutes()
let S = dd.getSeconds() < 10 ? '0' + dd.getSeconds() : dd.getSeconds()
return Y + M + D + H + MM + S
},
/*新增或修改的modal*/
addOrUpdateModal(addFlag){
//
this.$nextTick(() => {
//
if('Y' === addFlag){
this.$refs.comAddUpdateWarehouse.init({}, addFlag);
}else{
this.$refs.comAddUpdateWarehouse.init(this.currentRow, addFlag);
}
})
},
},
created() {
this.refreshPageTables();
// this.getLanguageList()
}
}
</script>
<style scoped>
</style>

347
src/views/modules/jst/shop_store.vue

@ -0,0 +1,347 @@
<template>
<div class="mod-config">
<el-form v-model="searchData">
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 5px;" >
<el-form-item :label="'店铺名称:'">
<el-input v-model="searchData.shopName" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'店铺编号:'">
<el-input v-model="searchData.shopId" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="' '">
<el-button @click="refreshPageTables()" style="margin-left: 0px" type="primary">查询</el-button>
<el-button @click="addOrUpdateModal('Y')" style="margin-left: 14px" type="primary">新增</el-button>
<el-button @click="addOrUpdateModal('N')" style="margin-left: 14px" type="primary">修改</el-button>
</el-form-item>
<el-form-item :label="' '">
<download-excel
:fields="fields()"
type="xls"
:name="exportName"
:fetch="createExportData"
worksheet="导出信息"
class="el-button el-button--primary el-button--medium">
{{ '导出' }}
</download-excel>
</el-form-item>
</el-form>
</el-form>
<el-table
:height="height"
:data="tableData"
ref="fileTable"
highlight-current-row
@row-click="setCurrentRow"
@current-change="changeCurrentRow"
border
style="width: 100%">
<el-table-column
v-for="(item,index) in columnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
header-align="center"
: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>
<!--新增或者修改-->
<comAddUpdateShopStore ref="comAddUpdateShopStore" @refreshPageTables="refreshPageTables" v-drag></comAddUpdateShopStore>
</div>
</template>
<script>
import comAddUpdateShopStore from "./com_add_update_shop_store";
import {
getShopStores,
insertShopStore,
saveShopStore,
} from '@/api/jst/shop_store.js'
import Vue from 'vue'
export default {
name: 'salesOrder',
data () {
return {
// + start
exportData: [],
exportName: '店铺映射表' + this.getStrDate(),
columnList: [
{
tableId: 'shopStoreHist',
tableName: this.$route.meta.title,
columnProp: 'contract',
columnLabel: '域',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 30,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'left'
},
{
tableId: 'shopStoreHist',
tableName: this.$route.meta.title,
columnProp: 'shopSite',
columnLabel: '店铺站点',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 60,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'left'
},
{
tableId: 'shopStoreHist',
tableName: this.$route.meta.title,
columnProp: 'shopId',
columnLabel: '店铺编号',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 60,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'left'
},
{
tableId: 'shopStoreHist',
tableName: this.$route.meta.title,
columnProp: 'shopName',
columnLabel: '店铺名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 120,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'left'
},
{
tableId: 'shopStoreHist',
tableName: this.$route.meta.title,
columnProp: 'customerNo',
columnLabel: '客户编号',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 60,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'left'
},
{
tableId: 'shopStoreHist',
tableName: this.$route.meta.title,
columnProp: 'pureCustom',
columnLabel: '区分纯电商',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 60,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'left'
},
{
tableId: 'shopStoreHist',
tableName: this.$route.meta.title,
columnProp: 'distinguishCustom',
columnLabel: '区分客户',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 60,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'left'
},
{
tableId: 'shopStoreHist',
tableName: this.$route.meta.title,
columnProp: 'consignmentFlag',
columnLabel: '区分寄售',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 60,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'left'
},
{
tableId: 'shopStoreHist',
tableName: this.$route.meta.title,
columnProp: 'orderType',
columnLabel: '订单类型',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 60,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'right'
},
],
currentRow:{},
visible: false,
// end
height: 200,
tableData: [],
searchData: {
shopName: '',
shopId: '',
},
}
},
components: {
comAddUpdateShopStore,/*新增或修改*/
},
mounted () {
this.$nextTick(() => {
this.height = window.innerHeight - 150
})
},
methods: {
refreshPageTables () {
getShopStores(this.searchData).then(({data}) => {
this.tableData = data.rows;
if(data.total > 0){
//
this.$refs.fileTable.setCurrentRow(this.tableData[0]);
}
})
},
/*设置工艺的行*/
setCurrentRow(row, column, event) {
this.currentRow = row;
},
//
/*当前值发生变化的时候修改*/
changeCurrentRow(row, oldRow){
//
if(row){
this.currentRow = JSON.parse(JSON.stringify(row));
}
},
// +
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 += '}'
return eval('(' + json + ')')
},
createExportData () {
// ,,
return this.tableData
},
getStrDate () {
let dd = new Date()
let Y = dd.getFullYear()
let M = (dd.getMonth() + 1) < 10 ? '0' + (dd.getMonth() + 1) : (dd.getMonth() + 1)// 100
let D = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate()// 100
let H = dd.getHours() < 10 ? '0' + dd.getHours() : dd.getHours()
let MM = dd.getMinutes() < 10 ? '0' + dd.getMinutes() : dd.getMinutes()
let S = dd.getSeconds() < 10 ? '0' + dd.getSeconds() : dd.getSeconds()
return Y + M + D + H + MM + S
},
/*新增或修改的modal*/
addOrUpdateModal(addFlag){
//
this.$nextTick(() => {
//
if('Y' === addFlag){
this.$refs.comAddUpdateShopStore.init({}, addFlag);
}else{
this.$refs.comAddUpdateShopStore.init(this.currentRow, addFlag);
}
})
},
},
created() {
this.refreshPageTables();
// this.getLanguageList()
}
}
</script>
<style scoped>
</style>
Loading…
Cancel
Save