|
@@ -17,12 +17,12 @@
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="品牌">
|
|
|
- <ProductBrand id="associatedProduct-productBrandSn" v-model="queryParam.product.productBrandSn"></ProductBrand>
|
|
|
+ <ProductBrand id="costSeting-productBrandSn" v-model="queryParam.product.productBrandSn"></ProductBrand>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="产品分类">
|
|
|
- <ProductType id="associatedProduct-productType" v-model="productType" @change="changeProductType"></ProductType>
|
|
|
+ <ProductType id="costSeting-productType" v-model="productType" @change="changeProductType"></ProductType>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
@@ -33,10 +33,10 @@
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="审核状态">
|
|
|
<v-select
|
|
|
- v-model="queryParam.state"
|
|
|
- ref="state"
|
|
|
- id="costSetList-state"
|
|
|
- code="FINANCIAL_RECEIVE_STATUS"
|
|
|
+ v-model="queryParam.auditState"
|
|
|
+ ref="auditState"
|
|
|
+ id="costSetList-auditState"
|
|
|
+ code="SUPPLIER_PRODUCT_STATE"
|
|
|
placeholder="请选择审核状态"
|
|
|
allowClear></v-select>
|
|
|
</a-form-item>
|
|
@@ -68,8 +68,9 @@
|
|
|
ref="table"
|
|
|
:style="{ height: tableHeight+84.5+'px' }"
|
|
|
size="small"
|
|
|
- :rowKey="(record) => record.id"
|
|
|
- :row-selection="{ columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: !record.id } }) }"
|
|
|
+ :rowKey="(record) => record.supplierProductSn"
|
|
|
+ rowKeyName="supplierProductSn"
|
|
|
+ :row-selection="{ columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: record.auditState!=='WAIT' } }) }"
|
|
|
@rowSelection="rowSelectionFun"
|
|
|
:columns="columns"
|
|
|
:data="loadData"
|
|
@@ -83,18 +84,22 @@
|
|
|
</template>
|
|
|
<!-- 操作 -->
|
|
|
<template slot="action" slot-scope="text, record">
|
|
|
- <a-button
|
|
|
- size="small"
|
|
|
- type="link"
|
|
|
- class="button-warning"
|
|
|
- @click="handleAudit(record)"
|
|
|
- >审核</a-button>
|
|
|
- <a-button
|
|
|
- size="small"
|
|
|
- type="link"
|
|
|
- class="button-warning"
|
|
|
- @click="handleCostSet(record)"
|
|
|
- >设置成本</a-button>
|
|
|
+ <div>
|
|
|
+ <a-button
|
|
|
+ size="small"
|
|
|
+ type="link"
|
|
|
+ class="button-warning"
|
|
|
+ v-if="record.auditState=='WAIT'"
|
|
|
+ @click="handleAudit([record.supplierProductSn])"
|
|
|
+ >审核</a-button>
|
|
|
+ <a-button
|
|
|
+ size="small"
|
|
|
+ type="link"
|
|
|
+ class="button-warning"
|
|
|
+ v-else
|
|
|
+ @click="handleCostSet(record)"
|
|
|
+ >设置成本</a-button>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</s-table>
|
|
|
</a-spin>
|
|
@@ -109,13 +114,14 @@
|
|
|
<script>
|
|
|
import { commonMixin } from '@/utils/mixin'
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
+import { hdExportExcel } from '@/libs/exportExcel'
|
|
|
import ProductType from '@/views/common/productType.js'
|
|
|
import ProductBrand from '@/views/common/productBrand.js'
|
|
|
import addProductModal from './addProductModal.vue'
|
|
|
import SettingCost from './settingCost.vue'
|
|
|
-import { supplierProductList } from '@/api/supplier'
|
|
|
+import { supplierProductList, supplierProductExportDetail, supplierProductUpdateAuditState } from '@/api/supplier'
|
|
|
export default {
|
|
|
- name: 'AssociatedProductDetailsList',
|
|
|
+ name: 'costSettingList',
|
|
|
mixins: [commonMixin],
|
|
|
components: { STable, VSelect, ProductBrand, ProductType, addProductModal, SettingCost },
|
|
|
data () {
|
|
@@ -132,8 +138,9 @@ export default {
|
|
|
productBrandSn: undefined, // 产品品牌
|
|
|
productTypeSn1: '', // 产品一级分类
|
|
|
productTypeSn2: '', // 产品二级分类
|
|
|
- productTypeSn3: '' // 产品三级分类
|
|
|
- }
|
|
|
+ productTypeSn3: '' ,// 产品三级分类
|
|
|
+ },
|
|
|
+ auditState: undefined
|
|
|
},
|
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
|
productType: [],
|
|
@@ -170,12 +177,13 @@ export default {
|
|
|
{ title: '产品品牌', dataIndex: 'product.productBrandName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '产品分类', scopedSlots: { customRender: 'productType' }, width: '12%', align: 'center' },
|
|
|
{ title: '供应商名称', dataIndex: 'supplierName', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '审核时间', dataIndex: 'creatDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '审核状态', dataIndex: 'state', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '审核时间', dataIndex: 'auditTime', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '审核状态', dataIndex: 'auditStateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
|
|
|
]
|
|
|
if (this.$hasPermissions('B_isShowCost')) { // 成本价权限
|
|
|
- arr.splice(7, 0, { title: '成本价(¥)', dataIndex: 'cost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
|
|
|
+ arr.splice(7, 0, { title: '当前成本价', dataIndex: 'cost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
|
|
|
+ arr.splice(8, 0, { title: '变更成本价', dataIndex: 'modifyCost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
|
|
|
}
|
|
|
return arr
|
|
|
}
|
|
@@ -194,6 +202,7 @@ export default {
|
|
|
this.queryParam.product.productTypeSn1 = ''
|
|
|
this.queryParam.product.productTypeSn2 = ''
|
|
|
this.queryParam.product.productTypeSn3 = ''
|
|
|
+ this.queryParam.auditState = undefined
|
|
|
this.productType = []
|
|
|
this.$refs.table.refresh(true)
|
|
|
},
|
|
@@ -205,7 +214,14 @@ export default {
|
|
|
},
|
|
|
// 导出明细
|
|
|
handleExport () {
|
|
|
-
|
|
|
+ const _this = this
|
|
|
+ const params = _this.queryParam
|
|
|
+ _this.exportLoading = true
|
|
|
+ _this.spinning = true
|
|
|
+ hdExportExcel(supplierProductExportDetail, params, '成本设置明细', function () {
|
|
|
+ _this.exportLoading = false
|
|
|
+ _this.spinning = false
|
|
|
+ })
|
|
|
},
|
|
|
// 新增成功
|
|
|
handleProductsOk () {
|
|
@@ -218,13 +234,15 @@ export default {
|
|
|
},
|
|
|
// 批量审核
|
|
|
handleBatchAudit () {
|
|
|
- if (!this.rowSelectionInfo || (this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length < 1)) {
|
|
|
+ const row = this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys
|
|
|
+ if (!this.rowSelectionInfo || (row.length < 1)) {
|
|
|
this.$message.warning('请在列表中进行勾选!')
|
|
|
return false
|
|
|
}
|
|
|
+ this.handleAudit(row)
|
|
|
},
|
|
|
// 单个审核
|
|
|
- handleAudit (row) {
|
|
|
+ handleAudit (sn) {
|
|
|
const _this = this
|
|
|
this.$confirm({
|
|
|
title: '提示',
|
|
@@ -234,16 +252,30 @@ export default {
|
|
|
okText: '通过',
|
|
|
cancelText: '不通过',
|
|
|
onOk () {
|
|
|
- // _this.auditOrder(row.allocateReturnSn, 'FINISH')
|
|
|
+ _this.auditOrder(sn, 'PASS')
|
|
|
},
|
|
|
onCancel (e) {
|
|
|
if (!e.triggerCancel) {
|
|
|
- // _this.auditOrder(row.allocateReturnSn, 'FINANCIAL_REJECT')
|
|
|
+ _this.auditOrder(sn, 'REJECT')
|
|
|
}
|
|
|
_this.$destroyAll()
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ auditOrder(sn,val){
|
|
|
+ this.spinning = true
|
|
|
+ supplierProductUpdateAuditState({
|
|
|
+ auditState: val,
|
|
|
+ supplierProductSnList: sn
|
|
|
+ }).then(res => {
|
|
|
+ if(res.status == 200){
|
|
|
+ this.$refs.table.refresh(true)
|
|
|
+ this.$refs.table.clearSelected()
|
|
|
+ this.$message.info(res.message)
|
|
|
+ }
|
|
|
+ this.spinning = false
|
|
|
+ })
|
|
|
+ },
|
|
|
// 成本设置
|
|
|
handleCostSet (row) {
|
|
|
this.openSetModal = true
|