Browse Source

完善采购渠道管理

master
yunuo970428 2 years ago
parent
commit
7666e308e0
  1. 4
      anrui-scm/anrui-scm-ui/src/api/purchasingchannels/purchasingchannels.js
  2. 2
      anrui-scm/anrui-scm-ui/src/router/modules/codemenu.js
  3. 148
      anrui-scm/anrui-scm-ui/src/views/purchasingchannels/caigouqudaoselected.vue
  4. 48
      anrui-scm/anrui-scm-ui/src/views/purchasingchannels/caigouqudaotobeselected.vue

4
anrui-scm/anrui-scm-ui/src/api/purchasingchannels/purchasingchannels.js

@ -4,7 +4,7 @@ export default {
// 查询分页列表
listPage: function(params) {
return request({
url: '/buscenter/v1/buspurchasechannel/listPage',
url: '/scm/v1/scmpurchasechannel/listPage',
method: 'post',
data: params,
headers: { 'Content-Type': 'application/json' }
@ -13,7 +13,7 @@ export default {
// 保存修改记录
choice: function(data) {
return request({
url: '/buscenter/v1/buspurchasechannel/choice',
url: '/scm/v1/scmpurchasechannel/choice',
method: 'post',
data: data,
headers: { 'Content-Type': 'application/json' }

2
anrui-scm/anrui-scm-ui/src/router/modules/codemenu.js

@ -748,7 +748,7 @@ const codemenu = [
title: '采购渠道'
},
children: [{
path: '/purchasingchannels',
path: '/purchasingchannels/caigouqudaotobeselected',
component: () => import('@/views/purchasingchannels/caigouqudaotobeselected.vue'),
name: 'caigouqudaotobeselected',
meta: { title: '采购渠道', noCache: true }

148
anrui-scm/anrui-scm-ui/src/views/purchasingchannels/caigouqudaoselected.vue

@ -45,15 +45,21 @@
</div>
</div>
<div class="listtop">
<div class="tit">选择列表</div>
<div class="tit">选择列表</div>
<pageye v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="init"/>
</div>
<div class="">
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%;">
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%;" @selection-change="handleSelectionChange">
<el-table-column fixed width="50" type="selection" align="center"/>
<el-table-column width="60" label="序号" type="index" :index="indexMethod" align="center"/>
<el-table-column label="采购渠道" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.purchaseOrderTypeValue }}</span>
</template>
</el-table-column>
<el-table-column label="销售订单编号" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.saleOrderNo }}</span>
<span class="bluezi" @click="lookSale(scope.row)">{{ scope.row.saleOrderNo }}</span>
</template>
</el-table-column>
<el-table-column label="销售订单审批日期" align="center" width="150">
@ -96,6 +102,16 @@
<span @click="flowRecord(scope.row)" class="bluezi">查看</span>
</template>
</el-table-column>
<el-table-column label="选择日期" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.choiceDate }}</span>
</template>
</el-table-column>
<el-table-column label="操作人" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.operateName }}</span>
</template>
</el-table-column>
</el-table>
</div>
<div class="pages">
@ -105,6 +121,33 @@
</div>
</div>
<!-- End 列表页面 -->
<!-- 查看销售订单 -->
<saleOrder v-show="viewState == 2" ref="divSale" @doback="resetState"/>
<!-- 选择采购渠道 -->
<el-dialog :visible.sync="dialogVisible" width="50%">
<el-form ref="form_obj" :model="formobj" class="formadd">
<el-row style="border-top: 1px solid #E0E3EB">
<el-col :span="24">
<el-form-item>
<span>选择采购渠道</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item>
<el-select v-model="formobj.purchaseOrderTypeValue" placeholder="请选择" filterable clearable @change="changePurchaseOrderType">
<el-option v-for="item in purchaseOrderType_list" :disabled="item.dictValue == '挂车'" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleConfirm">确定</el-button>
<el-button @click="handleQuXiao">取消</el-button>
</span>
</el-dialog>
<el-dialog title="" :visible.sync="centerDialogVisible" width="78%" height="1%" :before-close="closeIt" center>
<iframe frameborder="0" id="iframe" style="width:100%;" scrolling="no" :src="this.centerDialogVisible === true ? url :''"></iframe>
</el-dialog>
@ -116,15 +159,17 @@ import req from '@/api/purchasingchannels/purchasingchannels'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import ButtonBar from '@/components/ButtonBar'
import { getPathSidByUserSid } from '@/api/cheliang/dictcommons'
import { getPathSidByUserSid, selectOrgLists, typeValues } from '@/api/cheliang/dictcommons'
import { getStorage } from '@/utils/auth'
import saleOrder from '@/components/publicPage/saleOrder'
export default {
name: 'caigouqudaoselected',
components: {
Pagination,
pageye,
ButtonBar
ButtonBar,
saleOrder
},
data() {
return {
@ -132,8 +177,16 @@ export default {
dialogHeight: '80%',
centerDialogVisible: false,
viewState: 1,
dialogVisible: false,
btndisabled: false,
btnList: [
{
type: 'primary',
size: 'small',
icon: '',
btnKey: 'tobeSelect',
btnLabel: '再次选择'
},
{
type: 'info',
size: 'small',
@ -148,8 +201,13 @@ export default {
tableKey: 0,
list: [],
orgDept_list: [],
purchaseOrderType_list: [],
FormLoading: false,
listLoading: false,
formobj: {
purchaseOrderTypeValue: '',
purchaseOrderTypeKey: ''
},
listQuery: {
params: {
applyDeptSid: '',
@ -160,7 +218,7 @@ export default {
saleOrderApproEndDate: '',
saleOrderApproStartDate: '',
saleOrderNo: '',
state: '',
state: '2',
useOrgSid: ''
},
current: 1,
@ -217,6 +275,9 @@ export default {
btnHandle(btnKey) {
console.log('XXXXXXXXXXXXXXX ' + btnKey)
switch (btnKey) {
case 'tobeSelect':
this.tobeSelect()
break
case 'doClose':
this.doClose()
break
@ -225,6 +286,16 @@ export default {
}
},
init() {
typeValues({ type: 'purchaseOrderType' }).then((resp) => {
if (resp.success) {
this.purchaseOrderType_list = resp.data
}
})
selectOrgLists({ userSid: window.sessionStorage.getItem('userSid') }).then((res) => {
if (res.success) {
this.orgDept_list = res.data
}
})
getPathSidByUserSid({ userSid: window.sessionStorage.getItem('userSid') }).then((res) => {
if (res.success) {
this.listQuery.params.useOrgSid = res.data
@ -239,6 +310,19 @@ export default {
var pageindex = index + 1 + pagestart
return pageindex
},
handleSelectionChange(row) {
const aa = []
row.forEach((element) => {
aa.push({
sid: element.sid,
userSid: window.sessionStorage.getItem('userSid'),
orgSidPath: window.sessionStorage.getItem('defaultOrgPath'),
purchaseOrderTypeKey: '',
purchaseOrderTypeValue: ''
})
})
this.sids = aa
},
//
getList() {
this.listLoading = true
@ -274,7 +358,7 @@ export default {
saleOrderApproEndDate: '',
saleOrderApproStartDate: '',
saleOrderNo: '',
state: '',
state: '2',
useOrgSid: ''
},
current: 1,
@ -283,6 +367,56 @@ export default {
}
this.init()
},
tobeSelect() {
if (this.sids.length === 1) {
this.dialogVisible = true
} else {
this.$message({ showClose: true, type: 'error', message: '请选择一条记录进行操作' })
return
}
},
changePurchaseOrderType(value) {
const choose = this.purchaseOrderType_list.filter((item) => item.dictValue === value)
this.formobj.purchaseOrderTypeKey = choose[0].dictKey
},
handleConfirm() {
if (this.formobj.purchaseOrderTypeValue === '') {
this.$message({ showClose: true, type: 'error', message: '选择采购渠道不能为空' })
return
}
for (var i = 0; i < this.sids.length; i++) {
this.sids[i].purchaseOrderTypeValue = this.formobj.purchaseOrderTypeValue
this.sids[i].purchaseOrderTypeKey = this.formobj.purchaseOrderTypeKey
}
const tip = '请确认采购渠道是否选择正确'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
req.choice(this.sids).then((res) => {
if (res.success) {
this.$message({ showClose: true, type: 'success', message: '操作成功' })
this.handleQuXiao()
this.getList()
}
})
})
},
handleQuXiao() {
this.formobj = {
purchaseOrderTypeValue: '',
purchaseOrderTypeKey: ''
}
this.dialogVisible = false
},
lookSale(row) {
this.viewState = 2
this.$refs['divSale'].showInfo({ sid: row.saleOrderSid })
},
resetState() {
this.viewState = 1
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)

48
anrui-scm/anrui-scm-ui/src/views/purchasingchannels/caigouqudaotobeselected.vue

@ -2,7 +2,7 @@
<div class="app-container">
<!-- Start 列表页面 -->
<div v-show="viewState == 1">
<button-bar view-title="车型报价" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle"/>
<button-bar view-title="采购渠道选择" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle"/>
<div class="main-content">
<div class="switch_btn">
<el-button :class="{btn_style:viewState === 1}">待选择</el-button>
@ -52,14 +52,9 @@
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%;" @selection-change="handleSelectionChange">
<el-table-column fixed width="50" type="selection" align="center"/>
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center"/>
<el-table-column fixed width="100" label="操作" align="center">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="handleSelect(scope.row)">选择</el-button>
</template>
</el-table-column>
<el-table-column label="销售订单编号" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.saleOrderNo }}</span>
<span class="bluezi" @click="lookSale(scope.row)">{{ scope.row.saleOrderNo }}</span>
</template>
</el-table-column>
<el-table-column label="销售订单审批日期" align="center" width="150">
@ -111,7 +106,11 @@
</div>
</div>
<!-- End 列表页面 -->
<!-- 已选择列表 -->
<caigouqudaoselected v-show="viewState == 2" ref="divSelect" @doback="resetState"/>
<!-- 查看销售订单 -->
<saleOrder v-show="viewState == 3" ref="divSale" @doback="resetState"/>
<!-- 选择采购渠道 -->
<el-dialog :visible.sync="dialogVisible" width="50%">
<el-form ref="form_obj" :model="formobj" class="formadd">
<el-row style="border-top: 1px solid #E0E3EB">
@ -125,7 +124,7 @@
<el-col :span="24">
<el-form-item>
<el-select v-model="formobj.purchaseOrderTypeValue" placeholder="请选择" filterable clearable @change="changePurchaseOrderType">
<el-option v-for="item in purchaseOrderType_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"/>
<el-option v-for="item in purchaseOrderType_list" :disabled="item.dictValue == '挂车'" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"/>
</el-select>
</el-form-item>
</el-col>
@ -149,6 +148,7 @@ import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import ButtonBar from '@/components/ButtonBar'
import caigouqudaoselected from './caigouqudaoselected'
import saleOrder from '@/components/publicPage/saleOrder'
import { getStorage } from '@/utils/auth'
export default {
@ -157,7 +157,8 @@ export default {
Pagination,
pageye,
ButtonBar,
caigouqudaoselected
caigouqudaoselected,
saleOrder
},
data() {
return {
@ -173,7 +174,7 @@ export default {
size: 'small',
icon: '',
btnKey: 'tobeSelect',
btnLabel: '批量选择'
btnLabel: '选择'
},
{
type: 'info',
@ -207,7 +208,7 @@ export default {
saleOrderApproEndDate: '',
saleOrderApproStartDate: '',
saleOrderNo: '',
state: '',
state: '1',
useOrgSid: ''
},
current: 1,
@ -308,6 +309,8 @@ export default {
row.forEach((element) => {
aa.push({
sid: element.sid,
userSid: window.sessionStorage.getItem('userSid'),
orgSidPath: window.sessionStorage.getItem('defaultOrgPath'),
purchaseOrderTypeKey: '',
purchaseOrderTypeValue: ''
})
@ -331,19 +334,12 @@ export default {
})
},
tobeSelect() {
if (this.sids.length === 0) {
this.$message({ showClose: true, type: 'error', message: '请至少选择一条记录进行批量选择的操作' })
if (this.sids.length === 1) {
this.dialogVisible = true
} else {
this.$message({ showClose: true, type: 'error', message: '请选择一条记录进行操作' })
return
}
this.dialogVisible = true
},
handleSelect(row) {
this.sids.push({
sid: row.sid,
purchaseOrderTypeKey: '',
purchaseOrderTypeValue: ''
})
this.dialogVisible = true
},
changePurchaseOrderType(value) {
const choose = this.purchaseOrderType_list.filter((item) => item.dictValue === value)
@ -368,6 +364,7 @@ export default {
if (res.success) {
this.$message({ showClose: true, type: 'success', message: '操作成功' })
this.handleQuXiao()
this.getList()
}
})
})
@ -378,7 +375,6 @@ export default {
purchaseOrderTypeKey: ''
}
this.dialogVisible = false
this.getList()
},
handleClick() {
this.viewState = 2
@ -400,7 +396,7 @@ export default {
saleOrderApproEndDate: '',
saleOrderApproStartDate: '',
saleOrderNo: '',
state: '',
state: '1',
useOrgSid: ''
},
current: 1,
@ -409,6 +405,10 @@ export default {
}
this.init()
},
lookSale(row) {
this.viewState = 3
this.$refs['divSale'].showInfo({ sid: row.saleOrderSid })
},
resetState() {
this.viewState = 1
},

Loading…
Cancel
Save