|
|
@@ -20,6 +20,13 @@
|
|
|
</el-popover>
|
|
|
</template>
|
|
|
|
|
|
+ <template #table-column-cgStaffName="{scope}">
|
|
|
+ <span v-if="scope.row.cgStaffName!=''" style="cursor:pointer;" @click="changeCgStaff(scope.row)">{{ scope.row.cgStaffName }}</span>
|
|
|
+ <span v-else>
|
|
|
+ <i class="el-icon-edit" style="color:#409eff;font-size:17px;cursor:pointer;" slot="reference" @click="changeCgStaff(scope.row)"></i>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+
|
|
|
<template #table-column-name="{scope}">
|
|
|
<span class="item-name" v-if="scope.row.delStatus == 0">{{ scope.row.name }}</span>
|
|
|
<span class="item-name" v-else style="color:#CCCCCC;">{{ scope.row.name }}</span>
|
|
|
@@ -133,6 +140,14 @@
|
|
|
|
|
|
<template #slot-option-area>
|
|
|
<el-input v-model="search" placeholder="搜索花材" size="mini" style="width:160px;" ref="itemSearchRef" @input="changeSearch()" @focus="clearSearch()"></el-input>
|
|
|
+
|
|
|
+ <el-select size="mini" v-model="currentItemClassName" placeholder="分类" style="width:150px;margin-left:10px;" @change="getItemClass" clearable>
|
|
|
+ <el-option v-for="item in itemClassList" :key="item.value" :label="item.name" :value="item.id"> </el-option>
|
|
|
+ </el-select>
|
|
|
+
|
|
|
+ <el-select size="mini" v-model="currentCgStaffName" placeholder="采购人" style="width:110px;margin-left:10px;" @change="getCgStaff" :clearable="true">
|
|
|
+ <el-option v-for="item in staffList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
+ </el-select>
|
|
|
<el-radio-group v-model="hasStock" @change="changeHasStock" style="padding-top:6px;margin-left:10px;">
|
|
|
<el-radio label="-1">全部</el-radio>
|
|
|
<el-radio label="0">没库存</el-radio>
|
|
|
@@ -140,6 +155,15 @@
|
|
|
</el-radio-group>
|
|
|
</template>
|
|
|
|
|
|
+ <template #slot-more-do-btn>
|
|
|
+ <el-dropdown size="medium" split-button type="primary" @click="batchChangeCgStaff" @command="bottomDoMore($event)">
|
|
|
+ 修改采购人
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <el-dropdown-item command="batchChangeKd">修改开单人</el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
+ </template>
|
|
|
+
|
|
|
</x-crud>
|
|
|
<item-list-layer :show.sync="showItemModal" :classId.sync="classId" :className.sync="className" @confirm="selectItemFn" @cancel="showItemModal = false">
|
|
|
</item-list-layer>
|
|
|
@@ -249,19 +273,25 @@
|
|
|
|
|
|
<stock-detail ref="stockDetail" :itemData="itemData" @searchFocus="searchFocus" />
|
|
|
|
|
|
+ <select-staff ref="selectStaffRef" @getStaff="getStaff" :staffData="staffData" />
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
import itemListLayer from '@/components/module/item-list-layer';
|
|
|
import stockDetail from './components/stock-detail';
|
|
|
+import selectStaff from '@/components/select-staff';
|
|
|
export default {
|
|
|
name: 'list',
|
|
|
components: {
|
|
|
itemListLayer,
|
|
|
- stockDetail
|
|
|
+ stockDetail,
|
|
|
+ selectStaff
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
+ currentItemClassName:'',
|
|
|
+ staffData:{},
|
|
|
app: null,
|
|
|
hasStock:'-1',
|
|
|
sortLink: '',
|
|
|
@@ -308,7 +338,7 @@ export default {
|
|
|
batchAlterNum:'',
|
|
|
batchAddNum:'',
|
|
|
dialogFormVisible:false,
|
|
|
-
|
|
|
+ selectedData:[],
|
|
|
canAddPrice:false,
|
|
|
canSkAddPrice:false,
|
|
|
canByAddPrice:false,
|
|
|
@@ -396,20 +426,81 @@ export default {
|
|
|
unitList: [],
|
|
|
currentItemId: 0,
|
|
|
itemData:{},
|
|
|
- search:''
|
|
|
+ search:'',
|
|
|
+ currentCgStaffName:'',
|
|
|
+ currentCgStaffId:0,
|
|
|
+ currentCgStaffName:'',
|
|
|
+ staffList:[]
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
},
|
|
|
mounted() {
|
|
|
+ let that = this
|
|
|
+
|
|
|
this.init()
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.itemSearchRef.focus()
|
|
|
})
|
|
|
|
|
|
+ that.$service.shopAdmin.getAllStaff().then(res => {
|
|
|
+ that.staffList = res.list
|
|
|
+ })
|
|
|
+
|
|
|
},
|
|
|
methods: {
|
|
|
+ getItemClass(e){
|
|
|
+ this.classId = e
|
|
|
+ this.refreshData()
|
|
|
+ },
|
|
|
+ getCgStaff(e){
|
|
|
+ this.currentCgStaffId = e
|
|
|
+ this.refreshData()
|
|
|
+ },
|
|
|
+ batchChangeCgStaff(){
|
|
|
+ let that = this
|
|
|
+ if (this.$util.isEmpty(this.selectedData)) {
|
|
|
+ this.$message.error('请选择花材')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ this.staffData = {title:'修改采购负责人',changeType:'batchChangeCgStaff',obj:null}
|
|
|
+ this.$refs.selectStaffRef.init()
|
|
|
+ },
|
|
|
+ bottomDoMore(cmd){
|
|
|
+ if(cmd == 'batchChangeKd'){
|
|
|
+ this.$message.error('开发中')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getStaff(staff){
|
|
|
+ let that = this
|
|
|
+ if(this.staffData.changeType == 'changeCgStaff'){
|
|
|
+ let item = this.staffData.obj
|
|
|
+ let json = JSON.stringify([item.id])
|
|
|
+ this.$service.product.batchModifyCgStaff({ids:json,staffId:staff.id}).then(res=>{
|
|
|
+ this.$message.success('修改成功')
|
|
|
+ setTimeout(() => {
|
|
|
+ that.refreshData()
|
|
|
+ }, 1000)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ //批量修改采购负责人
|
|
|
+ if(this.staffData.changeType == 'batchChangeCgStaff'){
|
|
|
+ let ids = this.selectedData.map(ele=>{
|
|
|
+ return ele.id
|
|
|
+ })
|
|
|
+ this.$service.product.batchModifyCgStaff({ids:JSON.stringify(ids),staffId:staff.id}).then(res=>{
|
|
|
+ this.$message.success('修改成功')
|
|
|
+ setTimeout(() => {
|
|
|
+ that.refreshData()
|
|
|
+ }, 1000)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ changeCgStaff(item){
|
|
|
+ this.staffData = {title:'修改采购负责人',changeType:'changeCgStaff',obj:item}
|
|
|
+ this.$refs.selectStaffRef.init()
|
|
|
+ },
|
|
|
doMore(cmd,data){
|
|
|
if(cmd == 'downCode'){
|
|
|
let id = data.id
|
|
|
@@ -425,7 +516,7 @@ export default {
|
|
|
},
|
|
|
changeHasStock(e){
|
|
|
this.hasStock = e
|
|
|
- this.goRefresh()
|
|
|
+ this.refreshData()
|
|
|
},
|
|
|
clearSearch(){
|
|
|
if(this.search != ''){
|
|
|
@@ -439,12 +530,12 @@ export default {
|
|
|
clearTimeout(this.T)
|
|
|
}
|
|
|
this.T = setTimeout(function(){
|
|
|
- that.goRefresh()
|
|
|
+ that.refreshData()
|
|
|
},650)
|
|
|
},
|
|
|
- goRefresh(){
|
|
|
+ refreshData(){
|
|
|
let that = this
|
|
|
- that.app.refresh({ classId: that.classId,status:that.status,delStatus:that.delStatus,showPage:1,name:that.search,hasStock:that.hasStock})
|
|
|
+ that.app.refresh({ classId: that.classId,status:that.status,delStatus:that.delStatus,showPage:1,name:that.search,hasStock:that.hasStock,cgStaffId:this.currentCgStaffId})
|
|
|
},
|
|
|
getStockList(item){
|
|
|
this.itemData = {id:item.id,name:item.name}
|
|
|
@@ -594,15 +685,13 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
onLoad ({ ctx, app }) {
|
|
|
- this.app = app
|
|
|
- if (this.$route.query.classId) {
|
|
|
- this.classId = Number(this.$route.query.classId);
|
|
|
- if (this.$route.query.className != '') {
|
|
|
- this.tabsData[0].text = this.$route.query.className;
|
|
|
- this.$forceUpdate();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
+ this.app = app
|
|
|
+ if (this.$route.query.classId) {
|
|
|
+ this.classId = Number(this.$route.query.classId);
|
|
|
+ }
|
|
|
+ if (this.$route.query.className != '') {
|
|
|
+ this.currentItemClassName = this.$route.query.className
|
|
|
+ }
|
|
|
if(this.$route.query.status){
|
|
|
this.status = this.$route.query.status
|
|
|
}
|
|
|
@@ -614,6 +703,11 @@ export default {
|
|
|
.set('table', {
|
|
|
columns: [
|
|
|
{
|
|
|
+ type: 'selection',
|
|
|
+ align: 'center',
|
|
|
+ width: '40'
|
|
|
+ },
|
|
|
+ {
|
|
|
prop: 'id',
|
|
|
label: 'ID',
|
|
|
align: 'center',
|
|
|
@@ -696,6 +790,12 @@ export default {
|
|
|
label: '上架',
|
|
|
align: 'center',
|
|
|
minWidth: 60
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'cgStaffName',
|
|
|
+ label: '采购人',
|
|
|
+ align: 'center',
|
|
|
+ minWidth:90
|
|
|
},
|
|
|
{
|
|
|
prop: 'delStatus',
|
|
|
@@ -704,6 +804,13 @@ export default {
|
|
|
minWidth: 60
|
|
|
}
|
|
|
],
|
|
|
+ on: {
|
|
|
+ 'selection-change': selection => {
|
|
|
+ this.selectedData = selection.map(e => {
|
|
|
+ return {id:e.id}
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
op: {
|
|
|
visible: true,
|
|
|
props: {
|
|
|
@@ -718,14 +825,18 @@ export default {
|
|
|
.set('pagination', {
|
|
|
size: 50
|
|
|
})
|
|
|
- .set('layout', [['slot-tabs'],['slot-option-area','flex1', 'slot-addNew-goods-btn','slot-add-goods-btn','slot-download-price-btn', 'refresh-btn'],
|
|
|
- ['data-table'],['flex1', 'pagination']]).done();
|
|
|
- app.refresh({ classId: this.classId,status:this.status,delStatus:this.delStatus,showPage: 1,name:this.search,hasStock:this.hasStock});
|
|
|
+ .set('layout', [
|
|
|
+ ['slot-tabs'],
|
|
|
+ ['slot-option-area','flex1', 'slot-addNew-goods-btn','slot-add-goods-btn','slot-download-price-btn', 'refresh-btn'],
|
|
|
+ ['data-table'],
|
|
|
+ ['slot-more-do-btn','flex1', 'pagination']
|
|
|
+ ]).done();
|
|
|
+ app.refresh({ classId: this.classId,status:this.status,delStatus:this.delStatus,showPage: 1,name:this.search,hasStock:this.hasStock,cgStaffId:this.currentCgStaffId});
|
|
|
},
|
|
|
uploadSuccess() {
|
|
|
console.log('valid',this.$refs['replaceForm'].validateField('cover'))
|
|
|
},
|
|
|
- refresh (params) {
|
|
|
+ refresh(params) {
|
|
|
this.app.refresh(params);
|
|
|
},
|
|
|
showAddPrice(){
|