rev:新增原料需求功能
This commit is contained in:
@@ -83,6 +83,20 @@ public class PcsIfPurchaseorderController {
|
|||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/confirm")
|
||||||
|
@Log("强制确认原料需求")
|
||||||
|
@ApiOperation("强制确认原料需求")
|
||||||
|
public ResponseEntity<Object> confirm(@RequestBody List<PcsIfPurchaseorder> list) {
|
||||||
|
list.forEach(order -> {
|
||||||
|
order.setStatus(PCSEnum.BILL_STATUS.code("完成"));
|
||||||
|
order.setConfirm_id(SecurityUtils.getCurrentUserId());
|
||||||
|
order.setConfirm_name(SecurityUtils.getCurrentNickName());
|
||||||
|
order.setConfirm_time(DateUtil.now());
|
||||||
|
purchaseorderService.updateById(order);
|
||||||
|
});
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping("/getDtl")
|
@PostMapping("/getDtl")
|
||||||
@Log("获取原料需求明细")
|
@Log("获取原料需求明细")
|
||||||
@ApiOperation("获取原料需求明细")
|
@ApiOperation("获取原料需求明细")
|
||||||
|
|||||||
@@ -73,7 +73,8 @@ public class PcsIfPurchaseorderServiceImpl extends ServiceImpl<PcsIfPurchaseorde
|
|||||||
@Override
|
@Override
|
||||||
public List<PcsIfPurchaseorder> getDtl(JSONObject jo) {
|
public List<PcsIfPurchaseorder> getDtl(JSONObject jo) {
|
||||||
String material_id = jo.getString("material_id");
|
String material_id = jo.getString("material_id");
|
||||||
return this.list(new QueryWrapper<PcsIfPurchaseorder>().eq("material_id", material_id).eq("status", PCSEnum.BILL_STATUS.code("生成")).eq("is_delete", false));
|
String status = jo.getString("status");
|
||||||
|
return this.list(new QueryWrapper<PcsIfPurchaseorder>().eq("material_id", material_id).eq("status", status).eq("is_delete", false));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -82,6 +83,12 @@ public class PcsIfPurchaseorderServiceImpl extends ServiceImpl<PcsIfPurchaseorde
|
|||||||
for (int i = 0; i < rows.size(); i++) {
|
for (int i = 0; i < rows.size(); i++) {
|
||||||
JSONObject row = rows.getJSONObject(i);
|
JSONObject row = rows.getJSONObject(i);
|
||||||
PcsIfPurchaseorder purchase = row.toJavaObject(PcsIfPurchaseorder.class);
|
PcsIfPurchaseorder purchase = row.toJavaObject(PcsIfPurchaseorder.class);
|
||||||
|
if (purchase.getStatus().equals(PCSEnum.BILL_STATUS.code("提交"))) {
|
||||||
|
purchase.setStatus(PCSEnum.BILL_STATUS.code("确认采购"));
|
||||||
|
purchase.setPurchase_id(SecurityUtils.getCurrentUserId());
|
||||||
|
purchase.setPurchase_time(DateUtil.now());
|
||||||
|
purchase.setPurchase_name(SecurityUtils.getCurrentNickName());
|
||||||
|
}
|
||||||
this.updateById(purchase);
|
this.updateById(purchase);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import qs from 'qs'
|
|||||||
|
|
||||||
export function initData(url, params) {
|
export function initData(url, params) {
|
||||||
if (params.createTime) {
|
if (params.createTime) {
|
||||||
params.begin_time = params.createTime[0]
|
params.start_time = params.createTime[0]
|
||||||
params.end_time = params.createTime[1]
|
params.end_time = params.createTime[1]
|
||||||
}
|
}
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
@open="open"
|
@open="open"
|
||||||
@close="close"
|
@close="close"
|
||||||
>
|
>
|
||||||
<el-row v-show="crud.status.cu > 0" :gutter="20">
|
<el-row v-show="crud.status.cu > 0" :gutter="20" style="margin-bottom: 5px;">
|
||||||
<el-col :span="20" style="border: 1px solid white">
|
<el-col :span="20" style="border: 1px solid white">
|
||||||
<span/>
|
<span/>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
<el-form
|
<el-form
|
||||||
ref="form"
|
ref="form"
|
||||||
|
v-show="false"
|
||||||
style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;"
|
style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;"
|
||||||
:inline="true"
|
:inline="true"
|
||||||
:model="form"
|
:model="form"
|
||||||
@@ -91,25 +92,6 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
|
||||||
<div class="crud-opts2" style="margin-bottom: 5px;">
|
|
||||||
<span class="crud-opts-right2">
|
|
||||||
<!--左侧插槽-->
|
|
||||||
<slot name="left"/>
|
|
||||||
<el-button
|
|
||||||
slot="left"
|
|
||||||
class="filter-item"
|
|
||||||
type="primary"
|
|
||||||
icon="el-icon-plus"
|
|
||||||
v-if="crud.status.add > 0"
|
|
||||||
size="mini"
|
|
||||||
@click="add"
|
|
||||||
>
|
|
||||||
新增一行
|
|
||||||
</el-button>
|
|
||||||
</span>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<!--表格渲染-->
|
<!--表格渲染-->
|
||||||
<el-table
|
<el-table
|
||||||
ref="table"
|
ref="table"
|
||||||
@@ -119,13 +101,15 @@
|
|||||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||||
>
|
>
|
||||||
<el-table-column type="index" label="序号" width="55" align="center"/>
|
<el-table-column type="index" label="序号" width="55" align="center"/>
|
||||||
|
<el-table-column prop="ask_time" label="要求到货日期" width="150"/>
|
||||||
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码"/>
|
<el-table-column prop="material_code" label="物料编码" width="150"/>
|
||||||
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称"/>
|
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称"/>
|
||||||
<el-table-column show-overflow-tooltip prop="ask_time" label="要求到货日期" style="width: 250px">
|
<el-table-column prop="qty" label="需求数量" width="100"/>
|
||||||
|
<el-table-column prop="qty_unit_name" label="数量单位" width="100"/>
|
||||||
|
<el-table-column prop="ask_time" label="确认到货日期" width="250">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="form.tableData[scope.$index].ask_time"
|
v-model="form.tableData[scope.$index].agree_time"
|
||||||
type="date"
|
type="date"
|
||||||
placeholder="选择日期"
|
placeholder="选择日期"
|
||||||
align="center"
|
align="center"
|
||||||
@@ -134,33 +118,18 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column show-overflow-tooltip prop="qty" label="需求数量">
|
<el-table-column show-overflow-tooltip prop="po_code" label="采购订单">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input-number
|
<el-input
|
||||||
v-model.number="form.tableData[scope.$index].qty"
|
v-model="form.tableData[scope.$index].po_code"
|
||||||
size="small"
|
size="small"
|
||||||
:controls="false"
|
:controls="false"
|
||||||
controls-position="right"
|
controls-position="right"
|
||||||
:precision="3"
|
|
||||||
:min="0"
|
|
||||||
@change="changeQty"
|
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<!-- <el-table-column show-overflow-tooltip prop="safe_qty" label="安全库存"/>-->
|
<!-- <el-table-column show-overflow-tooltip prop="safe_qty" label="安全库存"/>-->
|
||||||
<!-- <el-table-column show-overflow-tooltip prop="remark" label="总需求数量"/>-->
|
<!-- <el-table-column show-overflow-tooltip prop="remark" label="总需求数量"/>-->
|
||||||
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="数量单位"/>
|
|
||||||
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="100" fixed="right">
|
|
||||||
<template scope="scope">
|
|
||||||
<el-button
|
|
||||||
type="danger"
|
|
||||||
class="filter-item"
|
|
||||||
size="mini"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click.native.prevent="deleteRow(scope.$index, form.tableData)"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<MaterDtl
|
<MaterDtl
|
||||||
@@ -196,28 +165,6 @@ export default {
|
|||||||
components: {MaterDtl},
|
components: {MaterDtl},
|
||||||
mixins: [crud(), form(defaultForm)],
|
mixins: [crud(), form(defaultForm)],
|
||||||
dicts: ['IO_BILL_STATUS', 'ST_INV_RAW_IN_TYPE', 'ST_QUALITY_SCODE', 'bill_type', 'product_area'],
|
dicts: ['IO_BILL_STATUS', 'ST_INV_RAW_IN_TYPE', 'ST_QUALITY_SCODE', 'bill_type', 'product_area'],
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
dialogVisible: false,
|
|
||||||
materShow: false,
|
|
||||||
billShow: false,
|
|
||||||
struct_id: '',
|
|
||||||
sect_id: '',
|
|
||||||
opendtlParam: null,
|
|
||||||
sects: [],
|
|
||||||
rules: {
|
|
||||||
product_code: [
|
|
||||||
{required: true, message: '生产车间不能为空', trigger: 'blur'}
|
|
||||||
],
|
|
||||||
bill_type: [
|
|
||||||
{required: true, message: '业务类型不能为空', trigger: 'blur'}
|
|
||||||
],
|
|
||||||
biz_date: [
|
|
||||||
{required: true, message: '业务日期不能为空', trigger: 'blur'}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
close() {
|
close() {
|
||||||
this.$emit('AddChanged')
|
this.$emit('AddChanged')
|
||||||
@@ -238,67 +185,6 @@ export default {
|
|||||||
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.form.workshop_id) {
|
|
||||||
this.crud.notify('车间不能为空!', CRUD.NOTIFICATION_TYPE.INFO)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
for (let i = 0; i < this.form.tableData.length; i++) {
|
|
||||||
const row = this.form.tableData[i]
|
|
||||||
if (!row.qty || row.qty === 0) {
|
|
||||||
this.crud.notify('数量不能为0', CRUD.NOTIFICATION_TYPE.INFO)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
deleteRow(index, rows) {
|
|
||||||
const material_code = rows[index].material_code
|
|
||||||
let len = rows.length
|
|
||||||
while (len--) {
|
|
||||||
const obj = rows[len]
|
|
||||||
if (material_code === obj.material_code) {
|
|
||||||
const index = rows.indexOf(obj)
|
|
||||||
if (index > -1) { // 移除找到的指定元素
|
|
||||||
this.form.total_qty = parseFloat(this.form.total_qty) - parseFloat(rows[index].plan_qty)
|
|
||||||
rows.splice(index, 1)
|
|
||||||
this.form.detail_count = this.form.tableData.length
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
tableChanged(item) {
|
|
||||||
this.form.qty_unit_id = item.base_unit_id
|
|
||||||
this.form.qty_unit_name = item.base_unit_name
|
|
||||||
this.form.material_code = item.material_code
|
|
||||||
this.form.material_name = item.material_name
|
|
||||||
this.form.material_id = item.material_id
|
|
||||||
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(row.plan_qty)
|
|
||||||
},
|
|
||||||
add() {
|
|
||||||
if (!this.form.material_code){
|
|
||||||
this.crud.notify('请选择一种物料进行新增!', CRUD.NOTIFICATION_TYPE.INFO)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
const row = {}
|
|
||||||
row.material_code = this.form.material_code
|
|
||||||
row.material_name = this.form.material_name
|
|
||||||
row.qty_unit_name = this.form.qty_unit_name
|
|
||||||
this.$set(row,'ask_time',null)
|
|
||||||
this.$set(row,'qty',null)
|
|
||||||
this.form.tableData.splice(-1, 0, row)
|
|
||||||
},
|
|
||||||
insertEvent() {
|
|
||||||
this.materShow = true
|
|
||||||
},
|
|
||||||
insertBill(row) {
|
|
||||||
this.billShow = true
|
|
||||||
},
|
|
||||||
changeQty() {
|
|
||||||
this.form.total_qty = 0
|
|
||||||
this.form.tableData.forEach((item) => {
|
|
||||||
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.plan_qty)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,11 +34,10 @@
|
|||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="query.createTime"
|
v-model="query.createTime"
|
||||||
type="daterange"
|
type="daterange"
|
||||||
value-format="yyyy-MM-dd HH:mm:ss"
|
value-format="yyyy-MM-dd"
|
||||||
align="center"
|
align="center"
|
||||||
start-placeholder="开始日期"
|
start-placeholder="开始日期"
|
||||||
end-placeholder="结束日期"
|
end-placeholder="结束日期"
|
||||||
:default-time="['00:00:00', '23:59:59']"
|
|
||||||
@change="crud.toQuery"
|
@change="crud.toQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -118,7 +117,7 @@
|
|||||||
icon="el-icon-finished"
|
icon="el-icon-finished"
|
||||||
:disabled="crud.selections.length !== 1"
|
:disabled="crud.selections.length !== 1"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="commit(crud.selections)"
|
@click="crud.toEdit(crud.selections[0])"
|
||||||
>
|
>
|
||||||
确认采购
|
确认采购
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -129,7 +128,7 @@
|
|||||||
icon="el-icon-check"
|
icon="el-icon-check"
|
||||||
:disabled="crud.selections.length === 0"
|
:disabled="crud.selections.length === 0"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="commit(crud.selections)"
|
@click="confirm(crud.selections)"
|
||||||
>
|
>
|
||||||
强制完成
|
强制完成
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -163,7 +162,7 @@
|
|||||||
<el-table-column label="生成方式" align="center" prop="create_mode" :formatter="createModeFormat"/>
|
<el-table-column label="生成方式" align="center" prop="create_mode" :formatter="createModeFormat"/>
|
||||||
<el-table-column label="创建人" align="center" prop="create_name" width="150"/>
|
<el-table-column label="创建人" align="center" prop="create_name" width="150"/>
|
||||||
<el-table-column label="创建时间" align="center" prop="create_time" width="150"/>
|
<el-table-column label="创建时间" align="center" prop="create_time" width="150"/>
|
||||||
<el-table-column label="提交人" align="center" prop="audit_namne" width="150"/>
|
<el-table-column label="提交人" align="center" prop="audit_name" width="150"/>
|
||||||
<el-table-column label="提交时间" align="center" prop="audit_time" width="140px"/>
|
<el-table-column label="提交时间" align="center" prop="audit_time" width="140px"/>
|
||||||
<el-table-column label="采购确认人" align="center" prop="purchase_name" width="150"/>
|
<el-table-column label="采购确认人" align="center" prop="purchase_name" width="150"/>
|
||||||
<el-table-column label="采购确认时间" align="center" prop="purchase_time" width="140px"/>
|
<el-table-column label="采购确认时间" align="center" prop="purchase_time" width="140px"/>
|
||||||
@@ -194,7 +193,7 @@ import crudOperation from '@crud/CRUD.operation'
|
|||||||
import udOperation from '@crud/UD.operation'
|
import udOperation from '@crud/UD.operation'
|
||||||
import pagination from '@crud/Pagination'
|
import pagination from '@crud/Pagination'
|
||||||
import DateRangePicker from '@/components/DateRangePicker/index'
|
import DateRangePicker from '@/components/DateRangePicker/index'
|
||||||
import AddDialog from '@/views/wms/pcs/purchaseorder/AddDialog'
|
import AddDialog from '@/views/wms/pcs/purchaseplan/AddDialog'
|
||||||
import crudStorattr from '@/views/wms/storage_manage/basedata/basedata'
|
import crudStorattr from '@/views/wms/storage_manage/basedata/basedata'
|
||||||
import { download } from '@/api/data'
|
import { download } from '@/api/data'
|
||||||
import { downloadFile } from '@/utils'
|
import { downloadFile } from '@/utils'
|
||||||
@@ -207,7 +206,7 @@ export default {
|
|||||||
return CRUD({
|
return CRUD({
|
||||||
title: '',
|
title: '',
|
||||||
optShow: {reset: true},
|
optShow: {reset: true},
|
||||||
idField: 'id',
|
idField: 'id,desc',
|
||||||
query: {
|
query: {
|
||||||
'status': '1'
|
'status': '1'
|
||||||
},
|
},
|
||||||
@@ -282,8 +281,8 @@ export default {
|
|||||||
crud.downloadLoading = false
|
crud.downloadLoading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
commit(rows) {
|
confirm(rows) {
|
||||||
crudPurchase.commit(rows).then(res => {
|
crudPurchase.confirm(rows).then(res => {
|
||||||
this.crud.notify('单据确认成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
this.crud.notify('单据确认成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
this.crud.toQuery()
|
this.crud.toQuery()
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user