add:添加调拨其他出库下推功能 fix:修复sys菜单组件名称问题
This commit is contained in:
@@ -2,6 +2,8 @@ import { constantRouterMap } from '@/router/routers'
|
||||
import Layout from '@/layout/index'
|
||||
import ParentView from '@/components/ParentView'
|
||||
|
||||
const MENU_TYPE_DIRECTORY = '2'
|
||||
|
||||
const permission = {
|
||||
state: {
|
||||
routers: constantRouterMap,
|
||||
@@ -42,6 +44,7 @@ export const filterAsyncRouter = (routers, lastRouter = false, type = false) =>
|
||||
if (type && router.children) {
|
||||
router.children = filterChildren(router.children)
|
||||
}
|
||||
const hasChildren = router.children != null && router.children && router.children.length
|
||||
if (router.component) {
|
||||
if (router.component === 'Layout') { // Layout组件特殊处理
|
||||
router.component = Layout
|
||||
@@ -51,8 +54,10 @@ export const filterAsyncRouter = (routers, lastRouter = false, type = false) =>
|
||||
const component = router.component
|
||||
router.component = loadView(component)
|
||||
}
|
||||
} else if (hasChildren && router.type === MENU_TYPE_DIRECTORY) {
|
||||
router.component = ParentView
|
||||
}
|
||||
if (router.children != null && router.children && router.children.length) {
|
||||
if (hasChildren) {
|
||||
router.children = filterAsyncRouter(router.children, router, type)
|
||||
} else {
|
||||
delete router['children']
|
||||
|
||||
@@ -80,13 +80,13 @@
|
||||
placeholder="菜单标题"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.type.toString() === '2'" label="按钮名称" prop="title">
|
||||
<el-form-item v-if="form.type.toString() === '4'" label="按钮名称" prop="title">
|
||||
<el-input v-model="form.title" placeholder="按钮名称" style="width: 190px;" />
|
||||
</el-form-item>
|
||||
<el-form-item v-show="form.type.toString() !== '1' " label="权限标识" prop="permission">
|
||||
<el-input v-model="form.permission" :disabled="form.iframe=='1'" placeholder="权限标识" style="width: 190px;" />
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.type.toString() !== '1' && form.type.toString() !== '2'" label="路由地址" prop="path">
|
||||
<el-form-item v-if="form.type.toString() !== '1'" label="路由地址" prop="path">
|
||||
<el-input v-model="form.path" placeholder="路由地址" style="width: 190px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="菜单排序" prop="menu_sort">
|
||||
@@ -101,7 +101,7 @@
|
||||
<el-form-item v-show="!form.iframe && form.type.toString() === '3' " label="组件名称" prop="componentName">
|
||||
<el-input v-model="form.componentName" style="width: 190px;" placeholder="匹配组件内Name字段" />
|
||||
</el-form-item>
|
||||
<el-form-item v-show="!form.iframe && (form.type.toString() === '2' ||form.type.toString() === '3' ) " label="组件路径" prop="component">
|
||||
<el-form-item v-show="!form.iframe && form.type.toString() === '3' " label="组件路径" prop="component">
|
||||
<el-input v-model="form.component" style="width: 190px;" placeholder="组件路径" />
|
||||
</el-form-item>
|
||||
<el-form-item label="上级类目" prop="pid">
|
||||
|
||||
@@ -38,16 +38,16 @@
|
||||
:title="crud.status.title"
|
||||
:width="computedLabelWidth"
|
||||
>
|
||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="mini" :label-width="computedFormLabelWidth">
|
||||
<el-form ref="form" :inline="true" :model="form" :rules="formRules" size="mini" :label-width="computedFormLabelWidth">
|
||||
<el-form-item :label="$t('menu.dialog.menu_type')" prop="type">
|
||||
<el-radio-group v-model="form.type" size="mini">
|
||||
<el-radio-button label="1">{{ $t('menu.dialog.system') }}</el-radio-button>
|
||||
<el-radio-button label="2">{{ $t('menu.dialog.catalogue') }}</el-radio-button>
|
||||
<el-radio-button label="3">{{ $t('menu.dialog.menu') }}</el-radio-button>
|
||||
<el-radio-button label="4">{{ $t('menu.dialog.button') }}</el-radio-button>
|
||||
<!-- <el-radio-button label="4">{{ $t('menu.dialog.button') }}</el-radio-button>-->
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="form.type.toString() !== '1' && form.type.toString() !== '4' " :label="$t('menu.dialog.menu_icon')" prop="icon">
|
||||
<el-form-item v-show="!isSystemType && !isButtonType" :label="$t('menu.dialog.menu_icon')" prop="icon">
|
||||
<el-popover
|
||||
placement="bottom-start"
|
||||
width="450"
|
||||
@@ -67,59 +67,59 @@
|
||||
</el-input>
|
||||
</el-popover>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="form.type.toString() !== '2' && form.type.toString() !== '1'" :label="$t('menu.dialog.menu_chain')" prop="iframe">
|
||||
<el-form-item v-show="!isDirectoryType && !isSystemType" :label="$t('menu.dialog.menu_chain')" prop="iframe">
|
||||
<el-radio-group v-model="form.iframe" size="mini">
|
||||
<el-radio-button label="true">{{ $t('common.Yes') }}</el-radio-button>
|
||||
<el-radio-button label="false">{{ $t('common.No') }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="form.type.toString() === '2'" :label="$t('menu.dialog.menu_cache')" prop="cache">
|
||||
<el-form-item v-show="isDirectoryType" :label="$t('menu.dialog.menu_cache')" prop="cache">
|
||||
<el-radio-group v-model="form.cache" size="mini">
|
||||
<el-radio-button label="true">{{ $t('common.Yes') }}</el-radio-button>
|
||||
<el-radio-button label="false">{{ $t('common.No') }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="form.type.toString() !== '2' && form.type.toString() !== '1' " :label="$t('menu.dialog.menu_visible')" prop="hidden">
|
||||
<el-form-item v-show="!isDirectoryType && !isSystemType" :label="$t('menu.dialog.menu_visible')" prop="hidden">
|
||||
<el-radio-group v-model="form.hidden" size="mini">
|
||||
<el-radio-button label="false">{{ $t('common.Yes') }}</el-radio-button>
|
||||
<el-radio-button label="true">{{ $t('common.No') }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.type.toString() !== '2'" :label="$t('menu.dialog.default_title')" prop="title">
|
||||
<el-form-item v-if="showTitleFields" :label="$t('menu.dialog.default_title')" prop="title">
|
||||
<el-input
|
||||
v-model="form.title"
|
||||
:style=" form.type.toString() === '0' ? 'width: 450px' : 'width: 190px'"
|
||||
:style=" isSystemType ? 'width: 450px' : 'width: 190px'"
|
||||
:placeholder="$t('menu.dialog.default_title')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.type.toString() !== '2'" :label="$t('menu.dialog.zh_title')" prop="zh_title">
|
||||
<el-form-item v-if="showTitleFields" :label="$t('menu.dialog.zh_title')" prop="zh_title">
|
||||
<el-input
|
||||
v-model="form.zh_title"
|
||||
:style=" form.type.toString() === '0' ? 'width: 450px' : 'width: 190px'"
|
||||
:style=" isSystemType ? 'width: 450px' : 'width: 190px'"
|
||||
:placeholder="$t('menu.dialog.zh_title')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.type.toString() !== '2'" :label="$t('menu.dialog.en_title')" prop="en_title">
|
||||
<el-form-item v-if="showTitleFields" :label="$t('menu.dialog.en_title')" prop="en_title">
|
||||
<el-input
|
||||
v-model="form.en_title"
|
||||
:style=" form.type.toString() === '0' ? 'width: 450px' : 'width: 190px'"
|
||||
:style=" isSystemType ? 'width: 450px' : 'width: 190px'"
|
||||
:placeholder="$t('menu.dialog.en_title')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.type.toString() !== '2'" :label="$t('menu.dialog.id_title')" prop="in_title">
|
||||
<el-form-item v-if="showTitleFields" :label="$t('menu.dialog.id_title')" prop="in_title">
|
||||
<el-input
|
||||
v-model="form.in_title"
|
||||
:style=" form.type.toString() === '0' ? 'width: 450px' : 'width: 190px'"
|
||||
:style=" isSystemType ? 'width: 450px' : 'width: 190px'"
|
||||
:placeholder="$t('menu.dialog.id_title')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.type.toString() === '2'" :label="$t('menu.dialog.button_name')" prop="title">
|
||||
<el-form-item v-if="isButtonType" :label="$t('menu.dialog.button_name')" prop="title">
|
||||
<el-input v-model="form.title" :placeholder="$t('menu.dialog.button_name')" style="width: 190px;" />
|
||||
</el-form-item>
|
||||
<el-form-item v-show="form.type.toString() !== '1' " :label="$t('menu.table.permission_ident')" prop="permission">
|
||||
<el-form-item v-show="showPermissionField" :label="$t('menu.table.permission_ident')" prop="permission">
|
||||
<el-input v-model="form.permission" :disabled="form.iframe" :placeholder="$t('menu.table.permission_ident')" style="width: 190px;" />
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.type.toString() !== '1' && form.type.toString() !== '2'" :label="$t('menu.dialog.router_path')" prop="path">
|
||||
<el-form-item v-if="showPathField" :label="$t('menu.dialog.router_path')" prop="path">
|
||||
<el-input v-model="form.path" :placeholder="$t('menu.dialog.router_path')" style="width: 190px;" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('menu.dialog.menu_sort')" prop="menu_sort">
|
||||
@@ -131,10 +131,10 @@
|
||||
style="width: 190px;"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="!form.iframe && form.type.toString() === '3' " :label="$t('menu.dialog.component_name')" prop="component_name">
|
||||
<el-form-item v-show="showComponentNameField" :label="$t('menu.dialog.component_name')" prop="component_name">
|
||||
<el-input v-model="form.component_name" style="width: 190px;" :placeholder="$t('menu.placeholder.component_tip')" />
|
||||
</el-form-item>
|
||||
<el-form-item v-show="!form.iframe && (form.type.toString() === '2' ||form.type.toString() === '3' ) " :label="$t('menu.dialog.component_path')" prop="component">
|
||||
<el-form-item v-show="showComponentField" :label="$t('menu.dialog.component_path')" prop="component">
|
||||
<el-input v-model="form.component" style="width: 190px;" :placeholder="$t('menu.dialog.component_path')" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('menu.dialog.superior_class')" prop="pid">
|
||||
@@ -170,7 +170,7 @@
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column :label="$t('menu.table.menu_title')" :prop="$langPre.computedProp('title')" :min-width="flexWidth($langPre.computedProp('title'),crud.data,$t('menu.table.menu_title'))" />
|
||||
<el-table-column :label="$t('menu.table.menu_title')" :prop="$langPre.computedProp('title')" width="180" />
|
||||
<el-table-column :label="$t('menu.table.system')" prop="system_type" :min-width="flexWidth('system_type',crud.data,$t('menu.table.system'))">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.system_type[scope.row.system_type] }} : {{ scope.row.system_type }}
|
||||
@@ -240,6 +240,13 @@ import DateRangePicker from '@/components/DateRangePicker'
|
||||
import Dict from '../../../components/Dict/Dict'
|
||||
import i18n from '@/i18n'
|
||||
|
||||
const MENU_TYPE = {
|
||||
SYSTEM: '1',
|
||||
DIRECTORY: '2',
|
||||
MENU: '3',
|
||||
BUTTON: '4'
|
||||
}
|
||||
|
||||
// crud交由presenter持有
|
||||
const defaultForm = {
|
||||
menu_id: null,
|
||||
@@ -280,26 +287,55 @@ export default {
|
||||
edit: ['admin', 'menu:edit'],
|
||||
del: ['admin', 'menu:del']
|
||||
},
|
||||
rules: {
|
||||
title: [
|
||||
{ required: true, message: '请输入标题', trigger: 'blur' }
|
||||
],
|
||||
zh_title: [
|
||||
{ required: true, message: '请输入标题', trigger: 'blur' }
|
||||
],
|
||||
en_title: [
|
||||
{ required: true, message: '请输入标题', trigger: 'blur' }
|
||||
],
|
||||
in_title: [
|
||||
{ required: true, message: '请输入标题', trigger: 'blur' }
|
||||
],
|
||||
path: [
|
||||
{ required: true, message: '请输入地址', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
rules: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isSystemType() {
|
||||
return String(this.form.type) === MENU_TYPE.SYSTEM
|
||||
},
|
||||
isDirectoryType() {
|
||||
return String(this.form.type) === MENU_TYPE.DIRECTORY
|
||||
},
|
||||
isMenuType() {
|
||||
return String(this.form.type) === MENU_TYPE.MENU
|
||||
},
|
||||
isButtonType() {
|
||||
return String(this.form.type) === MENU_TYPE.BUTTON
|
||||
},
|
||||
showTitleFields() {
|
||||
return this.isSystemType || this.isDirectoryType || this.isMenuType
|
||||
},
|
||||
showPermissionField() {
|
||||
return this.isMenuType || this.isButtonType
|
||||
},
|
||||
showPathField() {
|
||||
return String(this.form.type) === MENU_TYPE.MENU || String(this.form.type) === MENU_TYPE.DIRECTORY
|
||||
},
|
||||
showComponentNameField() {
|
||||
return !this.form.iframe && this.isMenuType
|
||||
},
|
||||
showComponentField() {
|
||||
return !this.form.iframe && String(this.form.type) === MENU_TYPE.MENU
|
||||
},
|
||||
formRules() {
|
||||
const titleRules = [{ required: true, message: '请输入标题', trigger: 'blur' }]
|
||||
const pathRules = this.showPathField ? [{ required: true, message: '请输入地址', trigger: 'blur' }] : []
|
||||
const componentRules = this.showComponentField ? [{ required: true, message: '请输入组件路径', trigger: 'blur' }] : []
|
||||
const componentNameRules = this.showComponentNameField ? [{ required: true, message: '请输入组件名称', trigger: 'blur' }] : []
|
||||
const permissionRules = this.isButtonType ? [{ required: true, message: '请输入权限标识', trigger: 'blur' }] : []
|
||||
|
||||
return {
|
||||
title: titleRules,
|
||||
zh_title: this.showTitleFields ? titleRules : [],
|
||||
en_title: this.showTitleFields ? titleRules : [],
|
||||
in_title: this.showTitleFields ? titleRules : [],
|
||||
path: pathRules,
|
||||
component: componentRules,
|
||||
component_name: componentNameRules,
|
||||
permission: permissionRules
|
||||
}
|
||||
},
|
||||
computedLabelWidth() {
|
||||
const item = localStorage.getItem('lang')
|
||||
if (item === 'en') {
|
||||
@@ -321,7 +357,61 @@ export default {
|
||||
return `100px`
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'form.type'(value) {
|
||||
this.applyTypeDefaults(value)
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.form) {
|
||||
this.$refs.form.clearValidate()
|
||||
}
|
||||
})
|
||||
},
|
||||
'form.iframe'(value) {
|
||||
this.applyIframeDefaults(value)
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.form) {
|
||||
this.$refs.form.clearValidate(['component', 'component_name'])
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
applyTypeDefaults(type) {
|
||||
const currentType = String(type)
|
||||
if (currentType === MENU_TYPE.SYSTEM) {
|
||||
this.form.icon = null
|
||||
this.form.iframe = false
|
||||
this.form.cache = false
|
||||
this.form.hidden = false
|
||||
this.form.permission = null
|
||||
this.form.path = null
|
||||
this.form.component = null
|
||||
this.form.component_name = null
|
||||
} else if (currentType === MENU_TYPE.DIRECTORY) {
|
||||
this.form.iframe = false
|
||||
this.form.cache = false
|
||||
this.form.hidden = false
|
||||
this.form.permission = null
|
||||
this.form.path = null
|
||||
this.form.component_name = null
|
||||
} else if (currentType === MENU_TYPE.MENU) {
|
||||
this.form.cache = false
|
||||
} else if (currentType === MENU_TYPE.BUTTON) {
|
||||
this.form.icon = null
|
||||
this.form.iframe = false
|
||||
this.form.cache = false
|
||||
this.form.hidden = false
|
||||
this.form.path = null
|
||||
this.form.component = null
|
||||
this.form.component_name = null
|
||||
}
|
||||
},
|
||||
applyIframeDefaults(iframe) {
|
||||
if (iframe) {
|
||||
this.form.component = null
|
||||
this.form.component_name = null
|
||||
}
|
||||
},
|
||||
normalizer(node) {
|
||||
return {
|
||||
id: node.menu_id,
|
||||
@@ -348,6 +438,10 @@ export default {
|
||||
},
|
||||
// 新增与编辑前做的操作
|
||||
[CRUD.HOOK.afterToCU](crud, form) {
|
||||
if (!form.menu_id) {
|
||||
this.applyTypeDefaults(form.type)
|
||||
this.applyIframeDefaults(form.iframe)
|
||||
}
|
||||
this.menus = []
|
||||
if (form.menu_id) { // 修改
|
||||
if (!form.pid) { // 一级菜单,一级的父级菜单的pid为0.
|
||||
@@ -386,6 +480,7 @@ export default {
|
||||
},
|
||||
getSupMenus(menu_id) {
|
||||
crudMenu.getMenuSuperior(menu_id).then(res => {
|
||||
res = res.data
|
||||
const children = res.map(function(obj) {
|
||||
if (!obj.leaf && !obj.children) {
|
||||
obj.children = null
|
||||
@@ -398,6 +493,7 @@ export default {
|
||||
loadMenus({ action, parentNode, callback }) {
|
||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||
crudMenu.getMenusTree(parentNode.menu_id).then(res => {
|
||||
res = res.data
|
||||
parentNode.children = res.map(function(obj) {
|
||||
if (!obj.leaf) {
|
||||
obj.children = null
|
||||
|
||||
@@ -26,8 +26,9 @@
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<crudOperation :permission="permission">
|
||||
<el-button slot="right" class="filter-item" type="warning" icon="el-icon-s-promotion" size="mini" :disabled="audit_flag" @click="issueReturnBill">下发回传单</el-button>
|
||||
<crudOperation>
|
||||
<el-button slot="right" class="filter-item" type="warning" icon="el-icon-s-promotion" size="mini" :disabled="audit_flag" @click="issueReturnBill">下发回传</el-button>
|
||||
<el-button slot="right" class="filter-item" type="success" icon="el-icon-s-promotion" size="mini" :disabled="!multipleSelection.length || multipleSelection.length>1" @click="handleBatchPush">下推出库</el-button>
|
||||
</crudOperation>
|
||||
<el-table ref="table" v-loading="crud.loading" size="mini" :data="crud.data" highlight-current-row style="width: 100%;" @selection-change="crud.selectionChangeHandler" @current-change="handleCurrentChange" @select="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
@@ -76,7 +77,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudPurchase from '@/views/wms/pm_manage/allocationOut/purchase'
|
||||
import crudPurchase, {outPush} from '@/views/wms/pm_manage/allocationOut/purchase'
|
||||
import CRUD, { crud, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
@@ -84,6 +85,7 @@ import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import AddDialog from '@/views/wms/pm_manage/purchase/AddDialog'
|
||||
import ViewDialog from '@/views/wms/pm_manage/purchase/ViewDialog'
|
||||
import {push} from "@/views/wms/pm_manage/demand/demand";
|
||||
|
||||
export default {
|
||||
name: 'AllocationOut',
|
||||
@@ -106,6 +108,7 @@ export default {
|
||||
edit: ['admin', 'purchasemst:edit'],
|
||||
del: ['admin', 'purchasemst:del']
|
||||
},
|
||||
multipleSelection: [],
|
||||
viewShow: false,
|
||||
mstrow: {},
|
||||
currentRow: null,
|
||||
@@ -129,6 +132,34 @@ export default {
|
||||
const map = { '0': '未审核', '1': '已审核' }
|
||||
return map[row.status] || row.status || '-'
|
||||
},
|
||||
handleBatchPush() {
|
||||
if (!this.multipleSelection.length) {
|
||||
this.$message.warning('请先勾选要下推的调拨出库单')
|
||||
return
|
||||
}
|
||||
// eslint-disable-next-line eqeqeq
|
||||
const invalidRows = this.multipleSelection.filter(item => String(item.bill_status) === '99')
|
||||
if (invalidRows.length) {
|
||||
this.$message.warning('仅支持批量下推状态为“分配”的需求单')
|
||||
return
|
||||
}
|
||||
this.$confirm(`确认批量下推已勾选的 ${this.multipleSelection.length} 条需求单吗?`, '提示', {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
crudPurchase.outPush(this.multipleSelection[0]).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$message.success('下推成功')
|
||||
this.crud.toQuery()
|
||||
} else {
|
||||
this.$message.error(res.message)
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$message.error('下推失败')
|
||||
})
|
||||
}).catch(() => {})
|
||||
},
|
||||
formatDate(val) {
|
||||
if (!val) return ''
|
||||
if (typeof val === 'string') return val
|
||||
@@ -156,6 +187,7 @@ export default {
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
console.log(val.length)
|
||||
this.multipleSelection = val
|
||||
if (val.length == 0) {
|
||||
this.audit_flag = true
|
||||
} else {
|
||||
|
||||
@@ -54,5 +54,12 @@ export function pushZD(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
export function outPush(data) {
|
||||
return request({
|
||||
url: '/api/purchasemst/outPush',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, get, issueReturnBill, print, pushZD }
|
||||
export default { add, edit, del, get, issueReturnBill, print, pushZD, outPush }
|
||||
|
||||
@@ -20,10 +20,9 @@
|
||||
<rrOperation :crud="crud" />
|
||||
</el-form>
|
||||
</div>
|
||||
<div style="margin-bottom: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;">
|
||||
<crudOperation :permission="permission" />
|
||||
<el-button size="mini" type="success" :disabled="!multipleSelection.length" @click="handleBatchPush">下推</el-button>
|
||||
</div>
|
||||
<crudOperation :permission="permission" >
|
||||
<el-button slot="right" class="filter-item" type="success" icon="el-icon-s-promotion" size="mini" :disabled="!multipleSelection.length" @click="handleBatchPush">下推出库</el-button>
|
||||
</crudOperation>
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="900px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="110px" label-suffix=":" style="border: 1px solid #cfe0df;margin-top: 10px;padding: 10px;">
|
||||
<el-row>
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
</div>
|
||||
<crudOperation :permission="permission">
|
||||
<el-button slot="right" class="filter-item" type="warning" icon="el-icon-s-promotion" size="mini" :disabled="audit_flag" @click="issueReturnBill">下发回传单</el-button>
|
||||
<el-button slot="right" class="filter-item" type="success" icon="el-icon-s-promotion" size="mini" :disabled="!multipleSelection.length || multipleSelection.length>1" @click="handleBatchPush">下推出库</el-button>
|
||||
</crudOperation>
|
||||
<el-table ref="table" v-loading="crud.loading" size="mini" :data="crud.data" highlight-current-row style="width: 100%;" @selection-change="crud.selectionChangeHandler" @current-change="handleCurrentChange" @select="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
@@ -108,6 +109,7 @@ export default {
|
||||
},
|
||||
viewShow: false,
|
||||
mstrow: {},
|
||||
multipleSelection: [],
|
||||
currentRow: null,
|
||||
audit_flag: true,
|
||||
billStatusOptions: [
|
||||
@@ -173,6 +175,35 @@ export default {
|
||||
querytable() {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
handleBatchPush() {
|
||||
if (!this.multipleSelection.length) {
|
||||
this.$message.warning('请先勾选要下推的调拨出库单')
|
||||
return
|
||||
}
|
||||
// eslint-disable-next-line eqeqeq
|
||||
const invalidRows = this.multipleSelection.filter(item => String(item.bill_status) === '99')
|
||||
if (invalidRows.length) {
|
||||
this.$message.warning('仅支持批量下推状态为“分配”的需求单')
|
||||
return
|
||||
}
|
||||
this.$confirm(`确认批量下推已勾选的 ${this.multipleSelection.length} 条需求单吗?`, '提示', {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
crudPurchase.outPush(this.multipleSelection[0]).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$message.success('下推成功')
|
||||
this.crud.toQuery()
|
||||
} else {
|
||||
this.$message.error(res.message)
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$message.error('下推失败')
|
||||
})
|
||||
}).catch(() => {})
|
||||
},
|
||||
|
||||
issueReturnBill() {
|
||||
const selections = this.crud.selections
|
||||
if (!selections || selections.length === 0) {
|
||||
|
||||
Reference in New Issue
Block a user