|
@@ -24,40 +24,16 @@
|
|
<template #table-header="{}">
|
|
<template #table-header="{}">
|
|
<div style="width: 100%">
|
|
<div style="width: 100%">
|
|
<el-row style="padding: 0 0 0 80px">
|
|
<el-row style="padding: 0 0 0 80px">
|
|
- <el-col :span="6" style="width: 463px">
|
|
|
|
|
|
+ <el-col :span="6" style="width: 220px">
|
|
<periodDatePickerActive
|
|
<periodDatePickerActive
|
|
- :start="parmValue.start_date"
|
|
|
|
- :end="parmValue.end_date"
|
|
|
|
- :placeholder="'产品操作'"
|
|
|
|
- :width="'205px'"
|
|
|
|
|
|
+ :month="month"
|
|
:size="searchSize"
|
|
:size="searchSize"
|
|
|
|
+ :newTime="newTime"
|
|
@timeReturned="time"
|
|
@timeReturned="time"
|
|
/>
|
|
/>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col :span="4" style="width: 66px; float: right">
|
|
|
|
- <el-button
|
|
|
|
- type="primary"
|
|
|
|
- style="margin-left: 30px"
|
|
|
|
- @click="download"
|
|
|
|
- :size="searchSize"
|
|
|
|
- class="fr"
|
|
|
|
- >
|
|
|
|
- 导出
|
|
|
|
- </el-button>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="3" style="width: 66px; float: right">
|
|
|
|
- <el-button
|
|
|
|
- :size="searchSize"
|
|
|
|
- type="primary"
|
|
|
|
- style="float: right; margin-left: 5px"
|
|
|
|
- @click="searchList"
|
|
|
|
- >
|
|
|
|
- 刷新
|
|
|
|
- </el-button>
|
|
|
|
- </el-col>
|
|
|
|
- </el-row>
|
|
|
|
- <el-row style="padding: 10px 0 0 0" gutter="10">
|
|
|
|
- <el-col :span="6" style="width: 240px">
|
|
|
|
|
|
+
|
|
|
|
+ <el-col :span="6" style="width: 140px;padding:0 0 0 10px">
|
|
<el-input
|
|
<el-input
|
|
clearable
|
|
clearable
|
|
placeholder="采购维护人"
|
|
placeholder="采购维护人"
|
|
@@ -72,7 +48,7 @@
|
|
>
|
|
>
|
|
</el-input>
|
|
</el-input>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col :span="6" style="width: 240px">
|
|
|
|
|
|
+ <el-col :span="6" style="width: 350px;padding:0 0 0 10px">
|
|
<el-input
|
|
<el-input
|
|
clearable
|
|
clearable
|
|
placeholder="供应商名称"
|
|
placeholder="供应商名称"
|
|
@@ -89,11 +65,27 @@
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="4" style="width: 66px; float: right">
|
|
<el-col :span="4" style="width: 66px; float: right">
|
|
<el-button
|
|
<el-button
|
|
- type="warning"
|
|
|
|
|
|
+ type="primary"
|
|
|
|
+ style="margin-left: 30px"
|
|
|
|
+ @click="download"
|
|
|
|
+ :size="searchSize"
|
|
class="fr"
|
|
class="fr"
|
|
|
|
+ >
|
|
|
|
+ 导出
|
|
|
|
+ </el-button>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="3" style="width: 66px; float: right">
|
|
|
|
+ <el-button
|
|
:size="searchSize"
|
|
:size="searchSize"
|
|
- @click="restSearch"
|
|
|
|
|
|
+ type="primary"
|
|
|
|
+ style="float: right; margin-left: 5px"
|
|
|
|
+ @click="searchList"
|
|
>
|
|
>
|
|
|
|
+ 刷新
|
|
|
|
+ </el-button>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="4" style="width: 66px; float: right">
|
|
|
|
+ <el-button type="warning" class="fr" :size="searchSize" @click="restSearch">
|
|
重置
|
|
重置
|
|
</el-button>
|
|
</el-button>
|
|
</el-col>
|
|
</el-col>
|
|
@@ -101,133 +93,17 @@
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
- <template #operation="{ scope }">
|
|
|
|
- <el-tooltip effect="dark" content="修改内容对比" placement="top">
|
|
|
|
- <i class="el-icon-view tb-icon" @click="dlgTable(scope.row)"></i>
|
|
|
|
- </el-tooltip>
|
|
|
|
- </template>
|
|
|
|
|
|
+ <template #catinfo="{ scope }"> </template>
|
|
</ex-table>
|
|
</ex-table>
|
|
-
|
|
|
|
- <el-dialog
|
|
|
|
- title="产品修改差异对比"
|
|
|
|
- :visible.sync="dialogTableVisible"
|
|
|
|
- :center="true"
|
|
|
|
- align="left"
|
|
|
|
- top="3vh"
|
|
|
|
- width="1040px"
|
|
|
|
- :close-on-click-modal="false"
|
|
|
|
- element-loading-text="拼命加载中"
|
|
|
|
- element-loading-spinner="el-icon-loading"
|
|
|
|
- element-loading-background="rgba(0, 0, 0, 0.8)"
|
|
|
|
- @close="dialogTableVisible = false"
|
|
|
|
- >
|
|
|
|
- <el-table
|
|
|
|
- :data="showData"
|
|
|
|
- :size="searchSize"
|
|
|
|
- border
|
|
|
|
- stripe
|
|
|
|
- max-height="750px"
|
|
|
|
- style="width: 100%; margin: -20px 0 0"
|
|
|
|
- >
|
|
|
|
- <el-table-column
|
|
|
|
- prop="key_name"
|
|
|
|
- label="修改字段名称"
|
|
|
|
- width="130px"
|
|
|
|
- show-overflow-tooltip
|
|
|
|
- />
|
|
|
|
- <el-table-column
|
|
|
|
- prop="key"
|
|
|
|
- label="修改字段"
|
|
|
|
- width="130px"
|
|
|
|
- show-overflow-tooltip
|
|
|
|
- />
|
|
|
|
- <el-table-column prop="before" label="修改前" show-overflow-tooltip>
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <div v-if="scope.row.key === 'good_img'">
|
|
|
|
- <img
|
|
|
|
- v-for="(si, sii) in scope.row.before"
|
|
|
|
- :key="si + sii"
|
|
|
|
- :src="si"
|
|
|
|
- alt=""
|
|
|
|
- class="fl"
|
|
|
|
- v-viewer
|
|
|
|
- style="width: 30px; height: 30px"
|
|
|
|
- />
|
|
|
|
- </div>
|
|
|
|
- <div v-else-if="scope.row.key === 'good_info_img'">
|
|
|
|
- <img
|
|
|
|
- v-for="(si, sii) in scope.row.after"
|
|
|
|
- :key="si + sii"
|
|
|
|
- :src="si"
|
|
|
|
- alt=""
|
|
|
|
- v-viewer
|
|
|
|
- class="fl"
|
|
|
|
- style="width: 30px; height: 30px"
|
|
|
|
- />
|
|
|
|
- </div>
|
|
|
|
- <div v-else-if="scope.row.key === 'good_thumb_img'">
|
|
|
|
- <img
|
|
|
|
- v-for="(si, sii) in scope.row.after"
|
|
|
|
- :key="si + sii"
|
|
|
|
- :src="si"
|
|
|
|
- alt=""
|
|
|
|
- v-viewer
|
|
|
|
- class="fl"
|
|
|
|
- style="width: 30px; height: 30px"
|
|
|
|
- />
|
|
|
|
- </div>
|
|
|
|
- <div v-else>{{ scope.row.before }}</div>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column prop="after" label="修改后" show-overflow-tooltip>
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <div v-if="scope.row.key === 'good_img'">
|
|
|
|
- <img
|
|
|
|
- v-for="(si, sii) in scope.row.after"
|
|
|
|
- :key="si + sii"
|
|
|
|
- :src="si"
|
|
|
|
- alt=""
|
|
|
|
- v-viewer
|
|
|
|
- class="fl"
|
|
|
|
- style="width: 30px; height: 30px"
|
|
|
|
- />
|
|
|
|
- </div>
|
|
|
|
- <div v-else-if="scope.row.key === 'good_info_img'">
|
|
|
|
- <img
|
|
|
|
- v-for="(si, sii) in scope.row.after"
|
|
|
|
- :key="si + sii"
|
|
|
|
- :src="si"
|
|
|
|
- alt=""
|
|
|
|
- v-viewer
|
|
|
|
- class="fl"
|
|
|
|
- style="width: 30px; height: 30px"
|
|
|
|
- />
|
|
|
|
- </div>
|
|
|
|
- <div v-else-if="scope.row.key === 'good_thumb_img'">
|
|
|
|
- <img
|
|
|
|
- v-for="(si, sii) in scope.row.after"
|
|
|
|
- :key="si + sii"
|
|
|
|
- :src="si"
|
|
|
|
- alt=""
|
|
|
|
- v-viewer
|
|
|
|
- class="fl"
|
|
|
|
- style="width: 30px; height: 30px"
|
|
|
|
- />
|
|
|
|
- </div>
|
|
|
|
- <div v-else>{{ scope.row.after }}</div>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- </el-table>
|
|
|
|
- </el-dialog>
|
|
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
- <script>
|
|
|
|
|
|
+<script>
|
|
import mixinPage from "@/mixins/elPaginationHandle";
|
|
import mixinPage from "@/mixins/elPaginationHandle";
|
|
import resToken from "@/mixins/resToken";
|
|
import resToken from "@/mixins/resToken";
|
|
import urlConfig from "@/apis/url-config";
|
|
import urlConfig from "@/apis/url-config";
|
|
import asyncRequest from "@/apis/service/reportQuery/productReport";
|
|
import asyncRequest from "@/apis/service/reportQuery/productReport";
|
|
-import periodDatePickerActive from "../period-date-picker/main.vue";
|
|
|
|
-import { table3, editTable3 } from "./columns";
|
|
|
|
|
|
+import periodDatePickerActive from "../period-date-picker-month/index.vue";
|
|
|
|
+import { table3 } from "./columns";
|
|
import { mapGetters } from "vuex";
|
|
import { mapGetters } from "vuex";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
@@ -241,9 +117,10 @@ export default {
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ newTime: "",
|
|
|
|
+ month: "",
|
|
editOld: {},
|
|
editOld: {},
|
|
editNew: {},
|
|
editNew: {},
|
|
- dialogTableVisible: false,
|
|
|
|
//选中数组
|
|
//选中数组
|
|
changeList: [],
|
|
changeList: [],
|
|
showData: [],
|
|
showData: [],
|
|
@@ -276,46 +153,29 @@ export default {
|
|
},
|
|
},
|
|
|
|
|
|
table3: table3,
|
|
table3: table3,
|
|
- editTable3,
|
|
|
|
};
|
|
};
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
- this.searchList();
|
|
|
|
|
|
+ this.month = this.transformTime();
|
|
|
|
+ this.getNewTime();
|
|
},
|
|
},
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
- dlgTable(row) {
|
|
|
|
- this.showData = [];
|
|
|
|
- const { before_info, after_info } = row;
|
|
|
|
-
|
|
|
|
- let keyList = [];
|
|
|
|
- for (let key in after_info) {
|
|
|
|
- keyList.push(key);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- for (let i = 0; i < keyList.length; i++) {
|
|
|
|
-
|
|
|
|
- let model = {
|
|
|
|
- key: keyList[i],
|
|
|
|
- key_name:
|
|
|
|
- (editTable3.find((s) => s.prop === keyList[i]) || {}).label ||
|
|
|
|
- "--",
|
|
|
|
- before: this.get_key_value(keyList[i], before_info),
|
|
|
|
- after: this.get_key_value(keyList[i], after_info),
|
|
|
|
- };
|
|
|
|
- // console.log(model.key_name)
|
|
|
|
- this.showData.push(model);
|
|
|
|
- }
|
|
|
|
- this.dialogTableVisible = true;
|
|
|
|
|
|
+ transformTime() {
|
|
|
|
+ let time = new Date();
|
|
|
|
+ let y = time.getFullYear();
|
|
|
|
+ let M = time.getMonth() + 1;
|
|
|
|
+ return y + "-" + (M < 10 ? "0" + M : M);
|
|
|
|
+ },
|
|
|
|
+ getNewTime() {
|
|
|
|
+ this.newTime = new Date().valueOf();
|
|
},
|
|
},
|
|
get_key_value(key, info) {
|
|
get_key_value(key, info) {
|
|
if (key === "good_img") {
|
|
if (key === "good_img") {
|
|
return info[key] ? (info[key] || "").split(",") : [];
|
|
return info[key] ? (info[key] || "").split(",") : [];
|
|
- }
|
|
|
|
- else if(key === "good_info_img") {
|
|
|
|
|
|
+ } else if (key === "good_info_img") {
|
|
return info[key] ? (info[key] || "").split(",") : [];
|
|
return info[key] ? (info[key] || "").split(",") : [];
|
|
- }
|
|
|
|
- else if(key === "good_thumb_img") {
|
|
|
|
|
|
+ } else if (key === "good_thumb_img") {
|
|
return info[key] ? (info[key] || "").split(",") : [];
|
|
return info[key] ? (info[key] || "").split(",") : [];
|
|
}
|
|
}
|
|
// else if(key === "cat_id") {
|
|
// else if(key === "cat_id") {
|
|
@@ -325,19 +185,28 @@ export default {
|
|
},
|
|
},
|
|
//初始化http请求
|
|
//初始化http请求
|
|
async searchList() {
|
|
async searchList() {
|
|
|
|
+ if (this.loading) return;
|
|
if (
|
|
if (
|
|
(this.parmValue.start_date !== "" && this.parmValue.end_date === "") ||
|
|
(this.parmValue.start_date !== "" && this.parmValue.end_date === "") ||
|
|
(this.parmValue.start_date === "" && this.parmValue.end_date !== "")
|
|
(this.parmValue.start_date === "" && this.parmValue.end_date !== "")
|
|
) {
|
|
) {
|
|
- this.$message.warning("时间区间不完整!");
|
|
|
|
|
|
+ this.$message.warning("请选择时间!");
|
|
|
|
+ this.tableData = [];
|
|
|
|
+ this.pageInfo.total = 0;
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- // return;
|
|
|
|
this.loading = true;
|
|
this.loading = true;
|
|
const res = await asyncRequest.goodSimpleZhao(this.parmValue);
|
|
const res = await asyncRequest.goodSimpleZhao(this.parmValue);
|
|
console.log(res);
|
|
console.log(res);
|
|
if (res && res.code === 0 && res.data) {
|
|
if (res && res.code === 0 && res.data) {
|
|
this.tableData = res.data.list;
|
|
this.tableData = res.data.list;
|
|
|
|
+ this.tableData.forEach((a) => {
|
|
|
|
+ a.cat_name = "";
|
|
|
|
+ let list = a.catinfo || [];
|
|
|
|
+ list.forEach((b, i) => {
|
|
|
|
+ a.cat_name += i == 0 ? b.name : "/" + b.name;
|
|
|
|
+ });
|
|
|
|
+ });
|
|
this.pageInfo.total = Number(res.data.count);
|
|
this.pageInfo.total = Number(res.data.count);
|
|
} else if (res && res.code >= 100 && res.code <= 104) {
|
|
} else if (res && res.code >= 100 && res.code <= 104) {
|
|
await this.logout();
|
|
await this.logout();
|
|
@@ -347,36 +216,37 @@ export default {
|
|
this.$message.warning(res.message);
|
|
this.$message.warning(res.message);
|
|
}
|
|
}
|
|
this.loading = false;
|
|
this.loading = false;
|
|
|
|
+ // } else {
|
|
|
|
+ // this.$message.warning("请选择时间!");
|
|
|
|
+ // }
|
|
},
|
|
},
|
|
|
|
|
|
//重置
|
|
//重置
|
|
restSearch() {
|
|
restSearch() {
|
|
- this.parmValue = {
|
|
|
|
- creater: "", //采购维护人
|
|
|
|
- supplier_name: "", // 供应商名称
|
|
|
|
- start_date: "", //新建起始时间
|
|
|
|
- end_date: "", // 新建结束时间
|
|
|
|
- page: 1, // 页码
|
|
|
|
- size: 15, // 每页显示条数
|
|
|
|
- };
|
|
|
|
- // 表格 - 分页
|
|
|
|
|
|
+ this.month = this.transformTime();
|
|
|
|
+
|
|
|
|
+ this.parmValue.page = 1;
|
|
|
|
+ this.parmValue.sizee = 15;
|
|
|
|
+ this.parmValue.creater = ""; //采购维护人
|
|
|
|
+ this.parmValue.supplier_name = ""; // 供应商名称
|
|
this.pageInfo = {
|
|
this.pageInfo = {
|
|
size: 15,
|
|
size: 15,
|
|
curr: 1,
|
|
curr: 1,
|
|
total: 0,
|
|
total: 0,
|
|
};
|
|
};
|
|
- this.searchList();
|
|
|
|
|
|
+ this.getNewTime();
|
|
},
|
|
},
|
|
|
|
|
|
// 时间函数
|
|
// 时间函数
|
|
async time(e) {
|
|
async time(e) {
|
|
this.parmValue.start_date = e.startTime || "";
|
|
this.parmValue.start_date = e.startTime || "";
|
|
this.parmValue.end_date = e.endTime || "";
|
|
this.parmValue.end_date = e.endTime || "";
|
|
|
|
+ this.month = e.value;
|
|
if (
|
|
if (
|
|
(this.parmValue.start_date !== "" && this.parmValue.end_date === "") ||
|
|
(this.parmValue.start_date !== "" && this.parmValue.end_date === "") ||
|
|
(this.parmValue.start_date === "" && this.parmValue.end_date !== "")
|
|
(this.parmValue.start_date === "" && this.parmValue.end_date !== "")
|
|
) {
|
|
) {
|
|
- this.$message.warning("时间区间不完整!");
|
|
|
|
|
|
+ this.$message.warning("请选择时间!");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
this.pageInfo.curr = 1;
|
|
this.pageInfo.curr = 1;
|
|
@@ -392,20 +262,13 @@ export default {
|
|
},
|
|
},
|
|
//导出文件
|
|
//导出文件
|
|
async download() {
|
|
async download() {
|
|
- // if(this.changeList.length<=0){
|
|
|
|
- // this.$message.warning("请选择有效数据")
|
|
|
|
- // return;
|
|
|
|
- // }
|
|
|
|
let start_date = new Date(this.parmValue.start_date).valueOf();
|
|
let start_date = new Date(this.parmValue.start_date).valueOf();
|
|
let end_date = new Date(this.parmValue.end_date).valueOf();
|
|
let end_date = new Date(this.parmValue.end_date).valueOf();
|
|
- let flag = end_date - start_date > 30 * 24 * 60 * 60 * 1000;
|
|
|
|
- if (this.parmValue.start_date != "" && this.parmValue.end_date != "") {
|
|
|
|
- if (flag) {
|
|
|
|
- this.$message.warning("导出文件的时间区间不能超过30天");
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- this.$message.warning("请选择导出文件的时间区间");
|
|
|
|
|
|
+ if (
|
|
|
|
+ (this.parmValue.start_date !== "" && this.parmValue.end_date === "") ||
|
|
|
|
+ (this.parmValue.start_date === "" && this.parmValue.end_date !== "")
|
|
|
|
+ ) {
|
|
|
|
+ this.$message.warning("请选择时间");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
let model = JSON.parse(JSON.stringify(this.parmValue));
|
|
let model = JSON.parse(JSON.stringify(this.parmValue));
|
|
@@ -415,7 +278,7 @@ export default {
|
|
let httpType = `aplication/zip`;
|
|
let httpType = `aplication/zip`;
|
|
axios({
|
|
axios({
|
|
method: "post",
|
|
method: "post",
|
|
- url: this.fileUrl + "admin/reportchangelogeexport",
|
|
|
|
|
|
+ url: this.fileUrl + "admin/goodSimpleZhaoExport",
|
|
responseType: "blob",
|
|
responseType: "blob",
|
|
data: model,
|
|
data: model,
|
|
headers: {
|
|
headers: {
|
|
@@ -438,7 +301,7 @@ export default {
|
|
let link = document.createElement("a");
|
|
let link = document.createElement("a");
|
|
link.style.display = "none";
|
|
link.style.display = "none";
|
|
link.href = url;
|
|
link.href = url;
|
|
- let excelName = "产品修改报表.zip";
|
|
|
|
|
|
+ let excelName = "商品基本信息报表.zip";
|
|
link.setAttribute("download", excelName);
|
|
link.setAttribute("download", excelName);
|
|
document.body.appendChild(link);
|
|
document.body.appendChild(link);
|
|
link.click();
|
|
link.click();
|
|
@@ -464,10 +327,11 @@ export default {
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
- <style lang="scss" scoped>
|
|
|
|
|
|
+<style lang="scss" scoped>
|
|
.purchaseOrder {
|
|
.purchaseOrder {
|
|
// text-align: right;
|
|
// text-align: right;
|
|
}
|
|
}
|
|
|
|
+
|
|
/deep/ .el-dialog {
|
|
/deep/ .el-dialog {
|
|
width: 80%;
|
|
width: 80%;
|
|
// height: 50vh;
|
|
// height: 50vh;
|
|
@@ -475,4 +339,3 @@ export default {
|
|
min-height: 500px;
|
|
min-height: 500px;
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|
|
-
|
|
|