|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <div class="app-container">
|
|
|
|
|
|
|
+ <div class="app-container store-product-audit-page">
|
|
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
|
|
|
|
|
<el-form-item label="商品分类" prop="cateId">
|
|
<el-form-item label="商品分类" prop="cateId">
|
|
@@ -103,7 +103,8 @@
|
|
|
<el-tab-pane label="待上架" name="0"></el-tab-pane>
|
|
<el-tab-pane label="待上架" name="0"></el-tab-pane>
|
|
|
</el-tabs>-->
|
|
</el-tabs>-->
|
|
|
|
|
|
|
|
- <el-table height="500" border v-loading="loading" :data="storeProductList" @selection-change="handleSelectionChange">
|
|
|
|
|
|
|
+ <div class="table-wrapper">
|
|
|
|
|
+ <el-table ref="storeProductTable" :height="tableHeight" border v-loading="loading" :data="storeProductList" @selection-change="handleSelectionChange">
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
<el-table-column label="ID" align="center" prop="productId" />
|
|
<el-table-column label="ID" align="center" prop="productId" />
|
|
|
<el-table-column label="商品图片" align="center" width="120">
|
|
<el-table-column label="商品图片" align="center" width="120">
|
|
@@ -119,7 +120,25 @@
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column label="商品名称" show-overflow-tooltip align="center" prop="productName" />
|
|
<el-table-column label="商品名称" show-overflow-tooltip align="center" prop="productName" />
|
|
|
<el-table-column label="分类" align="center" prop="cateName" />
|
|
<el-table-column label="分类" align="center" prop="cateName" />
|
|
|
- <el-table-column label="所属公司" align="center" prop="companyName" />
|
|
|
|
|
|
|
+ <el-table-column label="所属公司" align="center" min-width="160">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <div class="company-name-list">
|
|
|
|
|
+ <div
|
|
|
|
|
+ v-for="(name, idx) in getDisplayCompanyNameList(scope.row)"
|
|
|
|
|
+ :key="idx"
|
|
|
|
|
+ class="company-name-item"
|
|
|
|
|
+ >{{ name }}</div>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ v-if="getCompanyNameList(scope.row.companyName).length > 3"
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ @click="toggleCompanyNameExpand(scope.row)"
|
|
|
|
|
+ >
|
|
|
|
|
+ {{ isCompanyNameExpanded(scope.row) ? '收起' : `展开(${getCompanyNameList(scope.row.companyName).length})` }}
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="所属店铺" align="center" prop="storeName" />
|
|
<el-table-column label="所属店铺" align="center" prop="storeName" />
|
|
|
<el-table-column label="售价" align="center" prop="price" >
|
|
<el-table-column label="售价" align="center" prop="price" >
|
|
|
<template slot-scope="scope" >
|
|
<template slot-scope="scope" >
|
|
@@ -155,8 +174,10 @@
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
<pagination
|
|
<pagination
|
|
|
|
|
+ class="pagination-bar"
|
|
|
v-show="total>0"
|
|
v-show="total>0"
|
|
|
:total="total"
|
|
:total="total"
|
|
|
:page.sync="queryParams.pageNum"
|
|
:page.sync="queryParams.pageNum"
|
|
@@ -624,14 +645,35 @@
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="所属公司">
|
|
<el-form-item label="所属公司">
|
|
|
- <el-select style="width: 240px" v-model="form.companyIds" multiple placeholder="请选择企业" clearable size="small" >
|
|
|
|
|
- <el-option
|
|
|
|
|
- v-for="item in companyOptions"
|
|
|
|
|
- :key="item.companyId"
|
|
|
|
|
- :label="item.companyName"
|
|
|
|
|
- :value="item.companyId"
|
|
|
|
|
- />
|
|
|
|
|
- </el-select>
|
|
|
|
|
|
|
+ <div class="company-name-list audit-company-list">
|
|
|
|
|
+ <template v-if="auditCompanyList.length">
|
|
|
|
|
+ <div
|
|
|
|
|
+ v-for="(name, idx) in auditDisplayCompanyList"
|
|
|
|
|
+ :key="idx"
|
|
|
|
|
+ class="company-name-item"
|
|
|
|
|
+ >{{ name }}</div>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ v-if="auditCompanyList.length > 3"
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ @click="formAuditCompanyExpanded = !formAuditCompanyExpanded"
|
|
|
|
|
+ >
|
|
|
|
|
+ {{ formAuditCompanyExpanded ? '收起' : `展开(${auditCompanyList.length})` }}
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <span v-else class="text-muted">-</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="发货人手机号">
|
|
|
|
|
+ <div class="sender-phone-display">
|
|
|
|
|
+ <el-tag
|
|
|
|
|
+ v-for="(phone, index) in auditSenderPhoneList"
|
|
|
|
|
+ :key="phone + '-' + index"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ class="sender-phone-tag"
|
|
|
|
|
+ >{{ phone }}</el-tag>
|
|
|
|
|
+ <span v-if="!auditSenderPhoneList.length" class="text-muted">-</span>
|
|
|
|
|
+ </div>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<!-- 所属店铺 -->
|
|
<!-- 所属店铺 -->
|
|
|
<el-form-item label="所属店铺">
|
|
<el-form-item label="所属店铺">
|
|
@@ -753,6 +795,11 @@ export default {
|
|
|
},
|
|
},
|
|
|
drugImageArr: function(val) {
|
|
drugImageArr: function(val) {
|
|
|
this.form.drugImage = val.join(',');
|
|
this.form.drugImage = val.join(',');
|
|
|
|
|
+ },
|
|
|
|
|
+ showSearch() {
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ this.calcTableHeight()
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
@@ -832,6 +879,7 @@ export default {
|
|
|
storeOptions:[],
|
|
storeOptions:[],
|
|
|
// 遮罩层
|
|
// 遮罩层
|
|
|
loading: true,
|
|
loading: true,
|
|
|
|
|
+ tableHeight: 400,
|
|
|
// 选中数组
|
|
// 选中数组
|
|
|
ids: [],
|
|
ids: [],
|
|
|
// 非单个禁用
|
|
// 非单个禁用
|
|
@@ -845,6 +893,8 @@ export default {
|
|
|
total: 0,
|
|
total: 0,
|
|
|
// 商品表格数据
|
|
// 商品表格数据
|
|
|
storeProductList: [],
|
|
storeProductList: [],
|
|
|
|
|
+ expandedCompanyRows: {},
|
|
|
|
|
+ formAuditCompanyExpanded: false,
|
|
|
// 弹出层标题
|
|
// 弹出层标题
|
|
|
title: "",
|
|
title: "",
|
|
|
// 是否显示弹出层
|
|
// 是否显示弹出层
|
|
@@ -957,6 +1007,31 @@ export default {
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
|
|
+ computed: {
|
|
|
|
|
+ auditCompanyList() {
|
|
|
|
|
+ const ids = this.form.companyIds || [];
|
|
|
|
|
+ if (ids.length) {
|
|
|
|
|
+ return ids.map(id => {
|
|
|
|
|
+ const company = this.companyOptions.find(item => item.companyId === id);
|
|
|
|
|
+ return company ? company.companyName : String(id);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ return this.getCompanyNameList(this.form.companyName);
|
|
|
|
|
+ },
|
|
|
|
|
+ auditDisplayCompanyList() {
|
|
|
|
|
+ const list = this.auditCompanyList;
|
|
|
|
|
+ if (list.length <= 3 || this.formAuditCompanyExpanded) {
|
|
|
|
|
+ return list;
|
|
|
|
|
+ }
|
|
|
|
|
+ return list.slice(0, 3);
|
|
|
|
|
+ },
|
|
|
|
|
+ auditSenderPhoneList() {
|
|
|
|
|
+ if (!this.form.senderPhones) {
|
|
|
|
|
+ return [];
|
|
|
|
|
+ }
|
|
|
|
|
+ return String(this.form.senderPhones).split(/[,,]/).map(phone => phone.trim()).filter(Boolean);
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
created() {
|
|
created() {
|
|
|
this.getDicts("store_product_tui_cate").then((response) => {
|
|
this.getDicts("store_product_tui_cate").then((response) => {
|
|
|
this.productTuiCateOptions = response.data;
|
|
this.productTuiCateOptions = response.data;
|
|
@@ -989,7 +1064,49 @@ export default {
|
|
|
this.getTreeselect();
|
|
this.getTreeselect();
|
|
|
this.getList();
|
|
this.getList();
|
|
|
},
|
|
},
|
|
|
|
|
+ mounted() {
|
|
|
|
|
+ this.calcTableHeight();
|
|
|
|
|
+ window.addEventListener('resize', this.calcTableHeight);
|
|
|
|
|
+ },
|
|
|
|
|
+ beforeDestroy() {
|
|
|
|
|
+ window.removeEventListener('resize', this.calcTableHeight);
|
|
|
|
|
+ },
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ calcTableHeight() {
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ const wrapper = this.$el && this.$el.querySelector('.table-wrapper');
|
|
|
|
|
+ if (!wrapper) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ const height = wrapper.clientHeight;
|
|
|
|
|
+ this.tableHeight = height > 200 ? height : 200;
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ if (this.$refs.storeProductTable && this.$refs.storeProductTable.doLayout) {
|
|
|
|
|
+ this.$refs.storeProductTable.doLayout();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ getCompanyNameList(companyName) {
|
|
|
|
|
+ if (!companyName) {
|
|
|
|
|
+ return [];
|
|
|
|
|
+ }
|
|
|
|
|
+ return String(companyName).split(/[,,]/).map(s => s.trim()).filter(Boolean);
|
|
|
|
|
+ },
|
|
|
|
|
+ getDisplayCompanyNameList(row) {
|
|
|
|
|
+ const list = this.getCompanyNameList(row.companyName);
|
|
|
|
|
+ if (list.length <= 3 || this.isCompanyNameExpanded(row)) {
|
|
|
|
|
+ return list;
|
|
|
|
|
+ }
|
|
|
|
|
+ return list.slice(0, 3);
|
|
|
|
|
+ },
|
|
|
|
|
+ isCompanyNameExpanded(row) {
|
|
|
|
|
+ return !!this.expandedCompanyRows[row.productId];
|
|
|
|
|
+ },
|
|
|
|
|
+ toggleCompanyNameExpand(row) {
|
|
|
|
|
+ const key = row.productId;
|
|
|
|
|
+ this.$set(this.expandedCompanyRows, key, !this.expandedCompanyRows[key]);
|
|
|
|
|
+ },
|
|
|
cancel1(){
|
|
cancel1(){
|
|
|
this.open1 = false;
|
|
this.open1 = false;
|
|
|
this.form1.attachImage=null;
|
|
this.form1.attachImage=null;
|
|
@@ -1190,6 +1307,7 @@ export default {
|
|
|
this.storeProductList = response.rows;
|
|
this.storeProductList = response.rows;
|
|
|
this.total = response.total;
|
|
this.total = response.total;
|
|
|
this.loading = false;
|
|
this.loading = false;
|
|
|
|
|
+ this.calcTableHeight();
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
// 取消按钮
|
|
// 取消按钮
|
|
@@ -1243,6 +1361,7 @@ export default {
|
|
|
prescribeName: null,
|
|
prescribeName: null,
|
|
|
isDisplay:"1",
|
|
isDisplay:"1",
|
|
|
companyIds:[],
|
|
companyIds:[],
|
|
|
|
|
+ senderPhones: "",
|
|
|
isDrug: "0", // 是否药品
|
|
isDrug: "0", // 是否药品
|
|
|
drugImage: null, // 药品展示图
|
|
drugImage: null, // 药品展示图
|
|
|
drugRegCertNo: null, // 药品注册证书编号
|
|
drugRegCertNo: null, // 药品注册证书编号
|
|
@@ -1282,6 +1401,7 @@ export default {
|
|
|
this.attrs=[];
|
|
this.attrs=[];
|
|
|
this.photoArr=[];
|
|
this.photoArr=[];
|
|
|
this.imageArr=[];
|
|
this.imageArr=[];
|
|
|
|
|
+ this.formAuditCompanyExpanded = false;
|
|
|
},
|
|
},
|
|
|
/** 搜索按钮操作 */
|
|
/** 搜索按钮操作 */
|
|
|
handleQuery() {
|
|
handleQuery() {
|
|
@@ -1351,6 +1471,7 @@ export default {
|
|
|
if (response.data.companyIds != null && response.data.companyIds != undefined && response.data.companyIds.length > 0) {
|
|
if (response.data.companyIds != null && response.data.companyIds != undefined && response.data.companyIds.length > 0) {
|
|
|
this.form.companyIds = response.data.companyIds.split(',').map(Number);
|
|
this.form.companyIds = response.data.companyIds.split(',').map(Number);
|
|
|
}
|
|
}
|
|
|
|
|
+ this.formAuditCompanyExpanded = false;
|
|
|
|
|
|
|
|
this.appIds = this.form.appIds ? this.form.appIds.split(',') : [];
|
|
this.appIds = this.form.appIds ? this.form.appIds.split(',') : [];
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
@@ -1472,4 +1593,41 @@ export default {
|
|
|
<style scoped>::v-deep .el-upload-list__item-delete {
|
|
<style scoped>::v-deep .el-upload-list__item-delete {
|
|
|
display: none !important;
|
|
display: none !important;
|
|
|
}
|
|
}
|
|
|
|
|
+.store-product-audit-page {
|
|
|
|
|
+ height: calc(100vh - 104px);
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
|
+}
|
|
|
|
|
+.table-wrapper {
|
|
|
|
|
+ flex: 1;
|
|
|
|
|
+ min-height: 200px;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+}
|
|
|
|
|
+.store-product-audit-page .pagination-bar {
|
|
|
|
|
+ flex-shrink: 0;
|
|
|
|
|
+ margin-top: 10px;
|
|
|
|
|
+}
|
|
|
|
|
+.company-name-list {
|
|
|
|
|
+ text-align: left;
|
|
|
|
|
+ line-height: 1.5;
|
|
|
|
|
+}
|
|
|
|
|
+.company-name-item {
|
|
|
|
|
+ word-break: break-all;
|
|
|
|
|
+}
|
|
|
|
|
+.audit-company-list {
|
|
|
|
|
+ min-height: 32px;
|
|
|
|
|
+ line-height: 1.8;
|
|
|
|
|
+}
|
|
|
|
|
+.sender-phone-display {
|
|
|
|
|
+ min-height: 32px;
|
|
|
|
|
+ line-height: 1.8;
|
|
|
|
|
+}
|
|
|
|
|
+.sender-phone-tag {
|
|
|
|
|
+ margin: 0 8px 8px 0;
|
|
|
|
|
+}
|
|
|
|
|
+.text-muted {
|
|
|
|
|
+ color: #909399;
|
|
|
|
|
+}
|
|
|
</style>
|
|
</style>
|