|
@@ -114,52 +114,64 @@
|
|
<el-divider />
|
|
<el-divider />
|
|
</el-row>
|
|
</el-row>
|
|
<!-- v-el-select-loadmore="loadmore2" -->
|
|
<!-- v-el-select-loadmore="loadmore2" -->
|
|
- <el-table
|
|
|
|
|
|
+ <pl-table
|
|
v-loading="listLoading"
|
|
v-loading="listLoading"
|
|
:data="dataList"
|
|
:data="dataList"
|
|
|
|
+ row-key="id"
|
|
|
|
+ use-virtual
|
|
|
|
+ fixedColumnsRoll
|
|
|
|
+ :dataChangesScrollTop="false"
|
|
|
|
+ inverse-current-row
|
|
|
|
+ bigDataCheckbox
|
|
element-loading-text="Loading"
|
|
element-loading-text="Loading"
|
|
- max-height="600"
|
|
|
|
|
|
+ max-height="700"
|
|
border
|
|
border
|
|
fit
|
|
fit
|
|
highlight-current-row
|
|
highlight-current-row
|
|
stripe
|
|
stripe
|
|
>
|
|
>
|
|
- <el-table-column type="index" label="序号" width="50" align="left" />
|
|
|
|
- <el-table-column prop="materialNumber" label="物料编码" align="left" min-width="200">
|
|
|
|
|
|
+ <pl-table-column type="index" label="序号" width="50" align="left" />
|
|
|
|
+ <pl-table-column prop="materialNumber" label="物料编码" align="left" min-width="200">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<CopyButton :copy-text="scope.row.materialNumber" />
|
|
<CopyButton :copy-text="scope.row.materialNumber" />
|
|
-
|
|
|
|
|
|
+ <template v-if="scope.row.fang">
|
|
|
|
+ {{ scope.row.materialNumber }}
|
|
|
|
+ </template>
|
|
<el-select
|
|
<el-select
|
|
|
|
+ v-else
|
|
v-model="scope.row.materialNumber"
|
|
v-model="scope.row.materialNumber"
|
|
size="mini"
|
|
size="mini"
|
|
:remote-method="query => remoteMethod(query, 'number')"
|
|
:remote-method="query => remoteMethod(query, 'number')"
|
|
filterable
|
|
filterable
|
|
remote
|
|
remote
|
|
style="width: 85%"
|
|
style="width: 85%"
|
|
- @change="handleK3List($event, scope.row)"
|
|
|
|
|
|
+ @change="handleK3List($event, scope.row, scope.$index, 'materialNumber')"
|
|
>
|
|
>
|
|
<el-option v-for="(item, index) in k3List" :key="index" :label="item.number" :value="item.id" />
|
|
<el-option v-for="(item, index) in k3List" :key="index" :label="item.number" :value="item.id" />
|
|
</el-select>
|
|
</el-select>
|
|
</template>
|
|
</template>
|
|
- </el-table-column>
|
|
|
|
- <el-table-column show-overflow-tooltip min-width="150" prop="materialName" label="产品名称" align="left">
|
|
|
|
|
|
+ </pl-table-column>
|
|
|
|
+ <pl-table-column show-overflow-tooltip min-width="150" prop="materialName" label="产品名称" align="left">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<CopyButton :copy-text="scope.row.materialName" />
|
|
<CopyButton :copy-text="scope.row.materialName" />
|
|
<span>{{ scope.row.materialName }}</span>
|
|
<span>{{ scope.row.materialName }}</span>
|
|
</template>
|
|
</template>
|
|
- </el-table-column>
|
|
|
|
- <el-table-column min-width="300" prop="specification" label="规格型号" align="left">
|
|
|
|
|
|
+ </pl-table-column>
|
|
|
|
+ <pl-table-column min-width="300" prop="specification" label="规格型号" align="left">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<CopyButton :copy-text="scope.row.specification" />
|
|
<CopyButton :copy-text="scope.row.specification" />
|
|
-
|
|
|
|
|
|
+ <template v-if="scope.row.fang">
|
|
|
|
+ {{ scope.row.specification }}
|
|
|
|
+ </template>
|
|
<el-select
|
|
<el-select
|
|
|
|
+ v-else
|
|
v-model="scope.row.specification"
|
|
v-model="scope.row.specification"
|
|
size="mini"
|
|
size="mini"
|
|
:remote-method="query => remoteMethod(query, 'specification')"
|
|
:remote-method="query => remoteMethod(query, 'specification')"
|
|
filterable
|
|
filterable
|
|
style="width: 85%"
|
|
style="width: 85%"
|
|
remote
|
|
remote
|
|
- @change="handleK3List($event, scope.row)"
|
|
|
|
|
|
+ @change="handleK3List($event, scope.row, scope.$index, 'specification')"
|
|
>
|
|
>
|
|
<el-option
|
|
<el-option
|
|
v-for="(item, index) in k3List"
|
|
v-for="(item, index) in k3List"
|
|
@@ -169,20 +181,24 @@
|
|
/>
|
|
/>
|
|
</el-select>
|
|
</el-select>
|
|
</template>
|
|
</template>
|
|
- </el-table-column>
|
|
|
|
- <el-table-column show-overflow-tooltip min-width="150" prop="saleTypeName" label="销售类型" align="left">
|
|
|
|
|
|
+ </pl-table-column>
|
|
|
|
+ <pl-table-column show-overflow-tooltip min-width="150" prop="saleTypeName" label="销售类型" align="left">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
|
+ <template v-if="scope.row.fang">
|
|
|
|
+ {{ scope.row.saleTypeName }}
|
|
|
|
+ </template>
|
|
<el-select
|
|
<el-select
|
|
|
|
+ v-else
|
|
v-model="scope.row.saleTypeId"
|
|
v-model="scope.row.saleTypeId"
|
|
size="mini"
|
|
size="mini"
|
|
filterable
|
|
filterable
|
|
- @change="handleSalesType($event, scope.row)"
|
|
|
|
|
|
+ @change="handleSalesType($event, scope.row, scope.$index, 'saleTypeId')"
|
|
>
|
|
>
|
|
<el-option v-for="item in typeList" :key="item.id" :label="item.saleName" :value="item.id" />
|
|
<el-option v-for="item in typeList" :key="item.id" :label="item.saleName" :value="item.id" />
|
|
</el-select>
|
|
</el-select>
|
|
</template>
|
|
</template>
|
|
- </el-table-column>
|
|
|
|
- <el-table-column
|
|
|
|
|
|
+ </pl-table-column>
|
|
|
|
+ <pl-table-column
|
|
show-overflow-tooltip
|
|
show-overflow-tooltip
|
|
min-width="150"
|
|
min-width="150"
|
|
prop="saleTypeCode"
|
|
prop="saleTypeCode"
|
|
@@ -190,33 +206,57 @@
|
|
align="left"
|
|
align="left"
|
|
/>
|
|
/>
|
|
|
|
|
|
- <el-table-column prop="discAmount" label="格力折扣" align="right">
|
|
|
|
|
|
+ <pl-table-column prop="discAmount" label="格力折扣" align="right">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
|
+ <template v-if="scope.row.fang">
|
|
|
|
+ {{ scope.row.discAmount }}
|
|
|
|
+ </template>
|
|
<el-input
|
|
<el-input
|
|
|
|
+ v-else
|
|
v-model.number="scope.row.discAmount"
|
|
v-model.number="scope.row.discAmount"
|
|
class="yinput"
|
|
class="yinput"
|
|
type="number"
|
|
type="number"
|
|
placeholder="请输入格力折扣"
|
|
placeholder="请输入格力折扣"
|
|
size="mini"
|
|
size="mini"
|
|
@mousewheel.native.prevent
|
|
@mousewheel.native.prevent
|
|
|
|
+ @change="setText($event, scope.$index, scope.row, 'discAmount')"
|
|
/>
|
|
/>
|
|
</template>
|
|
</template>
|
|
- </el-table-column>
|
|
|
|
- <el-table-column prop="price" label="单价" align="right" show-overflow-tooltip min-width="150">
|
|
|
|
|
|
+ </pl-table-column>
|
|
|
|
+ <pl-table-column prop="price" label="单价" align="right" show-overflow-tooltip min-width="150">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
|
+ <template v-if="scope.row.fang">
|
|
|
|
+ {{ scope.row.price }}
|
|
|
|
+ </template>
|
|
<el-input
|
|
<el-input
|
|
|
|
+ v-else
|
|
v-model.number="scope.row.price"
|
|
v-model.number="scope.row.price"
|
|
class="yinput"
|
|
class="yinput"
|
|
type="number"
|
|
type="number"
|
|
placeholder="请输入单价"
|
|
placeholder="请输入单价"
|
|
size="mini"
|
|
size="mini"
|
|
|
|
+ @change="setText($event, scope.$index, scope.row, 'price')"
|
|
@mousewheel.native.prevent
|
|
@mousewheel.native.prevent
|
|
/>
|
|
/>
|
|
</template>
|
|
</template>
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="返利钱包" align="left" show-overflow-tooltip min-width="150">
|
|
|
|
|
|
+ </pl-table-column>
|
|
|
|
+ <pl-table-column label="返利钱包" align="left" show-overflow-tooltip min-width="150">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-select v-model="scope.row.rebateWalletIds" size="mini" multiple filterable>
|
|
|
|
|
|
+ <template v-if="scope.row.fang">
|
|
|
|
+ <template v-for="(item, index) in scope.row.walletRelaList">
|
|
|
|
+ <el-tag v-if="item.type === 'REBATE'" :key="index" size="mini">
|
|
|
|
+ {{ item.walletName }}
|
|
|
|
+ </el-tag>
|
|
|
|
+ </template>
|
|
|
|
+ </template>
|
|
|
|
+ <el-select
|
|
|
|
+ v-else
|
|
|
|
+ v-model="scope.row.rebateWalletIds"
|
|
|
|
+ size="mini"
|
|
|
|
+ multiple
|
|
|
|
+ filterable
|
|
|
|
+ @change="setText($event, scope.$index, scope.row, 'rebateWalletIds')"
|
|
|
|
+ >
|
|
<el-option
|
|
<el-option
|
|
v-for="item in rebateList"
|
|
v-for="item in rebateList"
|
|
:key="item.walletRebateId"
|
|
:key="item.walletRebateId"
|
|
@@ -225,26 +265,52 @@
|
|
/>
|
|
/>
|
|
</el-select>
|
|
</el-select>
|
|
</template>
|
|
</template>
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="现金钱包" align="left" show-overflow-tooltip min-width="150">
|
|
|
|
|
|
+ </pl-table-column>
|
|
|
|
+ <pl-table-column label="现金钱包" align="left" show-overflow-tooltip min-width="150">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-select v-model="scope.row.walletIds" size="mini" multiple filterable>
|
|
|
|
|
|
+ <template v-if="scope.row.fang">
|
|
|
|
+ <template v-for="(item, index) in scope.row.walletRelaList">
|
|
|
|
+ <el-tag v-if="item.type === 'COMMONLY'" :key="index" size="mini">
|
|
|
|
+ {{ item.walletName }}
|
|
|
|
+ </el-tag>
|
|
|
|
+ </template>
|
|
|
|
+ </template>
|
|
|
|
+ <el-select
|
|
|
|
+ v-else
|
|
|
|
+ v-model="scope.row.walletIds"
|
|
|
|
+ size="mini"
|
|
|
|
+ multiple
|
|
|
|
+ filterable
|
|
|
|
+ @change="setText($event, scope.$index, scope.row, 'walletIds')"
|
|
|
|
+ >
|
|
<el-option v-for="item in NoRebateWalletList" :key="item.id" :label="item.name" :value="item.id" />
|
|
<el-option v-for="item in NoRebateWalletList" :key="item.id" :label="item.name" :value="item.id" />
|
|
</el-select>
|
|
</el-select>
|
|
</template>
|
|
</template>
|
|
- </el-table-column>
|
|
|
|
- <el-table-column prop="remark" label="备注" align="left" show-overflow-tooltip min-width="150">
|
|
|
|
|
|
+ </pl-table-column>
|
|
|
|
+ <pl-table-column prop="remark" label="备注" align="left" show-overflow-tooltip min-width="150">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-input v-model="scope.row.remark" placeholder="备注" size="mini" />
|
|
|
|
|
|
+ <template v-if="scope.row.fang">
|
|
|
|
+ {{ scope.row.remark }}
|
|
|
|
+ </template>
|
|
|
|
+ <el-input
|
|
|
|
+ v-else
|
|
|
|
+ v-model="scope.row.remark"
|
|
|
|
+ placeholder="备注"
|
|
|
|
+ size="mini"
|
|
|
|
+ @change="setText($event, scope.$index, scope.row, 'remark')"
|
|
|
|
+ />
|
|
</template>
|
|
</template>
|
|
- </el-table-column>
|
|
|
|
- <el-table-column prop="status" label="状态" align="left" show-overflow-tooltip min-width="150">
|
|
|
|
|
|
+ </pl-table-column>
|
|
|
|
+ <pl-table-column prop="status" label="状态" align="left" show-overflow-tooltip min-width="150">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
{{ scope.row.status ? '启用' : '作废' }}
|
|
{{ scope.row.status ? '启用' : '作废' }}
|
|
</template>
|
|
</template>
|
|
- </el-table-column>
|
|
|
|
- <el-table-column fixed="right" label="操作" align="center">
|
|
|
|
|
|
+ </pl-table-column>
|
|
|
|
+ <pl-table-column fixed="right" label="操作" align="center" min-width="150">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
|
+ <el-button type="text" class="textColor el-popover-left" @click="scope.row.fang = !scope.row.fang"
|
|
|
|
+ >编辑</el-button
|
|
|
|
+ >
|
|
<el-popconfirm
|
|
<el-popconfirm
|
|
confirm-button-text="好的"
|
|
confirm-button-text="好的"
|
|
cancel-button-text="不用了"
|
|
cancel-button-text="不用了"
|
|
@@ -278,8 +344,8 @@
|
|
<el-button slot="reference" type="text" class="textColor el-popover-left">作废</el-button>
|
|
<el-button slot="reference" type="text" class="textColor el-popover-left">作废</el-button>
|
|
</el-popconfirm>
|
|
</el-popconfirm>
|
|
</template>
|
|
</template>
|
|
- </el-table-column>
|
|
|
|
- </el-table>
|
|
|
|
|
|
+ </pl-table-column>
|
|
|
|
+ </pl-table>
|
|
<!-- 分页 -->
|
|
<!-- 分页 -->
|
|
<div style="margin: 20px 20px 20px 0; display: flex; justify-content: space-between">
|
|
<div style="margin: 20px 20px 20px 0; display: flex; justify-content: space-between">
|
|
<div>
|
|
<div>
|
|
@@ -382,6 +448,7 @@ import { downloadFiles, handleImport } from '@/utils/util'
|
|
import TabelTransfer from './TabelTransfer'
|
|
import TabelTransfer from './TabelTransfer'
|
|
import AddCondition from './AddCondition'
|
|
import AddCondition from './AddCondition'
|
|
import ImageUpload from '@/components/Common/image-upload.vue'
|
|
import ImageUpload from '@/components/Common/image-upload.vue'
|
|
|
|
+import { PlTable, PlTableColumn } from 'pl-table'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
directives: {
|
|
directives: {
|
|
@@ -475,6 +542,7 @@ export default {
|
|
// this.handletwoList()
|
|
// this.handletwoList()
|
|
// }
|
|
// }
|
|
},
|
|
},
|
|
|
|
+
|
|
methods: {
|
|
methods: {
|
|
...mapMutations('sales', ['initData']),
|
|
...mapMutations('sales', ['initData']),
|
|
handleStatus(id, status) {
|
|
handleStatus(id, status) {
|
|
@@ -483,6 +551,9 @@ export default {
|
|
this.$successMsg(status ? '启用' : '作废')
|
|
this.$successMsg(status ? '启用' : '作废')
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ setText(e, index, row, name) {
|
|
|
|
+ this.dataList[index][name] = row[name]
|
|
|
|
+ },
|
|
// 下载excel模板
|
|
// 下载excel模板
|
|
handleDownloadFiles() {
|
|
handleDownloadFiles() {
|
|
downloadFiles('policy/download')
|
|
downloadFiles('policy/download')
|
|
@@ -567,7 +638,7 @@ export default {
|
|
const typeData = await getTypeList(params)
|
|
const typeData = await getTypeList(params)
|
|
this.typeList = typeData.data.records
|
|
this.typeList = typeData.data.records
|
|
},
|
|
},
|
|
- handleSalesType(e, row) {
|
|
|
|
|
|
+ handleSalesType(e, row, index, name) {
|
|
const item = this.typeList.filter(k => {
|
|
const item = this.typeList.filter(k => {
|
|
return k.id === e
|
|
return k.id === e
|
|
})[0]
|
|
})[0]
|
|
@@ -582,8 +653,12 @@ export default {
|
|
})
|
|
})
|
|
})
|
|
})
|
|
if (rebateList.length) {
|
|
if (rebateList.length) {
|
|
|
|
+ this.dataList[index].rebateWalletIds = [...new Set([...row.rebateWalletIds, rebateList[0].walletRebateId])]
|
|
this.$set(row, 'rebateWalletIds', [...new Set([...row.rebateWalletIds, rebateList[0].walletRebateId])])
|
|
this.$set(row, 'rebateWalletIds', [...new Set([...row.rebateWalletIds, rebateList[0].walletRebateId])])
|
|
}
|
|
}
|
|
|
|
+ this.dataList[index][name] = row[name]
|
|
|
|
+ this.dataList[index].saleTypeCode = item.saleCode
|
|
|
|
+ this.dataList[index].saleTypeName = item.saleName
|
|
|
|
|
|
this.$set(row, 'saleTypeCode', item.saleCode)
|
|
this.$set(row, 'saleTypeCode', item.saleCode)
|
|
this.$set(row, 'saleTypeName', item.saleName)
|
|
this.$set(row, 'saleTypeName', item.saleName)
|
|
@@ -633,18 +708,14 @@ export default {
|
|
this.importLoading = false
|
|
this.importLoading = false
|
|
this.importFileList = []
|
|
this.importFileList = []
|
|
if (result.code === 200) {
|
|
if (result.code === 200) {
|
|
- this.$alert(result.message, '导入成功', {
|
|
|
|
- confirmButtonText: '确定'
|
|
|
|
- })
|
|
|
|
|
|
+ this.$successMsg('导入成功')
|
|
this.dataList = []
|
|
this.dataList = []
|
|
this.listTotal = 0
|
|
this.listTotal = 0
|
|
this.sleectBox.currentPage = 1
|
|
this.sleectBox.currentPage = 1
|
|
this.dcurrentPage = 1
|
|
this.dcurrentPage = 1
|
|
this.handletwoList()
|
|
this.handletwoList()
|
|
} else {
|
|
} else {
|
|
- this.$alert(result.message, '导入失败', {
|
|
|
|
- confirmButtonText: '确定'
|
|
|
|
- })
|
|
|
|
|
|
+ this.$errorMsg('导入失败')
|
|
}
|
|
}
|
|
},
|
|
},
|
|
async getList() {
|
|
async getList() {
|
|
@@ -678,7 +749,7 @@ export default {
|
|
this.handletwoList()
|
|
this.handletwoList()
|
|
},
|
|
},
|
|
// 获取货品信息
|
|
// 获取货品信息
|
|
- async handletwoList() {
|
|
|
|
|
|
+ handletwoList() {
|
|
// this.searchForm.type
|
|
// this.searchForm.type
|
|
this.listLoading = true
|
|
this.listLoading = true
|
|
|
|
|
|
@@ -688,10 +759,11 @@ export default {
|
|
policyId: this.comCode,
|
|
policyId: this.comCode,
|
|
saleTypeCode: ''
|
|
saleTypeCode: ''
|
|
}
|
|
}
|
|
- try {
|
|
|
|
- const { data } = await getMaterialList(paramss)
|
|
|
|
- this.dataList = data.records
|
|
|
|
|
|
+
|
|
|
|
+ getMaterialList(paramss).then(res => {
|
|
|
|
+ const data = res.data
|
|
data.records.forEach(k => {
|
|
data.records.forEach(k => {
|
|
|
|
+ k.fang = true
|
|
k.walletIds = []
|
|
k.walletIds = []
|
|
k.rebateWalletIds = []
|
|
k.rebateWalletIds = []
|
|
if (!k.specification) {
|
|
if (!k.specification) {
|
|
@@ -711,10 +783,9 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
this.listTotal = data.total
|
|
this.listTotal = data.total
|
|
|
|
+ this.dataList = data.records
|
|
this.listLoading = false
|
|
this.listLoading = false
|
|
- } catch (error) {
|
|
|
|
- console.error(error)
|
|
|
|
- }
|
|
|
|
|
|
+ })
|
|
},
|
|
},
|
|
// 提交审核
|
|
// 提交审核
|
|
handleAddPolicy(policyCustomers, region) {
|
|
handleAddPolicy(policyCustomers, region) {
|
|
@@ -848,7 +919,6 @@ export default {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
savePolicy(this.dataList).then(res => {
|
|
savePolicy(this.dataList).then(res => {
|
|
this.dataList = []
|
|
this.dataList = []
|
|
this.dcurrentPage = 1
|
|
this.dcurrentPage = 1
|
|
@@ -858,7 +928,7 @@ export default {
|
|
this.handletwoList()
|
|
this.handletwoList()
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- handleK3List(e, row) {
|
|
|
|
|
|
+ handleK3List(e, row, index, name) {
|
|
const item = this.k3List.filter(k => {
|
|
const item = this.k3List.filter(k => {
|
|
return k.id == e
|
|
return k.id == e
|
|
})[0]
|
|
})[0]
|
|
@@ -866,6 +936,11 @@ export default {
|
|
this.$set(row, 'materialName', item.name)
|
|
this.$set(row, 'materialName', item.name)
|
|
this.$set(row, 'specification', item.specification)
|
|
this.$set(row, 'specification', item.specification)
|
|
this.$set(row, 'materialId', item.id)
|
|
this.$set(row, 'materialId', item.id)
|
|
|
|
+ this.dataList[index].materialNumber = item.number
|
|
|
|
+ this.dataList[index].materialName = item.name
|
|
|
|
+ this.dataList[index].specification = item.specification
|
|
|
|
+ this.dataList[index].materialId = item.id
|
|
|
|
+
|
|
this.getK3List()
|
|
this.getK3List()
|
|
},
|
|
},
|
|
handleReset() {
|
|
handleReset() {
|
|
@@ -876,7 +951,9 @@ export default {
|
|
components: {
|
|
components: {
|
|
TabelTransfer,
|
|
TabelTransfer,
|
|
AddCondition,
|
|
AddCondition,
|
|
- ImageUpload
|
|
|
|
|
|
+ ImageUpload,
|
|
|
|
+ PlTable,
|
|
|
|
+ PlTableColumn
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
@@ -914,4 +991,7 @@ h4 {
|
|
.footer {
|
|
.footer {
|
|
margin-bottom: 20px;
|
|
margin-bottom: 20px;
|
|
}
|
|
}
|
|
|
|
+::v-deep .el-table__virtual-wrapper {
|
|
|
|
+ width: auto !important;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|