|
@@ -3,7 +3,7 @@
|
|
|
<a-spin :spinning="spinning" tip="Loading...">
|
|
|
<!-- 搜索条件 -->
|
|
|
<div ref="tableSearch" class="table-page-search-wrapper">
|
|
|
- <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
|
|
|
+ <a-form layout="inline" @keyup.enter.native="searchForm">
|
|
|
<a-row :gutter="15">
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="产品名称">
|
|
@@ -43,8 +43,16 @@
|
|
|
</a-col>
|
|
|
</template>
|
|
|
<a-col :md="6" :sm="24" style="margin-bottom: 10px;">
|
|
|
- <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productPricingList-refresh">查询</a-button>
|
|
|
+ <a-button type="primary" @click="searchForm" :disabled="disabled" id="productPricingList-refresh">查询</a-button>
|
|
|
<a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="productPricingList-reset">重置</a-button>
|
|
|
+ <a-button
|
|
|
+ style="margin-left: 5px"
|
|
|
+ type="primary"
|
|
|
+ class="button-warning"
|
|
|
+ @click="handleExport"
|
|
|
+ :disabled="disabled"
|
|
|
+ v-if="$hasPermissions('B_ProductPriceExoprt')"
|
|
|
+ id="productInfoList-export">导出</a-button>
|
|
|
<a @click="advanced=!advanced" style="margin-left: 5px">
|
|
|
{{ advanced ? '收起' : '展开' }}
|
|
|
<a-icon :type="advanced ? 'up' : 'down'"/>
|
|
@@ -53,12 +61,33 @@
|
|
|
</a-row>
|
|
|
</a-form>
|
|
|
</div>
|
|
|
+ <!-- 操作按钮 -->
|
|
|
+ <div class="table-operator">
|
|
|
+ <a-button
|
|
|
+ style="margin: 0 15px 0 0;"
|
|
|
+ v-if="$hasPermissions('B_productPriceImport')"
|
|
|
+ id="productPricingList-add"
|
|
|
+ @click="openGuideModal=true"
|
|
|
+ type="primary"
|
|
|
+ class="button-error">定价导入</a-button>
|
|
|
+ <a-button
|
|
|
+ id="productPricingList-batchAudit"
|
|
|
+ type="primary"
|
|
|
+ class="button-warning"
|
|
|
+ :loading="spinning"
|
|
|
+ @click="handleBatchAudit"
|
|
|
+ v-if="$hasPermissions('B_productPricing_audit')"
|
|
|
+ style="margin: 0 15px 0 0;">批量审核</a-button>
|
|
|
+ <span v-if="$hasPermissions('B_productPricing_audit')&&selTotal">已选{{ selTotal }}项</span>
|
|
|
+ </div>
|
|
|
<!-- 列表 -->
|
|
|
<s-table
|
|
|
class="sTable fixPagination"
|
|
|
ref="table"
|
|
|
:style="{ height: tableHeight+84.5+'px' }"
|
|
|
size="small"
|
|
|
+ :row-selection="$hasPermissions('B_productPricing_audit') ? { columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: record.pricingState!='WAIT_PRICING_AUDIT' } })}: null"
|
|
|
+ @rowSelection="rowSelectionFun"
|
|
|
:rowKey="(record) => record.id"
|
|
|
:columns="columns"
|
|
|
:data="loadData"
|
|
@@ -103,27 +132,32 @@
|
|
|
<!-- 编辑价格 -->
|
|
|
<product-pricing-edit-modal :openModal="openModal" :itemSn="itemSn" @close="closeModal" @ok="$refs.table.refresh()" />
|
|
|
<!-- 审核价格 -->
|
|
|
- <product-pricing-audit-modal :openModal="openAuditModal" :itemSn="itemSn" @close="closeAuditModal" @ok="$refs.table.refresh()" />
|
|
|
+ <product-pricing-audit-modal :openModal="openAuditModal" :itemSn="itemSn" @close="closeAuditModal" @ok="auditSuccess" />
|
|
|
+ <!-- 导入产品 -->
|
|
|
+ <importGuideModal :openModal="openGuideModal" @close="openGuideModal=false" @ok="hanldeOk" />
|
|
|
</a-card>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { commonMixin } from '@/utils/mixin'
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
+import { exportExcel } from '@/libs/JGPrint.js'
|
|
|
import productPricingEditModal from './editModal.vue'
|
|
|
import productPricingAuditModal from './auditModal.vue'
|
|
|
import { productBrandQuery } from '@/api/productBrand'
|
|
|
import { productTypeQuery } from '@/api/productType'
|
|
|
-import { productPricingList } from '@/api/product'
|
|
|
+import { productPricingList, productExportPricing, batchAuditPrice, productPriceInsertImport } from '@/api/product'
|
|
|
import ProductBrand from '@/views/common/productBrand.js'
|
|
|
+import ImportGuideModal from './importGuideModal.vue'
|
|
|
export default {
|
|
|
name: 'ProductPricingList',
|
|
|
mixins: [commonMixin],
|
|
|
- components: { STable, VSelect, productPricingEditModal, productPricingAuditModal, ProductBrand },
|
|
|
+ components: { STable, VSelect, productPricingEditModal, productPricingAuditModal, ProductBrand, ImportGuideModal },
|
|
|
data () {
|
|
|
return {
|
|
|
spinning: false,
|
|
|
advanced: true, // 高级搜索 展开/关闭
|
|
|
+ openGuideModal: false,
|
|
|
tableHeight: 0,
|
|
|
queryParam: { // 查询条件
|
|
|
name: '', // 产品名称
|
|
@@ -160,10 +194,14 @@ export default {
|
|
|
openAuditModal: false, // 审核 弹框
|
|
|
itemSn: '', // 当前产品sn
|
|
|
productBrandList: [], // 品牌下拉数据
|
|
|
- productTypeList: [] // 分类下拉数据
|
|
|
+ productTypeList: [], // 分类下拉数据
|
|
|
+ rowSelectionInfo: null
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
+ selTotal () {
|
|
|
+ return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys ? this.rowSelectionInfo.selectedRowKeys.length : 0
|
|
|
+ },
|
|
|
columns () {
|
|
|
const arr = [
|
|
|
{ title: '序号', dataIndex: 'no', width: '3%', align: 'center' },
|
|
@@ -212,6 +250,10 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 表格选中项
|
|
|
+ rowSelectionFun (obj) {
|
|
|
+ this.rowSelectionInfo = obj || null
|
|
|
+ },
|
|
|
// 重置
|
|
|
resetSearchForm () {
|
|
|
this.queryParam.name = ''
|
|
@@ -222,6 +264,11 @@ export default {
|
|
|
this.queryParam.productTypeSn3 = ''
|
|
|
this.queryParam.pricingState = undefined
|
|
|
this.productType = []
|
|
|
+ this.$refs.table.clearSelected() // 清空表格选中项
|
|
|
+ this.$refs.table.refresh(true)
|
|
|
+ },
|
|
|
+ searchForm () {
|
|
|
+ this.$refs.table.clearSelected() // 清空表格选中项
|
|
|
this.$refs.table.refresh(true)
|
|
|
},
|
|
|
// 审核
|
|
@@ -229,6 +276,58 @@ export default {
|
|
|
this.itemSn = row.productSn
|
|
|
this.openAuditModal = true
|
|
|
},
|
|
|
+ auditSuccess () {
|
|
|
+ this.$refs.table.clearSelected() // 清空表格选中项
|
|
|
+ this.$refs.table.refresh()
|
|
|
+ },
|
|
|
+ // 批量审核
|
|
|
+ handleBatchAudit () {
|
|
|
+ const _this = this
|
|
|
+ if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys.length < 1)) {
|
|
|
+ _this.$message.warning('请先选择产品!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const obj = []
|
|
|
+ _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRows.map(item => {
|
|
|
+ obj.push(item.productSn)
|
|
|
+ })
|
|
|
+
|
|
|
+ this.$confirm({
|
|
|
+ title: '提示',
|
|
|
+ content: '确认要审核通过吗?',
|
|
|
+ centered: true,
|
|
|
+ onOk () {
|
|
|
+ _this.spinning = true
|
|
|
+ batchAuditPrice(obj).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ _this.$refs.table.clearSelected() // 清空表格选中项
|
|
|
+ _this.$message.success(res.message)
|
|
|
+ _this.$refs.table.refresh()
|
|
|
+ _this.spinning = false
|
|
|
+ } else {
|
|
|
+ _this.spinning = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 导入产品
|
|
|
+ hanldeOk (obj) {
|
|
|
+ productPriceInsertImport(obj).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.resetSearchForm()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 导出
|
|
|
+ handleExport () {
|
|
|
+ const _this = this
|
|
|
+ const params = this.queryParam
|
|
|
+ this.spinning = true
|
|
|
+ exportExcel(productExportPricing, params, '产品价格导出', function () {
|
|
|
+ _this.spinning = false
|
|
|
+ })
|
|
|
+ },
|
|
|
// 编辑
|
|
|
handleEdit (row) {
|
|
|
this.itemSn = row.productSn
|
|
@@ -280,7 +379,7 @@ export default {
|
|
|
},
|
|
|
setTableH () {
|
|
|
const tableSearchH = this.$refs.tableSearch.offsetHeight
|
|
|
- this.tableHeight = window.innerHeight - tableSearchH - 195
|
|
|
+ this.tableHeight = window.innerHeight - tableSearchH - 235
|
|
|
}
|
|
|
},
|
|
|
watch: {
|