add:出库单据同步,其他出入库单页面,调拨出入库单页面

This commit is contained in:
zhaoyf
2026-07-08 09:33:28 +08:00
parent 0a81376f10
commit 5324d1583e
21 changed files with 1280 additions and 15 deletions

View File

@@ -9,4 +9,8 @@ public interface InboundEasSyncService {
void syncTransferBill(BillChangeDto billChangeDto);
void syncOtherBill(BillChangeDto billChangeDto);
void syncTransferOutBill(BillChangeDto billChangeDto);
void syncOtherOutBill(BillChangeDto billChangeDto);
}

View File

@@ -36,6 +36,14 @@ public class EasToWmsServiceImpl implements EasToWmsService {
//其他入库单
inboundEasSyncService.syncOtherBill(billChangeDto);
break;
case "106":
//调拨出库单
inboundEasSyncService.syncTransferOutBill(billChangeDto);
break;
case "108":
//其他出库单
inboundEasSyncService.syncOtherOutBill(billChangeDto);
break;
}
result.put("respCode", 0);
result.put("respMsg", "单据变更通知成功");

View File

@@ -56,4 +56,26 @@ public class InboundEasQueryService {
public List<Purchasedtl> queryDtlList(String billId) {
return easPurchasedtlMapper.selectByBillId(billId);
}
@Transactional(propagation = Propagation.REQUIRES_NEW)
public List<Purchasedtl> queryDtlListByOtherOut(String billId) {
return easPurchasedtlMapper.selectOtherOutByBillId(billId);
}
@Transactional(propagation = Propagation.REQUIRES_NEW)
public Purchasemst queryMstByOtherOut(String billId) {
List<Purchasemst> list = easPurchasemstMapper.selectOtherOutByBillId(billId);
return list != null && !list.isEmpty() ? list.get(0) : null;
}
@Transactional(propagation = Propagation.REQUIRES_NEW)
public List<Purchasedtl> queryDtlListByTransferOut(String billId) {
return easPurchasedtlMapper.selectTransferOutByBillId(billId);
}
@Transactional(propagation = Propagation.REQUIRES_NEW)
public Purchasemst queryMstByTransferOut(String billId) {
List<Purchasemst> list = easPurchasemstMapper.selectTransferOutByBillId(billId);
return list != null && !list.isEmpty() ? list.get(0) : null;
}
}

View File

@@ -1,33 +1,26 @@
package org.nl.wms.ext_manage.purchase.service.impl;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.exception.BadRequestException;
import org.nl.config.SpringContextHolder;
import org.nl.wms.ext_manage.enums.EXTConstant;
import org.nl.wms.ext_manage.purchase.service.InboundEasSyncService;
import org.nl.wms.ext_manage.purchase.service.dto.BillChangeDto;
import org.nl.wms.ext_manage.service.WmsToZDWmdService;
import org.nl.wms.pm_manage.purchase.service.enums.PurchaseBillStatus;
import org.nl.wms.ext_manage.purchase.service.InboundEasSyncService;
import org.nl.wms.pm_manage.purchase.service.dao.Purchasedtl;
import org.nl.wms.pm_manage.purchase.service.dao.Purchasemst;
import org.nl.wms.pm_manage.purchase.service.dao.mapper.PurchasedtlMapper;
import org.nl.wms.pm_manage.purchase.service.dao.mapper.PurchasemstMapper;
import org.nl.wms.system_manage.enums.SysParamConstant;
import org.nl.wms.pm_manage.purchase.service.enums.PurchaseBillStatus;
import org.nl.wms.system_manage.service.param.ISysParamService;
import org.nl.wms.system_manage.service.param.dao.Param;
import org.nl.wms.system_manage.service.param.impl.SysParamServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@Slf4j
@Service
@@ -238,4 +231,130 @@ public class InboundEasSyncServiceImpl implements InboundEasSyncService {
.eq(Purchasemst::getBill_id, billId));
}
}
@Override
public void syncTransferOutBill(BillChangeDto billChangeDto) {
String billId = billChangeDto.getBillid();
Integer status = billChangeDto.getStatus();//1:已提交2:更新3:删除;
//更新单据
final Purchasemst purchasemst = purchasemstMapper.selectOne(new LambdaQueryWrapper<Purchasemst>()
.eq(Purchasemst::getBill_id, billId));
if (purchasemst!=null && !purchasemst.getBill_status().equals(PurchaseBillStatus.CREATED.getCode())){
throw new BadRequestException("EAS采购单同步失败当前单据在WMS系统中已经执行 " + billId);
}
Param zdStorParam = iSysParamService.findByCode(EXTConstant.ZD_STOR_SET);
List ZD_STOR_SET;
if (zdStorParam!=null){
ZD_STOR_SET = JSONObject.parseObject(zdStorParam.getValue(), List.class);
} else {
ZD_STOR_SET = new ArrayList<>();
}
switch (status){
case 1:
case 2:
//增加单据
Purchasemst easMst = easQueryService.queryMstByTransferOut(billId);
if (easMst == null) {
throw new BadRequestException("EAS采购单同步失败EAS系统中未找到单据: " + billId);
}
purchasedtlMapper.delete(new LambdaQueryWrapper<Purchasedtl>()
.eq(Purchasedtl::getBill_id, billId));
purchasemstMapper.delete(new LambdaQueryWrapper<Purchasemst>()
.eq(Purchasemst::getBill_id, billId));
//更新单据
List<Purchasedtl> easDtlList = easQueryService.queryDtlListByTransferOut(billId);
Boolean allZD = true;
for (Purchasedtl dtl : easDtlList) {
if (ZD_STOR_SET.contains(dtl.getHouse_code())){
//中鼎立库
dtl.setInstock_qty(dtl.getQty());
easMst.setForwardZD(1);
easMst.setBill_status(PurchaseBillStatus.EXECUTING.getCode());
}else {
allZD = false;
}
}
if (easMst.getForwardZD()==1){
if (allZD){
//如果全部都是中鼎的则由中鼎回传EAS
easMst.setBill_status(PurchaseBillStatus.COMPLETED.getCode());
}
//转发中鼎
wmsToZDWmdService.syncPurchaseReceiving(billChangeDto);
}
purchasedtlMapper.batchSave(easDtlList);
purchasemstMapper.insert(easMst);
log.info("EAS采购入库单同步完成, billId: {}, 明细数: {}", billId, easDtlList.size());
break;
case 3:
//删除单据
purchasedtlMapper.delete(new LambdaQueryWrapper<Purchasedtl>()
.eq(Purchasedtl::getBill_id, billId));
purchasemstMapper.delete(new LambdaQueryWrapper<Purchasemst>()
.eq(Purchasemst::getBill_id, billId));
}
}
@Override
public void syncOtherOutBill(BillChangeDto billChangeDto) {
String billId = billChangeDto.getBillid();
Integer status = billChangeDto.getStatus();//1:已提交2:更新3:删除;
//更新单据
final Purchasemst purchasemst = purchasemstMapper.selectOne(new LambdaQueryWrapper<Purchasemst>()
.eq(Purchasemst::getBill_id, billId));
if (purchasemst!=null && !purchasemst.getBill_status().equals(PurchaseBillStatus.CREATED.getCode())){
throw new BadRequestException("EAS采购单同步失败当前单据在WMS系统中已经执行 " + billId);
}
Param zdStorParam = iSysParamService.findByCode(EXTConstant.ZD_STOR_SET);
List ZD_STOR_SET;
if (zdStorParam!=null){
ZD_STOR_SET = JSONObject.parseObject(zdStorParam.getValue(), List.class);
} else {
ZD_STOR_SET = new ArrayList<>();
}
switch (status){
case 1:
case 2:
//增加单据
Purchasemst easMst = easQueryService.queryMstByOtherOut(billId);
if (easMst == null) {
throw new BadRequestException("EAS采购单同步失败EAS系统中未找到单据: " + billId);
}
purchasedtlMapper.delete(new LambdaQueryWrapper<Purchasedtl>()
.eq(Purchasedtl::getBill_id, billId));
purchasemstMapper.delete(new LambdaQueryWrapper<Purchasemst>()
.eq(Purchasemst::getBill_id, billId));
//更新单据
List<Purchasedtl> easDtlList = easQueryService.queryDtlListByOtherOut(billId);
Boolean allZD = true;
for (Purchasedtl dtl : easDtlList) {
if (ZD_STOR_SET.contains(dtl.getHouse_code())){
//中鼎立库
dtl.setInstock_qty(dtl.getQty());
easMst.setForwardZD(1);
easMst.setBill_status(PurchaseBillStatus.EXECUTING.getCode());
}else {
allZD = false;
}
}
if (easMst.getForwardZD()==1){
if (allZD){
//如果全部都是中鼎的则由中鼎回传EAS
easMst.setBill_status(PurchaseBillStatus.COMPLETED.getCode());
}
//转发中鼎
wmsToZDWmdService.syncPurchaseReceiving(billChangeDto);
}
purchasedtlMapper.batchSave(easDtlList);
purchasemstMapper.insert(easMst);
log.info("EAS采购入库单同步完成, billId: {}, 明细数: {}", billId, easDtlList.size());
break;
case 3:
//删除单据
purchasedtlMapper.delete(new LambdaQueryWrapper<Purchasedtl>()
.eq(Purchasedtl::getBill_id, billId));
purchasemstMapper.delete(new LambdaQueryWrapper<Purchasemst>()
.eq(Purchasemst::getBill_id, billId));
}
}
}

View File

@@ -15,4 +15,8 @@ public interface EasPurchasedtlMapper extends BaseMapper<Purchasedtl> {
List<Purchasedtl> selectTransferByBillId(String billId);
List<Purchasedtl> selectOtherByBillId(String billId);
List<Purchasedtl> selectOtherOutByBillId(String billId);
List<Purchasedtl> selectTransferOutByBillId(String billId);
}

View File

@@ -77,5 +77,43 @@
FROM V_UC_QTRK04
WHERE billid = #{bill_id}
</select>
<select id="selectOtherOutByBillId" resultType="org.nl.wms.pm_manage.purchase.service.dao.Purchasedtl">
SELECT
entryid,
billid,
itemNo,
categoryCode,
categoryName,
skuCode,
skuName,
model,
houseCode,
batchNo,
qty,
unitCode,
unit,
trackNo
FROM V_UC_QTCK03
WHERE billid = #{bill_id}
</select>
<select id="selectTransferOutByBillId" resultType="org.nl.wms.pm_manage.purchase.service.dao.Purchasedtl">
SELECT
entryid,
billid,
itemNo,
categoryCode,
categoryName,
skuCode,
skuName,
model,
houseCode,
batchNo,
qty,
unitCode,
unit,
trackNo
FROM V_UC_DBCK01
WHERE billid = #{bill_id}
</select>
</mapper>

View File

@@ -17,4 +17,8 @@ public interface EasPurchasemstMapper extends BaseMapper<Purchasemst> {
List<Purchasemst> selectTransferByBillId(String billId);
List<Purchasemst> selectOtherByBillId(String billId);
List<Purchasemst> selectOtherOutByBillId(String billId);
List<Purchasemst> selectTransferOutByBillId(String billId);
}

View File

@@ -77,5 +77,35 @@
FROM V_UC_QTRK04
WHERE billid = #{bill_id}
</select>
<select id="selectOtherOutByBillId" resultType="org.nl.wms.pm_manage.purchase.service.dao.Purchasemst">
SELECT DISTINCT
billid,
orderNo,
orderType,
supplierCode,
supplierName,
creator,
createTime,
modifyDate,
status,
red
FROM V_UC_QTCK03
WHERE billid = #{bill_id}
</select>
<select id="selectTransferOutByBillId" resultType="org.nl.wms.pm_manage.purchase.service.dao.Purchasemst">
SELECT DISTINCT
billid,
orderNo,
orderType,
supplierCode,
supplierName,
creator,
createTime,
modifyDate,
status,
red
FROM V_UC_DBCK01
WHERE billid = #{bill_id}
</select>
</mapper>

View File

@@ -23,13 +23,14 @@ public class PurchaseController {
@Autowired
private PurchaseService purchaseService;
@GetMapping
@GetMapping("/{type}")
@Log("查询采购入库单")
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page) {
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page, @PathVariable String type) {
whereJson.put("type",type);
return new ResponseEntity<>(TableDataInfo.build(purchaseService.queryAll(whereJson, page)), HttpStatus.OK);
}
@GetMapping("/{id}")
@GetMapping("/{type}/{id}")
@Log("查询采购入库单详情")
public ResponseEntity<Object> getById(@PathVariable String id) {
PurchaseDto dto = purchaseService.getDetailById(id);

View File

@@ -24,7 +24,7 @@
FROM st_ivt_purchasemst m
LEFT JOIN st_ivt_purchasedtl d on d.bill_id = m.bill_id
<where>
1=1
m.order_type = #{params.type}
<if test="params.bill_id != null and params.bill_id != ''">
AND m.bill_id LIKE CONCAT('%', #{params.bill_id}, '%')
</if>

View File

@@ -0,0 +1,213 @@
<template>
<div class="app-container">
<div class="head-container">
<div v-if="crud.props.searchToggle">
<el-form :inline="true" class="demo-form-inline" label-position="right" label-width="80px" label-suffix=":">
<el-form-item label="模糊查询">
<el-input v-model="query.blurry" size="mini" clearable placeholder="单据号/订单号/供应商"
@keyup.enter.native="crud.toQuery"/>
</el-form-item>
<el-form-item label="单据编号">
<el-input v-model="query.bill_id" size="mini" clearable placeholder="单据编号"
@keyup.enter.native="crud.toQuery"/>
</el-form-item>
<el-form-item label="订单号">
<el-input v-model="query.order_no" size="mini" clearable placeholder="订单号"
@keyup.enter.native="crud.toQuery"/>
</el-form-item>
<el-form-item label="供应商">
<el-input v-model="query.supplier_name" size="mini" clearable placeholder="供应商名称"
@keyup.enter.native="crud.toQuery"/>
</el-form-item>
<el-form-item label="单据状态">
<el-select v-model="query.bill_status" clearable size="mini" placeholder="全部" class="filter-item"
@change="crud.toQuery">
<el-option v-for="item in billStatusOptions" :key="item.value" :label="item.label" :value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker v-model="query.createTime" type="daterange" value-format="yyyy-MM-dd HH:mm:ss"
start-placeholder="开始日期" end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']" @change="crud.toQuery"/>
</el-form-item>
<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>
<el-button slot="right" class="filter-item" type="primary" icon="el-icon-printer" size="mini"
:disabled="audit_flag" @click="printBill">打印
</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"/>
<el-table-column v-permission="['admin','purchasemst:del','purchasemst:edit']" label="操作" width="115"
align="center" fixed="right">
<template slot-scope="scope">
<udOperation :data="scope.row" :permission="permission" :disabled-edit="canUd(scope.row)"
:disabled-dle="canUd(scope.row)"/>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="bill_id" width="160" label="单据编号">
<template slot-scope="scope">
<el-link type="warning" @click="toView(scope.$index, scope.row)">{{ scope.row.bill_id }}</el-link>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="order_no" width="150" label="订单号"/>
<el-table-column show-overflow-tooltip prop="order_type" width="100" label="订单类型"/>
<el-table-column :formatter="billStatusFormat" prop="bill_status" width="100" label="单据状态"/>
<el-table-column label="明细数" align="center" prop="dtl_count" width="80"/>
<el-table-column label="单据总数" align="center" prop="total_qty" width="80"/>
<el-table-column label="入库数量" align="center" prop="instock_qty" width="80"/>
<el-table-column label="转发中鼎" align="center" prop="forwardZD" width="80">
<template slot-scope="scope">
<p v-if="scope.row.forwardZD == '0'">-</p>
<template v-else-if="scope.row.forwardZD == '1'">
<el-popconfirm confirm-button-text="" cancel-button-text="" icon="el-icon-info" icon-color="red"
title="是否重新转发中鼎?" @confirm="toForwardZD">
<a slot="reference" style="color: red;text-decoration: underline">失败</a>
</el-popconfirm>
</template>
<p v-else>成功</p>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="supplier_code" width="120" label="供应商编码"/>
<el-table-column show-overflow-tooltip prop="supplier_name" width="150" label="供应商名称"/>
<el-table-column show-overflow-tooltip prop="creator" width="100" label="创建人"/>
<el-table-column show-overflow-tooltip prop="create_time" width="150" label="创建时间">
<template slot-scope="scope">{{ formatDate(scope.row.create_time) }}</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="modify_date" width="150" label="修改时间">
<template slot-scope="scope">{{ formatDate(scope.row.modify_date) }}</template>
</el-table-column>
</el-table>
<pagination/>
</div>
<AddDialog @AddChanged="querytable"/>
<ViewDialog :dialog-show.sync="viewShow" :row-mst="mstrow" @AddChanged="querytable"/>
</div>
</template>
<script>
import crudPurchase from '@/views/wms/st/allocationIn/purchase'
import CRUD, {crud, header, presenter} from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import AddDialog from '@/views/wms/st/purchase/AddDialog'
import ViewDialog from '@/views/wms/st/purchase/ViewDialog'
export default {
name: 'AllocationIn',
components: {AddDialog, ViewDialog, crudOperation, rrOperation, udOperation, pagination},
cruds() {
return CRUD({
title: '调拨入库单',
optShow: {add: true, reset: true},
idField: 'id',
url: '/api/purchasemst/107',
crudMethod: {...crudPurchase},
queryOnPresenterCreated: true
})
},
mixins: [presenter(), header(), crud()],
data() {
return {
permission: {
add: ['admin', 'purchasemst:add'],
edit: ['admin', 'purchasemst:edit'],
del: ['admin', 'purchasemst:del']
},
viewShow: false,
mstrow: {},
currentRow: null,
audit_flag: true,
billStatusOptions: [{value: '0', label: '已创建'}, {value: '1', label: '执行中'}, {value: '2', label: '已完成'}]
}
},
methods: {
canUd(row) {
return row.bill_status !== '0'
},
billStatusFormat(row) {
return ({'0': '已创建', '1': '执行中', '2': '已完成'})[row.bill_status] || row.bill_status
},
formatDate(val) {
if (!val) return '';
if (typeof val === 'string') return val;
const d = new Date(val);
return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')} ${String(d.getHours()).padStart(2, '0')}:${String(d.getMinutes()).padStart(2, '0')}:${String(d.getSeconds()).padStart(2, '0')}`
},
toForwardZD() {
console.log(123)
}, toView(index, row) {
this.mstrow = row;
this.viewShow = true
},
handleSelectionChange(val, row) {
this.audit_flag = val.length == 0
},
handleCurrentChange(currentRow) {
this.currentRow = currentRow || {};
this.audit_flag = this.crud.selections.length === 0
},
querytable() {
this.crud.toQuery()
},
issueReturnBill() {
const selections = this.crud.selections;
if (!selections || selections.length === 0) {
this.crud.notify('请至少选择一条单据', CRUD.NOTIFICATION_TYPE.INFO);
return
}
const ids = selections.map(s => s.id);
const billIds = selections.map(s => s.bill_id).join('、')
this.$confirm('确认下发以下单据的回传单?\n' + billIds, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
crudPurchase.issueReturnBill(ids).then(() => {
this.crud.notify('下发成功', CRUD.NOTIFICATION_TYPE.SUCCESS);
this.crud.toQuery()
}).catch(() => {
this.crud.notify('下发失败', CRUD.NOTIFICATION_TYPE.ERROR)
})
}).catch(() => {
})
},
printBill() {
const selections = this.crud.selections;
if (!selections || selections.length === 0) {
this.crud.notify('请至少选择一条单据', CRUD.NOTIFICATION_TYPE.INFO);
return
}
const ids = selections.map(s => s.id);
const billIds = selections.map(s => s.order_no).join('、')
this.$confirm('确认打印以下单据的物料标签?\n' + billIds, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
crudPurchase.print(ids).then(() => {
this.crud.notify('打印指令已发送', CRUD.NOTIFICATION_TYPE.SUCCESS)
}).catch(() => {
this.crud.notify('打印失败', CRUD.NOTIFICATION_TYPE.ERROR)
})
}).catch(() => {
})
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-dialog__body {
padding-top: 10px;
}
</style>

View File

@@ -0,0 +1,50 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: '/api/purchasemst',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: '/api/purchasemst',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: '/api/purchasemst',
method: 'put',
data
})
}
export function get(id) {
return request({
url: '/api/purchasemst/107/' + id,
method: 'get'
})
}
export function issueReturnBill(data) {
return request({
url: '/api/purchasemst/issueReturnBill',
method: 'put',
data
})
}
export function print(ids) {
return request({
url: '/api/purchasemst/print',
method: 'post',
data: ids
})
}
export default { add, edit, del, get, issueReturnBill, print }

View File

@@ -0,0 +1,199 @@
<template>
<div class="app-container">
<div class="head-container">
<div v-if="crud.props.searchToggle">
<el-form :inline="true" class="demo-form-inline" label-position="right" label-width="80px" label-suffix=":">
<el-form-item label="模糊查询">
<el-input v-model="query.blurry" size="mini" clearable placeholder="单据号/订单号/供应商" @keyup.enter.native="crud.toQuery" />
</el-form-item>
<el-form-item label="单据编号">
<el-input v-model="query.bill_id" size="mini" clearable placeholder="单据编号" @keyup.enter.native="crud.toQuery" />
</el-form-item>
<el-form-item label="订单号">
<el-input v-model="query.order_no" size="mini" clearable placeholder="订单号" @keyup.enter.native="crud.toQuery" />
</el-form-item>
<el-form-item label="供应商">
<el-input v-model="query.supplier_name" size="mini" clearable placeholder="供应商名称" @keyup.enter.native="crud.toQuery" />
</el-form-item>
<el-form-item label="单据状态">
<el-select v-model="query.bill_status" clearable size="mini" placeholder="全部" class="filter-item" @change="crud.toQuery">
<el-option v-for="item in billStatusOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker v-model="query.createTime" type="daterange" value-format="yyyy-MM-dd HH:mm:ss" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" @change="crud.toQuery" />
</el-form-item>
<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-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" />
<el-table-column v-permission="['admin','purchasemst:del','purchasemst:edit']" label="操作" width="115" align="center" fixed="right">
<template slot-scope="scope">
<udOperation :data="scope.row" :permission="permission" :disabled-edit="canUd(scope.row)" :disabled-dle="canUd(scope.row)" />
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="bill_id" width="160" label="单据编号">
<template slot-scope="scope">
<el-link type="warning" @click="toView(scope.$index, scope.row)">{{ scope.row.bill_id }}</el-link>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="order_no" width="150" label="订单号" />
<el-table-column show-overflow-tooltip prop="order_type" width="100" label="订单类型" />
<el-table-column :formatter="billStatusFormat" prop="bill_status" width="100" label="单据状态" />
<el-table-column label="明细数" align="center" prop="dtl_count" width="80" />
<el-table-column label="单据总数" align="center" prop="total_qty" width="80" />
<el-table-column label="入库数量" align="center" prop="instock_qty" width="80" />
<el-table-column label="转发中鼎" align="center" prop="forwardZD" width="80">
<template slot-scope="scope">
<p v-if="scope.row.forwardZD == '0'">-</p>
<template v-else-if="scope.row.forwardZD == '1'">
<el-popconfirm confirm-button-text="" cancel-button-text="" icon="el-icon-info" icon-color="red" title="是否重新转发中鼎?" @confirm="toForwardZD">
<a slot="reference" style="color: red;text-decoration: underline">失败</a>
</el-popconfirm>
</template>
<p v-else>成功</p>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="supplier_code" width="120" label="供应商编码" />
<el-table-column show-overflow-tooltip prop="supplier_name" width="150" label="供应商名称" />
<el-table-column show-overflow-tooltip prop="creator" width="100" label="创建人" />
<el-table-column show-overflow-tooltip prop="create_time" width="150" label="创建时间">
<template slot-scope="scope">{{ formatDate(scope.row.create_time) }}</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="modify_date" width="150" label="修改时间">
<template slot-scope="scope">{{ formatDate(scope.row.modify_date) }}</template>
</el-table-column>
</el-table>
<pagination />
</div>
<AddDialog @AddChanged="querytable" />
<ViewDialog :dialog-show.sync="viewShow" :row-mst="mstrow" @AddChanged="querytable" />
</div>
</template>
<script>
import crudPurchase from '@/views/wms/st/allocationOut/purchase'
import CRUD, { crud, header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import AddDialog from '@/views/wms/st/purchase/AddDialog'
import ViewDialog from '@/views/wms/st/purchase/ViewDialog'
export default {
name: 'AllocationOut',
components: { AddDialog, ViewDialog, crudOperation, rrOperation, udOperation, pagination },
cruds() {
return CRUD({
title: '调拨出库单',
optShow: { add: true, reset: true },
idField: 'id',
url: '/api/purchasemst/106',
crudMethod: { ...crudPurchase },
queryOnPresenterCreated: true
})
},
mixins: [presenter(), header(), crud()],
data() {
return {
permission: {
add: ['admin', 'purchasemst:add'],
edit: ['admin', 'purchasemst:edit'],
del: ['admin', 'purchasemst:del']
},
viewShow: false,
mstrow: {},
currentRow: null,
audit_flag: true,
billStatusOptions: [
{ value: '0', label: '已创建' },
{ value: '1', label: '执行中' },
{ value: '2', label: '已完成' }
]
}
},
methods: {
canUd(row) {
return row.bill_status !== '0'
},
billStatusFormat(row) {
const map = { '0': '已创建', '1': '执行中', '2': '已完成' }
return map[row.bill_status] || row.bill_status
},
auditStatusFormat(row) {
const map = { '0': '未审核', '1': '已审核' }
return map[row.status] || row.status || '-'
},
formatDate(val) {
if (!val) return ''
if (typeof val === 'string') return val
const d = new Date(val)
const y = d.getFullYear()
const m = String(d.getMonth() + 1).padStart(2, '0')
const day = String(d.getDate()).padStart(2, '0')
const h = String(d.getHours()).padStart(2, '0')
const min = String(d.getMinutes()).padStart(2, '0')
const s = String(d.getSeconds()).padStart(2, '0')
return y + '-' + m + '-' + day + ' ' + h + ':' + min + ':' + s
},
toForwardZD() {
console.log(123)
},
toView(index, row) {
this.mstrow = row
this.viewShow = true
},
handleSelectionChange(val, row) {
console.log(val.length)
if (val.length == 0) {
this.audit_flag = true
} else {
this.audit_flag = false
}
},
handleCurrentChange(currentRow) {
if (currentRow === null) {
this.currentRow = {}
} else {
this.currentRow = currentRow
}
this.audit_flag = this.crud.selections.length === 0
},
querytable() {
this.crud.toQuery()
},
issueReturnBill() {
const selections = this.crud.selections
if (!selections || selections.length === 0) {
this.crud.notify('请至少选择一条单据', CRUD.NOTIFICATION_TYPE.INFO)
return
}
const ids = selections.map(s => s.id)
const billIds = selections.map(s => s.bill_id).join('、')
this.$confirm('确认下发以下单据的回传单?\n' + billIds, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
crudPurchase.issueReturnBill(ids).then(() => {
this.crud.notify('下发成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.toQuery()
}).catch(() => {
this.crud.notify('下发失败', CRUD.NOTIFICATION_TYPE.ERROR)
})
}).catch(() => {})
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-dialog__body {
padding-top: 10px;
}
</style>

View File

@@ -0,0 +1,50 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: '/api/purchasemst',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: '/api/purchasemst',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: '/api/purchasemst',
method: 'put',
data
})
}
export function get(id) {
return request({
url: '/api/purchasemst/106/' + id,
method: 'get'
})
}
export function issueReturnBill(data) {
return request({
url: '/api/purchasemst/issueReturnBill',
method: 'put',
data
})
}
export function print(ids) {
return request({
url: '/api/purchasemst/print',
method: 'post',
data: ids
})
}
export default { add, edit, del, get, issueReturnBill, print }

View File

@@ -297,11 +297,13 @@ export default {
const requestTypeMap = {
'0001': '生产入库',
'0005': '采购入库',
'102': '销售出库',
'103': '采购入库',
'0009': '手工入库',
'1001': '销售出库',
'0006': '生产领料',
'0007': '库存调拨',
'106': '调拨出库',
'107': '调拨入库',
'109': '其他入库',
'1005': '生产出库',

View File

@@ -0,0 +1,222 @@
<template>
<div class="app-container">
<div class="head-container">
<div v-if="crud.props.searchToggle">
<el-form :inline="true" class="demo-form-inline" label-position="right" label-width="80px" label-suffix=":">
<el-form-item label="模糊查询">
<el-input v-model="query.blurry" size="mini" clearable placeholder="单据号/订单号/供应商" @keyup.enter.native="crud.toQuery" />
</el-form-item>
<el-form-item label="单据编号">
<el-input v-model="query.bill_id" size="mini" clearable placeholder="单据编号" @keyup.enter.native="crud.toQuery" />
</el-form-item>
<el-form-item label="订单号">
<el-input v-model="query.order_no" size="mini" clearable placeholder="订单号" @keyup.enter.native="crud.toQuery" />
</el-form-item>
<el-form-item label="供应商">
<el-input v-model="query.supplier_name" size="mini" clearable placeholder="供应商名称" @keyup.enter.native="crud.toQuery" />
</el-form-item>
<el-form-item label="单据状态">
<el-select v-model="query.bill_status" clearable size="mini" placeholder="全部" class="filter-item" @change="crud.toQuery">
<el-option v-for="item in billStatusOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker v-model="query.createTime" type="daterange" value-format="yyyy-MM-dd HH:mm:ss" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" @change="crud.toQuery" />
</el-form-item>
<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>
<el-button slot="right" class="filter-item" type="primary" icon="el-icon-printer" size="mini"
:disabled="audit_flag" @click="printBill">打印
</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" />
<el-table-column v-permission="['admin','purchasemst:del','purchasemst:edit']" label="操作" width="115" align="center" fixed="right">
<template slot-scope="scope">
<udOperation :data="scope.row" :permission="permission" :disabled-edit="canUd(scope.row)" :disabled-dle="canUd(scope.row)" />
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="bill_id" width="160" label="单据编号">
<template slot-scope="scope">
<el-link type="warning" @click="toView(scope.$index, scope.row)">{{ scope.row.bill_id }}</el-link>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="order_no" width="150" label="订单号" />
<el-table-column show-overflow-tooltip prop="order_type" width="100" label="订单类型" />
<el-table-column :formatter="billStatusFormat" prop="bill_status" width="100" label="单据状态" />
<el-table-column label="明细数" align="center" prop="dtl_count" width="80" />
<el-table-column label="单据总数" align="center" prop="total_qty" width="80" />
<el-table-column label="入库数量" align="center" prop="instock_qty" width="80" />
<el-table-column label="转发中鼎" align="center" prop="forwardZD" width="80">
<template slot-scope="scope">
<p v-if="scope.row.forwardZD == '0'">-</p>
<template v-else-if="scope.row.forwardZD == '1'">
<el-popconfirm confirm-button-text="" cancel-button-text="" icon="el-icon-info" icon-color="red" title="是否重新转发中鼎?" @confirm="toForwardZD">
<a slot="reference" style="color: red;text-decoration: underline">失败</a>
</el-popconfirm>
</template>
<p v-else>成功</p>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="supplier_code" width="120" label="供应商编码" />
<el-table-column show-overflow-tooltip prop="supplier_name" width="150" label="供应商名称" />
<el-table-column show-overflow-tooltip prop="creator" width="100" label="创建人" />
<el-table-column show-overflow-tooltip prop="create_time" width="150" label="创建时间">
<template slot-scope="scope">{{ formatDate(scope.row.create_time) }}</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="modify_date" width="150" label="修改时间">
<template slot-scope="scope">{{ formatDate(scope.row.modify_date) }}</template>
</el-table-column>
</el-table>
<pagination />
</div>
<AddDialog @AddChanged="querytable" />
<ViewDialog :dialog-show.sync="viewShow" :row-mst="mstrow" @AddChanged="querytable" />
</div>
</template>
<script>
import crudPurchase from '@/views/wms/st/otherIn/purchase'
import CRUD, { crud, header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import AddDialog from '@/views/wms/st/purchase/AddDialog'
import ViewDialog from '@/views/wms/st/purchase/ViewDialog'
export default {
name: 'OtherIn',
components: { AddDialog, ViewDialog, crudOperation, rrOperation, udOperation, pagination },
cruds() {
return CRUD({
title: '其他入库单',
optShow: { add: true, reset: true },
idField: 'id',
url: '/api/purchasemst/109',
crudMethod: { ...crudPurchase },
queryOnPresenterCreated: true
})
},
mixins: [presenter(), header(), crud()],
data() {
return {
permission: {
add: ['admin', 'purchasemst:add'],
edit: ['admin', 'purchasemst:edit'],
del: ['admin', 'purchasemst:del']
},
viewShow: false,
mstrow: {},
currentRow: null,
audit_flag: true,
billStatusOptions: [
{ value: '0', label: '已创建' },
{ value: '1', label: '执行中' },
{ value: '2', label: '已完成' }
]
}
},
methods: {
canUd(row) {
return row.bill_status !== '0'
},
billStatusFormat(row) {
const map = { '0': '已创建', '1': '执行中', '2': '已完成' }
return map[row.bill_status] || row.bill_status
},
auditStatusFormat(row) {
const map = { '0': '未审核', '1': '已审核' }
return map[row.status] || row.status || '-'
},
formatDate(val) {
if (!val) return ''
if (typeof val === 'string') return val
const d = new Date(val)
const y = d.getFullYear()
const m = String(d.getMonth() + 1).padStart(2, '0')
const day = String(d.getDate()).padStart(2, '0')
const h = String(d.getHours()).padStart(2, '0')
const min = String(d.getMinutes()).padStart(2, '0')
const s = String(d.getSeconds()).padStart(2, '0')
return y + '-' + m + '-' + day + ' ' + h + ':' + min + ':' + s
},
toForwardZD() {
console.log(123)
},
toView(index, row) {
this.mstrow = row
this.viewShow = true
},
handleSelectionChange(val, row) {
console.log(val.length)
if (val.length == 0) {
this.audit_flag = true
} else {
this.audit_flag = false
}
},
handleCurrentChange(currentRow) {
if (currentRow === null) {
this.currentRow = {}
} else {
this.currentRow = currentRow
}
this.audit_flag = this.crud.selections.length === 0
},
querytable() {
this.crud.toQuery()
},
issueReturnBill() {
const selections = this.crud.selections
if (!selections || selections.length === 0) {
this.crud.notify('请至少选择一条单据', CRUD.NOTIFICATION_TYPE.INFO)
return
}
const ids = selections.map(s => s.id)
const billIds = selections.map(s => s.bill_id).join('、')
this.$confirm('确认下发以下单据的回传单?\n' + billIds, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
crudPurchase.issueReturnBill(ids).then(() => {
this.crud.notify('下发成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.toQuery()
}).catch(() => {
this.crud.notify('下发失败', CRUD.NOTIFICATION_TYPE.ERROR)
})
}).catch(() => {})
},
printBill() {
const selections = this.crud.selections
if (!selections || selections.length === 0) {
this.crud.notify('请至少选择一条单据', CRUD.NOTIFICATION_TYPE.INFO)
return
}
const ids = selections.map(s => s.id)
const billIds = selections.map(s => s.order_no).join('、')
this.$confirm('确认打印以下单据的物料标签?\n' + billIds, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
crudPurchase.print(ids).then(() => {
this.crud.notify('打印指令已发送', CRUD.NOTIFICATION_TYPE.SUCCESS)
}).catch(() => {
this.crud.notify('打印失败', CRUD.NOTIFICATION_TYPE.ERROR)
})
}).catch(() => {})
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-dialog__body {
padding-top: 10px;
}
</style>

View File

@@ -0,0 +1,50 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: '/api/purchasemst',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: '/api/purchasemst',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: '/api/purchasemst',
method: 'put',
data
})
}
export function get(id) {
return request({
url: '/api/purchasemst/109/' + id,
method: 'get'
})
}
export function issueReturnBill(data) {
return request({
url: '/api/purchasemst/issueReturnBill',
method: 'put',
data
})
}
export function print(ids) {
return request({
url: '/api/purchasemst/print',
method: 'post',
data: ids
})
}
export default { add, edit, del, get, issueReturnBill, print }

View File

@@ -0,0 +1,199 @@
<template>
<div class="app-container">
<div class="head-container">
<div v-if="crud.props.searchToggle">
<el-form :inline="true" class="demo-form-inline" label-position="right" label-width="80px" label-suffix=":">
<el-form-item label="模糊查询">
<el-input v-model="query.blurry" size="mini" clearable placeholder="单据号/订单号/供应商" @keyup.enter.native="crud.toQuery" />
</el-form-item>
<el-form-item label="单据编号">
<el-input v-model="query.bill_id" size="mini" clearable placeholder="单据编号" @keyup.enter.native="crud.toQuery" />
</el-form-item>
<el-form-item label="订单号">
<el-input v-model="query.order_no" size="mini" clearable placeholder="订单号" @keyup.enter.native="crud.toQuery" />
</el-form-item>
<el-form-item label="供应商">
<el-input v-model="query.supplier_name" size="mini" clearable placeholder="供应商名称" @keyup.enter.native="crud.toQuery" />
</el-form-item>
<el-form-item label="单据状态">
<el-select v-model="query.bill_status" clearable size="mini" placeholder="全部" class="filter-item" @change="crud.toQuery">
<el-option v-for="item in billStatusOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker v-model="query.createTime" type="daterange" value-format="yyyy-MM-dd HH:mm:ss" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" @change="crud.toQuery" />
</el-form-item>
<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-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" />
<el-table-column v-permission="['admin','purchasemst:del','purchasemst:edit']" label="操作" width="115" align="center" fixed="right">
<template slot-scope="scope">
<udOperation :data="scope.row" :permission="permission" :disabled-edit="canUd(scope.row)" :disabled-dle="canUd(scope.row)" />
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="bill_id" width="160" label="单据编号">
<template slot-scope="scope">
<el-link type="warning" @click="toView(scope.$index, scope.row)">{{ scope.row.bill_id }}</el-link>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="order_no" width="150" label="订单号" />
<el-table-column show-overflow-tooltip prop="order_type" width="100" label="订单类型" />
<el-table-column :formatter="billStatusFormat" prop="bill_status" width="100" label="单据状态" />
<el-table-column label="明细数" align="center" prop="dtl_count" width="80" />
<el-table-column label="单据总数" align="center" prop="total_qty" width="80" />
<el-table-column label="入库数量" align="center" prop="instock_qty" width="80" />
<el-table-column label="转发中鼎" align="center" prop="forwardZD" width="80">
<template slot-scope="scope">
<p v-if="scope.row.forwardZD == '0'">-</p>
<template v-else-if="scope.row.forwardZD == '1'">
<el-popconfirm confirm-button-text="" cancel-button-text="" icon="el-icon-info" icon-color="red" title="是否重新转发中鼎?" @confirm="toForwardZD">
<a slot="reference" style="color: red;text-decoration: underline">失败</a>
</el-popconfirm>
</template>
<p v-else>成功</p>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="supplier_code" width="120" label="供应商编码" />
<el-table-column show-overflow-tooltip prop="supplier_name" width="150" label="供应商名称" />
<el-table-column show-overflow-tooltip prop="creator" width="100" label="创建人" />
<el-table-column show-overflow-tooltip prop="create_time" width="150" label="创建时间">
<template slot-scope="scope">{{ formatDate(scope.row.create_time) }}</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="modify_date" width="150" label="修改时间">
<template slot-scope="scope">{{ formatDate(scope.row.modify_date) }}</template>
</el-table-column>
</el-table>
<pagination />
</div>
<AddDialog @AddChanged="querytable" />
<ViewDialog :dialog-show.sync="viewShow" :row-mst="mstrow" @AddChanged="querytable" />
</div>
</template>
<script>
import crudPurchase from '@/views/wms/st/otherOut/purchase'
import CRUD, { crud, header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import AddDialog from '@/views/wms/st/purchase/AddDialog'
import ViewDialog from '@/views/wms/st/purchase/ViewDialog'
export default {
name: 'OtherOut',
components: { AddDialog, ViewDialog, crudOperation, rrOperation, udOperation, pagination },
cruds() {
return CRUD({
title: '其他出库单',
optShow: { add: true, reset: true },
idField: 'id',
url: '/api/purchasemst/108',
crudMethod: { ...crudPurchase },
queryOnPresenterCreated: true
})
},
mixins: [presenter(), header(), crud()],
data() {
return {
permission: {
add: ['admin', 'purchasemst:add'],
edit: ['admin', 'purchasemst:edit'],
del: ['admin', 'purchasemst:del']
},
viewShow: false,
mstrow: {},
currentRow: null,
audit_flag: true,
billStatusOptions: [
{ value: '0', label: '已创建' },
{ value: '1', label: '执行中' },
{ value: '2', label: '已完成' }
]
}
},
methods: {
canUd(row) {
return row.bill_status !== '0'
},
billStatusFormat(row) {
const map = { '0': '已创建', '1': '执行中', '2': '已完成' }
return map[row.bill_status] || row.bill_status
},
auditStatusFormat(row) {
const map = { '0': '未审核', '1': '已审核' }
return map[row.status] || row.status || '-'
},
formatDate(val) {
if (!val) return ''
if (typeof val === 'string') return val
const d = new Date(val)
const y = d.getFullYear()
const m = String(d.getMonth() + 1).padStart(2, '0')
const day = String(d.getDate()).padStart(2, '0')
const h = String(d.getHours()).padStart(2, '0')
const min = String(d.getMinutes()).padStart(2, '0')
const s = String(d.getSeconds()).padStart(2, '0')
return y + '-' + m + '-' + day + ' ' + h + ':' + min + ':' + s
},
toForwardZD() {
console.log(123)
},
toView(index, row) {
this.mstrow = row
this.viewShow = true
},
handleSelectionChange(val, row) {
console.log(val.length)
if (val.length == 0) {
this.audit_flag = true
} else {
this.audit_flag = false
}
},
handleCurrentChange(currentRow) {
if (currentRow === null) {
this.currentRow = {}
} else {
this.currentRow = currentRow
}
this.audit_flag = this.crud.selections.length === 0
},
querytable() {
this.crud.toQuery()
},
issueReturnBill() {
const selections = this.crud.selections
if (!selections || selections.length === 0) {
this.crud.notify('请至少选择一条单据', CRUD.NOTIFICATION_TYPE.INFO)
return
}
const ids = selections.map(s => s.id)
const billIds = selections.map(s => s.bill_id).join('、')
this.$confirm('确认下发以下单据的回传单?\n' + billIds, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
crudPurchase.issueReturnBill(ids).then(() => {
this.crud.notify('下发成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.toQuery()
}).catch(() => {
this.crud.notify('下发失败', CRUD.NOTIFICATION_TYPE.ERROR)
})
}).catch(() => {})
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-dialog__body {
padding-top: 10px;
}
</style>

View File

@@ -0,0 +1,50 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: '/api/purchasemst',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: '/api/purchasemst',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: '/api/purchasemst',
method: 'put',
data
})
}
export function get(id) {
return request({
url: '/api/purchasemst/108/' + id,
method: 'get'
})
}
export function issueReturnBill(data) {
return request({
url: '/api/purchasemst/issueReturnBill',
method: 'put',
data
})
}
export function print(ids) {
return request({
url: '/api/purchasemst/print',
method: 'post',
data: ids
})
}
export default { add, edit, del, get, issueReturnBill, print }

View File

@@ -118,7 +118,7 @@ export default {
title: '采购入库单',
optShow: { add: true, reset: true },
idField: 'id',
url: '/api/purchasemst',
url: '/api/purchasemst/103',
crudMethod: { ...crudPurchase },
queryOnPresenterCreated: true
})

View File

@@ -26,7 +26,7 @@ export function edit(data) {
export function get(id) {
return request({
url: '/api/purchasemst/' + id,
url: '/api/purchasemst/103/' + id,
method: 'get'
})
}