|
@@ -2,6 +2,24 @@
|
|
|
<fullscreen :fullscreen.sync="fullscreen" class="container">
|
|
|
<div class="container-box">
|
|
|
<toolList @iconCli="iconCli" :tooltit="tooltit"></toolList>
|
|
|
+ <div class="search" style="justify-content: flex-start;">
|
|
|
+ <el-button class="btn-check" size="medium" type="primary" @click="outlist">导出
|
|
|
+ </el-button>
|
|
|
+ <el-button class="btn-check" size="medium" type="primary" @click="exportTempletelist">下载导入模板
|
|
|
+ </el-button>
|
|
|
+ <myUpload style="display:inline-block;" :fileInfo="fileInfot"
|
|
|
+ :fileList="fileInfot.fileList" @uploadBack='uploadBack'></myUpload>
|
|
|
+ <el-button
|
|
|
+ class="btn-check"
|
|
|
+ size="medium"
|
|
|
+ type="primary"
|
|
|
+ @click="dialogCheck(3)"
|
|
|
+ v-if="
|
|
|
+ userInfo.countyName != null || userInfo.cityName != null
|
|
|
+ "
|
|
|
+ >添加
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
<div class="search">
|
|
|
<mySearch
|
|
|
:searchList="searchList"
|
|
@@ -433,12 +451,14 @@
|
|
|
import mySearch from "../../../components/search.vue";
|
|
|
import myMessage from "../../../components/myMessage.vue";
|
|
|
import toolList from "../../../components/toolList";
|
|
|
+import myUpload from "../../../components/upload.vue";
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
|
mySearch,
|
|
|
myMessage,
|
|
|
- toolList
|
|
|
+ toolList,
|
|
|
+ myUpload
|
|
|
},
|
|
|
data() {
|
|
|
//地市名称
|
|
@@ -649,25 +669,37 @@ export default {
|
|
|
type: "input",
|
|
|
tit: "地市名称",
|
|
|
value: "",
|
|
|
- width: "24%"
|
|
|
+ width: "16%"
|
|
|
},
|
|
|
{
|
|
|
type: "input",
|
|
|
tit: "区县名称",
|
|
|
value: "",
|
|
|
- width: "24%"
|
|
|
+ width: "16%"
|
|
|
},
|
|
|
{
|
|
|
type: "input",
|
|
|
tit: "渠道名称",
|
|
|
value: "",
|
|
|
- width: "24%"
|
|
|
+ width: "16%"
|
|
|
},
|
|
|
{
|
|
|
type: "input",
|
|
|
tit: "场景",
|
|
|
value: "",
|
|
|
- width: "24%"
|
|
|
+ width: "16%"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ tit: "物料类别",
|
|
|
+ value: "",
|
|
|
+ width: "16%"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ tit: "物料名称",
|
|
|
+ value: "",
|
|
|
+ width: "16%"
|
|
|
}
|
|
|
],
|
|
|
tooltit: "物料基础信息维护",
|
|
@@ -794,7 +826,16 @@ export default {
|
|
|
metirialTypeopt: [],
|
|
|
materialNameopt: [],
|
|
|
metirialInfoSingle: [],
|
|
|
- quantityDisabled: true
|
|
|
+ quantityDisabled: true,
|
|
|
+ fileInfot: {
|
|
|
+ type: 'btn',
|
|
|
+ typename: '导入',
|
|
|
+ btntype: 'primary',
|
|
|
+ limit: 1,
|
|
|
+ url: '/market/cadvBusiMetirial/import',
|
|
|
+ fileList: [],
|
|
|
+ woNo: "",
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -902,6 +943,9 @@ export default {
|
|
|
v[1] ? (this.params.countyName = v[1]) : "";
|
|
|
v[2] ? (this.params.channelName = v[2]) : "";
|
|
|
v[3] ? (this.params.sceneName = v[3]) : "";
|
|
|
+ //新增物料类别和物料名称模糊查询
|
|
|
+ v[4] ? (this.params.metirialType = v[4]) : "";
|
|
|
+ v[5] ? (this.params.metirialName = v[5]) : "";
|
|
|
this.getList(this.params, this.pageSize);
|
|
|
},
|
|
|
//获取列表
|
|
@@ -1083,7 +1127,14 @@ export default {
|
|
|
},
|
|
|
//文件返回值
|
|
|
uploadBack(v) {
|
|
|
+ let that = this;
|
|
|
console.log(v);
|
|
|
+ if(v.data.result==0){
|
|
|
+ that.getList({}, 1);
|
|
|
+ that.getUser();
|
|
|
+ that.getMetirialType();
|
|
|
+ that.getMetirialInfo();
|
|
|
+ }
|
|
|
},
|
|
|
//功能栏
|
|
|
iconCli(v) {
|
|
@@ -1204,6 +1255,72 @@ export default {
|
|
|
}).then(res => {
|
|
|
this.materialNameopt = res.data;
|
|
|
});
|
|
|
+ },
|
|
|
+ outlist() {
|
|
|
+ let data = this.params;
|
|
|
+ console.log(data);
|
|
|
+ // return
|
|
|
+ this.$http({
|
|
|
+ url: "/market/cadvBusiMetirial/excelExportBase",
|
|
|
+ method: "post",
|
|
|
+ headers: {
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ },
|
|
|
+ responseType: "blob",
|
|
|
+ data: data,
|
|
|
+ }).then((response) => {
|
|
|
+ if (window.navigator && window.navigator.msSaveOrOpenBlob) {
|
|
|
+ let blob = new Blob([response.data], {
|
|
|
+ type: 'application/vnd.ms-excel'
|
|
|
+ })
|
|
|
+ window.navigator.msSaveOrOpenBlob(blob,
|
|
|
+ new Date().getTime() + '.xlsx')
|
|
|
+ } else {
|
|
|
+ /* 火狐谷歌的文件下载方式 */
|
|
|
+ var blob = new Blob([response.data])
|
|
|
+ var downloadElement = document.createElement('a')
|
|
|
+ var href = window.URL.createObjectURL(blob)
|
|
|
+ downloadElement.href = href
|
|
|
+ downloadElement.download = new Date().getTime() + '.xlsx'
|
|
|
+ document.body.appendChild(downloadElement)
|
|
|
+ downloadElement.click()
|
|
|
+ document.body.removeChild(downloadElement)
|
|
|
+ window.URL.revokeObjectURL(href)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ exportTempletelist() {
|
|
|
+ let data = this.params;
|
|
|
+ console.log(data);
|
|
|
+ // return
|
|
|
+ this.$http({
|
|
|
+ url: "/market/cadvBusiMetirial/excelExportTemplete",
|
|
|
+ method: "post",
|
|
|
+ headers: {
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ },
|
|
|
+ responseType: "blob",
|
|
|
+ data: data,
|
|
|
+ }).then((response) => {
|
|
|
+ if (window.navigator && window.navigator.msSaveOrOpenBlob) {
|
|
|
+ let blob = new Blob([response.data], {
|
|
|
+ type: 'application/vnd.ms-excel'
|
|
|
+ })
|
|
|
+ window.navigator.msSaveOrOpenBlob(blob,
|
|
|
+ new Date().getTime() + '.xlsx')
|
|
|
+ } else {
|
|
|
+ /* 火狐谷歌的文件下载方式 */
|
|
|
+ var blob = new Blob([response.data])
|
|
|
+ var downloadElement = document.createElement('a')
|
|
|
+ var href = window.URL.createObjectURL(blob)
|
|
|
+ downloadElement.href = href
|
|
|
+ downloadElement.download = new Date().getTime() + '.xlsx'
|
|
|
+ document.body.appendChild(downloadElement)
|
|
|
+ downloadElement.click()
|
|
|
+ document.body.removeChild(downloadElement)
|
|
|
+ window.URL.revokeObjectURL(href)
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|