修改出库相关代码
property-only-app
zxf 3 months ago
parent fb9d0b9ad2
commit 6c3c8b3e66

@ -75,4 +75,11 @@ export function confirmPutBill(id) {
})
}
// 分页查询出入库单据明细列表
export function selectTotalWt(query) {
return request({
url: 'autogencode/ckbillcargo/selectTotalWt',
method: 'get',
params: query
})
}

@ -61,3 +61,31 @@ export function ckcargostockListApi(params) {
})
}
/**
* ckcargostock列表
* @param pram
*/
export function listCkstock(params) {
return request({
url: `autogencode/ckcargostock/listCkstock`,
method: 'GET',
params
})
}
export function newList(query) {
return request({
url: 'autogencode/ckcargostock/newList',
method: 'get',
params: query
})
}
// 查询仓库库存列表
export function newListCkstock(query) {
return request({
url: 'autogencode/ckcargostock/newList' ,
method: 'get'
})
}

@ -228,4 +228,4 @@ export default {
.el-form-item {
margin-bottom: 10px;
}
</style>
</style>

@ -252,6 +252,28 @@ export default {
return { ...item.inputStyle };
},
formatDate(date) {
if (!date) return null;
let dateObj;
if (typeof date === 'string') {
dateObj = new Date(date);
} else if (date instanceof Date) {
dateObj = date;
} else {
return null;
}
if (isNaN(dateObj.getTime())) {
return null;
}
const year = dateObj.getFullYear();
const month = String(dateObj.getMonth() + 1).padStart(2, '0');
const day = String(dateObj.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
},
handleQuery() {
const query = {...this.queryForm};
//
@ -259,9 +281,9 @@ export default {
if (item.type === 'daterange' && item.splitDaterange) {
const range = query[item.prop];
if (range && range.length === 2) {
//
query[`${item.prop}Begin`] = range[0];
query[`${item.prop}End`] = range[1];
// yyyy-MM-dd
query[`${item.prop}Begin`] = this.formatDate(range[0]);
query[`${item.prop}End`] = this.formatDate(range[1]);
//
delete query[item.prop];
}

@ -0,0 +1,28 @@
<template>
<span>{{ warehouseName }}</span>
</template>
<script>
export default {
name: 'WarehouseName',
props: {
stockCode: {
type: String,
default: ''
}
},
computed: {
warehouseName() {
const stock = this.$store.getters.warehouseData[this.stockCode] || {};
return stock.stockName;
}
},
created() {
this.$store.dispatch('warehouse/getWarehouse', {})
}
}
</script>
<style>
</style>

@ -14,6 +14,7 @@ import dialogDrag from './dialog/drag'
import dialogDragWidth from './dialog/dragWidth'
import dialogDragHeight from './dialog/dragHeight'
import copy from './copy/copy'
import enterboard from './module/enterboard'
const install = function(Vue) {
Vue.directive('hasRole', hasRole)
@ -22,6 +23,7 @@ const install = function(Vue) {
Vue.directive('dialogDragWidth', dialogDragWidth)
Vue.directive('dialogDragHeight', dialogDragHeight)
Vue.directive('copy', copy)
Vue.directive('enterboard', enterboard)
}
if (window.Vue) {

@ -0,0 +1,22 @@
export default {
inserted: function (el) {
const inputs = el.querySelectorAll("input");
const inputArray = Array.from(inputs);
inputArray.forEach((input, index) => {
input.setAttribute("keyFocusIndex", index);
input.addEventListener("keydown", (ev) => {
if (ev.keyCode === 13) {
const targetTo = ev.srcElement.getAttribute("keyFocusTo");
if (targetTo) {
this.$refs[targetTo].$el.focus();
} else {
const attrIndex = ev.srcElement.getAttribute("keyFocusIndex");
const ctlI = parseInt(attrIndex);
if (ctlI < inputArray.length - 1) inputArray[ctlI + 1].focus();
}
}
});
});
},
}

@ -114,7 +114,7 @@ Vue.prototype.$validator = function(rule) {
return new schema(rule);
};
Vue.prototype.handleTree = handleTree
Vue.prototype.parseTime = parseTime
Vue.prototype.parseTime = parseTime
Vue.prototype.resetForm = resetForm
Vue.prototype.addDateRange = addDateRange
Vue.prototype.$sortBy = sortBy

@ -24,6 +24,7 @@ const getters = {
permissions: state => state.user.permissions,
sidebarRouters: state => state.permission.sidebarRouters,
errorLogs: state => state.errorLog.logs,
isLogin: state => state.user.isLogin
isLogin: state => state.user.isLogin,
warehouseData: state => state.warehouse.warehouse
}
export default getters

@ -0,0 +1,39 @@
import { listWarehouse } from "@/api/cmwarehouse";
const state = {
warehouse: {}
};
const mutations = {
SET_WAREHOUSE: (state, warehouse) => {
state.warehouse = warehouse;
}
};
const actions = {
// 获取仓库列表
getWarehouse({ commit }, params) {
return new Promise((resolve, reject) => {
listWarehouse(params)
.then(response => {
const data = response.data || [];
const warehouseMap = {};
data.forEach(item => {
warehouseMap[item.stockCode] = item;
});
commit('SET_WAREHOUSE', warehouseMap);
resolve(warehouseMap);
})
.catch(error => {
reject(error);
});
});
}
};
export default {
namespaced: true,
state,
mutations,
actions
};

@ -0,0 +1,248 @@
<template>
<div style="display: flex;flex-direction: column;" v-loading="loading">
<el-row :gutter="6" type="flex" align="middle">
<el-col :span="1.5">
<label >备案号</label>
</el-col>
<el-col :span="4">
<el-input v-model="searchGdsSeqno" placeholder="请输入备案号" id="gdsSeqno"></el-input>
</el-col>
<el-col :span="2">
<el-button type="primary" @click="getList"></el-button>
</el-col>
</el-row>
<el-table ref="table" style="flex: 1;" height="70vh" :data="list" @select="select" @select-all="selectAll"
@selection-change="selectionChange" @current-change="handleCurrentChange" highlight-current-row border stripe>
<el-table-column type="selection" width="55" align="center" :selectable="selectable" />
<el-table-column type="expand" label="更多">
<template slot-scope="scope">
<el-descriptions class="desc-table" size="mini" :column="5" border>
<el-descriptions-item label="仓库名称">
{{scope.row.stockName}}/{{scope.row.shelfName}}/{{scope.row.locationName}}
</el-descriptions-item>
<el-descriptions-item label="HS编号">{{ scope.row.hsCode }}</el-descriptions-item>
<el-descriptions-item label="自然序号">{{ scope.row.cargoNumber }}</el-descriptions-item>
<el-descriptions-item label="商品料号">{{ scope.row.itemNumber }}</el-descriptions-item>
<el-descriptions-item label="电子账册项号">{{ scope.row.bookNumber }}</el-descriptions-item>
<el-descriptions-item label="报关单号">{{ scope.row.customsNo }}</el-descriptions-item>
<el-descriptions-item label="核注清单号">{{ scope.row.listNumber }}</el-descriptions-item>
<el-descriptions-item label="有效期至">{{ scope.row.expiryDate }}</el-descriptions-item>
<el-descriptions-item label="规格类型品质">{{ scope.row.cargoSpec }}</el-descriptions-item>
<el-descriptions-item label="原产国">{{ scope.row.originCountry }}</el-descriptions-item>
<el-descriptions-item label="备案号">{{ scope.row.gdsSeqno }}</el-descriptions-item>
</el-descriptions>
</template>
</el-table-column>
<el-table-column label="单据编号" prop="billNumber">
<template slot-scope="scope">
<div class="nomal-text">{{ scope.row.billNumber }}</div>
</template>
</el-table-column>
<el-table-column label="货物" prop="cargoName">
<template slot-scope="scope">
<div class="nomal-text">{{ scope.row.cargoName }}</div>
</template>
</el-table-column>
<el-table-column label="仓库" prop="stockName">
<template slot-scope="scope">
<div class="nomal-text">
{{scope.row.stockName}}/{{scope.row.shelfName}}/{{scope.row.locationName}}
</div>
</template>
</el-table-column>
<el-table-column label="件数" prop="cargoNum">
<template slot-scope="scope">
<div class="nomal-text">{{ scope.row.cargoNum }}</div>
</template>
</el-table-column>
<el-table-column label="重量" prop="cargoWt">
<template slot-scope="scope">
<div class="nomal-text">{{ scope.row.cargoWt }}</div>
</template>
</el-table-column>
<el-table-column label="体积" prop="cargoVol">
<template slot-scope="scope">
<div class="nomal-text">{{ scope.row.cargoVol }}</div>
</template>
</el-table-column>
<el-table-column label="价值" prop="cargoValue">
<template slot-scope="scope">
<div class="nomal-text">{{ scope.row.cargoValue }}</div>
</template>
</el-table-column>
</el-table>
<div class="stock-btns">
<el-button @click="$emit('cancel')"></el-button>
<el-button type="primary" @click="save"></el-button>
</div>
</div>
</template>
<script>
import { listCkstock } from "@/api/ckcargostock";
import WarehouseName from '@/components/WarehouseName';
export default {
name: 'StockChoose',
components: {
WarehouseName,
},
props: {
custId: {
type: String | Number,
default: ''
},
disableItems: {
type: Array,
default() {
return [];
}
},
single: {
type: Boolean,
default: false,
},
singleItem: {
type: Object,
default() {
return {};
}
}
},
data() {
return {
list: [],
selectedList: [],
loading: false,
searchGdsSeqno: '',
}
},
watch: {
custId() {
this.getList();
}
},
created() {
this.getList();
},
methods: {
selectable(row, index) {
if (this.disableItems && this.disableItems.length) {
return !this.disableItems.some(val => val.outBillNumber === row.billNumber && val.outStockId === row.stockId && val.cargoId === row.cargoId);
}
return true;
},
//
selectAll(selection) {
if (this.single) {
//
this.$refs.table.clearSelection();
}
},
select(selection, row) {
if (this.single) {
//
this.$nextTick(() => {
this.$refs.table.clearSelection();
this.$nextTick(() => {
this.$refs.table.toggleRowSelection(row);
});
});
}
},
//
selectionChange(sel) {
console.log('选中项变化', sel);
if (sel.length === 0) {
//
this.$refs.table.setCurrentRow();
}
this.selectedList = sel;
},
//
handleCurrentChange(currentRow) {
if (this.single) {
//
this.$nextTick(() => {
this.$refs.table.clearSelection();
this.$nextTick(() => {
if (currentRow) {
this.$refs.table.toggleRowSelection(currentRow);
}
});
});
}
},
save() {
this.$emit('confirm', this.selectedList);
},
getList() {
this.list = [];
if (!this.custId) return;
this.loading = true;
listCkstock({
custId: this.custId,
gdsSeqno: this.searchGdsSeqno,
}).then(res => {
this.loading = false;
this.list = res || [];
if (this.singleItem.stockId) {
const findex = this.list.findIndex(val => val.billNumber === this.singleItem.billNumber && val.stockId === this.singleItem.stockId && val.cargoId === this.singleItem.cargoId);
if (findex > -1) {
this.$nextTick(() => {
this.$refs.table.toggleRowSelection(this.list[findex]);
});
}
}
this.$emit('updateList', this.list);
}).catch(e => {
this.loading = false;
});
}
}
}
</script>
<style scoped>
.stock-btns {
margin-top: 10px;
display: flex;
justify-content: right;
}
.nomal-text {
padding: 8px 10px;
}
.desc-table {
padding: 5px;
}
/* ::v-deep .el-table td.el-table__cell {
padding: 10px;
}
::v-deep .el-table--border .el-table__cell {
padding: 10px;
}
::v-deep .el-table .cell {
padding: 10px;
}
::v-deep .el-table--border .el-table__cell:first-child .cell {
padding-left: 10px;
} */</style>

@ -0,0 +1,771 @@
<template>
<div v-loading="loading">
<el-form ref="form" :model="form" :rules="rules" label-width="90px">
<!-- 第一行3个字段每个 span=83×8=24 -->
<el-row>
<el-col :span="8">
<el-form-item label="单据编号" prop="billNumber">
<bill-number-input ref="billInput" v-model="form.billNumber" type="CK" :disabled="!!form.id"></bill-number-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="单据时间" prop="billDate">
<el-date-picker
clearable
v-model="form.billDate"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择单据时间"
style="width: 100%"
></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="货主" prop="custId">
<el-select
v-model="form.custId"
filterable
placeholder="请输入货主名称"
style="width: 100%"
clearable
@change="setCustDetail"
>
<el-option
v-for="item in custList"
:key="item.id"
:label="item.custName"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<!-- 第二行4个字段每个 span=64×6=24 -->
<el-row>
<!-- <el-col :span="6">-->
<!-- <el-form-item label="贸易方式" prop="tradWay">-->
<!-- <MyFormItemInput type="select" class="required" :required="isSubmit" :options="dict.type.trad_ways" :maxlength="4" prop="tradWay" v-model="form.tradWay"></MyFormItemInput>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :span="6">
<el-form-item label="出库类型" prop="outType">
<el-select
filterable
v-model="form.outType"
placeholder="请输入出库类型"
clearable
style="width: 100%"
>
<el-option
v-for="dict in dict.type.sys_out_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<!-- <el-col :span="6">-->
<!-- <el-form-item label="船舶名称" prop="vesselName">-->
<!-- <el-select-->
<!-- v-model="form.vesselId"-->
<!-- filterable-->
<!-- placeholder="请输入船舶名称"-->
<!-- style="width: 100%"-->
<!-- clearable-->
<!-- @change="setVesselDetail"-->
<!-- >-->
<!-- <el-option-->
<!-- v-for="item in vesselList"-->
<!-- :key="item.id"-->
<!-- :label="item.vesselName"-->
<!-- :value="item.id"-->
<!-- ></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="6">-->
<!-- <el-form-item label="航次号" prop="voyageNo">-->
<!-- <el-input-->
<!-- v-model="form.voyageNo"-->
<!-- placeholder="请输入航次号"-->
<!-- style="width: 100%"-->
<!-- ></el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
</el-row>
</el-form>
<div class="stock-content">
<div v-if="!tableReadonly">
<el-button type="primary" plain @click="addStockOut"></el-button>
<el-button type="danger" plain @click="deleteStocks"></el-button>
</div>
<el-form ref="listForm" style="flex: 1;margin-top: 10px;" :model="form" v-enterboard>
<el-table v-if="!loading" highlight-current-row ref="table" style="height: 100%;" height="62vh" :data="form.ckBillCargos" :summary-method="getSummaries"
show-summary @selection-change="selectionChange" border stripe>
<el-table-column v-bind="tableIndexAttrs" align="center" />
<el-table-column type="expand" label="更多">
<template slot-scope="scope">
<el-descriptions class="desc-table" size="mini" :column="5" border>
<el-descriptions-item label="HS编号">{{ scope.row.hsCode }}</el-descriptions-item>
<el-descriptions-item label="自然序号">{{ scope.row.cargoNumber }}</el-descriptions-item>
<el-descriptions-item label="商品料号">{{ scope.row.itemNumber }}</el-descriptions-item>
<el-descriptions-item label="电子账册项号"> <el-input v-model="scope.row.bookNumber" placeholder="电子账册项号" /></el-descriptions-item>
<el-descriptions-item label="报关单号"><el-input v-model="scope.row.customsNo" placeholder="报关单号" /></el-descriptions-item>
<el-descriptions-item label="核注清单号"><el-input v-model="scope.row.listNumber" placeholder="核注清单号" /></el-descriptions-item>
<el-descriptions-item label="有效期至"><el-date-picker v-model="scope.row.expiryDate" placeholder="有效期至" type="date" value-format="yyyy-MM-dd " /></el-descriptions-item>
<el-descriptions-item label="规格类型品质">{{ scope.row.cargoSpec }}</el-descriptions-item>
<el-descriptions-item label="原产国"><dict-tag :options="dict.type.sys_origin_country" :value="scope.row.originCountry"></dict-tag></el-descriptions-item>
<el-descriptions-item label="货物流向">
<el-select v-model="scope.row.cargoFlow" filterable placeholder="请输入货物流向" style="width: 100%" clearable>
<el-option v-for="item in custList" :key="item.id" :label="item.custName" :value="item.custName">
</el-option>
</el-select>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">文件上传</template>
<div v-if="tableReadonly" class="nomal-text">
<el-form-item label="附件" prop="file">
<FileUpload
v-model="scope.row.file"
></FileUpload>
</el-form-item>
</div>
<el-form-item v-else prop="file" class="margin-none">
<FileUpload
v-model="scope.row.file"
></FileUpload>
</el-form-item>
</el-descriptions-item>
</el-descriptions>
</template>
</el-table-column>
<el-table-column label="单据编号" prop="billNumber">
<template slot-scope="scope">
<div class="nomal-text">{{ scope.row.outBillNumber }}</div>
</template>
</el-table-column>
<el-table-column label="货物" prop="cargoName">
<template slot-scope="scope">
<div class="nomal-text">{{ scope.row.cargoName }}</div>
</template>
</el-table-column>
<el-table-column label="仓库" prop="stockName">
<template slot-scope="scope">
<div class="nomal-text">{{scope.row.stockName}}/{{scope.row.shelfName}}/{{scope.row.locationName}}</div>
</template>
</el-table-column>
<el-table-column label="件数" prop="cargoNum">
<template slot-scope="scope">
<el-form-item prop="cargoNum" class="margin-none">
<div v-if="tableReadonly" class="nomal-text">{{ scope.row.cargoNum }}</div>
<el-input-number style="width: 100%" controls-position="right" v-else v-model="scope.row.cargoNum"
:min="0" :max="getMaxData(scope.row).cargoNum" :precision="2" placeholder="输入件数" />
</el-form-item>
</template>
</el-table-column>
<el-table-column label="重量" prop="cargoWt">
<template slot-scope="scope">
<el-form-item class="margin-none" :prop="'ckBillCargos.' + scope.$index + '.cargoWt'"
:rules="rules.cargoWt">
<div v-if="tableReadonly" class="nomal-text">{{ scope.row.cargoWt }}</div>
<el-input-number style="width: 100%" controls-position="right" v-else v-model="scope.row.cargoWt" :min="0"
:precision="2" :max="getMaxData(scope.row).cargoWt" placeholder="输入重量" />
</el-form-item>
</template>
</el-table-column>
<el-table-column label="体积" prop="cargoVol">
<template slot-scope="scope">
<el-form-item prop="cargoVol" class="margin-none">
<div v-if="tableReadonly" class="nomal-text">{{ scope.row.cargoVol }}</div>
<el-input-number style="width: 100%" controls-position="right" v-else v-model="scope.row.cargoVol"
:min="0" :precision="2" :max="getMaxData(scope.row).cargoVol" placeholder="输入体积" />
</el-form-item>
</template>
</el-table-column>
<el-table-column label="单价" prop="unitPrice">
<template slot-scope="scope">
<el-form-item prop="unitPrice" class="margin-none">
<div v-if="tableReadonly" class="nomal-text">{{ scope.row.unitPrice }}</div>
<el-input-number style="width: 100%" controls-position="right" v-else v-model="scope.row.unitPrice"
:min="0" :precision="4" placeholder="输入单价" />
</el-form-item>
</template>
</el-table-column>
<el-table-column label="价值" prop="cargoValue">
<template slot-scope="scope">
<el-form-item prop="cargoValue" class="margin-none">
<div v-if="tableReadonly" class="nomal-text">{{ scope.row.cargoValue }}</div>
<el-input-number style="width: 100%" controls-position="right" v-else v-model="scope.row.cargoValue"
:min="0" :precision="4" placeholder="输入价值" />
</el-form-item>
</template>
</el-table-column>
</el-table>
</el-form>
</div>
<div class="stock-btns">
<el-button v-if="!readonly" type="primary" plain
style="margin-right: 20px;" @click="confirm">{{ form.billStatus == 1 ? '单据撤销' : '单据确认' }}</el-button>
<el-button @click="cancel(!readonly)"></el-button>
<el-button v-if="!readonly && form.billStatus != 1" type="primary" @click="save(false)"></el-button>
</div>
<el-dialog title="选择出库货物" :visible.sync="open" width="80%" append-to-body :close-on-click-modal="false" destroy-on-close>
<StockChoose style="height: 60vh;" :cust-id="form.custId" :disable-items="form.ckBillCargos" :search-keyword="searchKeyword" @confirm="chooseStock" @cancel="open = false" @updateList="updateStockList"></StockChoose>
</el-dialog>
</div>
</template>
<script>
import { cmcustListByAll as listCust } from "@/api/cmcust";
import { listCkstock } from "@/api/ckcargostock";
import { getCkbillInfo, outBill } from '@/api/ckbill';
import { delCkcargo, recallOutBill } from '@/api/ckbillcargo';
import StockChoose from "../StockChoose";
import BillNumberInput from "@/components/BillNumberInput";
import FileUpload from "@/components/FileUploadVO";
import MyFormItemInput from "@/components/MyFormItemInput";
import WarehouseName from '@/components/WarehouseName';
export default {
name: 'StockOut',
dicts: ['sys_origin_country','sys_out_type','trad_ways'],
components: {
FileUpload,
StockChoose,
MyFormItemInput,
BillNumberInput,
WarehouseName,
},
props: {
//
billInfo: {
type: Object,
default() {
return {};
}
},
//
modifyData: {
type: Object,
default() {
return {};
}
},
readonly: {
type: Boolean,
default: false,
}
},
data() {
return {
vesselList: [],
searchKeyword: '',
open: false,
loading: false,
form: {
ckBillCargos: []
},
rules: {
cargoNumber: [
{ required: true, message: '货物自然序号不能为空', trigger: 'blur' }
],
itemNumber: [
{ required: true, message: '商品料号不能为空', trigger: 'blur' }
],
bookNumber: [
{ required: true, message: '电子账册项号不能为空', trigger: 'blur' }
],
// customsNo: [
// { required: true, message: '', trigger: 'blur' }
// ],
// listNumber: [
// { required: true, message: '', trigger: 'blur' }
// ],
expiryDate: [
{ required: true, message: '过期时间不能为空', trigger: 'blur' }
],
cargoValue: [
{ required: true, message: '货物价值不能为空', trigger: 'blur' }
],
stockId: [
{ required: true, message: '库场ID不能为空', trigger: 'blur' }
],
billDate: [
{ required: true, message: '单据日期不能为空', trigger: 'blur' }
],
billNumber: [
{ required: true, message: '单据编号不能为空', trigger: 'blur' }
],
custId: [
{ required: true, message: '货主不能为空', trigger: 'blur' }
],
cargoName: [
{ required: true, message: '货物名称不能为空', trigger: 'blur' }
],
billNo: [
{ required: true, message: '提运单号不能为空', trigger: 'blur' }
],
cargoWt: [
{ required: true, message: '货物重量不能为空', trigger: 'blur' }
],
cargoNum: [
{ required: true, message: '货物件数不能为空', trigger: 'blur' }
],
cargoVol: [
{ required: true, message: '货物体积不能为空', trigger: 'blur' }
],
stockName: [
{ required: true, message: '库场名称不能为空', trigger: 'blur' }
],
custName: [
{ required: true, message: '货主名称不能为空', trigger: 'blur' }
]
},
//
selectedList: [],
//
custList: [],
//
stockList: [],
// ID
tempCustId: null,
};
},
// watch: {
// billInfo() {
// this.getDetail();
// },
// modifyData() {
// this.getDetail();
// }
// },
computed: {
//
tableReadonly() {
return this.readonly || this.form.billStatus == 1;
},
tableIndexAttrs() {
if (this.tableReadonly) {
return {
label: '序号',
type: 'index',
width: '50',
}
}
return {
type: 'selection',
width: '55',
}
}
},
created() {
// this.getVesselList();
},
methods: {
// getCargoValue(row){
// const value = row.unitPrice * row.cargoWt;
// row.cargoValue = isNaN(value) ? 0 : value.toFixed(4);
// return row.cargoValue;
// },
init() {
this.getCustList();
this.getDetail();
},
// getVesselList() {
// let param = {};
// listVessel(param).then(response => {
// this.vesselList = response.data;
// }).catch(e => {
// });
// },
// setVesselDetail(vesselId) {
//
// if (!vesselId) {
// this.form.vesselName = '';
// this.form.vesselId = '';
// return;
// }
// this.vesselList.forEach(ele => {
// if (ele.id == vesselId) {
// this.form.vesselName = ele.vesselName;
// }
// });
// },
getMaxData(row) {
if (this.stockList.length) {
const index = this.stockList.findIndex(val => val.stockId === row.outStockId && val.billNumber === row.outBillNumber && val.cargoId === row.cargoId);
if (index > -1) {
const item = this.stockList[index];
return {
cargoNum: item.cargoNum,
cargoWt: item.cargoWt,
cargoValue: item.cargoValue,
cargoVol: item.cargoVol
};
}
}
return {
cargoNum: Infinity,
cargoWt: Infinity,
cargoValue: Infinity,
cargoVol: Infinity
};
},
cancel(e) {
this.$emit('close', e);
},
refreshList() {
this.$emit('refresh');
},
validate(success) {
this.$refs.form.validate(valid => {
if (valid) {
if (this.form.ckBillCargos.length === 0) {
this.$message({
message: '请添加出库明细',
type: 'warning'
});
return;
}
this.$refs.listForm.validate((listValid, checkItem) => {
if (listValid) {
const tempChoose = {};
let findRepeat = false;
let findValueEmpty = false;
this.form.ckBillCargos.forEach(val => {
const checkIdef = `${val.outStockId}/${val.outBillNumber}`;
if (tempChoose[val.cargoId] && tempChoose[val.cargoId] === checkIdef) {
findRepeat = true;
}
tempChoose[val.cargoId] = checkIdef;
if (!val.cargoWt && !val.cargoNum && !val.cargoVol) {
findValueEmpty = true;
}
});
if (findRepeat) {
this.$message({
message: '出库单重复了,请修改',
type: 'warning'
});
return;
}
if (findValueEmpty) {
this.$message({
message: '货物重量、数量、体积不能同时为空',
type: 'warning'
});
return;
}
success();
} else {
this.$message({
message: checkItem[Object.keys(checkItem)[0]][0].message,
type: 'warning'
});
}
});
}
});
},
save(submitStatus) {
if (!this.form.billNumber) {
this.$refs.billInput.updateNumber().then(res => {
this.validSendData(submitStatus);
}).catch(e => {
this.$message.error('单据编号获取失败');
});
return;
}
this.validSendData(submitStatus);
},
validSendData(submitStatus) {
this.validate(() => {
this.form.ckBillCargos.forEach(val => {
val.custId = this.form.custId;
val.custName = this.form.custName;
val.custCode = this.form.custCode;
});
const params = { ...this.form };
// 1 2
// params.billType = '2';
params.submitStatus = submitStatus;
this.loading = true;
outBill(params).then(res => {
this.loading = false;
this.cancel();
this.refreshList();
this.$message({
message: '保存成功!',
type: 'success'
});
}).catch(e => {
this.loading = false;
});
});
},
confirm() {
this.$confirm(`确定${this.form.billStatus == '1' ? '撤销' : '确认'}当前单据吗?`, '温馨提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: this.form.billStatus == '1' ? 'warning' : 'info',
}).then(() => {
if (this.form.billStatus == '1') {
//
this.loading = true;
recallOutBill(this.form.id).then(res => {
this.$message({
message: '撤销成功!',
type: 'success'
});
this.loading = false;
this.cancel();
this.refreshList();
}).catch(e => {
this.loading = false;
});
return;
}
//
this.save(true);
});
},
addStockOut() {
if (!this.form.custId) {
this.$message('请先选择货主');
return;
}
this.open = true;
},
//
getDetail() {
let billId = this.modifyData.billId || this.billInfo.id || '';
if (billId) {
this.loading = true;
getCkbillInfo(billId).then(res => {
const data = res.data || {};
if (!data.ckBillCargos) {
data.ckBillCargos = [];
}
const firstitem = data.ckBillCargos[0];
if (firstitem) {
data.custId = firstitem.custId;
data.custName = firstitem.custName;
data.custCode = firstitem.custCode;
}
this.form = data;
this.getStockList();
this.loading = false;
this.$nextTick(() => {
if (this.$refs.table) {
this.$refs.table.doLayout();
}
});
}).catch(e => {
this.loading = false;
});
}
},
//
updateStockList(list) {
this.stockList = list;
},
//
getStockList() {
if (!this.form.custId) {
return;
}
listCkstock({
custId: this.form.custId,
}).then(res => {
this.stockList = res || [];
}).catch(e => {
});
},
//
chooseStock(list) {
const noIdItems = list.map(val => {
return {
...val,
outBillNumber: val.billNumber,
outStockId: val.stockId,
billNumber: null,
stockId: null,
id: null,
// customsNo
customsNo: val.customsNo ?? "",
cargoFlow: val.cargoFlow ?? "",
file: val.file ?? [],
};
});
this.open = false;
this.form.ckBillCargos.splice(0, 0, ...noIdItems);
this.$refs.table.bodyWrapper.scrollTop = this.$refs.table.bodyWrapper.scrollHeight;
this.$nextTick(() => {
this.$refs.table.bodyWrapper.scrollTop = 0;
this.$refs.table.doLayout();
});
},
//
setCustDetail(custId) {
if (this.form.ckBillCargos.length && this.tempCustId && custId !== this.tempCustId) {
this.$confirm('切换货主会清空当前出库表单, 是否继续?', '温馨提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
showClose: false,
}).then(() => {
this.tempCustId = custId;
this.custList.forEach(ele => {
if (ele.id == custId) {
this.form.custName = ele.custName;
this.form.custCode = ele.custCode;
}
})
this.form.ckBillCargos = [];
this.selectedList = [];
this.$refs.table.clearSelection();
}).catch(() => {
this.form.custId = this.tempCustId;
});
} else {
this.tempCustId = custId;
}
},
//
getCustList() {
listCust({custBelong:1}).then(response => {
this.custList = response;
}).catch(e => {
});
},
//
selectionChange(sel) {
this.selectedList = sel;
},
//
deleteStocks() {
if (this.selectedList.length) {
this.$confirm('删除的信息将无法找回,确定删除吗?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
const serveIds = this.selectedList.filter(val => val.id).map(val => val.id).join();
const didDelete = () => {
this.form.ckBillCargos = this.form.ckBillCargos.filter(val => !this.selectedList.includes(val));
this.selectedList = [];
this.$refs.table.clearSelection();
}
if (serveIds) {
//
this.loading = true;
delCkcargo(serveIds).then(res => {
didDelete();
this.loading = false;
this.refreshList();
}).catch(e => {
this.loading = false;
})
} else {
didDelete();
}
}).catch((action) => {
});
}
},
getSummaries(param) {
const { columns, data } = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计';
return;
}
if (index < 5) {
sums[index] = '';
return;
}
const values = data.map(item => Number(item[column.property]));
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
// sums[index] += ' ';
} else {
sums[index] = '';
}
});
return sums;
}
},
}
</script>
<style scoped>
.stock-btns {
margin-top: 5px;
display: flex;
justify-content: right;
}
::v-deep .el-dialog__body {
padding-top: 5px;
}
.stock-content {
display: flex;
flex-direction: column;
height: 70vh;
}
.nomal-text {
padding: 4px 5px;
}
.margin-none {
margin: 0;
}
.desc-table {
padding: 5px;
}
::v-deep .el-table td.el-table__cell {
padding: 0;
}
::v-deep .el-table--border .el-table__cell {
padding: 0;
}
::v-deep .el-table .cell {
padding: 0;
text-align: center;
}
::v-deep .el-table--border .el-table__cell:first-child .cell {
padding-left: 0;
}
::v-deep .el-table th.el-table__cell>.cell {
padding: 0;
}
</style>

@ -0,0 +1,623 @@
<template>
<el-container style="margin-top: 10px;">
<!-- 搜索部分 -->
<el-header height="auto" style="padding: 10px 0; background-color: #fff; border-bottom: 1px solid #eaeaea;">
<SearchBlock v-model="billQuery" v-show="showSearch" size="mini" :menus="queryOption" @change="handleQuery"></SearchBlock>
</el-header>
<el-container>
<!-- 左侧单据部分 -->
<el-aside width="300px" style="border-right: 1px solid #eaeaea; padding: 10px;max-height: 90vh;">
<h3 style="margin: 0 0 10px 0; font-size: 16px; font-weight: 500;">单据列表</h3>
<BillList ref="billList" billType="2" :params="billQuery" @rowClick="billClick"></BillList>
</el-aside>
<!-- 右侧货物部分 -->
<el-main style="padding: 10px;">
<!-- 操作按钮 -->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" size="small" plain icon="el-icon-plus" @click="handleAdd('bill')"
v-hasPermi="['jxc:ckcargo:add']">新增单据</el-button>
</el-col>
<el-col :span="1.5">
<el-tooltip content="选择左侧单据号后新增明细" placement="top">
<el-button type="primary" size="small"
v-if="(this.selectedBill.sourceType == '1' && this.selectedBill.billStatus == '0')" plain icon="el-icon-plus"
@click="handleAdd('out')" v-hasPermi="['jxc:ckcargo:add']">新增明细</el-button>
</el-tooltip>
</el-col>
<el-col :span="1.5">
<el-tooltip content="选择左侧单据后删除" placement="top">
<el-button type="danger" size="small"
v-if="(this.selectedBill.sourceType == '1' && this.selectedBill.billStatus == '0')" plain icon="el-icon-delete"
@click="handleDel" v-hasPermi="['jxc:ckcargo:remove']">删除单据</el-button>
</el-tooltip>
</el-col>
<el-col :span="1.5">
<el-tooltip content="选择左侧单据号后撤销" placement="top">
<el-button plain size="small" v-if="(this.selectedBill.sourceType == '1' && this.selectedBill.billStatus == '1')"
type="warning" icon="el-icon-plus" v-hasPermi="['jxc:ckcargo:add']" @click="backBill">单据撤销</el-button>
</el-tooltip>
</el-col>
<el-col :span="1.5">
<el-tooltip content="选择左侧单据号后单据确认" placement="top">
<el-button plain size="small" v-if="(this.selectedBill.sourceType == '1' && this.selectedBill.billStatus == '0')"
type="success" icon="el-icon-plus" v-hasPermi="['jxc:ckcargo:add']" @click="confirm">单据确认</el-button>
</el-tooltip>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 货物列表 -->
<el-table v-loading="loading" highlight-current-row :data="ckcargoList" height="calc(100vh - 200px)" @sort-change="handleSortChange"
@selection-change="handleSelectionChange" border>
<el-table-column type="selection" width="55" align="center" fixed="left" />
<el-table-column label="货物名称" align="center" prop="cargoName" sortable='custom' min-width="100" fixed="left"/>
<el-table-column label="仓库名称" align="center" prop="stockCode" sortable='custom' min-width="100" fixed="left">
<template slot-scope="scope">
<WarehouseName :stockCode="scope.row.stockCode"/>
</template>
</el-table-column>
<el-table-column label="仓位名称" align="center" prop="stockName" sortable='custom' min-width="100" fixed="left"/>
<el-table-column label="货主名称" align="center" prop="custName" sortable='custom' min-width="150" />
<el-table-column label="贸易方式" align="center" prop="tradWay" sortable='custom' min-width="100">
<template slot-scope="scope">
<dict-tag :options="dict.type.trad_ways" :value="scope.row.tradWay"></dict-tag>
</template>
</el-table-column>
<!-- <el-table-column label="船舶名称" align="center" prop="vesselName" sortable='custom' min-width="100" /> -->
<!-- <el-table-column label="船舶航次" align="center" prop="voyageNo" sortable='custom' min-width="100" /> -->
<el-table-column label="数据来源" align="center" prop="sourceType" sortable='custom' min-width="100" >
<template slot-scope="scope">
<el-tag>{{scope.row.sourceType=='0'?'载货清单':scope.row.sourceType=='2'?'转场':scope.row.sourceType=='3'?'混配':'直接出库'}}</el-tag>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status" sortable='custom' min-width="100" >
<template slot-scope="scope">
<el-tag>{{scope.row.billStatus=='1'?'已确认':'未确认'}}</el-tag>
</template>
</el-table-column>
<el-table-column label="货物自然序号" align="center" prop="cargoNumber" sortable='custom' min-width="100" />
<el-table-column label="商品料号" align="center" prop="itemNumber" sortable='custom' min-width="100" />
<el-table-column label="电子账册项号" align="center" prop="bookNumber" sortable='custom' min-width="130" />
<el-table-column label="HS编号" align="center" prop="hsCode" sortable='custom' min-width="100" />
<el-table-column label="报关单号" align="center" prop="customsNo" sortable='custom' min-width="100" />
<el-table-column label="核注清单号" align="center" prop="listNumber" sortable='custom' min-width="130" />
<el-table-column label="提运单号" align="center" prop="billNo" sortable='custom' min-width="100" />
<el-table-column label="货物价值" align="center" prop="cargoValue" sortable='custom' min-width="100" />
<el-table-column label="货物重量" align="center" prop="cargoWt" sortable='custom' min-width="100" />
<el-table-column label="规格类型品质" show-overflow-tooltip align="center" prop="cargoSpec" sortable='custom' min-width="200" />
<el-table-column label="原产国" align="center" prop="originCountry" sortable='custom' min-width="100">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_origin_country" :value="scope.row.originCountry!=null ?scope.row.originCountry:''"></dict-tag>
</template>
</el-table-column>
<el-table-column label="有效期至" align="center" prop="expiryDate" min-width="180" sortable='custom'>
</el-table-column>
<el-table-column label="单据日期" align="center" prop="billDate" min-width="180" sortable='custom'>
</el-table-column>
<el-table-column label="单据编号" align="center" prop="billNumber" sortable='custom' min-width="100" />
<el-table-column label="源单据" align="center" prop="outBillNumber" sortable='custom' min-width="100" />
<el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width" width="120px">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-check" @click="showDetail(scope.row)"
v-hasPermi="['jxc:ckcargo:edit']">查看
</el-button>
<el-button size="mini" type="text" v-if="scope.row.billStatus=='0'&&scope.row.sourceType=='1'" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['jxc:ckcargo:edit']">修改
</el-button>
</template>
</el-table-column>
</el-table>
<pagination :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
<!-- 添加或修改仓库出库管理对话框 -->
<el-dialog :title="title" destroy-on-close fullscreen :visible.sync="open" append-to-body
:close-on-click-modal="false">
<StockOut ref="stockOut" :readonly="readonly" :modifyData="modifyData" :billInfo="selectedBill" @close="handleClose"
@refresh="refreshList"></StockOut>
</el-dialog>
</el-main>
</el-container>
</el-container>
</template>
<script>
import {
pageListCkcargo,
getCkcargo,
delCkcargo,
addCkcargo,
updateCkcargo,
recallOutBill,
recallPutBill, confirmPutBill, confirmOutBill
} from '@/api/ckbillcargo'
import { datePickerOpts } from "@/utils";
import BillList from '@/views/ck/ckwarehouse/components/BillList';
import StockOut from '@/views/ck/ckoutbound/components/StockOut';
import { listWarehouse } from "@/api/cmwarehouse";
import {delCkbill} from "@/api/ckbill";
import SearchBlock from '@/components/SearchBlock';
// import { listVessel } from "@/api/jxc/vessel";
export default {
name: 'Ckoutbound',
dicts: ['sys_origin_country','trad_ways'],
components: {
BillList,
StockOut,
SearchBlock,
},
data() {
return {
queryOption: [
// {
// label: '',
// prop: 'vesselId',
// type: 'select',
// getOptions: () => this.vesselList,
// optionsProp: 'id',
// optionsLabel: 'vesselName',
// },
// {
// label: '',
// prop: 'voyageNo',
// type: 'text',
// },
{
label: '核注清单号',
prop: 'listNumber',
type: 'text',
labelWidth: '90px'
},
{
label: '单据日期',
prop: 'queryTime',
type: 'daterange',
options: datePickerOpts()
},
{
label: '单据编号',
prop: 'billNumber',
type: 'text',
},
{
label: '贸易方式',
prop: 'tradWay',
type: 'select',
getOptions: () => this.dict.type.trad_ways,
},
{
label: '货物名称',
prop: 'cargoName',
type: 'text',
},
{
label: '仓库名称',
prop: 'stockCode',
type: 'select',
getOptions: () => this.warehouses,
optionsProp: 'stockCode',
optionsLabel: 'stockName',
},
{
label: '仓位名称',
prop: 'stockName',
type: 'text',
},
{
label: '源单据',
prop: 'outBillNumber',
type: 'text',
},
{
label: '报关单号',
prop: 'customsNo',
type: 'text',
},
],
pickerOptions: {
shortcuts: [{
text: '最近一周',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
picker.$emit('pick', [start, end])
}
}, {
text: '最近一个月',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
picker.$emit('pick', [start, end])
}
}, {
text: '最近三个月',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
picker.$emit('pick', [start, end])
}
}]
},
//
loading: false,
//
ids: [],
//
names: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
queryTimeTwo: [],
//
queryTime: [],
//
ckcargoList: [],
warehouses: [],
// vesselList: [],
//
title: '',
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
billId: null,
billDate: null,
billNumber: null,
inoutType: '2',
// voyageId: null,
// voyageNo: null,
// vesselId: null,
// vesselName: null,
cargoId: null,
hsCode: null,
cargoName: null,
billNo: null,
cargoSpec: null,
originCountry: null,
custId: null,
custName: null,
opType: null,
tradType: null,
cargoNum: null,
cargoWt: null,
cargoVol: null,
stockId: null,
stockCode: null,
stockName: null,
cargoValue: null,
customsNo: null,
listNumber: null,
beginDate: null,
endDate: null,
beginDateTwo: null,
endDateTwo: null
},
//
billQuery: {
billNumber: null,
cargoName: null,
stockCode: null,
stockName: null,
customsNo: null,
listNumber: null,
beginDate: null,
endDate: null,
},
selectedBill: {},
modifyData: {},
readonly: false,
//
form: {},
}
},
created() {
listWarehouse({}).then(response=>{
this.warehouses=response.data;
});
// this.getVesselList();
},
methods: {
// getVesselList() {
// let param = {};
// listVessel(param).then(response => {
// this.vesselList = response.data;
// }).catch(e => {
// });
// },
//
billClick(row) {
const isChange = this.selectedBill.id !== row.id;
this.selectedBill = row || {};
this.queryParams.billNumber = this.selectedBill.billNumber;
//
if (isChange) {
this.queryParams.pageNum = 1;
}
if (this.queryParams.billNumber) {
this.getList();
} else {
this.ckcargoList = [];
}
},
handleClose(show) {
if (!show) {
this.open = false;
return;
}
this.$confirm('关闭后未保存信息会丢失', '确认关闭?')
.then(_ => {
this.open = false;
})
.catch(_ => { });
},
//
refreshList() {
this.queryParams.billNumber = '';
if (this.billQuery.queryTime) {
this.billQuery.beginDate = this.billQuery.queryTime[0];
this.billQuery.endDate = this.billQuery.queryTime[1];
} else {
this.billQuery.beginDate = null;
this.billQuery.endDate = null;
}
this.$nextTick(() => {
this.$refs.billList.getList();
})
},
/** 查询仓库出库管理列表 */
getList() {
this.loading = true
// if (this.queryTime != null) {
// this.queryParams.beginDate = this.queryTime[0]
// this.queryParams.endDate = this.queryTime[1]
// } else {
// this.queryParams.beginDate = null
// this.queryParams.endDate = null
// }
// if (this.queryTimeTwo != null) {
// this.queryParams.beginDateTwo = this.queryTimeTwo[0]
// this.queryParams.endDateTwo = this.queryTimeTwo[1]
// } else {
// this.queryParams.beginDateTwo = null
// this.queryParams.endDateTwo = null
// }
pageListCkcargo(this.queryParams).then(response => {
this.ckcargoList = response.rows
this.total = response.total
this.loading = false
}).catch(e => {
this.loading = false
})
},
//
handleSortChange(col) {
this.$sortBy(col, this.queryParams)
this.getList()
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
//this.getList()
this.refreshList();
},
/** 重置按钮操作 */
resetQuery() {
// this.resetForm('queryForm')
this.queryTime = []
this.queryTimeTwo = []
this.billQuery = {
billNumber: null,
cargoName: null,
stockCode: null,
stockName: null,
customsNo: null,
listNumber: null,
beginDateTwo: null,
endDateTwo: null,
}
this.handleQuery()
},
backBill() {
this.$confirm(`确定撤销当前单据吗?`, '温馨提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning' ,
}).then(() => {
//
this.loading = true;
recallOutBill(this.selectedBill.id).then(res => {
this.$message({
message: '撤销成功!',
type: 'success'
});
this.loading = false;
this.refreshList();
}).catch(e => {
this.loading = false;
});
});
},
confirm() {
this.$confirm(`确定提交当前单据吗?`, '温馨提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning' ,
}).then(() => {
//
this.loading = true;
confirmOutBill(this.selectedBill.id).then(res => {
this.$message({
message: '提交成功!',
type: 'success'
});
this.loading = false;
this.refreshList();
}).catch(e => {
this.loading = false;
});
});
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.names = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
this.modifyData = selection[0] || {};
},
handleDel() {
if (this.selectedBill.billStatus == '0') {
const ids = this.selectedBill.id || this.ids;
this.$modal.confirm('是否确认删除"' + this.selectedBill.billNumber+ '"的出库单据?').then(function() {
return delCkbill(ids);
}).then(() => {
this.refreshList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
}
},
/** 新增按钮操作 */
handleAdd(type) {
this.readonly = false;
if (type === 'bill') {
this.selectedBill = {};
this.modifyData = {};
this.open = true
this.title = '新增仓库出库单据';
this.$nextTick(() => {
this.$refs.stockOut.init();
})
return;
}
if (this.selectedBill.billStatus == '1') {
this.$confirm('当前选中单据已确认,是否新增单据?', '温馨提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'info',
}).then(() => {
this.selectedBill = {};
this.modifyData = {};
this.open = true
this.title = '新增仓库出库单据';
this.$nextTick(() => {
this.$refs.stockOut.init();
})
});
return;
}
this.modifyData = {};
this.open = true
this.title = this.selectedBill.id ? '新增仓库出库明细':'新增仓库出库单据';
this.$nextTick(() => {
this.$refs.stockOut.init();
})
},
/** 修改按钮操作 */
handleUpdate(row) {
this.readonly = false;
this.modifyData = row;
this.open = true
this.title = '修改仓库出库单据';
this.$nextTick(() => {
this.$refs.stockOut.init();
})
},
/** 查看按钮操作 */
showDetail(row) {
this.readonly = true;
if (row.id) {
this.modifyData = row;
}
this.open = true;
this.title = '查看仓库出库单据';
this.$nextTick(() => {
this.$refs.stockOut.init();
})
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids
const names = row.id || this.names
this.$modal.confirm('是否确认删除"' + row.billNumber + '"的数据项?').then(function () {
return delCkcargo(ids)
}).then(() => {
this.getList()
this.$modal.msgSuccess('删除成功')
}).catch(() => {
})
},
/** 导出按钮操作 */
handleExport() {
this.download('jxc/ckcargo/export', {
...this.queryParams
}, `仓库出库管理_${new Date().getTime()}.xlsx`)
}
}
}
</script>
<style scoped>
.app-container {
display: flex;
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
}
.right-content {
flex: 1;
overflow: hidden;
display: flex;
flex-direction: column;
}
.search-item {
margin-bottom: 6px;
}
.table {
flex: 1;
}
.search-input {
max-width: 150px;
}
::v-deep .el-dialog.is-fullscreen {
display: flex;
flex-direction: column;
}
::v-deep .el-dialog__body {
padding-top: 0px;
flex: 1;
overflow: hidden;
}
</style>

@ -0,0 +1,639 @@
<template>
<div class="app-container">
<div v-if="show==0">
<SearchBlock v-model="queryParams" v-show="showSearch" size="mini" :menus="queryOption"
@change="handleQuery"></SearchBlock>
<!-- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">-->
<!-- <el-form-item label="货物名称" prop="cargoName">-->
<!-- <el-input-->
<!-- v-model="queryParams.cargoName"-->
<!-- placeholder="请输入货物名称"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="货主名称" prop="custName">-->
<!-- <el-input-->
<!-- v-model="queryParams.custName"-->
<!-- placeholder="请输入货主名称"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item>-->
<!-- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>-->
<!-- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
</el-col>
<el-col :span="1.5">
</el-col>
<el-col :span="1.5">
</el-col>
<!-- <el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['jxc:ckstock:export']"
>导出
</el-button>
</el-col>-->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" highlight-current-row :data="ckstockList" @sort-change="handleSortChange"
@selection-change="handleSelectionChange" border>
<el-table-column type="selection" width="55" align="center"/>
<!-- <el-table-column label="货物自然序号" align="center" prop="cargoNumber" sortable='custom'/>-->
<el-table-column label="商品编码" align="center" prop="hsCode" sortable='custom'/>
<el-table-column label="货物名称" align="center" prop="cargoName" sortable='custom'/>
<el-table-column label="货主名称" align="center" prop="custName" sortable='custom'/>
<el-table-column label="数量" align="center" prop="cargoNum" sortable='custom'/>
<el-table-column label="重量" align="center" prop="cargoWt" sortable='custom'/>
<el-table-column label="体积" align="center" prop="cargoVol" sortable='custom'/>
<!-- <el-table-column label="规格类型品质" align="center" prop="cargoSpec" sortable='custom' />-->
<el-table-column label="原产国" align="center" prop="originCountry" sortable='custom' width="100">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_origin_country"
:value="scope.row.originCountry != null ? scope.row.originCountry : ''"></dict-tag>
</template>
</el-table-column>
<!-- <el-table-column label="盘点日期" align="center" prop="updateTime" sortable='custom'/>-->
<el-table-column label="入库日期" align="center" prop="stockDate" sortable='custom'>
<template slot-scope="{ row }">
{{ formatDate(row.stockDate) }}
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width" width="120px">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['jxc:ckstock:edit']"
>库存明细
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
<div v-if="show == 1 ">
<div>
<el-button @click="cancel" style="right: 3%;position:absolute;"> </el-button>
<br>
<br>
<el-table v-loading="loading" highlight-current-row :data="ckstockDetailList" @sort-change="handleSortChange"
@selection-change="handleSelectionChange" border>
<!-- <el-table-column type="selection" width="55" align="center"/>-->
<el-table-column label="单据信息" align="center">
<el-table-column label="入库日期" align="center" prop="stockDate" width="180" sortable='custom'>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.stockDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="单据编号" align="center" prop="billNumber" sortable='custom' width="100"/>
</el-table-column>
<el-table-column label="船舶信息" align="center">
<el-table-column label="航次号" align="center" prop="voyageNo" sortable='custom' width="100"/>
<el-table-column label="船舶名称" align="center" prop="vesselName" sortable='custom' width="100"/>
</el-table-column>
<el-table-column label="货物信息" align="center">
<el-table-column label="库场名称" align="center" prop="stockCode" sortable='custom' width="100">
<template slot-scope="scope">
<WarehouseName :stockCode="scope.row.stockCode"/>
</template>
</el-table-column>
<el-table-column label="仓位名称" align="center" prop="stockName" sortable='custom' width="100"/>
<el-table-column label="货主名称" align="center" prop="custName" sortable='custom' width="100"/>
<el-table-column label="货物名称" align="center" prop="cargoName" sortable='custom' width="100"/>
<el-table-column label="货物自然序号" align="center" prop="cargoNumber" sortable='custom' width="130"/>
<el-table-column label="商品料号" align="center" prop="itemNumber" sortable='custom' width="100"/>
<el-table-column label="电子账册项号" align="center" prop="bookNumber" sortable='custom' width="130"/>
<el-table-column label="HS编号" align="center" prop="hsCode" sortable='custom' width="100"/>
<el-table-column label="报关单号" align="center" prop="customsNo" sortable='custom' width="100"/>
<el-table-column label="核注清单号" align="center" prop="listNumber" sortable='custom' width="130"/>
<el-table-column label="货物价值" align="center" prop="cargoValue" sortable='custom' width="100"/>
<el-table-column label="提运单号" align="center" prop="billNo" sortable='custom' width="100"/>
<el-table-column label="规格类型品质" show-overflow-tooltip align="center" prop="cargoSpec" sortable='custom'
min-width="200"/>
<el-table-column label="原产国" align="center" prop="originCountry" sortable='custom' width="100">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_origin_country"
:value="scope.row.originCountry != null ? scope.row.originCountry : ''"></dict-tag>
</template>
</el-table-column>
<el-table-column label="业务性质" align="center" prop="opType" sortable='custom' width="100">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_business_nature" :value="scope.row.opType"/>
</template>
</el-table-column>
<el-table-column label="贸易性质" align="center" prop="tradType" sortable='custom' width="100">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_trade_nature" :value="scope.row.tradType"/>
</template>
</el-table-column>
<el-table-column label="货物件数" align="center" prop="cargoNum" sortable='custom' width="130"/>
<el-table-column label="货物重量" align="center" prop="cargoWt" sortable='custom' width="130"/>
<el-table-column label="货物体积" align="center" prop="cargoVol" sortable='custom' width="130"/>
</el-table-column>
<el-table-column label="有效期至" align="center" prop="expiryDate" width="180" sortable='custom'>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.expiryDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
</el-table>
<pagination
:total="detailTotal"
:page.sync="detailParams.pageNum"
:limit.sync="detailParams.pageSize"
@pagination="handleUpdate"
/>
</div>
</div>
</div>
</template>
<script>
import {
newList,
getCkstock,
// delCkstock,
// addCkstock,
// updateCkstock,
newListCkstock,
ckcargostockListApi as pageListCkstock
} from '@/api/ckcargostock';
import {listStock} from "@/api/cmstock";
import {listCust} from "@/api/cmcust";
import {listCargo} from "@/api/cmcustproduct";
// import {listVessel,} from "@/api/jxc/vessel";
// import {listBmvoyage} from "@/api/jxc/bmvoyage";
import {datePickerOpts} from "@/utils";
import {listWarehouse} from "@/api/cmwarehouse";
import SearchBlock from '@/components/SearchBlock';
export default {
name: "Ckstock",
components: {
SearchBlock,
},
dicts: ['sys_business_nature', 'sys_trade_nature', 'sys_origin_country'],
data() {
return {
queryOption: [
{
label: '货物名称',
prop: 'cargoName',
type: 'text',
},
{
label: '商品编码',
prop: 'hsCode',
type: 'text',
},
{
label: '货主名称',
prop: 'custName',
type: 'text',
},
],
activeName: ['1', '2', '3'],
show: 0,
tableData: [{
id: 3,
cargoName: '铁',
stockName: '1号库场',
custName: '王晓敏',
cargoNum: '1519 ',
cargoWt: '11',
cargoVol: '120',
}, {
id: 31,
cargoName: '铁',
stockName: '1号库场',
custName: '王晓敏',
cargoNum: '519 ',
cargoWt: '10',
cargoVol: '100',
},
],
//
warehouses: [],
//
loading: true,
//
ids: [],
//
names: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
queryTime: [],
// newListCkstockList
newListCkstockList: [],
//
bmvoyageList: [],
//
vesselList: [],
//
custList: [],
//
cargoList: [],
//
stockList: [],
//
ckstockList: [],
ckstockDetailList: [],
detailTotal: 0,
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
stockDate: null,
billNumber: null,
voyageId: null,
voyageNo: null,
vesselId: null,
vesselName: null,
cargoId: null,
hsCode: null,
cargoName: null,
billNo: null,
cargoSpec: null,
originCountry: null,
custId: null,
custName: null,
opType: null,
tradType: null,
cargoNum: null,
cargoWt: null,
cargoVol: null,
stockId: null,
stockCode: null,
stockName: null,
cargoValue: null,
customsNo: null,
listNumber: null,
cargoNumber: null,
itemNumber: null,
bookNumber: null,
expiryDate: null,
},
//
detailParams: {
pageNum: 1,
pageSize: 10,
cargoId: null,
},
//
form: {},
//
rules: {
stockId: [
{required: true, message: "库场ID不能为空", trigger: "blur"}
],
stockDate: [
{required: true, message: "入库日期不能为空", trigger: "blur"}
],
billNumber: [
{required: true, message: "单据编号不能为空", trigger: "blur"}
],
voyageNo: [
{required: true, message: "航次号不能为空", trigger: "blur"}
],
vesselName: [
{required: true, message: "船舶名称不能为空", trigger: "blur"}
],
cargoName: [
{required: true, message: "货物名称不能为空", trigger: "blur"}
],
billNo: [
{required: true, message: "提运单号不能为空", trigger: "blur"}
],
custName: [
{required: true, message: "货主名称不能为空", trigger: "blur"}
],
opType: [
{required: true, message: "业务性质不能为空", trigger: "blur"}
],
tradType: [
{required: true, message: "贸易性质不能为空", trigger: "blur"}
],
stockName: [
{required: true, message: "库场名称不能为空", trigger: "blur"}
],
}
};
},
created() {
this.getList();
this.getStockList();
this.getCustList();
this.getCargoList();
this.getVesselList();
this.getBmvoyage();
this.getNewListCkstock();
listWarehouse({}).then(response => {
this.warehouses = response.data;
});
},
methods: {
formatDate(timestamp) {
const date = new Date(timestamp);
return date.toISOString().split('T')[0];
},
getNewListCkstock() {
let param = {};
newListCkstock(param).then(response => {
this.newListCkstockList = response.data;
}).catch(e => {
});
},
//
// setBmvoyageDetail(voyageId) {
//
// this.bmvoyageList.forEach(ele => {
// if (ele.id == voyageId) {
// this.form.voyageNo = ele.voyageNo;
// this.form.vesselName = ele.vesselName;
// this.form.deptId = ele.deptId;
// this.form.vesselId = ele.vesselId;
// this.form.netTon = ele.netTon;
// this.form.opType = ele.opType;
//
//
// }
// })
// },
getBmvoyage() {
let param = {};
listBmvoyage(param).then(response => {
this.bmvoyageList = response.data;
}).catch(e => {
});
},
//
setVesselDetail(vesselId) {
console.log(vesselId);
this.vesselList.forEach(ele => {
if (ele.id == vesselId) {
console.log("aa:", ele.vesselName);
this.form.vesselName = ele.vesselName;
}
})
},
getVesselList() {
let param = {};
listVessel(param).then(response => {
this.vesselList = response.data;
}).catch(e => {
});
},
//
setCargoDetail(cargoId) {
this.cargoList.forEach(ele => {
if (ele.id == cargoId) {
this.form.cargoName = ele.cargoName;
this.form.hsCode = ele.hsCode;
this.form.cargoSpec = ele.cargoSpec;
this.form.originCountry = ele.originCountry;
}
})
},
getCargoList() {
let param = {};
listCargo(param).then(response => {
this.cargoList = response.data;
}).catch(e => {
});
},
//
setCustDetail(custId) {
this.custList.forEach(ele => {
if (ele.id == custId) {
this.form.custName = ele.custName;
this.form.custCode = ele.custCode;
}
})
},
getCustList() {
let param = {};
listCust(param).then(response => {
this.custList = response.data;
}).catch(e => {
});
},
//
setStockDetail(stockId) {
this.stockList.forEach(ele => {
if (ele.id == stockId) {
this.form.stockName = ele.stockName;
this.form.stockCode = ele.stockCode;
}
})
},
getStockList() {
let param = {};
listStock(param).then(response => {
this.stockList = response.data;
}).catch(e => {
});
},
/** 查询仓库库存列表 */
getList() {
this.loading = true;
newList(this.queryParams).then(response => {
this.ckstockList = response.list;
this.total = response.total;
this.loading = false;
}).catch(e => {
this.loading = false;
});
},
//
cancel() {
this.show = 0;
this.reset();
},
//
reset() {
this.form = {
id: null,
stockDate: null,
billNumber: null,
voyageId: null,
voyageNo: null,
vesselId: null,
vesselName: null,
cargoId: null,
hsCode: null,
cargoName: null,
billNo: null,
cargoSpec: null,
originCountry: null,
custId: null,
custName: null,
opType: null,
tradType: null,
cargoNum: null,
cargoWt: null,
cargoVol: null,
stockId: null,
stockCode: null,
stockName: null,
remark: null,
cargoValue: null,
customsNo: null,
listNumber: null,
cargoNumber: null,
itemNumber: null,
bookNumber: null,
expiryDate: null,
};
this.resetForm("form");
},
//
handleSortChange(col) {
this.$sortBy(col, this.queryParams);
this.getList();
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id);
this.names = selection.map(item => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加仓库库存";
},
/** 详情按钮操作 */
handleUpdate(row) {
if (row) {
this.detailParams.cargoId = row.cargoId,
this.detailParams.custId = row.custId
}
pageListCkstock(this.detailParams).then(response => {
this.ckstockDetailList = response.list;
this.detailTotal = response.total;
this.show = 1;
}).catch(e => {
});
},
/** 提交按钮 */
// submitForm() {
// this.$refs["form"].validate(valid => {
// if (valid) {
// if (this.form.id != null) {
// updateCkstock(this.form).then(response => {
// this.$modal.msgSuccess("");
// this.open = false;
// this.getList();
// });
// } else {
// addCkstock(this.form).then(response => {
// this.$modal.msgSuccess("");
// this.open = false;
// this.getList();
// });
// }
// }
// });
// },
/** 删除按钮操作 */
// handleDelete(row) {
// const ids = row.id || this.ids;
// const names = row.id || this.names;
// this.$modal.confirm('"' + row.billNumber + '"').then(function () {
// return delCkstock(ids);
// }).then(() => {
// this.getList();
// this.$modal.msgSuccess("");
// }).catch(() => {
// });
// },
/** 导出按钮操作 */
handleExport() {
this.download('jxc/ckstock/export', {
...this.queryParams
}, `库场货物查询_${new Date().getTime()}.xlsx`)
}
}
};
</script>

@ -211,17 +211,11 @@
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">文件上传</template>
<div v-if="tableReadonly" class="nomal-text">
<el-form-item label="附件" prop="file">
<FileUpload
v-model="scope.row.file"
></FileUpload>
</el-form-item>
</div>
<el-form-item v-else prop="file" class="margin-none">
<FileUpload
v-model="scope.row.file"
></FileUpload>
<el-form-item prop="fileUploadFiles" class="margin-none">
<FileUploadVO
:value="scope.row.fileUploadFiles"
@input="updateFile($event, scope.row)"
></FileUploadVO>
</el-form-item>
</el-descriptions-item>
</el-descriptions>
@ -279,7 +273,7 @@ import { cmstoragelocationListByAll as listLocation } from "@/api/cmstoragelocat
import { ckbillDetailApi as getCkbillInfo, putBill } from '@/api/ckbill';
import { ckbillcargoDeleteApi as delCkcargo, recallPutBill } from '@/api/ckbillcargo';
// import { listVessel } from "@/api/jxc/vessel";
import FileUpload from "@/components/FileUploadVO";
import FileUploadVO from "@/components/FileUploadVO/index.vue";
import MyFormItemInput from "@/components/MyFormItemInput";
import rq from "@/components/Rq";
import BillNumberInput from "@/components/BillNumberInput";
@ -287,7 +281,7 @@ import BillNumberInput from "@/components/BillNumberInput";
export default {
name: 'BillEdit',
components: {
FileUpload,
FileUploadVO,
MyFormItemInput,
rq,
BillNumberInput,
@ -427,6 +421,12 @@ export default {
// type: 0 1 2data: billInfodata
open({ type, data }) {
this.type = type;
// form
if (type === 1) {
this.form = {
ckBillCargos: []
};
}
//console.log("data", data);
this.getCargoList();
this.getCustList();
@ -445,10 +445,33 @@ export default {
if (billId) {
this.loading = true;
getCkbillInfo(billId).then(res => {
const data = res.data || {};
const data = res || {};
if (!data.ckBillCargos) {
data.ckBillCargos = [];
}
// HS
data.ckBillCargos.forEach(item => {
// hsCodegoodsCodehsCodegoodsCode
if (item.hsCode && !item.goodsCode) {
item.goodsCode = item.hsCode;
}
// fileFileUploadVO
if (item.file && item.file.length > 0) {
item.fileUploadFiles = item.file.map((file, index) => ({
attachFileUrl: file.attDir || file.filePath || file.url || '',
attDir: file.attDir || file.filePath || file.url || '',
name: file.name || file.fileName || '',
oldName: file.name || file.fileName || '',
attId: file.attId || '',
uid: file.id || file.fileId || index + new Date().getTime()
}));
} else {
item.fileUploadFiles = [];
}
});
const firstitem = data.ckBillCargos[0];
if (firstitem) {
data.custId = firstitem.custId;
@ -456,7 +479,74 @@ export default {
data.custCode = firstitem.custCode;
}
//
data.ckBillCargos.forEach(item => {
//
if (item.shelfId) {
//
// API
// APIIDAPI
//
if (!item.shelfName) {
item.shelfName = '货架 ' + item.shelfId;
}
}
//
if (item.locationId) {
//
//
if (!item.locationName) {
item.locationName = '货位 ' + item.locationId;
}
}
});
//
this.form = data;
//
if (data.ckBillCargos.length > 0) {
data.ckBillCargos.forEach(item => {
if (item.stockCode) {
// ID
const warehouse = this.warehouseList.find(warehouseItem => warehouseItem.stockCode === item.stockCode);
if (warehouse) {
//
const currentShelfId = item.shelfId;
const currentLocationId = item.locationId;
//
this.getShelfList(warehouse.id).then(() => {
//
setTimeout(() => {
// ID
if (currentShelfId) {
const shelf = this.shelfList.find(shelfItem => shelfItem.id === currentShelfId);
if (shelf) {
item.shelfName = shelf.shelfName;
//
this.getLocationList(currentShelfId).then(() => {
//
setTimeout(() => {
// ID
if (currentLocationId) {
const location = this.locationList.find(locationItem => locationItem.id === currentLocationId);
if (location) {
item.locationName = location.storageLocationName;
}
}
}, 100);
});
}
}
}, 100);
});
}
}
});
}
if (type === 1) {
this.addBillTable();
}
@ -630,6 +720,9 @@ export default {
stockName: '',
shelfName: '',
locationName: '',
file: [], //
fileUploadFiles: [], // FileUploadVO
fileId: '',
});
this.$refs.table.bodyWrapper.scrollTop = this.$refs.table.bodyWrapper.scrollHeight;
this.$nextTick(() => {
@ -644,13 +737,13 @@ export default {
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
const serveIds = this.selectedList.filter(val => val.id).map(val => val.id).join();
const serveIds = this.selectedList.filter(val => val.id).map(val => val.id);
const didDelete = () => {
this.form.ckBillCargos = this.form.ckBillCargos.filter(val => !this.selectedList.includes(val));
this.selectedList = [];
this.$refs.table.clearSelection();
}
if (serveIds) {
if (serveIds && serveIds.length > 0) {
//
this.loading = true;
delCkcargo(serveIds).then(res => {
@ -683,8 +776,9 @@ export default {
if (ele.id == cargoId) {
form.cargoName = ele.cargoName;
form.goodsCode = ele.goodsCode;
form.cargoSpec = ele.cargoSpec;
form.originCountry = ele.originCountry;
// 使cargoListspeccargoSpec
form.cargoSpec = ele.spec || '';
// originCountry
}
})
},
@ -716,20 +810,28 @@ export default {
},
//
getShelfList(warehouseId) {
listShelf({ warehouseId }).then(response => {
this.shelfList = response || [];
}).catch(e => {
console.error('获取货架列表失败:', e);
this.shelfList = [];
return new Promise((resolve, reject) => {
listShelf({ warehouseId }).then(response => {
this.shelfList = response || [];
resolve();
}).catch(e => {
console.error('获取货架列表失败:', e);
this.shelfList = [];
resolve(); // 使resolve
});
});
},
//
getLocationList(shelfId) {
listLocation({ shelfId }).then(response => {
this.locationList = response || [];
}).catch(e => {
console.error('获取货位列表失败:', e);
this.locationList = [];
return new Promise((resolve, reject) => {
listLocation({ shelfId }).then(response => {
this.locationList = response || [];
resolve();
}).catch(e => {
console.error('获取货位列表失败:', e);
this.locationList = [];
resolve(); // 使resolve
});
});
},
//
@ -798,6 +900,57 @@ export default {
// }).catch(e => {
// });
// },
//
updateFile(files, row) {
// FileUploadVO
row.fileUploadFiles = files;
// fileId
if (files && files.length > 0) {
const newId = Date.now() + Math.floor(Math.random() * 1000);
row.fileId = String(newId);
// FileUploadVOSystemAttachment
row.file = files.map(file => {
//
let attDir = file.attDir || file.attachFileUrl || '';
// /file/public/
if (attDir.startsWith('/file/public/')) {
attDir = attDir.replace('/file/public/', '');
} else if (attDir.startsWith('/file/')) {
attDir = attDir.replace('/file/', '');
}
return {
// SystemAttachment
attId: file.id || file.attId || String(newId), //
name: file.name || file.oldName || '', //
attDir: attDir, //
attSize: file.attSize || '', //
attType: file.attType || '', //
//
fileName: file.name || file.oldName || '',
filePath: attDir,
url: attDir,
createTime: null,
createdBy: null,
createTimeStr: null,
delFlag: '0',
updateBy: null,
updateTime: null,
i18nCode: '',
i18nLanguage: '',
originalFileName: file.name || file.oldName || '',
position: 0,
remark: file.remark || '',
sort: 0,
status: ''
}
});
} else {
row.fileId = '';
row.file = [];
row.fileUploadFiles = [];
}
},
}
}
</script>

@ -86,10 +86,21 @@ export default {
getList() {
this.loading = true;
this.queryParams.billType = this.billType;
stockPageListCkbill({
// dateBegin/dateEnd beginDate/endDate
const requestParams = {
...this.queryParams,
...this.params
}).then(response => {
};
//
if (requestParams.dateBegin) {
requestParams.beginDate = requestParams.dateBegin;
delete requestParams.dateBegin;
}
if (requestParams.dateEnd) {
requestParams.endDate = requestParams.dateEnd;
delete requestParams.dateEnd;
}
stockPageListCkbill(requestParams).then(response => {
this.list = response.list || [];
this.total = response.total;

@ -124,7 +124,7 @@
import { datePickerOpts } from "@/utils";
import SearchBlock from '@/components/SearchBlock';
import {
ckbillcargoListApi as pageListCkcargo,
ckbillcargoListApi,
ckbillcargoDeleteApi as delCkcargo,
recallPutBill,
confirmPutBill
@ -164,8 +164,9 @@ export default {
},
{
label: '单据日期',
prop: 'queryTime',
prop: 'date',
type: 'daterange',
splitDaterange: true,
options: datePickerOpts()
},
{
@ -269,6 +270,7 @@ export default {
listNumber: null,
beginDate: null,
endDate: null,
queryTime: null,
},
//
selectedBill: {},
@ -278,7 +280,7 @@ export default {
},
created() {
listWarehouse({}).then(response => {
this.warehouses = response.data || [];
this.warehouses = response || [];
}).catch(error => {
console.error('获取仓库列表失败:', error);
this.warehouses = [];
@ -303,13 +305,6 @@ export default {
//
refreshList() {
this.queryParams.billNumber = '';
if (this.billQuery.queryTime) {
this.billQuery.beginDate = this.billQuery.queryTime[0];
this.billQuery.endDate = this.billQuery.queryTime[1];
} else {
this.billQuery.beginDate = null;
this.billQuery.endDate = null;
}
this.$nextTick(() => {
this.$refs.billList.getList();
})
@ -317,7 +312,27 @@ export default {
/** 查询仓库入库管理列表 */
getList() {
this.loading = true;
pageListCkcargo(this.queryParams).then(response => {
//
const params = { ...this.queryParams };
//
if (Array.isArray(params.beginDate)) {
params.beginDate = params.beginDate[0];
}
if (Array.isArray(params.endDate)) {
params.endDate = params.endDate[1];
}
// yyyy-MM-dd HH:mm:ss
// if (params.beginDate && typeof params.beginDate === 'object') {
// params.beginDate = this.formatDate(params.beginDate, false);
// }
// if (params.endDate && typeof params.endDate === 'object') {
// params.endDate = this.formatDate(params.endDate, true);
// }
ckbillcargoListApi(params).then(response => {
this.ckcargoList = response.list;
this.total = response.total;
this.loading = false;
@ -338,12 +353,53 @@ export default {
},
//
handleSortChange(col) {
//
const beginDate = this.queryParams.beginDate;
const endDate = this.queryParams.endDate;
this.$sortBy(col, this.queryParams);
//
this.queryParams.beginDate = beginDate;
this.queryParams.endDate = endDate;
this.getList();
},
/** 格式化日期为 yyyy-MM-dd 格式 */
formatDate(date) {
if (!date) return null;
let dateObj;
if (typeof date === 'string') {
dateObj = new Date(date);
} else if (date instanceof Date) {
dateObj = date;
} else {
return null;
}
if (isNaN(dateObj.getTime())) {
return null;
}
const year = dateObj.getFullYear();
const month = String(dateObj.getMonth() + 1).padStart(2, '0');
const day = String(dateObj.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
//
this.queryParams.beginDate = this.billQuery.dateBegin || null;
this.queryParams.endDate = this.billQuery.dateEnd || null;
// queryParams
this.queryParams.stockCode = this.billQuery.stockCode;
this.queryParams.cargoName = this.billQuery.cargoName;
this.queryParams.billNumber = this.billQuery.billNumber;
this.queryParams.customsNo = this.billQuery.customsNo;
this.queryParams.listNumber = this.billQuery.listNumber;
this.refreshList();
},
/** 重置按钮操作 */
@ -356,8 +412,8 @@ export default {
stockName: null,
customsNo: null,
listNumber: null,
beginDateTwo: null,
endDateTwo: null,
dateBegin: null,
dateEnd: null,
}
this.handleQuery();
},
@ -384,15 +440,10 @@ export default {
/** 新增按钮操作 */
handleAdd(type) {
this.hideEdit = false;
this.title = "添加";
if (type === 'bill') {
this.open = true;
this.$nextTick(() => {
if (this.$refs.billEdit) {
this.$refs.billEdit.open({ type: 1 });
} else {
console.error('BillEdit component not found');
}
this.$refs.billEdit.open({ type: 1 });
})
return;
}
@ -404,22 +455,14 @@ export default {
}).then(() => {
this.open = true;
this.$nextTick(() => {
if (this.$refs.billEdit) {
this.$refs.billEdit.open({ type: 1 });
} else {
console.error('BillEdit component not found');
}
this.$refs.billEdit.open({ type: 1 });
})
});
return;
}
this.open = true;
this.$nextTick(() => {
if (this.$refs.billEdit) {
this.$refs.billEdit.open({ type: 1, data: this.selectedBill });
} else {
console.error('BillEdit component not found');
}
this.$refs.billEdit.open({ type: 1, data: this.selectedBill });
})
},
backBill() {
@ -462,37 +505,21 @@ export default {
});
});
},
/** 修改按钮操作 */
handleUpdate(row) {
this.hideEdit = row.billStatus == '1';
this.title = "修改";
this.open = true;
this.$nextTick(() => {
if (this.$refs.billEdit) {
this.$refs.billEdit.open({ type: 0, data: row });
} else {
console.error('BillEdit component not found');
}
this.$refs.billEdit.open({ type: 0, data: row });
})
},
showDetail(row) {
this.hideEdit = true;
this.title = "查看";
this.open = true;
this.$nextTick(() => {
console.log(row.id)
if (this.$refs.billEdit) {
// rowbillId
const data = row.id ? row : this.modifyData;
console.log(data)
this.$refs.billEdit.open({ type: 2, data: data });
} else {
console.error('BillEdit component not found');
}
this.$refs.billEdit.open({ type: 2, data: row.id ? row : this.modifyData });
})
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;

@ -0,0 +1,731 @@
<template>
<div class="app-container">
<SearchBlock v-model="queryParams" v-show="showSearch" size="mini" :menus="queryOption" @change="handleQuery"></SearchBlock>
<!-- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="单据编号" prop="billNumber">
<el-input
v-model="queryParams.billNumber"
placeholder="请输入单据编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="航次号" prop="voyageNo">
<el-input
v-model="queryParams.voyageNo"
placeholder="请输入航次号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="船舶名称" prop="vesselName">
<el-input
v-model="queryParams.vesselName"
placeholder="请输入船舶名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="货物名称" prop="cargoName">
<el-input
v-model="queryParams.cargoName"
placeholder="请输入货物名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="仓库名称" prop="stockCode" class="search-item">
<el-select v-model="queryParams.stockCode" filterable placeholder="请选择">
<el-option v-for="dict in warehouses" :key="dict.stockCode" :label="dict.stockName" :value="dict.stockCode">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="仓位名称" prop="stockName" class="search-item">
<el-select v-model="queryParams.stockName" filterable placeholder="请选择">
<el-option v-for="dict in stockList" :key="dict.stockName" :label="dict.stockName" :value="dict.stockName">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="报关单号" prop="customsNo">
<el-input
v-model="queryParams.customsNo"
placeholder="请输入报关单号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="核注清单号" prop="listNumber" >
<el-input
v-model="queryParams.listNumber"
placeholder="请输入核注清单号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="项号" prop="bookNumber" >
<el-input
v-model="queryParams.bookNumber"
placeholder="请输入项号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="单据日期" prop="queryTime">
<el-date-picker clearable
v-model="queryTime"
type="daterange"
:picker-options="pickerOptions"
value-format="yyyy-MM-dd"
end-placeholder="结束日期"
range-separator="-" start-placeholder="开始日期"
placeholder="请选择单据日期">
</el-date-picker>
</el-form-item>
<el-form-item label="有效期至" prop="queryTime">
<el-date-picker clearable
v-model="queryTimeTwo"
size="small"
:picker-options="pickerOptions"
end-placeholder="结束日期"
range-separator="-" start-placeholder="开始日期" type="daterange"
value-format="yyyy-MM-dd"
placeholder="请选择有效期至">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form> -->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['jxc:ckcargo:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" highlight-current-row :data="ckcargoList" @sort-change="handleSortChange" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="单据编号" align="center" prop="billNumber" sortable='custom' width="100"/>
<el-table-column label="单据日期" align="center" prop="billDate" width="180" sortable='custom'>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.billDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="仓库名称" align="center" prop="stockCode" sortable='custom' width="120">
<template slot-scope="scope">
{{scope.row.stockName}}/{{scope.row.shelfName}}/{{scope.row.locationName}}
</template>
</el-table-column>
<el-table-column label="仓位名称" align="center" prop="stockName" sortable='custom' width="100" v-if="false"/>
<el-table-column label="货主名称" align="center" prop="custName" sortable='custom' width="100"/>
<el-table-column label="商品编码" align="center" prop="hsCode" sortable='custom' width="100"/>
<el-table-column label="货物名称" align="center" prop="cargoName" sortable='custom' width="100"/>
<el-table-column label="入库库件数" align="center" prop="cargoNum" sortable='custom' width="130"/>
<el-table-column label="入库重量" align="center" prop="cargoWt" sortable='custom' width="130"/>
<el-table-column label="入库体积" align="center" prop="cargoVol" sortable='custom' width="130"/>
<el-table-column label="入库货物价值" align="center" prop="cargoValue" sortable='custom' width="130"/>
<el-table-column label="货物自然序号" align="center" prop="cargoNumber" sortable='custom'width="130" />
<el-table-column label="商品料号" align="center" prop="itemNumber" sortable='custom' width="100" />
<el-table-column label="电子账册项号" align="center" prop="bookNumber" sortable='custom' width="130"/>
<el-table-column label="HS编号" align="center" prop="hsCode" sortable='custom'width="100" />
<el-table-column label="货物名称" align="center" prop="cargoName" sortable='custom' width="100"/>
<el-table-column label="规格类型品质" show-overflow-tooltip align="center" prop="cargoSpec" sortable='custom' min-width="200"/>
<el-table-column label="原产国" align="center" prop="originCountry" sortable='custom' width="100">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_origin_country"
:value="scope.row.originCountry != null ? scope.row.originCountry : ''"></dict-tag>
</template>
</el-table-column>
<el-table-column label="报关单号" align="center" prop="customsNo" sortable='custom' width="100"/>
<el-table-column label="核注清单号" align="center" prop="listNumber" sortable='custom' width="130"/>
<el-table-column label="提运单号" align="center" prop="billNo" sortable='custom' width="100"/>
<el-table-column label="贸易性质" align="center" prop="tradType" sortable='custom' width="100">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_trade_nature" :value="scope.row.tradType"/>
</template>
</el-table-column>
<!-- <el-table-column label="船舶信息" align="center">-->
<!-- <el-table-column label="航次号" align="center" prop="voyageNo" sortable='custom' width="100"/>-->
<!-- <el-table-column label="船舶名称" align="center" prop="vesselName" sortable='custom' width="100"/>-->
<!-- </el-table-column>-->
<el-table-column label="有效期至" align="center" prop="expiryDate" width="180" sortable='custom'>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.expiryDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
</el-table>
<el-row>
<el-col :span="12" class="text-right" style=" margin-top: 10px; margin-left: 10px">
<span style="font-size: 16px">总重量: {{ totalWeight }}</span>
</el-col>
</el-row>
<pagination
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { ckbillcargoListApi as pageListCkcargo, ckbillcargoDetailApi as getCkcargo, ckbillcargoDeleteApi as delCkcargo, ckbillcargoCreateApi as addCkcargo, ckbillcargoUpdateApi as updateCkcargo,selectTotalWt } from "@/api/ckbillcargo";
// import { listStock } from "@/api/jxc/stock";
import { cmcustListByAll as listCust } from "@/api/cmcust";
import { cmcustproductListByAll as listCargo } from "@/api/cmcustproduct";
// import {listVessel,} from "@/api/jxc/vessel";
// import {listBmvoyage} from "@/api/jxc/bmvoyage";
import {listWarehouse} from "@/api/cmwarehouse";
import { cmshelfListByAll as listShelf } from "@/api/cmshelf";
import { datePickerOpts } from "@/utils";
import SearchBlock from '@/components/SearchBlock';
import WarehouseName from '@/components/WarehouseName';
export default {
name: "Instock",
components: {
SearchBlock,
WarehouseName,
},
dicts: ['sys_business_nature', 'sys_trade_nature','sys_inbound_outbound_type','sys_origin_country'],
data() {
return {
//
queryOption: [
{
label: '仓库名称',
prop: 'stockCode',
type: 'select',
getOptions: () => this.warehouses,
optionsProp: 'stockCode',
optionsLabel: 'stockName',
},
{
label: '项号',
prop: 'bookNumber',
type: 'text',
},
{
label: '核注清单号',
prop: 'listNumber',
type: 'text',
labelWidth: '90px'
},
{
label: '有效期至',
prop: 'excTime',
type: 'daterange',
options: datePickerOpts()
},
{
label: '单据编号',
prop: 'billNumber',
type: 'text',
},
// {
// label: '',
// prop: 'vesselName',
// type: 'text',
// },
{
label: '商品编码',
prop: 'hsCode',
type: 'text',
},
{
label: '货物名称',
prop: 'cargoName',
type: 'text',
},
// {
// label: '',
// prop: 'voyageNo',
// type: 'text',
// },
{
label: '货架名称',
prop: 'shelfName',
type: 'select',
getOptions: () => this.shelfList,
optionsProp: 'shelfName',
optionsLabel: 'shelfName',
},
{
label: '报关单号',
prop: 'customsNo',
type: 'text',
},
{
label: '单据日期',
prop: 'queryTime',
type: 'daterange',
options: datePickerOpts()
},
{
label: '货主名称',
prop: 'custName',
type: 'text',
},
{
label: '贸易性质',
prop: 'tradType',
type: 'select',
getOptions: () => this.dict.type.sys_trade_nature,
},
],
activeName: ['1', '2', '3'],
pickerOptions: {
shortcuts: [{
text: '最近一周',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit('pick', [start, end]);
}
}, {
text: '最近一个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit('pick', [start, end]);
}
}, {
text: '最近三个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit('pick', [start, end]);
}
}]
},
totalWeight: 0,
//
loading: true,
//
ids: [],
//
names: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
queryTimeTwo: [],
//
queryTime: [],
//
warehouses: [],
//
bmvoyageList: [],
//
vesselList: [],
//
custList: [],
//
cargoList: [],
//
stockList: [],
//
shelfList: [],
//
ckcargoList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
billId: null,
billDate: null,
billNumber: null,
inoutType: "1",
voyageId: null,
voyageNo: null,
vesselId: null,
vesselName: null,
cargoId: null,
hsCode: null,
cargoName: null,
billNo: null,
cargoSpec: null,
originCountry: null,
custId: null,
custName: null,
opType: null,
tradType: null,
cargoNum: null,
cargoWt: null,
cargoVol: null,
stockId: null,
stockCode: null,
stockName: null,
shelfName: null,
cargoValue:null,
customsNo:null,
listNumber:null,
beginDate: null,
endDate: null,
beginDateTwo: null,
endDateTwo: null,
bookNumber: null,
},
//
form: {},
//
rules: {
stockId: [
{ required: true, message: "库场ID不能为空", trigger: "blur" }
],
billDate: [
{ required: true, message: "单据日期不能为空", trigger: "blur" }
],
billNumber: [
{ required: true, message: "单据编号不能为空", trigger: "blur" }
],
inoutType: [
{ required: true, message: "出入库类型不能为空", trigger: "blur" }
],
voyageNo: [
{ required: true, message: "航次号不能为空", trigger: "blur" }
],
vesselName: [
{ required: true, message: "船舶名称不能为空", trigger: "blur" }
],
cargoName: [
{ required: true, message: "货物名称不能为空", trigger: "blur" }
],
cargoWt: [
{ required: true, message: "货物重量不能为空", trigger: "blur" }
],
cargoNum: [
{ required: true, message: "货物件数不能为空", trigger: "blur" }
],
cargoVol: [
{ required: true, message: "货物体积不能为空", trigger: "blur" }
],
stockName: [
{ required: true, message: "库场名称不能为空", trigger: "blur" }
],
custName: [
{ required: true, message: "货主名称不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
// this.getStockList();
this.getCustList();
this.getCargoList();
this.getWarehouseList();
this.getShelfList();
// listWarehouse({}).then(response => {
// console.log(response)
// this.warehouses = response.list;
// });
},
methods: {
getWarehouseList() {
let param = {};
listWarehouse(param).then(response => {
this.warehouses = response || [];
}).catch(e => {
this.warehouses = [];
});
},
//
// setBmvoyageDetail(voyageId) {
// this.bmvoyageList.forEach(ele => {
// if (ele.id == voyageId) {
// this.form.voyageNo = ele.voyageNo;
// this.form.vesselName = ele.vesselName;
// // this.form.berthName = ele.berthName;
// this.form.deptId = ele.deptId;
// this.form.vesselId = ele.vesselId;
// this.form.netTon = ele.netTon;
// this.form.opType = ele.opType;
// }
// })
// },
// getBmvoyage() {
// let param = {};
// listBmvoyage(param).then(response => {
// this.bmvoyageList = response.data;
// }).catch(e => {
// });
// },
//
// setVesselDetail(vesselId) {
// this.vesselList.forEach(ele => {
// if (ele.id == vesselId) {
// this.form.vesselName = ele.vesselName;
//
// }
// })
// },
// getVesselList() {
// let param = {};
// listVessel(param).then(response => {
// this.vesselList = response.data;
// }).catch(e => {
// });
// },
//
setCargoDetail(cargoId) {
this.cargoList.forEach(ele => {
if (ele.id == cargoId) {
this.form.cargoName = ele.cargoName;
this.form.hsCode = ele.hsCode;
this.form.cargoSpec = ele.cargoSpec;
this.form.originCountry = ele.originCountry;
}
})
},
getCargoList() {
let param = {};
listCargo(param).then(response => {
this.cargoList = response.data;
}).catch(e => {
});
},
//
setCustDetail(custId) {
this.custList.forEach(ele => {
if (ele.id == custId) {
this.form.custName = ele.custName;
this.form.custCode = ele.custCode;
this.form.custId = ele.id;
}
})
},
getCustList() {
let param = {};
listCust(param).then(response => {
this.custList = response.data;
}).catch(e => {
});
},
//
setStockDetail(stockId) {
this.stockList.forEach(ele => {
if (ele.id == stockId) {
// this.form.stockId = ele.stockId;
this.form.stockName = ele.stockName;
this.form.stockCode = ele.stockCode;
}
})
},
// getStockList() {
// let param = {};
// listStock(param).then(response => {
// this.stockList = response.data;
// }).catch(e => {
// });
// },
//
getShelfList() {
let param = {};
listShelf(param).then(response => {
this.shelfList = response;
}).catch(e => {
this.shelfList = [];
});
},
/** 查询仓库入库管理列表 */
getList() {
this.loading = true;
this.queryParams.inoutType = "1";
if(this.queryParams.queryTime){
this.queryParams.beginDate=this.queryParams.queryTime[0];
this.queryParams.endDate=this.queryParams.queryTime[1];
this.queryParams.queryTime = [];
}else{
this.queryParams.beginDate=null;
this.queryParams.endDate=null;
}
if(this.queryParams.excTime){
this.queryParams.beginDateTwo=this.queryParams.excTime[0];
this.queryParams.endDateTwo=this.queryParams.excTime[1];
this.queryParams.excTime = [];
}else{
this.queryParams.beginDateTwo=null;
this.queryParams.endDateTwo=null;
}
pageListCkcargo(this.queryParams).then(response => {
this.ckcargoList = response.list;
this.total = response.total;
this.loading = false;
}).catch(e => {
this.loading = false;
});
selectTotalWt(this.queryParams).then(response => {
this.totalWeight = response;
}).catch(e => {
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
billId: null,
billDate: null,
billNumber: null,
inoutType: "1",
voyageId: null,
voyageNo: null,
vesselId: null,
vesselName: null,
cargoId: null,
hsCode: null,
cargoName: null,
billNo: null,
cargoSpec: null,
originCountry: null,
custId: null,
custName: null,
opType: null,
tradType: null,
cargoNum: null,
cargoWt: null,
cargoVol: null,
stockId: null,
stockCode: null,
stockName: null,
remark: null,
cargoValue:null,
customsNo:null,
listNumber:null,
bookNumber:null,
};
this.resetForm("form");
},
//
handleSortChange(col) {
this.$sortBy(col, this.queryParams);
this.getList();
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
if (this.queryParams.pageSize === undefined) {
this.queryParams.pageSize = 10;
}
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.queryTime = [];
this.queryTimeTwo = [];
this.queryParams = {
...this.queryParams,
pageNum: 1,
pageSize: 10
};
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id);
this.names = selection.map(item => item.id);
this.single = selection.length!==1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.form.inoutType="入库";
this.open = true;
this.title = "添加仓库入库管理";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
getCkcargo(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改仓库入库管理";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateCkcargo(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addCkcargo(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
const names = row.id || this.names;
this.$modal.confirm('是否确认删除"' + row.billNumber + '"的数据项?').then(function() {
return delCkcargo(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('jxc/ckcargo/export', {
...this.queryParams
}, `仓库入库管理_${new Date().getTime()}.xlsx`)
}
}
};
</script>

@ -1,8 +1,10 @@
package com.zbkj.modules.autogencode.controller;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -10,8 +12,10 @@ import java.util.Map;
import cn.hutool.core.lang.Validator;
import cn.hutool.core.util.StrUtil;
import com.zbkj.modules.autogencode.entity.*;
import com.zbkj.modules.autogencode.service.CkStockChangeService;
import org.apache.commons.lang3.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zbkj.common.request.PageParamRequest;
import com.zbkj.common.response.CommonResult;
import com.zbkj.common.page.CommonPage;
@ -42,6 +46,8 @@ public class CkBillCargoController {
@Autowired
private CkBillStockService ckBillStockService;
@Autowired
private CkStockChangeService ckStockChangeService;
/**
*
*
@ -286,6 +292,39 @@ public class CkBillCargoController {
}
/**
* stockCodeshelfName
*/
private void handleStockCodeParam(LambdaQueryWrapper<CkBillCargo> queryWrapper, CkBillCargo request) {
if (StrUtil.isNotBlank(request.getStockCode()) || StrUtil.isNotBlank(request.getShelfName())) {
// 查询CkBillStock表中stockCode或shelfName等于该值的记录
LambdaQueryWrapper<CkBillStock> stockQueryWrapper = new LambdaQueryWrapper<>();
// 添加stockCode条件
if (StrUtil.isNotBlank(request.getStockCode())) {
stockQueryWrapper.eq(CkBillStock::getStockCode, request.getStockCode());
}
// 添加shelfName条件
if (StrUtil.isNotBlank(request.getShelfName())) {
stockQueryWrapper.eq(CkBillStock::getShelfName, request.getShelfName());
}
List<CkBillStock> ckBillStockList = ckBillStockService.list(stockQueryWrapper);
// 提取billCargoId列表
List<Long> billCargoIds = new ArrayList<>();
for (CkBillStock ckBillStock : ckBillStockList) {
billCargoIds.add(ckBillStock.getBillCargoId());
}
// 如果有billCargoId添加in条件
if (!billCargoIds.isEmpty()) {
queryWrapper.in(CkBillCargo::getId, billCargoIds);
}
}
}
/**
*
* @param request
@ -296,6 +335,9 @@ public class CkBillCargoController {
public CommonResult<CommonPage<CkBillCargo>> getList(@Validated CkBillCargo request, @Validated PageParamRequest pageParamRequest) {
LambdaQueryWrapper<CkBillCargo> queryWrapper = new LambdaQueryWrapper();
// 处理stockCode参数
handleStockCodeParam(queryWrapper, request);
// 应用搜索条件
buildQueryWrapper(queryWrapper, request);
@ -391,6 +433,22 @@ public class CkBillCargoController {
return ckBillService.warehouseWork(ckBill,false);
}
/**
*
*/
@ApiOperation("撤回入库单据")
@GetMapping(value = "/recallPutBill/{id}")
public CommonResult<String> recallPutBill(@PathVariable("id") Long id) {
CkBill ckBill = ckBillService.getById(id);
if (!ckBill.getSourceType().equals("1")) {
return CommonResult.failed("非人工操作入库,不能撤回");
}
if (ckBill.getBillStatus().equals("0")) {
return CommonResult.failed("未提交的出库单不允许做撤回操作");
}
return ckBillService.recallPutBill(id);
}
/**
*
@ -429,10 +487,111 @@ public class CkBillCargoController {
*/
@RequestMapping(value = "/delete", method = RequestMethod.POST)
public CommonResult<String> delete(@RequestBody Long[] ids){
if (ckBillCargoService.removeByIds(Arrays.asList(ids))) {
return CommonResult.success();
for (int i = 0; i < ids.length; i++) {
Long id = ids[i];
CkBill ckBill = ckBillService.getById(id);
if (ckBill != null && ckBill.getBillStatus().equals("1")) {
return CommonResult.failed("此单据已经提交,不允许删除");
}
LambdaQueryWrapper<CkBillCargo> wrapper = new LambdaQueryWrapper<>();
wrapper.select(CkBillCargo::getId);
wrapper.eq(CkBillCargo::getBillId,id);
List<Object> list = ckBillCargoService.listObjs(wrapper);
ckBillCargoService.remove(wrapper);
//删除入库记录
ckStockChangeService.remove(new LambdaQueryWrapper<CkStockChange>().eq(CkStockChange::getBillId,id));
//单据明细下出入库信息
if (!list.isEmpty()) {
LambdaQueryWrapper<CkBillStock> stockWapper = new LambdaQueryWrapper<>();
stockWapper.in(CkBillStock::getBillCargoId,list);
ckBillStockService.remove(stockWapper);
}
ckBillService.removeById(id);
}
return CommonResult.failed();
return CommonResult.success("删除成功");
}
/**
*
*/
@ApiOperation("查询总重量")
@GetMapping("/selectTotalWt")
public CommonResult<BigDecimal> selectTotalWt(CkBillCargo ckBillCargo) {
LambdaQueryWrapper<CkBillCargo> queryWrapper = new LambdaQueryWrapper();
// 处理stockCode参数
handleStockCodeParam(queryWrapper, ckBillCargo);
buildQueryWrapper(queryWrapper, ckBillCargo);
List<CkBillCargo> list = ckBillCargoService.list(queryWrapper);
BigDecimal totalWeight = list.stream()
.map(CkBillCargo::getCargoWt)
.reduce(BigDecimal.ZERO, BigDecimal::add);
return CommonResult.success(totalWeight);
}
// public MPJLambdaWrapper<CkBillCargo> buildQueryWrapper(CkBillCargo ckBillCargo) {
// MPJLambdaWrapper<CkBillCargo> queryWrapper = new MPJLambdaWrapper();
// queryWrapper.select(CkBillCargo::getId, CkBillCargo::getBillStatus, CkBillCargo::getSourceType
// , CkBillCargo::getBillId, CkBillCargo::getBillDate, CkBillCargo::getBillNumber
// ,CkBillCargo::getInoutType,CkBillCargo::getVoyageId,CkBillCargo::getVoyageNo
// ,CkBillCargo::getVesselId,CkBillCargo::getVesselName,CkBillCargo::getVesselCargoId
// ,CkBillCargo::getCargoId,CkBillCargo::getHsCode,CkBillCargo::getCargoName
// ,CkBillCargo::getBillNo,CkBillCargo::getCargoSpec,CkBillCargo::getOriginCountry
// ,CkBillCargo::getCustId,CkBillCargo::getCustName,CkBillCargo::getCargoNumber
// ,CkBillCargo::getItemNumber,CkBillCargo::getBookNumber,CkBillCargo::getExpiryDate
// ,CkBillCargo::getOpType,CkBillCargo::getTradType,CkBillCargo::getCustomsNo
// ,CkBillCargo::getListNumber)
// .select(CkBill::getBillNumber,CkBill::getTradWay)
// .select(CkBillStock::getStockName,CkBillStock::getCargoNum,CkBillStock::getCargoWt,CkBillStock::getCargoVol,CkBillStock::getCargoValue,CkBillStock::getStockCode)
// .selectAs(CkBillStock::getBillNumber,CkBillCargo::getOutBillNumber)
// .leftJoin(CkBill.class, CkBill::getId, CkBillCargo::getBillId)
// .leftJoin(CkBillStock.class,CkBillStock::getBillCargoId,CkBillCargo::getId);
// if (Validator.isNotEmpty(ckBillCargo.getInoutType())) {
// if ("3".equals(ckBillCargo.getInoutType())) {
// // 查询转场数据
// queryWrapper.inSql(CkBillCargo::getBillId, "select id from ck_bill where bill_type = '3'");
// } else if ("4".equals(ckBillCargo.getInoutType())) {
// // 查询混配数据
// queryWrapper.inSql(CkBillCargo::getBillId, "select id from ck_bill where bill_type = '4'");
// } else {
// queryWrapper.eq(CkBillCargo::getInoutType, ckBillCargo.getInoutType());
// }
// }
// //出入库的页面需要查询所有
// if(StringUtils.isEmpty(ckBillCargo.getInoutType())||(!ckBillCargo.getInoutType().equals("1")&&!ckBillCargo.getInoutType().equals("2"))){
// queryWrapper.eq(CkBillCargo::getBillStatus,"1");
// }
// queryWrapper.eq(ckBillCargo.getBillId()!=null,CkBillCargo::getBillId,ckBillCargo.getBillId());
// queryWrapper.between(null != ckBillCargo.getBeginDate(),CkBillCargo::getBillDate, ckBillCargo.getBeginDate(), adjustEndDate(ckBillCargo.getEndDate()));
// queryWrapper.between(null != ckBillCargo.getBeginDateTwo(),CkBillCargo::getExpiryDate, ckBillCargo.getBeginDateTwo(), adjustEndDate(ckBillCargo.getEndDateTwo()));
// //单据编号
// queryWrapper.like(Validator.isNotEmpty(ckBillCargo.getBillNumber()),CkBillCargo::getBillNumber,ckBillCargo.getBillNumber());
// queryWrapper.like(Validator.isNotEmpty(ckBillCargo.getVesselName()),CkBillCargo::getVesselName,ckBillCargo.getVesselName());
// //货物名称
// queryWrapper.like(Validator.isNotEmpty(ckBillCargo.getCargoName()),CkBillCargo::getCargoName,ckBillCargo.getCargoName());
// //货主名称
// queryWrapper.like(Validator.isNotEmpty(ckBillCargo.getCustName()),CkBillCargo::getCustName,ckBillCargo.getCustName());
// //航次号
// queryWrapper.like(Validator.isNotEmpty(ckBillCargo.getVoyageNo()),CkBillCargo::getVoyageNo,ckBillCargo.getVoyageNo());
// //核注清单号和报关单号,电子账册项号
// queryWrapper.like(Validator.isNotEmpty(ckBillCargo.getCustomsNo()),CkBillCargo::getCustomsNo,ckBillCargo.getCustomsNo());
// queryWrapper.like(Validator.isNotEmpty(ckBillCargo.getListNumber()),CkBillCargo::getListNumber,ckBillCargo.getListNumber());
// queryWrapper.eq(Validator.isNotEmpty(ckBillCargo.getBookNumber()),CkBillCargo::getBookNumber,ckBillCargo.getBookNumber());
// //业务性质和贸易性质
// queryWrapper.eq(Validator.isNotEmpty(ckBillCargo.getOpType()),CkBillCargo::getOpType,ckBillCargo.getOpType());
// queryWrapper.eq(Validator.isNotEmpty(ckBillCargo.getTradType()),CkBillCargo::getTradType,ckBillCargo.getTradType());
// queryWrapper.eq(Validator.isNotEmpty(ckBillCargo.getStockCode()),CkBillStock::getStockCode,ckBillCargo.getStockCode());
// queryWrapper.like(Validator.isNotEmpty(ckBillCargo.getStockName()),CkBillStock::getStockName,ckBillCargo.getStockName());
// queryWrapper.like(Validator.isNotEmpty(ckBillCargo.getOutBillNumber()),CkBillStock::getBillNumber,ckBillCargo.getOutBillNumber());
// queryWrapper.eq(Validator.isNotEmpty(ckBillCargo.getTradWay()),CkBill::getTradWay,ckBillCargo.getTradWay());
// //商品编码
// queryWrapper.eq(Validator.isNotEmpty(ckBillCargo.getHsCode()),CkBillCargo::getHsCode,ckBillCargo.getHsCode());
// queryWrapper.orderByDesc(CkBillCargo::getBillDate);
// return queryWrapper;
// }
}

@ -1,5 +1,6 @@
package com.zbkj.modules.autogencode.controller;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@ -14,6 +15,11 @@ import com.zbkj.common.response.CommonResult;
import com.zbkj.common.page.CommonPage;
import com.zbkj.common.exception.ExceptionCodeEnum;
import com.zbkj.modules.autogencode.entity.CkBillCargo;
import com.zbkj.modules.autogencode.entity.CkBillStock;
import com.zbkj.modules.autogencode.entity.CkCargoStock;
import com.zbkj.modules.autogencode.service.CkBillCargoService;
import com.zbkj.modules.autogencode.service.CkBillStockService;
import com.zbkj.modules.autogencode.service.CkCargoStockService;
import com.zbkj.service.service.SystemAttachmentService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -44,152 +50,122 @@ public class CkBillController {
@Autowired
private SystemAttachmentService systemAttachmentService;
@Autowired
private CkBillCargoService ckBillCargoService;
@Autowired
private CkCargoStockService ckCargoStockService;
@Autowired
private CkBillStockService ckBillStockService;
/**
*
*
*/
private void condition(LambdaQueryWrapper<CkBill> queryWrapper, CkBill request) {
if (request == null) {
return;
private void condition(LambdaQueryWrapper<CkBill> queryWrapper, CkBill ckBill) {
if (Validator.isNotEmpty(ckBill.getCargoName())) {
queryWrapper.inSql(CkBill::getId, "select bill_id from ck_bill_cargo where cargo_name like '%"+ ckBill.getCargoName() +"%'");
}
// 根据实体类字段自动生成查询条件
// 主键
if (request.getId() != null) {
queryWrapper.eq(CkBill::getId, request.getId());
}
// 区分直接出入库1与其他出入库0(直接出入库,可以在出入库页面直接撤回,其他出入库,需要回到其他入库页面进行撤回)
if (StrUtil.isNotBlank(request.getSourceType())) {
queryWrapper.eq(CkBill::getSourceType, request.getSourceType());
}
// 单据状态 0未提交1提交 默认1主要用于出入库页面
if (StrUtil.isNotBlank(request.getBillStatus())) {
queryWrapper.eq(CkBill::getBillStatus, request.getBillStatus());
}
// 单据类型
if (StrUtil.isNotBlank(request.getBillType())) {
queryWrapper.eq(CkBill::getBillType, request.getBillType());
}
// 出库类型船舶、火车、车辆
if (StrUtil.isNotBlank(request.getOutType())) {
queryWrapper.eq(CkBill::getOutType, request.getOutType());
}
// 混配比例
if (request.getProportion() != null) {
queryWrapper.eq(CkBill::getProportion, request.getProportion());
}
// 单据日期
if (request.getBillDate() != null) {
queryWrapper.eq(CkBill::getBillDate, request.getBillDate());
}
// 放行日期
if (request.getReleaseDate() != null) {
queryWrapper.eq(CkBill::getReleaseDate, request.getReleaseDate());
}
// 提运单号
if (StrUtil.isNotBlank(request.getBillNo())) {
queryWrapper.eq(CkBill::getBillNo, request.getBillNo());
}
// 单据编号
if (StrUtil.isNotBlank(request.getBillNumber())) {
queryWrapper.eq(CkBill::getBillNumber, request.getBillNumber());
}
// 船舶航次ID
if (request.getVoyageId() != null) {
queryWrapper.eq(CkBill::getVoyageId, request.getVoyageId());
}
// 船舶航次货物ID
if (request.getVoyageCargoId() != null) {
queryWrapper.eq(CkBill::getVoyageCargoId, request.getVoyageCargoId());
}
// 航次号
if (StrUtil.isNotBlank(request.getVoyageNo())) {
queryWrapper.eq(CkBill::getVoyageNo, request.getVoyageNo());
}
// 贸易方式
if (StrUtil.isNotBlank(request.getTradWay())) {
queryWrapper.eq(CkBill::getTradWay, request.getTradWay());
}
// 船舶ID
if (request.getVesselId() != null) {
queryWrapper.eq(CkBill::getVesselId, request.getVesselId());
}
// 船舶名称
if (StrUtil.isNotBlank(request.getVesselName())) {
queryWrapper.eq(CkBill::getVesselName, request.getVesselName());
}
// 委托单号
if (StrUtil.isNotBlank(request.getWtNumber())) {
queryWrapper.eq(CkBill::getWtNumber, request.getWtNumber());
}
// 批次号
if (StrUtil.isNotBlank(request.getBatchNumber())) {
queryWrapper.eq(CkBill::getBatchNumber, request.getBatchNumber());
}
// 状态
if (StrUtil.isNotBlank(request.getStatus())) {
queryWrapper.eq(CkBill::getStatus, request.getStatus());
}
// 备注
if (StrUtil.isNotBlank(request.getRemark())) {
queryWrapper.eq(CkBill::getRemark, request.getRemark());
}
// 删除标志0代表存在 2代表删除
if (StrUtil.isNotBlank(request.getDelFlag())) {
queryWrapper.eq(CkBill::getDelFlag, request.getDelFlag());
}
// 创建部门
if (request.getCreateDept() != null) {
queryWrapper.eq(CkBill::getCreateDept, request.getCreateDept());
}
// 创建人
if (request.getCreateBy() != null) {
queryWrapper.eq(CkBill::getCreateBy, request.getCreateBy());
}
// 创建时间
if (request.getCreateTime() != null) {
queryWrapper.eq(CkBill::getCreateTime, request.getCreateTime());
}
// 修改人
if (request.getUpdateBy() != null) {
queryWrapper.eq(CkBill::getUpdateBy, request.getUpdateBy());
}
// 修改时间
if (request.getUpdateTime() != null) {
queryWrapper.eq(CkBill::getUpdateTime, request.getUpdateTime());
}
//
if (StrUtil.isNotBlank(request.getTenantId())) {
queryWrapper.eq(CkBill::getTenantId, request.getTenantId());
if (Validator.isNotEmpty(ckBill.getCustName())) {
queryWrapper.inSql(CkBill::getId, "select bill_id from ck_bill_cargo where cust_name like '%"+ ckBill.getCustName() +"%'");
}
if (Validator.isNotEmpty(ckBill.getBillNumber())) {
queryWrapper.like(CkBill::getBillNumber, ckBill.getBillNumber());
}
if (Validator.isNotEmpty(ckBill.getStockCode())) {
queryWrapper.inSql(CkBill::getId, "select a.bill_id from ck_bill_cargo a, ck_bill_stock b where a.id = b.bill_cargo_id and b.stock_code = '"+ ckBill.getStockCode() +"'");
}
if (Validator.isNotEmpty(ckBill.getOutBillNumber())) {
queryWrapper.inSql(CkBill::getId, "select a.bill_id from ck_bill_cargo a, ck_bill_stock b where a.id = b.bill_cargo_id and b.bill_number like '%"+ ckBill.getOutBillNumber() +"%'");
}
if (Validator.isNotEmpty(ckBill.getStockName())) {
queryWrapper.inSql(CkBill::getId, "select a.bill_id from ck_bill_cargo a, ck_bill_stock b where a.id = b.bill_cargo_id and b.stock_name like '%"+ ckBill.getStockName() +"%'");
}
if (Validator.isNotEmpty(ckBill.getCustomsNo())) {
queryWrapper.inSql(CkBill::getId, "select bill_id from ck_bill_cargo where customs_no like '%"+ ckBill.getCustomsNo() +"%'");
}
if (Validator.isNotEmpty(ckBill.getListNumber())) {
queryWrapper.inSql(CkBill::getId, "select bill_id from ck_bill_cargo where list_number like '%"+ ckBill.getListNumber() +"%'");
}
//单据日期
// if (ckBill.getBillDate() != null) {
// queryWrapper.eq(CkBill::getBillDate, ckBill.getBillDate());
// }
if (null != ckBill.getBeginDate()) {
queryWrapper.between(CkBill::getBillDate, ckBill.getBeginDate(), ckBill.getEndDate());
}
//单据编号
if (Validator.isNotEmpty(ckBill.getBillNo())) {
queryWrapper.like(CkBill::getBillNo, ckBill.getBillNo());
}
//贸易方式
if (Validator.isNotEmpty(ckBill.getTradWay())) {
queryWrapper.like(CkBill::getTradWay, ckBill.getTradWay());
}
if (Validator.isNotEmpty(ckBill.getWtNumber())) {
queryWrapper.like(CkBill::getWtNumber, ckBill.getWtNumber());
}
if (Validator.isNotEmpty(ckBill.getBatchNumber())) {
queryWrapper.like(CkBill::getBatchNumber, ckBill.getBatchNumber());
}
//船舶航次ID
if (ckBill.getVoyageId() != null) {
queryWrapper.eq(CkBill::getVoyageId, ckBill.getVoyageId());
}
//航次号
if (Validator.isNotEmpty(ckBill.getVoyageNo())) {
queryWrapper.like(CkBill::getVoyageNo, ckBill.getVoyageNo());
}
//船舶ID
if (ckBill.getVesselId() != null) {
queryWrapper.eq(CkBill::getVesselId, ckBill.getVesselId());
}
//船舶名称
if (Validator.isNotEmpty(ckBill.getVesselName())) {
queryWrapper.like(CkBill::getVesselName, ckBill.getVesselName());
}
//状态
if (Validator.isNotEmpty(ckBill.getStatus())) {
queryWrapper.eq(CkBill::getStatus, ckBill.getStatus());
}
//备注
if (Validator.isNotEmpty(ckBill.getRemark())) {
queryWrapper.eq(CkBill::getRemark, ckBill.getRemark());
}
//删除标志0代表存在 2代表删除
if (Validator.isNotEmpty(ckBill.getDelFlag())) {
queryWrapper.eq(CkBill::getDelFlag, ckBill.getDelFlag());
}
//租户ID
if (Validator.isNotEmpty(ckBill.getTenantId())) {
queryWrapper.eq(CkBill::getTenantId, ckBill.getTenantId());
}
}
@ -254,7 +230,7 @@ public class CkBillController {
private void updateFile(CkBillCargo ckbBillCargo) {
Long newId = System.currentTimeMillis() + new Random().nextInt(1000);
List<SystemAttachment> file = ckbBillCargo.getFile();
List<SystemAttachment> file = ckbBillCargo.getFileUploadFiles();
if (null != file) {
for (SystemAttachment cmAttach : file) {
cmAttach.setFileId(String.valueOf(newId));
@ -318,11 +294,83 @@ public class CkBillController {
*/
@RequestMapping(value = "/info/{id}", method = RequestMethod.GET)
public CommonResult<CkBill> info(@PathVariable("id") Long id){
CkBill ckBill = ckBillService.getById(id);
CkBill ckBill = ckBillService.getById(id);
// 查询CkBillCargo列表
LambdaQueryWrapper<CkBillCargo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(CkBillCargo::getBillId, id);
queryWrapper.orderByDesc(CkBillCargo::getCreateTime);
List<CkBillCargo> ckBillCargos = ckBillCargoService.list(queryWrapper);
// 遍历处理每个CkBillCargo
ckBillCargos.forEach(ckBillCargo -> {
// 查询对应的CkBillStock信息
LambdaQueryWrapper<CkBillStock> stockQueryWrapper = new LambdaQueryWrapper<>();
stockQueryWrapper.eq(CkBillStock::getBillCargoId, ckBillCargo.getId());
CkBillStock ckBillStock = ckBillStockService.getOne(stockQueryWrapper);
if (ckBillStock != null) {
// 设置从CkBillStock获取的属性
ckBillCargo.setStockName(ckBillStock.getStockName());
ckBillCargo.setStockCode(ckBillStock.getStockCode());
ckBillCargo.setInStockId(ckBillStock.getStockId());
ckBillCargo.setOutBillNumber(ckBillStock.getBillNumber());
ckBillCargo.setCargoNum(ckBillStock.getCargoNum());
ckBillCargo.setCargoWt(ckBillStock.getCargoWt());
ckBillCargo.setCargoVol(ckBillStock.getCargoVol());
ckBillCargo.setCargoValue(ckBillStock.getCargoValue());
ckBillCargo.setShelfId(ckBillStock.getShelfId());
ckBillCargo.setShelfName(ckBillStock.getShelfName());
ckBillCargo.setLocationName(ckBillStock.getLocationName());
ckBillCargo.setLocationId(ckBillStock.getLocationId());
}
// 处理出库类型的逻辑
if (ckBillCargo.getInoutType().equals("2")) {
ckBillCargo.setOutStockId(ckBillCargo.getInStockId());
LambdaQueryWrapper<CkCargoStock> wrapper = new LambdaQueryWrapper();
wrapper.eq(CkCargoStock::getCargoId, ckBillCargo.getCargoId());
wrapper.eq(CkCargoStock::getCustId, ckBillCargo.getCustId());
wrapper.eq(CkCargoStock::getStockId, ckBillCargo.getOutStockId());
wrapper.eq(CkCargoStock::getBillNumber, ckBillCargo.getOutBillNumber());
CkCargoStock ckCargoStock = ckCargoStockService.getOne(wrapper);
if (ckCargoStock != null) {
ckBillCargo.setNowStockWt(ckCargoStock.getCargoWt());
ckBillCargo.setNowStockVol(ckCargoStock.getCargoVol());
ckBillCargo.setNowStockNum(ckCargoStock.getCargoNum());
ckBillCargo.setNowCargoValue(ckCargoStock.getCargoValue());
} else {
ckBillCargo.setNowStockWt(new BigDecimal(0));
ckBillCargo.setNowStockVol(new BigDecimal(0));
ckBillCargo.setNowStockNum(new BigDecimal(0));
ckBillCargo.setNowCargoValue(new BigDecimal(0));
}
}
});
ckBill.setCkBillCargos(ckBillCargos);
setFile(ckBill);
return CommonResult.success(ckBill);
}
private void setFile(CkBill ckBill) {
if (null != ckBill) {
List<CkBillCargo> ckBillCargos = ckBill.getCkBillCargos();
if (null != ckBillCargos && ckBillCargos.size() > 0) {
for (CkBillCargo ckBillCargo : ckBillCargos) {
String fileId = ckBillCargo.getFileId();
if (null != fileId) {
List<SystemAttachment> cmAttaches = systemAttachmentService.list(new LambdaQueryWrapper<SystemAttachment>().eq(SystemAttachment::getFileId, fileId));
ckBillCargo.setFileUploadFiles(cmAttaches);
ckBillCargo.setFile(cmAttaches);
}
}
}
}
}
/**
*
*/

@ -1,13 +1,23 @@
package com.zbkj.modules.autogencode.controller;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zbkj.common.request.PageParamRequest;
import com.zbkj.common.response.CommonResult;
import com.zbkj.common.page.CommonPage;
import com.zbkj.modules.autogencode.entity.CkBill;
import com.zbkj.modules.autogencode.entity.CkBillCargo;
import com.zbkj.modules.autogencode.entity.CkBillStock;
import com.zbkj.modules.autogencode.service.CkBillCargoService;
import com.zbkj.modules.autogencode.service.CkBillService;
import com.zbkj.modules.autogencode.service.CkBillStockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@ -33,8 +43,15 @@ public class CkCargoStockController {
@Autowired
private CkCargoStockService ckCargoStockService;
@Autowired
private CkBillService ckBillService;
@Autowired
private CkBillCargoService ckBillCargoService;
@Autowired
private CkBillStockService ckBillStockService;
/**
*
*
@ -266,11 +283,40 @@ public class CkCargoStockController {
// 应用搜索条件
condition(queryWrapper, request);
CommonPage<CkCargoStock> page = CommonPage.restPage(ckCargoStockService.pageList(queryWrapper, pageParamRequest));
if (null != request.getIsShow() && request.getIsShow()) {
queryWrapper.gt(CkCargoStock::getCargoWt, 0);
}
if (null != request.getBeginDateOut()) {
queryWrapper.gt(CkCargoStock::getStockDate, request.getBeginDateOut());
}
List<CkCargoStock> cargoStocks = ckCargoStockService.pageList(queryWrapper, pageParamRequest);
List<CkCargoStock> ckCargoStocks = outRecovery(cargoStocks, request);
CommonPage<CkCargoStock> page = CommonPage.restPage(ckCargoStocks);
return CommonResult.success(page);
}
/**
*
*/
@ApiOperation("查询仓库库存重量")
@GetMapping("/listByAll")
public CommonResult<BigDecimal> listByAll(CkCargoStock ckCargoStock) {
LambdaQueryWrapper<CkCargoStock> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper, ckCargoStock);
if (null != ckCargoStock.getIsShow() && ckCargoStock.getIsShow()) {
queryWrapper.gt(CkCargoStock::getCargoWt, 0);
}
if (null != ckCargoStock.getBeginDateOut()) {
queryWrapper.gt(CkCargoStock::getStockDate, ckCargoStock.getBeginDateOut());
}
List<CkCargoStock> list = ckCargoStockService.list(queryWrapper);
List<CkCargoStock> ckCargoStocks = outRecovery(list, ckCargoStock);
BigDecimal totalWeight = ckCargoStocks.stream()
.map(CkCargoStock::getCargoWt)
.reduce(BigDecimal.ZERO, BigDecimal::add);
return CommonResult.success(totalWeight);
}
/**
*
@ -315,4 +361,202 @@ public class CkCargoStockController {
return CommonResult.failed();
}
/**
*
*
* @return
*/
@ApiOperation("查询仓库库存列表")
@GetMapping("/newList")
public CommonResult<CommonPage<CkCargoStock>> ckCargoStockList(CkCargoStock ckCargoStock, @Validated PageParamRequest pageParamRequest) {
QueryWrapper<CkCargoStock> queryWrapper = new QueryWrapper<>();
// 选择字段和聚合函数
queryWrapper.select(
"cargo_id",
"cargo_name",
"cust_id",
"cust_name",
"cargo_spec",
"origin_country",
"hs_code",
"cargo_number",
"stock_date",
"sum(cargo_num) as cargo_num",
"sum(cargo_wt) as cargo_wt",
"sum(cargo_vol) as cargo_vol"
);
// 应用搜索条件
applyCondition(queryWrapper, ckCargoStock);
// 添加条件货物件数、重量、体积至少有一个大于0
queryWrapper.and(wrapper -> {
wrapper.gt("cargo_num", 0).or().
gt("cargo_wt", 0).or().
gt("cargo_vol", 0);
});
// 添加分组
queryWrapper.groupBy(
"cargo_id",
"cargo_name",
"cust_id",
"cust_name",
"cargo_spec",
"origin_country",
"hs_code",
"cargo_number",
"stock_date"
);
// 分页查询
Page<CkCargoStock> page = new Page<>(pageParamRequest.getPage(), pageParamRequest.getLimit());
Page<CkCargoStock> resultPage = ckCargoStockService.page(page, queryWrapper);
CommonPage<CkCargoStock> commonPage = new CommonPage<>();
commonPage.setPage((int) resultPage.getCurrent());
commonPage.setLimit((int) resultPage.getSize());
commonPage.setTotal(resultPage.getTotal());
commonPage.setTotalPage((int) resultPage.getPages());
commonPage.setList(resultPage.getRecords());
return CommonResult.success(commonPage);
}
/**
*
*/
@ApiOperation("查询仓库库存列表")
@GetMapping("/listCkstock")
public CommonResult<List<CkCargoStock>> listCkstock(CkCargoStock ckCargoStock) {
LambdaQueryWrapper<CkCargoStock> queryWrapper = new LambdaQueryWrapper();
queryWrapper.select(CkCargoStock::getId, CkCargoStock::getStockDate, CkCargoStock::getCargoNumber,
CkCargoStock::getItemNumber, CkCargoStock::getBookNumber, CkCargoStock::getExpiryDate, CkCargoStock::getBillNumber,
CkCargoStock::getVoyageId, CkCargoStock::getVoyageNo, CkCargoStock::getVesselId, CkCargoStock::getVesselName,
CkCargoStock::getCargoId, CkCargoStock::getHsCode, CkCargoStock::getCargoName,
CkCargoStock::getBillNo, CkCargoStock::getCargoSpec, CkCargoStock::getOriginCountry, CkCargoStock::getFirstUnit,
CkCargoStock::getUnitPrice, CkCargoStock::getCurrType, CkCargoStock::getCustId, CkCargoStock::getCustName, CkCargoStock::getOpType,
CkCargoStock::getTradType, CkCargoStock::getCargoNum, CkCargoStock::getCargoWt, CkCargoStock::getCargoVol, CkCargoStock::getStockId,
CkCargoStock::getStockCode, CkCargoStock::getStockName, CkCargoStock::getCargoValue, CkCargoStock::getCustomsNo, CkCargoStock::getListNumber,
CkCargoStock::getRemark, CkCargoStock::getCreateDept, CkCargoStock::getCreateBy, CkCargoStock::getCreateTime, CkCargoStock::getUpdateBy,
CkCargoStock::getUpdateTime, CkCargoStock::getDelFlag);
condition(queryWrapper, ckCargoStock);
if(ckCargoStock.getCustId()!=null){
queryWrapper.and(qw -> {
qw.gt(CkCargoStock::getCargoNum, "0")
.or().gt(CkCargoStock::getCargoWt, "0")
.or().gt(CkCargoStock::getCargoValue, "0")
.or().gt(CkCargoStock::getCargoVol, "0");
});
}
List<CkCargoStock> list = ckCargoStockService.list(queryWrapper);
for (CkCargoStock stock : list) {
if (StrUtil.isNotBlank(stock.getBillNumber())) {
LambdaQueryWrapper<CkBillStock> stockQueryWrapper = new LambdaQueryWrapper<>();
stockQueryWrapper.eq(CkBillStock::getBillNumber, stock.getBillNumber());
stockQueryWrapper.eq(CkBillStock::getStockId, stock.getStockId());
stockQueryWrapper.last("LIMIT 1");
CkBillStock ckBillStock = ckBillStockService.getOne(stockQueryWrapper);
if (ckBillStock != null) {
stock.setShelfName(ckBillStock.getShelfName());
stock.setLocationName(ckBillStock.getLocationName());
}
}
}
return CommonResult.success(list);
}
public List<CkCargoStock> outRecovery(List<CkCargoStock> list,CkCargoStock ckCargoStock) {
if (null != ckCargoStock.getEndDateOut()) {
for (CkCargoStock ckCargoStockVo : list) {
LambdaQueryWrapper<CkBill> queryWrapperBill = new LambdaQueryWrapper();
queryWrapperBill.ne(CkBill::getBillType, "1");
queryWrapperBill.inSql(CkBill::getId, "select a.bill_id from ck_bill_cargo a, ck_bill_stock b where a.id = b.bill_cargo_id and b.bill_number like '%"+
ckCargoStockVo.getBillNumber() +"%'")
.eq(CkBill::getBillStatus,"1");
List<CkBill> listBill = ckBillService.list(queryWrapperBill);
BigDecimal totalCargoWt = BigDecimal.ZERO;
BigDecimal totalCargoValue = BigDecimal.ZERO;
for (CkBill ckBill : listBill) {
LambdaQueryWrapper<CkBillCargo> queryWrapperBillCargo = new LambdaQueryWrapper();
queryWrapperBillCargo.eq(CkBillCargo::getInoutType, "2")
.eq(CkBillCargo::getBillNumber, ckBill.getBillNumber())
.gt(CkBillCargo::getBillDate, ckCargoStock.getEndDateOut());
if ("4".equals(ckBill.getBillType())) {
queryWrapperBillCargo.eq(CkBillCargo::getListNumber,ckCargoStockVo.getListNumber());
}
List<CkBillCargo> listBillCargo = ckBillCargoService.list(queryWrapperBillCargo);
for (CkBillCargo ckBillCargo : listBillCargo) {
System.out.println( ckBillCargo.getBillNumber() + "+++" + ckBillCargo.getCargoWt());
totalCargoWt = totalCargoWt.add(ckBillCargo.getCargoWt());
totalCargoValue = totalCargoValue.add(ckBillCargo.getCargoValue());
}
}
ckCargoStockVo.setCargoWt(ckCargoStockVo.getCargoWt().add(totalCargoWt));
ckCargoStockVo.setCargoValue(ckCargoStockVo.getCargoValue().add(totalCargoValue));
}
}
return list;
}
/**
* QueryWrapper
*/
private void applyCondition(QueryWrapper<CkCargoStock> queryWrapper, CkCargoStock request) {
if (request == null) {
return;
}
// 货物ID
if (request.getCargoId() != null) {
queryWrapper.eq("cargo_id", request.getCargoId());
}
// 货物名称
if (StrUtil.isNotBlank(request.getCargoName())) {
queryWrapper.like("cargo_name", request.getCargoName());
}
// 货主ID
if (request.getCustId() != null) {
queryWrapper.eq("cust_id", request.getCustId());
}
// 货主名称
if (StrUtil.isNotBlank(request.getCustName())) {
queryWrapper.like("cust_name", request.getCustName());
}
// 规格类型品质
if (StrUtil.isNotBlank(request.getCargoSpec())) {
queryWrapper.eq("cargo_spec", request.getCargoSpec());
}
// 原产国
if (StrUtil.isNotBlank(request.getOriginCountry())) {
queryWrapper.eq("origin_country", request.getOriginCountry());
}
// HS编号
if (StrUtil.isNotBlank(request.getHsCode())) {
queryWrapper.eq("hs_code", request.getHsCode());
}
// 货物自然序号
if (StrUtil.isNotBlank(request.getCargoNumber())) {
queryWrapper.eq("cargo_number", request.getCargoNumber());
}
// 入库日期
if (request.getStockDate() != null) {
queryWrapper.eq("stock_date", request.getStockDate());
}
}
}

@ -3,6 +3,7 @@ package com.zbkj.modules.autogencode.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
@ -10,6 +11,7 @@ import java.util.Date;
import java.util.List;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
@Data
@ -53,6 +55,16 @@ public class CkBill implements Serializable {
*/
@ApiModelProperty(value = "单据日期")
private Date billDate;
@TableField(exist = false)
@JsonFormat(pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date beginDate;
@TableField(exist = false)
@JsonFormat(pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date endDate;
/**
*
*/

@ -6,9 +6,10 @@ import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zbkj.common.model.system.SystemAttachment;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.io.Serializable;
import java.math.BigDecimal;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
@ -255,7 +256,8 @@ public class CkBillCargo implements Serializable {
@TableField(exist = false)
private List<SystemAttachment> file;
@TableField(exist = false)
private List<SystemAttachment> fileUploadFiles;
/**
*
*/
@ -328,18 +330,22 @@ public class CkBillCargo implements Serializable {
@TableField(exist = false)
@JsonFormat(pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date beginDate;
@TableField(exist = false)
@JsonFormat(pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date endDate;
@TableField(exist = false)
@JsonFormat(pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date beginDateTwo;
@TableField(exist = false)
@JsonFormat(pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date endDateTwo;
@TableField(exist = false)

@ -1,7 +1,9 @@
package com.zbkj.modules.autogencode.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
@ -181,6 +183,18 @@ public class CkCargoStock implements Serializable {
*/
@ApiModelProperty(value = "库场名称")
private String stockName;
/**
*
*/
@ApiModelProperty(value = "货架名称")
@TableField(exist = false)
private String shelfName;
/**
*
*/
@ApiModelProperty(value = "货位名称")
@TableField(exist = false)
private String locationName;
/**
*
*/
@ -222,4 +236,41 @@ public class CkCargoStock implements Serializable {
@ApiModelProperty(value = "")
private String tenantId;
@TableField(exist = false)
@JsonFormat(pattern = "yyyy-MM-dd")
private Date beginDate;
@TableField(exist = false)
@JsonFormat(pattern = "yyyy-MM-dd")
private Date endDate;
@TableField(exist = false)
@JsonFormat(pattern = "yyyy-MM-dd")
private Date beginDateTwo;
@TableField(exist = false)
@JsonFormat(pattern = "yyyy-MM-dd")
private Date endDateTwo;
@TableField(exist = false)
@JsonFormat(pattern = "yyyy-MM-dd")
private Date beginDateOut;
@TableField(exist = false)
@JsonFormat(pattern = "yyyy-MM-dd")
private Date endDateOut;
@TableField(exist = false)
private String isExpire;
@TableField(exist = false)
private String gdsSeqno;
/** 是否显示为0的库存 */
@TableField(exist = false)
private Boolean isShow;
}

@ -37,5 +37,7 @@ public interface CkBillService extends IService<CkBill> {
*/
public CommonResult<String> putCargo(CkBill ckBill);
CommonResult<String> recallPutBill(Long id);
}

@ -12,6 +12,7 @@ import com.zbkj.modules.autogencode.service.*;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zbkj.modules.autogencode.dao.CkBillDao;
@ -61,6 +62,9 @@ public class CkBillServiceImpl extends ServiceImpl<CkBillDao, CkBill> implements
@Resource
private CmStorageLocationService cmStorageLocationService;
@Autowired
private CmCustProductService cmCustProductService;
/**
*
*/
@ -191,9 +195,11 @@ public class CkBillServiceImpl extends ServiceImpl<CkBillDao, CkBill> implements
BeanUtils.copyProperties(ckBillCargo,inCargoStock,"id");
inCargoStock.setStockDate(ckBillCargo.getBillDate());
CmWarehouse cmWarehouse = cmWarehouseService.getById(ckBillStock.getStockId());
inCargoStock.setStockId(cmWarehouse.getId());
inCargoStock.setStockCode(cmWarehouse.getStockCode());
inCargoStock.setStockName(cmWarehouse.getStockName());
if(cmWarehouse != null){
inCargoStock.setStockId(cmWarehouse.getId());
inCargoStock.setStockCode(cmWarehouse.getStockCode());
inCargoStock.setStockName(cmWarehouse.getStockName());
}
inCargoStock.setCargoNum(ckBillStock.getCargoNum());
inCargoStock.setCargoWt(ckBillStock.getCargoWt());
inCargoStock.setCargoVol(ckBillStock.getCargoVol());
@ -241,6 +247,17 @@ public class CkBillServiceImpl extends ServiceImpl<CkBillDao, CkBill> implements
return CommonResult.success();
}
/**
*
* @param id
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public CommonResult<String> recallPutBill(Long id) {
return warehouseWork(this.getById(id),true);
}
/**
*
* @param ckBill
@ -262,6 +279,11 @@ public class CkBillServiceImpl extends ServiceImpl<CkBillDao, CkBill> implements
}
Map<Long,CkBillStock> billStockMap = new HashMap<>();
ckBillCargos.forEach(ckBillCargo->{
CmCustProduct custProduct = cmCustProductService.getById(ckBillCargo.getCargoId());
if (null != custProduct) {
ckBillCargo.setCargoName(custProduct.getGoodsName());
ckBillCargo.setHsCode(custProduct.getGoodsCode());
}
ckBillCargo.setBillStatus("0");
//创建单据明细
ckBillCargo.setBillDate(ckBill.getBillDate());
@ -295,9 +317,11 @@ public class CkBillServiceImpl extends ServiceImpl<CkBillDao, CkBill> implements
}
ckBillCargoService.saveOrUpdate(ckBillCargo);
ckBillStock.setInoutType("1");
ckBillStock.setStockId(cmWarehouse.getId());
ckBillStock.setStockName(cmWarehouse.getStockName());
ckBillStock.setStockCode(cmWarehouse.getStockCode());
if(cmWarehouse != null){
ckBillStock.setStockId(cmWarehouse.getId());
ckBillStock.setStockName(cmWarehouse.getStockName());
ckBillStock.setStockCode(cmWarehouse.getStockCode());
}
// 设置货架信息
if(cmShelf != null){
@ -354,8 +378,10 @@ public class CkBillServiceImpl extends ServiceImpl<CkBillDao, CkBill> implements
BeanUtils.copyProperties(ckBillCargo,ckStockChange,"id");
ckStockChange.setChangeType(ckBillCargo.getInoutType());
CmWarehouse cmWarehouse = cmWarehouseService.getById(ckBillStock.getStockId());
ckStockChange.setStockId(cmWarehouse.getId());
ckStockChange.setStockName(cmWarehouse.getStockName());
if(cmWarehouse != null){
ckStockChange.setStockId(cmWarehouse.getId());
ckStockChange.setStockName(cmWarehouse.getStockName());
}
ckStockChange.setBeforeNum(countStock.getCargoNum());
ckStockChange.setBeforeWt(countStock.getCargoWt());
ckStockChange.setBeforeVol(countStock.getCargoVol());

Loading…
Cancel
Save