入库整理
parent
8e75d1addd
commit
0bfaa367e4
|
|
@ -76,4 +76,12 @@ export function zjRegister(ids) {
|
|||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del,zlRegister,cyRegister,zjRegister }
|
||||
export function deleteAsnAndDetail(ids) {
|
||||
return request({
|
||||
url: 'api/asn/deleteAsnAndDetail',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del,zlRegister,cyRegister,zjRegister ,getIdByAsn,deleteAsnAndDetail}
|
||||
|
|
|
|||
|
|
@ -80,4 +80,4 @@ export function stockMsg(data) {
|
|||
})
|
||||
}
|
||||
|
||||
export default {add, edit, del, containerIn, containerOut, updateStockStatus, stockMsg}
|
||||
export default {add, edit, del, containerIn, containerOut, updateStockStatus, stockMsg,queryKyStockList}
|
||||
|
|
|
|||
|
|
@ -1,27 +1,15 @@
|
|||
<template>
|
||||
<div class="app-container" >
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<!-- 搜索 -->
|
||||
<div v-if="crud.props.searchToggle" >
|
||||
<div v-if="crud.props.searchToggle" type="flex">
|
||||
<!-- 搜索 -->
|
||||
<!-- <label class="el-form-item-label">单号</label>-->
|
||||
<el-input v-model="query.code" clearable placeholder="单号" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<!-- <label class="el-form-item-label">库区</label>-->
|
||||
<!-- <el-input v-model="query.areaId" clearable placeholder="库区" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />-->
|
||||
<el-select v-model="query.areaCode" clearable placeholder="库区" value-key="id" class="filter-item" @keyup.enter.native="crud.toQuery" >
|
||||
<el-option
|
||||
style="width: 180px"
|
||||
v-for="item in areaOptions"
|
||||
:key="item.id"
|
||||
:label="item.code"
|
||||
:value="item.code"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<!-- <label class="el-form-item-label">单号</label>-->
|
||||
<el-input v-model="query.code" clearable placeholder="凭证号" style="width: 250px;" class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"/>
|
||||
|
||||
<!-- <el-input v-model="query.orderDate" clearable placeholder="订单日期" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />-->
|
||||
<!-- <label class="el-form-item-label">状态</label>-->
|
||||
<el-select v-model="query.status" clearable placeholder="状态" value-key="id" class="filter-item" @keyup.enter.native="crud.toQuery" >
|
||||
<el-select v-model="query.status" clearable placeholder="状态" value-key="id" class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery">
|
||||
<el-option
|
||||
style="width: 180px"
|
||||
v-for="item in this.dict.asn_status"
|
||||
|
|
@ -31,21 +19,12 @@
|
|||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<rrOperation :crud="crud" />
|
||||
<rrOperation :crud="crud"/>
|
||||
</div>
|
||||
<div class="head-container" v-loading="this.loading_add" element-loading-text="拼命加载中" element-loading-background="rgba(0, 0, 0, 0.1)">
|
||||
<div class="head-container" v-loading="this.loading_add" element-loading-text="拼命加载中"
|
||||
element-loading-background="rgba(0, 0, 0, 0.1)">
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<!-- <el-button-->
|
||||
<!-- slot="right"-->
|
||||
<!-- class="filter-item"-->
|
||||
<!-- type="primary"-->
|
||||
<!-- icon="el-icon-plus"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- @click="inserAsnOnOffM()"-->
|
||||
<!-- >-->
|
||||
<!-- 新增-->
|
||||
<!-- </el-button>-->
|
||||
<viewAsnDetail ref="viewAsnDetail" />
|
||||
<viewAsnDetail ref="viewAsnDetail"/>
|
||||
<crudOperation :permission="permission" :tableKey="this.$options.name">
|
||||
<el-button
|
||||
slot="left"
|
||||
|
|
@ -59,6 +38,7 @@
|
|||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="false"
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
|
|
@ -69,6 +49,7 @@
|
|||
整理
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="false"
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
|
|
@ -79,6 +60,7 @@
|
|||
抽样
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="false"
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
|
|
@ -89,6 +71,7 @@
|
|||
质检
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="false"
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
|
|
@ -98,18 +81,6 @@
|
|||
@click="invVerifyS(crud.selections)">
|
||||
整单入库
|
||||
</el-button>
|
||||
|
||||
<!-- <el-button-->
|
||||
<!-- slot="right"-->
|
||||
<!-- class="filter-item"-->
|
||||
<!-- type="primary"-->
|
||||
<!-- icon="el-icon-plus"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- :disabled="crud.selections.length!=1"-->
|
||||
<!-- @click="asnDetailRouter(crud.selections)"-->
|
||||
<!-- >-->
|
||||
<!-- 明细-->
|
||||
<!-- </el-button>-->
|
||||
</crudOperation>
|
||||
|
||||
|
||||
|
|
@ -164,7 +135,7 @@
|
|||
</el-form-item>
|
||||
|
||||
<el-form-item label="备注" style="float: left">
|
||||
<el-input type="textarea" :rows="2" v-model="asnFrom.description" style="width: 400px;"/>
|
||||
<el-input type="textarea" :rows="2" v-model="asnFrom.description" style="width: 400px;"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
|
|
@ -179,7 +150,7 @@
|
|||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
|
||||
<el-form-item label="单号" prop="code">
|
||||
<el-input :disabled="true" v-model="form.code" style="width: 200px;"/>
|
||||
<el-input :disabled="true" v-model="form.code" style="width: 200px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="库区" prop="area">
|
||||
<!-- <el-input v-model="form.area" style="width: 370px;"/>-->
|
||||
|
|
@ -198,7 +169,8 @@
|
|||
</el-form-item>
|
||||
<el-form-item label="单据类型">
|
||||
<!-- <el-input v-model="form.billType" style="width: 370px;"/>-->
|
||||
<el-select v-model="form.billType" clearable placeholder="请选择单据类型" value-key="id" style="width: 200px">
|
||||
<el-select v-model="form.billType" clearable placeholder="请选择单据类型" value-key="id"
|
||||
style="width: 200px">
|
||||
<el-option
|
||||
v-for="item in billTypeOptions"
|
||||
:key="item.code"
|
||||
|
|
@ -220,18 +192,19 @@
|
|||
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler" :height="crud.tableHeight" @select="invVerifySTFM" @select-all="invVerifySTFAll" border
|
||||
@selection-change="crud.selectionChangeHandler" :height="crud.tableHeight" @select="invVerifySTFM"
|
||||
@select-all="invVerifySTFAll" border
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="code" label="单号" width="120px" align="center"/>
|
||||
<el-table-column prop="area" label="库区" width="140px" align="center">
|
||||
<el-table-column type="selection" width="55"/>
|
||||
<el-table-column prop="code" label="凭证号" width="120px" align="center" :show-overflow-tooltip="true"/>
|
||||
<el-table-column prop="orderDate" label="订单日期" width="120px" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.area.name }}
|
||||
{{ formatDate1(scope.row.orderDate) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="billType" label="单据类型">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.billType.name}}
|
||||
{{ scope.row.billType.name }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" label="状态" align="center">
|
||||
|
|
@ -239,39 +212,34 @@
|
|||
{{ dict.label.asn_status[scope.row.status] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="orderDate" label="订单日期" width="140px" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{formatDate1(scope.row.orderDate)}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="zlDate" label="整理日期" width="140px" align="center"/>
|
||||
<el-table-column prop="cyDate" label="抽样日期" width="140px" align="center"/>
|
||||
<el-table-column prop="zjDate" label="质检日期" width="140px" align="center"/>
|
||||
<el-table-column prop="receivedDate" label="收货日期" width="140px" align="center"/>
|
||||
<el-table-column prop="orderQuantity" label="订单数量" align="center"/>
|
||||
<el-table-column prop="receivedQuantity" label="收货数量" align="center"/>
|
||||
<el-table-column prop="createBy" label="创建人" align="center"/>
|
||||
<el-table-column prop="createTime" label="创建时间" width="140px" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ formatDate1(scope.row.createTime)}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="checkPer(['admin','asn:edit','asn:del'])" label="操作" width="175px" align="center" fixed="right">
|
||||
<el-table-column prop="orderQuantity" label="待收数量" align="center"/>
|
||||
<el-table-column prop="receivedQuantity" label="已收数量" align="center"/>
|
||||
<el-table-column prop="zlBy" label="SAP收货人" align="center"/>
|
||||
<el-table-column prop="cyBy" label="申请人" align="center"/>
|
||||
<el-table-column prop="cusCode" label="SAP接口号" align="center"/>
|
||||
<el-table-column v-if="checkPer(['admin','asn:edit','asn:del'])" label="操作" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
style="float: right"
|
||||
@click="asnDetailRouter(scope.row)"
|
||||
/>
|
||||
<el-popconfirm
|
||||
title="是否确定删除?"
|
||||
@confirm="deleteAsnAndDetail(scope.row)"
|
||||
>
|
||||
明细
|
||||
</el-button>
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
>
|
||||
</udOperation>
|
||||
<el-button
|
||||
class="filter-item"
|
||||
slot="reference"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
|
||||
/>
|
||||
</el-popconfirm>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
@ -288,18 +256,18 @@
|
|||
|
||||
<script>
|
||||
import DateRangePicker from "@/components/DateRangePicker/index.vue";
|
||||
import crudAsn, { getCodeNo, queryAsnAll, save,zlRegister,cyRegister,zjRegister } from '@/api/asn'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import crudAsn, {getCodeNo, queryAsnAll, save, zlRegister, cyRegister, zjRegister} from '@/api/asn'
|
||||
import CRUD, {presenter, header, form, crud} from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation.vue'
|
||||
import crudOperation from '@crud/CRUD.operation.vue'
|
||||
import udOperation from '@crud/UD.operation.vue'
|
||||
import pagination from '@crud/Pagination.vue'
|
||||
import { getAreas } from '@/api/area'
|
||||
import { getBillType } from '@/api/billType'
|
||||
import { add, invVerify, queryAsnDetailAll } from '@/api/asnDetail'
|
||||
import { queryPointList } from '@/api/point'
|
||||
import { queryItemAll } from '@/api/item'
|
||||
import { formatDate } from '@/utils/commonUtils'
|
||||
import {getAreas} from '@/api/area'
|
||||
import {getBillType} from '@/api/billType'
|
||||
import {add, invVerify, queryAsnDetailAll} from '@/api/asnDetail'
|
||||
import {queryPointList} from '@/api/point'
|
||||
import {queryItemAll} from '@/api/item'
|
||||
import {formatDate} from '@/utils/commonUtils'
|
||||
import {xbjsOut} from "@/api/pickOut";
|
||||
import viewAsnDetail from "@/views/business-asn/asn/viewAsnDetail.vue"
|
||||
|
||||
|
|
@ -333,15 +301,15 @@ const defaultForm = {
|
|||
}
|
||||
export default {
|
||||
name: 'Asn',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation,DateRangePicker,viewAsnDetail },
|
||||
components: {pagination, crudOperation, rrOperation, udOperation, DateRangePicker, viewAsnDetail},
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
dicts: ['asn_status'],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: 'asn', url: 'api/asn', idField: 'id', sort: 'id,desc', crudMethod: { ...crudAsn }, optShow: {
|
||||
title: 'asn', url: 'api/asn', idField: 'id', sort: 'id,desc', crudMethod: {...crudAsn}, optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: true,
|
||||
del: false,
|
||||
reset: false,
|
||||
download: false
|
||||
},
|
||||
|
|
@ -360,22 +328,22 @@ export default {
|
|||
},
|
||||
rules: {
|
||||
code: [
|
||||
{ required: true, message: '单号不能为空', trigger: 'blur' }
|
||||
{required: true, message: '单号不能为空', trigger: 'blur'}
|
||||
],
|
||||
area: [
|
||||
{ required: true, message: '库区不能为空', trigger: 'blur' }
|
||||
{required: true, message: '库区不能为空', trigger: 'blur'}
|
||||
],
|
||||
orderDate: [
|
||||
{ required: true, message: '订单日期不能为空', trigger: 'blur' }
|
||||
{required: true, message: '订单日期不能为空', trigger: 'blur'}
|
||||
]
|
||||
},
|
||||
queryTypeOptions: [
|
||||
{ key: 'code', display_name: '单号' },
|
||||
{ key: 'areaCode', display_name: '库区' },
|
||||
{ key: 'status', display_name: '状态查询' },
|
||||
{key: 'code', display_name: '单号'},
|
||||
{key: 'areaCode', display_name: '库区'},
|
||||
{key: 'status', display_name: '状态查询'},
|
||||
],
|
||||
areaOptions: [],
|
||||
loading_add:false,
|
||||
loading_add: false,
|
||||
billTypeOptions: [],
|
||||
//新增数据的弹窗开关
|
||||
inserAsnOnOff: false,
|
||||
|
|
@ -444,10 +412,12 @@ export default {
|
|||
itemListData: [],
|
||||
pointList: [],
|
||||
asnOptions: [],
|
||||
invVerifySTF:true,
|
||||
viewZl:true,
|
||||
viewCy:true,
|
||||
viewZj:true
|
||||
invVerifySTF: true,
|
||||
viewZl: true,
|
||||
viewCy: true,
|
||||
viewZj: true,
|
||||
asnIdList: []
|
||||
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
|
@ -464,7 +434,7 @@ export default {
|
|||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
formatDate1(value){
|
||||
formatDate1(value) {
|
||||
return formatDate(value);
|
||||
// const date = new Date(value)
|
||||
// const year = date.getUTCFullYear()
|
||||
|
|
@ -490,7 +460,7 @@ export default {
|
|||
},
|
||||
//新政的开关
|
||||
inserAsnOnOffM() {
|
||||
this.$refs.viewAsnDetail.dialogInsertAsn=true
|
||||
this.$refs.viewAsnDetail.dialogInsertAsn = true
|
||||
//this.$router.push({path:'/business-asn/viewAsnDetail'})
|
||||
},
|
||||
//获取当前时间
|
||||
|
|
@ -506,7 +476,7 @@ export default {
|
|||
crudAsn.add(data).then(res => {
|
||||
this.$message.success('新增成功')
|
||||
this.inserAsnOnOff = false
|
||||
this.asnFrom=defaultForm;
|
||||
this.asnFrom = defaultForm;
|
||||
this.crud.toQuery()
|
||||
})
|
||||
},
|
||||
|
|
@ -536,70 +506,70 @@ export default {
|
|||
this.asnOptions = res
|
||||
})
|
||||
},
|
||||
asnDetailRouter(datas){
|
||||
this.$refs.viewAsnDetail.dialogInsertAsn=true
|
||||
this.$refs.viewAsnDetail.asnFrom=datas
|
||||
asnDetailRouter(datas) {
|
||||
this.$refs.viewAsnDetail.asnFrom = datas
|
||||
this.$refs.viewAsnDetail.queryAsnDetail(datas.id)
|
||||
this.$refs.viewAsnDetail.dialogInsertAsn = true
|
||||
//this.$router.push({path:'/business-asn/viewAsnDetail',query: {ids:datas.id}})
|
||||
},
|
||||
//入库批量确认
|
||||
invVerifyS(data){
|
||||
invVerifyS(data) {
|
||||
console.log(data)
|
||||
let ids = [];
|
||||
for (const idsKey of data) {
|
||||
ids.push(idsKey.id);
|
||||
}
|
||||
invVerify(ids).then(res=>{
|
||||
invVerify(ids).then(res => {
|
||||
// if (res != null){
|
||||
// this.$message.error(res)
|
||||
// }else {
|
||||
this.$message.success(res)
|
||||
this.crud.toQuery()
|
||||
this.$message.success(res)
|
||||
this.crud.toQuery()
|
||||
// }
|
||||
})
|
||||
},
|
||||
invVerifySTFM(selection, row){
|
||||
if (selection.length>0){
|
||||
invVerifySTFM(selection, row) {
|
||||
if (selection.length > 0) {
|
||||
this.invVerifySTF = false;
|
||||
this.viewZl = false;
|
||||
this.viewCy = false;
|
||||
this.viewZj = false;
|
||||
}else {
|
||||
} else {
|
||||
return
|
||||
}
|
||||
//判断
|
||||
for (const selectionElement of selection) {
|
||||
//收货完成
|
||||
if (selectionElement.status === 'RECEIVED'){
|
||||
if (selectionElement.status === 'RECEIVED') {
|
||||
this.invVerifySTF = true;
|
||||
this.viewZl = true;
|
||||
this.viewCy = true;
|
||||
this.viewZj = true;
|
||||
}
|
||||
if (selectionElement.status !== 'OPEN'){
|
||||
if (selectionElement.status !== 'OPEN') {
|
||||
this.viewZl = true;
|
||||
}
|
||||
if (selectionElement.status !== 'OPEN'&&selectionElement.status !== 'ZL'){
|
||||
if (selectionElement.status !== 'OPEN' && selectionElement.status !== 'ZL') {
|
||||
this.viewCy = true;
|
||||
}
|
||||
if (selectionElement.status !== 'OPEN'&&selectionElement.status !== 'ZL'&&selectionElement.status !== 'CY'){
|
||||
if (selectionElement.status !== 'OPEN' && selectionElement.status !== 'ZL' && selectionElement.status !== 'CY') {
|
||||
this.viewZj = true;
|
||||
}
|
||||
}
|
||||
},
|
||||
invVerifySTFAll(selection){
|
||||
if (selection.length>0){
|
||||
invVerifySTFAll(selection) {
|
||||
if (selection.length > 0) {
|
||||
this.invVerifySTF = false;
|
||||
this.viewZl = true;
|
||||
this.viewCy = true;
|
||||
this.viewZj = true;
|
||||
}else {
|
||||
} else {
|
||||
return
|
||||
}
|
||||
//判断
|
||||
for (const selectionElement of selection) {
|
||||
//打开/收货中
|
||||
if (selectionElement.status === 'RECEIVED'){
|
||||
if (selectionElement.status === 'RECEIVED') {
|
||||
this.invVerifySTF = true;
|
||||
this.viewZl = true;
|
||||
this.viewCy = true;
|
||||
|
|
@ -607,46 +577,58 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
zlBtn(data){
|
||||
this.loading_add=true;
|
||||
zlBtn(data) {
|
||||
this.loading_add = true;
|
||||
let ids = [];
|
||||
for (const obj of data) {
|
||||
ids.push(obj.id)
|
||||
}
|
||||
zlRegister(ids).then(res=>{
|
||||
zlRegister(ids).then(res => {
|
||||
this.crud.toQuery()
|
||||
this.loading_add=false;
|
||||
this.loading_add = false;
|
||||
this.$message.success("整理登记完成")
|
||||
},e=>{
|
||||
this.loading_add=false;
|
||||
}, e => {
|
||||
this.loading_add = false;
|
||||
})
|
||||
},
|
||||
cyBtn(data){
|
||||
this.loading_add=true;
|
||||
cyBtn(data) {
|
||||
this.loading_add = true;
|
||||
let ids = [];
|
||||
for (const obj of data) {
|
||||
ids.push(obj.id)
|
||||
}
|
||||
cyRegister(ids).then(res=>{
|
||||
cyRegister(ids).then(res => {
|
||||
this.crud.toQuery()
|
||||
this.loading_add=false;
|
||||
this.loading_add = false;
|
||||
this.$message.success("抽样登记完成")
|
||||
},e=>{
|
||||
this.loading_add=false;
|
||||
}, e => {
|
||||
this.loading_add = false;
|
||||
})
|
||||
},
|
||||
zjBtn(data){
|
||||
this.loading_add=true;
|
||||
zjBtn(data) {
|
||||
this.loading_add = true;
|
||||
let ids = [];
|
||||
for (const obj of data) {
|
||||
ids.push(obj.id)
|
||||
}
|
||||
zjRegister(ids).then(res=>{
|
||||
zjRegister(ids).then(res => {
|
||||
this.crud.toQuery()
|
||||
this.loading_add=false;
|
||||
this.loading_add = false;
|
||||
this.$message.success("质检登记完成")
|
||||
},e=>{
|
||||
this.loading_add=false;
|
||||
}, e => {
|
||||
this.loading_add = false;
|
||||
})
|
||||
},
|
||||
deleteAsnAndDetail(data) {
|
||||
this.asnIdList.push(data.id)
|
||||
crudAsn.deleteAsnAndDetail(this.asnIdList).then(res => {
|
||||
console.log(res)
|
||||
if (res.status == 200) {
|
||||
this.crud.notify(res.message, CRUD.NOTIFICATION_TYPE.SUCCESS);
|
||||
this.crud.toQuery();
|
||||
} else {
|
||||
this.crud.notify(res.message, CRUD.NOTIFICATION_TYPE.ERROR);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
center
|
||||
top="0.5vh"
|
||||
:fullscreen="fullscreen"
|
||||
width="80%"
|
||||
width="85%"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
:before-close="handleClose"
|
||||
|
|
@ -52,12 +52,12 @@
|
|||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="凭证号" prop="code">
|
||||
<el-input v-model="asnFrom.code"/>
|
||||
<el-form-item label="凭证号">
|
||||
<el-input :disabled="true" v-model="asnFrom.code"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="订单数量">
|
||||
<el-form-item label="待收数量">
|
||||
<el-input :disabled="true" v-model.number="asnFrom.orderQuantity"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
|
@ -75,6 +75,29 @@
|
|||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" :tableKey="this.$options.name">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
size="mini"
|
||||
:disabled="this.asnFrom.id == null||!this.asnFrom.status=='OPEN'"
|
||||
@click="insertAsnDetail"
|
||||
:loading="logining1"
|
||||
>
|
||||
添加明细
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
size="mini"
|
||||
:disabled="!(crud.selections.length === 1)"
|
||||
@click="asnDetailZl(crud.selections)"
|
||||
:loading="logining1"
|
||||
>
|
||||
明细整理
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="false"
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
|
|
@ -85,6 +108,7 @@
|
|||
整单入库
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="false"
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
|
|
@ -96,6 +120,7 @@
|
|||
单一入库
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="false"
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
|
|
@ -107,6 +132,7 @@
|
|||
取消收货
|
||||
</el-button>
|
||||
<el-upload
|
||||
v-if="false"
|
||||
class="upload-demo"
|
||||
ref="upload"
|
||||
slot='right'
|
||||
|
|
@ -172,13 +198,16 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="checkPer(['admin','asnDetail:edit','asnDetail:del'])" label="操作"
|
||||
width="150px"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
style="float: left"
|
||||
size="mini" type="primary" icon="el-icon-edit" @click="toEditAsnDetail(scope.row)"/>
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
:show-edit="false"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
|
@ -231,12 +260,18 @@
|
|||
<el-button type="primary" @click="rkAndQxButtonM(2)">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0"
|
||||
:title="crud.status.title" width="400px"
|
||||
<el-dialog
|
||||
:visible.sync="dialogInsertAsnDetail"
|
||||
center
|
||||
width="400px"
|
||||
:close-on-click-modal="false"
|
||||
:before-close="handleAsnDetailClose"
|
||||
|
||||
>
|
||||
<el-form ref="form" :rules="asnDetailRules" :model="form" size="small" label-width="80px"
|
||||
style="height: 200px"
|
||||
style="height: 300px"
|
||||
>
|
||||
|
||||
<el-form-item label="物料" prop="item" style="float: left">
|
||||
|
|
@ -258,39 +293,115 @@
|
|||
<el-form-item label="订单数量" prop="orderQty" style="float: left">
|
||||
<el-input v-model="form.orderQty" style="width: 200px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="pointTF" label="库位" prop="point" style="float: left">
|
||||
<el-select v-model="form.point" value-key="id" filterable placeholder="请选择库位" clearable
|
||||
style="width: 200px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in pointOptions"
|
||||
:key="item.id"
|
||||
:label="item.code"
|
||||
:value="item"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="viewPropC1" label="批次号" prop="propC1" style="float: left">
|
||||
<el-form-item v-if="isBatch" label="批次号" prop="propC1" style="float: left">
|
||||
<el-input v-model="form.propC1" style="width: 200px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="viewPropC2" label="序列号" prop="propC2" style="float: left">
|
||||
<el-form-item v-if="isSerial" label="序列号" prop="propC2" style="float: left">
|
||||
<el-input v-model="form.propC2" style="width: 200px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="isValidPeriod" label="生成日期" prop="propD1" style="float: left">
|
||||
<el-input v-model="form.propD1" style="width: 200px;"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="备注" prop="remark" style="float: left">
|
||||
<el-input type="textarea" :rows="2" v-model="form.remark" style="width: 200px;"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
<el-button @click="asnDetailCel">取消</el-button>
|
||||
<el-button :loading="crud.status.cu === 2" type="primary" @click="asnDetailConf">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 明细整理-->
|
||||
<el-dialog
|
||||
title="明细整理"
|
||||
:visible.sync="zlDialogVisible"
|
||||
width="30%"
|
||||
:before-close="handleZlClose">
|
||||
<el-form :model="zlForm" :rules="zlRules" ref="zlForm" label-width="100px" class="demo-ruleForm">
|
||||
<el-form-item label="料号">
|
||||
<el-input v-model="zlForm.item.code"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料描述">
|
||||
<el-input v-model="zlForm.item.name"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="待收数量">
|
||||
<el-input v-model.number="zlForm.orderQty"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="订单日期">
|
||||
<el-date-picker
|
||||
style="width: 370px"
|
||||
v-model="zlForm.asn.orderDate"
|
||||
type="date"
|
||||
placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="库区" prop="area">
|
||||
<el-select v-model="zlForm.area" value-key="id"
|
||||
placeholder="请选择库区" clearable filterable style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="areas in areaOptions"
|
||||
:key="areas.id"
|
||||
:label="areas.name"
|
||||
:value="areas"
|
||||
/>
|
||||
</el-select>
|
||||
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="库位" prop="loc">
|
||||
<el-select v-model="zlForm.loc" value-key="id"
|
||||
@focus="getPointList(null,null,null)"
|
||||
placeholder="请选择库位" clearable filterable style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="points in pointOptions"
|
||||
:key="points.id"
|
||||
:label="points.name"
|
||||
:value="points"
|
||||
/>
|
||||
</el-select>
|
||||
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="收货数量">
|
||||
<el-input v-model.number="zlForm.receivedQty"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="容器" prop="stock">
|
||||
<el-select v-model="zlForm.stock" value-key="id"
|
||||
@focus="queryStock()"
|
||||
placeholder="请选择容器" clearable filterable style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="stocks in stockOptions"
|
||||
:key="stocks.id"
|
||||
:label="stocks.name"
|
||||
:value="stocks"
|
||||
/>
|
||||
</el-select>
|
||||
|
||||
</el-form-item>
|
||||
|
||||
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="zhengliCel">取 消</el-button>
|
||||
<el-button type="primary" @click="zhengli">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudAsnDetail, {rkAndQxButton} from '@/api/asnDetail'
|
||||
import crudAsnDetail, {add, rkAndQxButton} from '@/api/asnDetail'
|
||||
import CRUD, {presenter, header, form, crud} from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation.vue'
|
||||
import crudOperation from '@crud/CRUD.operation.vue'
|
||||
|
|
@ -308,11 +419,13 @@ import {getBillTypes} from '@/api/billType'
|
|||
import crudAsn from '@/api/asn'
|
||||
import {queryBomAccountList} from '@/api/bomAccount'
|
||||
import {mapGetters} from "vuex";
|
||||
|
||||
import {addAsnDetail} from "@/api/xppRecord";
|
||||
import crudStock from "@/api/stock"
|
||||
|
||||
const defaultForm = {
|
||||
id: null,
|
||||
asn: null,
|
||||
asnId: null,
|
||||
item: null,
|
||||
stock: null,
|
||||
lineNo: null,
|
||||
|
|
@ -367,9 +480,9 @@ export default {
|
|||
sort: 'id,desc',
|
||||
crudMethod: {...crudAsnDetail},
|
||||
optShow: {
|
||||
add: true,
|
||||
add: false,
|
||||
edit: false,
|
||||
del: true,
|
||||
del: false,
|
||||
reset: false,
|
||||
download: false
|
||||
}
|
||||
|
|
@ -385,6 +498,8 @@ export default {
|
|||
fullscreen: false,
|
||||
activeName: 'first',
|
||||
dialogInsertAsn: false,
|
||||
dialogInsertAsnDetail: false,
|
||||
zlDialogVisible: false,
|
||||
isResizing: false,
|
||||
initialWidth: 0,
|
||||
initialHeight: 0,
|
||||
|
|
@ -406,9 +521,6 @@ export default {
|
|||
}],
|
||||
billType: [{
|
||||
required: true, message: '单据类型不能为空', trigger: 'blur'
|
||||
}],
|
||||
code: [{
|
||||
required: true, message: '凭证号不能为空', trigger: 'blur'
|
||||
}]
|
||||
},
|
||||
asnDetailRules: {
|
||||
|
|
@ -417,11 +529,21 @@ export default {
|
|||
],
|
||||
orderQty: [
|
||||
{required: true, message: '订单数量不能为空', trigger: 'blur'}
|
||||
],
|
||||
propC1: [
|
||||
{required: true, message: '批次号不能为空', trigger: 'blur'}
|
||||
],
|
||||
propC2: [
|
||||
{required: true, message: '序列号不能为空', trigger: 'blur'}
|
||||
],
|
||||
propD1: [
|
||||
{required: true, message: '生成日期不能为空', trigger: 'blur'}
|
||||
]
|
||||
// point: [
|
||||
// { required: true, message: '库位不能为空', trigger: 'blur' }
|
||||
// ]
|
||||
},
|
||||
zlRules: {},
|
||||
//下拉物料
|
||||
itemOptions: [],
|
||||
//下拉点位
|
||||
|
|
@ -431,6 +553,7 @@ export default {
|
|||
areaOptions: [],
|
||||
//下拉类型
|
||||
billTypeOptions: [],
|
||||
stockOptions:[],
|
||||
// 新增主表
|
||||
asnFrom: {
|
||||
id: null,
|
||||
|
|
@ -477,8 +600,17 @@ export default {
|
|||
logining2: false,
|
||||
logining3: false,
|
||||
pointTF: false,
|
||||
viewPropC1: false,
|
||||
viewPropC2: false,
|
||||
isBatch: false,
|
||||
isSerial: false,
|
||||
isValidPeriod: false,
|
||||
zlForm: {
|
||||
item: {},
|
||||
asn: {},
|
||||
orderQty: 0,
|
||||
area: {},
|
||||
loc:{},
|
||||
receivedQty:0
|
||||
}
|
||||
}
|
||||
},
|
||||
// beforeDestroy() { //页面关闭时清除定时器
|
||||
|
|
@ -499,12 +631,14 @@ export default {
|
|||
// this.setTime();
|
||||
},
|
||||
methods: {
|
||||
addAsnDetail,
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
this.asnTF()
|
||||
return true
|
||||
},
|
||||
queryAsnDetail(ansId) {
|
||||
this.form.asnId = ansId
|
||||
this.asnFrom.id = ansId
|
||||
this.crud.query = {asnId: ansId}
|
||||
this.crud.toQuery()
|
||||
|
|
@ -521,6 +655,11 @@ export default {
|
|||
// 执行关闭操作
|
||||
done();
|
||||
},
|
||||
queryStock(){
|
||||
crudStock.queryKyStockList({}).then(res => {
|
||||
this.stockOptions = res
|
||||
})
|
||||
},
|
||||
setTime() { //设置定时器
|
||||
// this.clearTimeSet=setInterval(() => {
|
||||
// this.asnTF();
|
||||
|
|
@ -540,41 +679,15 @@ export default {
|
|||
getPointList(itObj, code, data) {
|
||||
console.log(itObj)
|
||||
if (itObj != null) {
|
||||
this.viewPropC1 = itObj.bepc;
|
||||
this.viewPropC2 = itObj.bexq;
|
||||
}
|
||||
if (data.area.bexb) {
|
||||
this.pointTF = true;
|
||||
let selectDate = {rAreaCode: null, itemCode: null}
|
||||
selectDate.rAreaCode = data.area.code
|
||||
selectDate.itemCode = code
|
||||
// if (selectDate.rAreaCode === null) {
|
||||
// if (selectDate.rAreaCode === null) {
|
||||
// this.$message.error('主表未绑定库区')
|
||||
// return
|
||||
// }
|
||||
queryBomAccountList(selectDate).then(res => {
|
||||
this.pointOptions = []
|
||||
if (res != null) {
|
||||
console.log(res)
|
||||
let data_ = []
|
||||
for (const re of res) {
|
||||
data_.push(re.zPoint)
|
||||
}
|
||||
this.pointOptions = this.filterListObj(data_)
|
||||
}
|
||||
if (!(this.pointOptions.length > 0)) {
|
||||
queryPointList({code: 'ZZKW'}).then(re => {
|
||||
this.pointOptions = re
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.pointTF = false;
|
||||
queryPointList({type: 'CH'}).then(re => {
|
||||
this.pointOptions = re
|
||||
})
|
||||
this.isBatch = itObj.isBatch;
|
||||
this.isSerial = itObj.isSerial;
|
||||
this.isValidPeriod = itObj.isValidPeriod
|
||||
}
|
||||
|
||||
queryPointList({}).then(res => {
|
||||
this.pointOptions = res
|
||||
})
|
||||
|
||||
}
|
||||
,
|
||||
//过滤重复数据
|
||||
|
|
@ -650,9 +763,8 @@ export default {
|
|||
this.asnId = res.id
|
||||
//加载数据
|
||||
this.asnTF()
|
||||
this.$message.success('添加成功')
|
||||
this.crud.notify('添加成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
//this.$router.push({path: '/business-asn/viewAsnDetail', query: {ids: res.id}})
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
|
|
@ -743,6 +855,60 @@ export default {
|
|||
duration: 2500
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
insertAsnDetail() {
|
||||
this.dialogInsertAsnDetail = true;
|
||||
},
|
||||
handleAsnDetailClose(done) {
|
||||
this.form = {};
|
||||
this.isBatch = false,
|
||||
this.isSerial = false,
|
||||
this.isValidPeriod = false
|
||||
done();
|
||||
},
|
||||
asnDetailConf() {
|
||||
if (this.asnFrom.id == null || this.asnFrom.id <= 0) {
|
||||
this.crud.notify('请先提交入库单', CRUD.NOTIFICATION_TYPE.ERROR)
|
||||
}
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
crudAsn.getIdByAsn(this.asnFrom.id).then(res => {
|
||||
this.form.asn = res;
|
||||
crudAsnDetail.add(this.form).then(res => {
|
||||
this.crud.notify('添加成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
this.dialogInsertAsnDetail = false;
|
||||
})
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
asnDetailCel() {
|
||||
this.form = {};
|
||||
this.isBatch = false,
|
||||
this.isSerial = false,
|
||||
this.isValidPeriod = false
|
||||
this.dialogInsertAsnDetail = false;
|
||||
},
|
||||
toEditAsnDetail(data) {
|
||||
this.form = data;
|
||||
this.dialogInsertAsnDetail = true;
|
||||
},
|
||||
asnDetailZl(datas) {
|
||||
this.zlForm = datas[0];
|
||||
this.zlDialogVisible = true;
|
||||
},
|
||||
zhengli() {
|
||||
|
||||
},
|
||||
zhengliCel() {
|
||||
this.zlDialogVisible = false;
|
||||
},
|
||||
handleZlClose(done) {
|
||||
done();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue