|
@@ -89,7 +89,7 @@
|
|
|
</el-row>
|
|
|
|
|
|
<el-row>
|
|
|
- <el-col :span="4" style="width: 200px">
|
|
|
+ <el-col :span="4" style="width: 150px">
|
|
|
<el-select
|
|
|
v-model="parmValue.exam_status"
|
|
|
filterable
|
|
@@ -111,7 +111,7 @@
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-col>
|
|
|
- <el-col :span="4" style="width: 240px; padding: 0 0 0 10px">
|
|
|
+ <el-col :span="4" style="width: 210px; padding: 0 0 0 10px">
|
|
|
<search-brand
|
|
|
:value="brandid"
|
|
|
:disabled="false"
|
|
@@ -123,7 +123,7 @@
|
|
|
/>
|
|
|
</el-col>
|
|
|
|
|
|
- <el-col :span="4" style="width: 470px; padding: 0 0 0 10px">
|
|
|
+ <el-col :span="4" style="width: 430px; padding: 0 0 0 10px">
|
|
|
<el-input
|
|
|
:size="searchSize"
|
|
|
v-model="sinput"
|
|
@@ -148,7 +148,7 @@
|
|
|
>
|
|
|
<el-option label="商品名称" value="1" />
|
|
|
<el-option label="成本商品编号" value="2" />
|
|
|
- <el-option label="上线商品编号" value="8" />
|
|
|
+ <el-option label="上线商品编号" value="8" />
|
|
|
<!-- <el-option label="平台编号" value="3" /> -->
|
|
|
<!-- <el-option label="供应商编号" value="4" /> -->
|
|
|
<el-option label="业务企业编号" value="5" />
|
|
@@ -171,6 +171,22 @@
|
|
|
添加
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
+
|
|
|
+ <el-col
|
|
|
+ :span="3"
|
|
|
+ class="fr"
|
|
|
+ style="width: 66px; padding: 0 0 0 10px"
|
|
|
+ v-if="powers.some((item) => item == '087')"
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ :size="searchSize"
|
|
|
+ type="primary"
|
|
|
+ style="float: right"
|
|
|
+ @click="centerDialogVisible = true"
|
|
|
+ >
|
|
|
+ 导出上线商品
|
|
|
+ </el-button>
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
</div></template
|
|
|
>
|
|
@@ -224,8 +240,7 @@
|
|
|
>
|
|
|
<i
|
|
|
class="el-icon-view tb-icon"
|
|
|
-
|
|
|
- @click="getRouter('goodsOnlineDetail', scope.row.skuCode )"
|
|
|
+ @click="getRouter('goodsOnlineDetail', scope.row.skuCode)"
|
|
|
></i>
|
|
|
</el-tooltip>
|
|
|
<el-tooltip
|
|
@@ -258,6 +273,56 @@
|
|
|
</template>
|
|
|
</ex-table>
|
|
|
<no-auth v-else></no-auth>
|
|
|
+ <el-dialog
|
|
|
+ title="上线商品导出"
|
|
|
+ :visible.sync="centerDialogVisible"
|
|
|
+ width="500px"
|
|
|
+ center
|
|
|
+ >
|
|
|
+ <el-form
|
|
|
+ :model="ruleForm"
|
|
|
+ :rules="rules"
|
|
|
+ ref="ruleForm"
|
|
|
+ class="demo-ruleForm"
|
|
|
+ label-width="80px"
|
|
|
+ >
|
|
|
+ <el-form-item prop="date" label="日期: ">
|
|
|
+ <el-date-picker
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ v-model="ruleForm.date"
|
|
|
+ type="date"
|
|
|
+ placeholder="请选择"
|
|
|
+ >
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="状态: " prop="status">
|
|
|
+ <el-select v-model="ruleForm.status" placeholder="请选择">
|
|
|
+ <el-option label="待上线" value="5"></el-option>
|
|
|
+ <el-option label="上线成功" value="6"></el-option>
|
|
|
+ <el-option label="已下线" value="8"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="平台id: " prop="platform_id">
|
|
|
+ <!-- <el-input
|
|
|
+ v-model="ruleForm.platform_id"
|
|
|
+ style="width: 300px"
|
|
|
+ placeholder="请输入"
|
|
|
+ ></el-input> -->
|
|
|
+ <search-terrace
|
|
|
+ :value="ruleForm.platform_id"
|
|
|
+ :disabled="false"
|
|
|
+ :isDetail="false"
|
|
|
+ :placeholder="'所属平台'"
|
|
|
+ @searchChange="platform_codesearchChange"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="centerDialogVisible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="goodsExport">导 出</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
<!-- 弹窗 新增/修改 -->
|
|
|
<add-edit
|
|
|
:id="modelId"
|
|
@@ -272,6 +337,7 @@
|
|
|
import asyncRequest from "@/apis/service/goodStore/goodsOnline";
|
|
|
import mixinPage from "@/mixins/elPaginationHandle";
|
|
|
import { mapGetters } from "vuex";
|
|
|
+import urlConfig from "@/apis/url-config";
|
|
|
import resToken from "@/mixins/resToken";
|
|
|
import { listCol, options1, options8 } from "./columns";
|
|
|
export default {
|
|
@@ -293,14 +359,42 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
data() {
|
|
|
+ var validate = (rule, value, callback) => {
|
|
|
+ if (value == "") {
|
|
|
+ return callback(new Error("必填项不能为空"));
|
|
|
+ } else {
|
|
|
+ callback();
|
|
|
+ }
|
|
|
+ };
|
|
|
return {
|
|
|
+ fileUrl: urlConfig.baseURL,
|
|
|
+ ruleForm: {
|
|
|
+ date: "",
|
|
|
+ platform_id: "",
|
|
|
+ status: "",
|
|
|
+ },
|
|
|
+ rules: {
|
|
|
+ date: [
|
|
|
+ {
|
|
|
+ validator: validate,
|
|
|
+ type: "date",
|
|
|
+ required: true,
|
|
|
+ trigger: "change",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ status: [{ validator: validate, required: true, trigger: "change" }],
|
|
|
+ platform_id: [
|
|
|
+ { validator: validate, required: true, trigger: "change" },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ centerDialogVisible: false,
|
|
|
options1: options1,
|
|
|
options8: options8,
|
|
|
loading: false,
|
|
|
parmValue: {
|
|
|
good_name: "", //商品名称
|
|
|
spucode: "", //商品编号
|
|
|
- skucode: "", //商品编号
|
|
|
+ skucode: "", //商品编号
|
|
|
cat_id: "", //商品分类
|
|
|
start: "", //开始日期
|
|
|
end: "", //结束日期
|
|
@@ -343,26 +437,25 @@ export default {
|
|
|
const { back } = this.$route.query;
|
|
|
if (back) {
|
|
|
this.parmValue = JSON.parse(back);
|
|
|
- console.log(this.parmValue)
|
|
|
- const {page,size}=this.parmValue;
|
|
|
+ console.log(this.parmValue);
|
|
|
+ const { page, size } = this.parmValue;
|
|
|
// this.parmValue.start = start || last_start;
|
|
|
// this.parmValue.end = end || last_end;
|
|
|
- if(this.parmValue.brand_id.length>0){
|
|
|
- this.brandid = [this.parmValue.brand_id] ;
|
|
|
+ if (this.parmValue.brand_id.length > 0) {
|
|
|
+ this.brandid = [this.parmValue.brand_id];
|
|
|
}
|
|
|
-
|
|
|
- this.pageInfo= {
|
|
|
+
|
|
|
+ this.pageInfo = {
|
|
|
size: size,
|
|
|
curr: page,
|
|
|
total: 0,
|
|
|
- }
|
|
|
+ };
|
|
|
//多选条件
|
|
|
- this.select = this.parmValue.select;
|
|
|
- // this.sselect = this.parmValue.sselect;
|
|
|
- this.sinput = this.parmValue.sinput
|
|
|
-
|
|
|
- }else{
|
|
|
- this.select = "1";
|
|
|
+ this.select = this.parmValue.select;
|
|
|
+ // this.sselect = this.parmValue.sselect;
|
|
|
+ this.sinput = this.parmValue.sinput;
|
|
|
+ } else {
|
|
|
+ this.select = "1";
|
|
|
// this.sselect = "创建时间"
|
|
|
}
|
|
|
this.cat_id = [];
|
|
@@ -370,31 +463,108 @@ export default {
|
|
|
this.searchList();
|
|
|
},
|
|
|
methods: {
|
|
|
- getRouter(toRouter, queryId){
|
|
|
+ platform_codesearchChange(e) {
|
|
|
+ const { id, code, label } = e;
|
|
|
+ this.ruleForm.platform_id = id || "";
|
|
|
+ this.$refs.ruleForm.validateField("platform_id");
|
|
|
+ },
|
|
|
+ //导出
|
|
|
+ async goodsExport() {
|
|
|
+ // console.log(this.$refs.ruleForm)
|
|
|
+ // return;
|
|
|
+ await this.$refs.ruleForm.validate(async (valid) => {
|
|
|
+ if (valid) {
|
|
|
+ if (!this.loading) {
|
|
|
+ this.loading = true;
|
|
|
+ let httpType = `aplication/zip`;
|
|
|
+ axios({
|
|
|
+ method: "post",
|
|
|
+ url: this.fileUrl + "admin/exportgood",
|
|
|
+ responseType: "blob",
|
|
|
+ data: this.ruleForm,
|
|
|
+ headers: {
|
|
|
+ Accept: httpType,
|
|
|
+ },
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ if (res && res.status == 200 && res.data) {
|
|
|
+ let url = window.URL.createObjectURL(
|
|
|
+ new Blob([res.data], {
|
|
|
+ type: httpType,
|
|
|
+ })
|
|
|
+ );
|
|
|
+ let link = document.createElement("a");
|
|
|
+ link.style.display = "none";
|
|
|
+ link.href = url;
|
|
|
+ let excelName = "商品.zip";
|
|
|
+ link.setAttribute("download", excelName);
|
|
|
+ document.body.appendChild(link);
|
|
|
+ link.click();
|
|
|
+ link.remove();
|
|
|
+ window.URL.revokeObjectURL(url); //释放掉blob对象
|
|
|
+ this.$message.success(`导出成功!`);
|
|
|
+ setTimeout(() => {
|
|
|
+ this.loading = false;
|
|
|
+ }, 500);
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.data.message);
|
|
|
+ setTimeout(() => {
|
|
|
+ this.loading = false;
|
|
|
+ }, 500);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ console.log(error);
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ // this.loading = true;
|
|
|
+
|
|
|
+ // const res = await asyncRequest.exportgood(this.ruleForm);
|
|
|
+ // if (res && res.code === 0) {
|
|
|
+ // this.$message.warning(res.message);
|
|
|
+ // console.log(res);
|
|
|
+ // this.loading = false;
|
|
|
+ // } else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
+ // await this.logout();
|
|
|
+ // } else {
|
|
|
+ // this.loading = false;
|
|
|
+ // this.$message.warning(res.message);
|
|
|
+ // }
|
|
|
+ } else {
|
|
|
+ console.log("error submit!!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //点击详情
|
|
|
+ getRouter(toRouter, queryId) {
|
|
|
if (toRouter && queryId) {
|
|
|
let model = {
|
|
|
id: queryId,
|
|
|
- type: 'view',
|
|
|
+ type: "view",
|
|
|
};
|
|
|
|
|
|
//有多选框的条件
|
|
|
- this.parmValue.select = this.select ;
|
|
|
+ this.parmValue.select = this.select;
|
|
|
// this.parmValue.sselect = this.sselect ;
|
|
|
- this.parmValue.sinput= this.sinput;
|
|
|
+ this.parmValue.sinput = this.sinput;
|
|
|
//
|
|
|
- console.log(this.parmValue)
|
|
|
- let routerModel = {
|
|
|
+ console.log(this.parmValue);
|
|
|
+ let routerModel = {
|
|
|
options: JSON.parse(JSON.stringify(this.parmValue)),
|
|
|
router: this.$route.path,
|
|
|
};
|
|
|
model.preModel = JSON.stringify(routerModel);
|
|
|
-
|
|
|
+
|
|
|
this.routeGoto(toRouter, model);
|
|
|
} else {
|
|
|
this.$message.warning("暂未找到相关流程!");
|
|
|
}
|
|
|
},
|
|
|
restSearch() {
|
|
|
+ this.select = "1";
|
|
|
+ this.sinput = "";
|
|
|
this.cat_id = [];
|
|
|
this.brandid = [];
|
|
|
// 表格 - 分页
|
|
@@ -406,7 +576,7 @@ export default {
|
|
|
this.parmValue = {
|
|
|
good_name: "", //商品名称
|
|
|
spucode: "", //商品编号
|
|
|
- skucode: "", //商品编号
|
|
|
+ skucode: "", //商品编号
|
|
|
cat_id: "", //商品分类
|
|
|
start: "", //开始日期
|
|
|
end: "", //结束日期
|