代码更新

This commit is contained in:
2023-03-25 17:14:33 +08:00
parent c6b57d9756
commit b83498741d
20 changed files with 4631 additions and 2 deletions

View File

@@ -169,6 +169,9 @@ public class SectattrServiceImpl implements SectattrService {
String is_productstore = (String) whereJson.get("is_productstore");
String is_attachment = (String) whereJson.get("is_attachment");
String is_reversed = (String) whereJson.get("is_reversed");
String stor_id = (String) whereJson.get("stor_id");
stor_map.put("stor_id", stor_id);
if (!StrUtil.isEmpty(is_materialstore)) {
stor_map.put("is_materialstore", is_materialstore);
}

View File

@@ -21,6 +21,7 @@
输入.is_productstore TYPEAS s_string
输入.is_attachment TYPEAS s_string
输入.is_reversed TYPEAS s_string
输入.stor_id TYPEAS s_string
[临时表]
@@ -95,6 +96,9 @@
ENDOPTION
OPTION 输入.is_reversed <> ""
stor.is_reversed = 输入.is_reversed
ENDOPTION
OPTION 输入.stor_id <> ""
stor.stor_id = 输入.stor_id
ENDOPTION
ENDSELECT
ENDQUERY

View File

@@ -1,5 +1,6 @@
package org.nl.wms.sch.rest;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
@@ -79,5 +80,12 @@ public class RegionController {
return new ResponseEntity<>(regionService.getPointTypeSelectByCode(region_code), HttpStatus.CREATED);
}
@PostMapping("/getRegionSelect")
@Log("获取区域下拉框")
@ApiOperation("获取区域下拉框")
public ResponseEntity<Object> getRegionSelect(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(regionService.getRegionSelect(whereJson), HttpStatus.CREATED);
}
}

View File

@@ -1,6 +1,7 @@
package org.nl.wms.sch.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.nl.wms.sch.service.dto.RegionDto;
import org.springframework.data.domain.Pageable;
@@ -74,4 +75,11 @@ public interface RegionService {
* @return
*/
JSONArray getPointTypeSelectByCode(String region_code);
/**
* 获取区域类型下拉框
* @param
* @return JSONObject
*/
JSONObject getRegionSelect(JSONObject whereJson);
}

View File

@@ -245,7 +245,7 @@ public class PointServiceImpl implements PointService {
@Override
public JSONArray getPoint(Map wherJson) {
String area_type = (String) wherJson.get("area_type");
JSONArray point_rows = WQLObject.getWQLObject("sch_base_point").query("area_type IN (" + area_type + ") AND is_used = '1' AND is_delete = '0' order by point_code").getResultJSONArray(0);
JSONArray point_rows = WQLObject.getWQLObject("sch_base_point").query("region_code = '"+area_type+"' and is_used = '1' and is_delete = '0'").getResultJSONArray(0);
return point_rows;
}

View File

@@ -166,4 +166,38 @@ public class RegionServiceImpl implements RegionService {
return res;
}
@Override
public JSONObject getRegionSelect(JSONObject whereJson) {
String stor_id = whereJson.getString("stor_id");
JSONArray prodArr = WQL.getWO("QSCH_REGION_01").addParam("flag", "2").addParam("value",stor_id).process().getResultJSONArray(0);
JSONArray new_ja = new JSONArray();
for (int i = 0; i < prodArr.size(); i++) {
JSONObject json = prodArr.getJSONObject(i);
JSONObject jsonMst = new JSONObject();
jsonMst.put("value",json.getString("value"));
jsonMst.put("label",json.getString("label"));
// 查询子类
JSONArray DtlArr = WQL.getWO("QSCH_REGION_01").addParam("flag", "3").addParam("product_area", json.getString("value")).process().getResultJSONArray(0);
if (DtlArr.size() > 0) {
JSONArray sect_ja = new JSONArray();
for (int j = 0; j < DtlArr.size(); j++) {
JSONObject json2 = DtlArr.getJSONObject(j);
JSONObject sect_cas = new JSONObject();
sect_cas.put("value", json2.getString("region_code"));
sect_cas.put("label", json2.getString("region_name"));
sect_ja.add(sect_cas);
}
jsonMst.put("children", sect_ja);
}
new_ja.add(jsonMst);
}
JSONObject jo = new JSONObject();
jo.put("content", new_ja);
return jo;
}
}

View File

@@ -16,6 +16,7 @@
输入.flag TYPEAS s_string
输入.region_code TYPEAS s_string
输入.product_area TYPEAS s_string
输入.value TYPEAS s_string
[临时表]
--这边列出来的临时表就会在运行期动态创建
@@ -57,3 +58,35 @@
ENDSELECT
ENDPAGEQUERY
ENDIF
IF 输入.flag = "2"
QUERY
SELECT
*
FROM
sys_dict
WHERE
code = 'product_area'
OPTION 输入.value <> ""
value = 输入.value
ENDOPTION
ENDSELECT
ENDQUERY
ENDIF
IF 输入.flag = "3"
QUERY
SELECT
*
FROM
sch_base_region
WHERE
1=1
OPTION 输入.product_area <> ""
product_area = 输入.product_area
ENDOPTION
ENDSELECT
ENDQUERY
ENDIF

View File

@@ -0,0 +1,204 @@
package org.nl.wms.st.in.rest;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.anno.Log;
import org.nl.wms.st.in.service.ProductInService;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
@RestController
@RequiredArgsConstructor
@Api(tags = "成品入库")
@RequestMapping("/api/in/productIn")
@Slf4j
public class ProductInController {
private final ProductInService productInService;
@GetMapping
@Log("查询入库单据")
@ApiOperation("查询入库单据")
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
return new ResponseEntity<>(productInService.pageQuery(whereJson, page), HttpStatus.OK);
}
@Log("删除出入库单")
@ApiOperation("删除出入库单")
@DeleteMapping
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
productInService.deleteAll(ids);
return new ResponseEntity<>(HttpStatus.OK);
}
@GetMapping("/getBillDtl")
@Log("查询入库单来源")
@ApiOperation("查询入库单来源")
public ResponseEntity<Object> getBillDtl(@RequestParam Map whereJson, Pageable page) {
return new ResponseEntity<>(productInService.getBillDtl(whereJson, page), HttpStatus.OK);
}
@PostMapping()
@Log("新增入库单")
@ApiOperation("新增入库单")
public ResponseEntity<Object> insertDtl(@RequestBody JSONObject whereJson) {
productInService.insertDtl(whereJson);
return new ResponseEntity<>(HttpStatus.CREATED);
}
@PutMapping
@Log("修改入库单")
@ApiOperation("修改入库单")
public ResponseEntity<Object> update(@RequestBody JSONObject whereJson) {
productInService.update(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/queryStor")
@Log("查询仓库")
@ApiOperation("查询仓库")
public ResponseEntity<Object> queryStor() {
return new ResponseEntity<>(productInService.queryStor(), HttpStatus.OK);
}
@PostMapping("/getIODtl")
@Log("查询出入库单明细")
@ApiOperation("查询出入库单明细")
public ResponseEntity<Object> getIODtl(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(productInService.getIODtl(whereJson), HttpStatus.OK);
}
@PostMapping("/commit")
@Log("出入单提交")
@ApiOperation("出入单提交")
public ResponseEntity<Object> commit(@RequestBody Map whereJson) {
productInService.commit(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/getDisDtl")
@Log("查询入库分配明细")
@ApiOperation("查询入库分配明细")
public ResponseEntity<Object> getDisDtl(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(productInService.getDisDtl(whereJson), HttpStatus.OK);
}
@PostMapping("/divStruct")
@Log("分配货位")
@ApiOperation("分配货位")
public ResponseEntity<Object> divStruct(@RequestBody Map whereJson) {
productInService.divStruct(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/unDivStruct")
@Log("取消分配货位")
@ApiOperation("取消分配货位")
public ResponseEntity<Object> unDivStruct(@RequestBody Map whereJson) {
productInService.unDivStruct(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/divPoint")
@Log("设置起点")
@ApiOperation("设置起点")
public ResponseEntity<Object> divPoint(@RequestBody Map whereJson) {
productInService.divPoint(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/queryTask")
@Log("查询任务")
@ApiOperation("查询任务")
public ResponseEntity<Object> queryTask(@RequestBody Map whereJson) {
return new ResponseEntity<>(productInService.queryTask(whereJson), HttpStatus.OK);
}
@PostMapping("/delDis")
@Log("删除分配")
@ApiOperation("删除分配")
public ResponseEntity<Object> delDis(@RequestBody JSONObject whereJson) {
productInService.delDis(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/queryBoxMater")
@Log("查询箱内子卷")
@ApiOperation("查询箱内子卷")
public ResponseEntity<Object> queryBoxMater(@RequestBody JSONArray whereJson) {
return new ResponseEntity<>(productInService.queryBoxMater(whereJson), HttpStatus.OK);
}
@PostMapping("/updateTask")
@Log("变更任务")
@ApiOperation("变更任务")
public ResponseEntity<Object> updateTask(@RequestBody Map whereJson) {
productInService.updateTask(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/delTask")
@Log("删除任务")
@ApiOperation("删除任务")
public ResponseEntity<Object> delTask(@RequestBody Map whereJson) {
productInService.delTask(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/reIssueTask")
@Log("下发")
@ApiOperation("下发")
public ResponseEntity<Object> reIssueTask(@RequestBody Map whereJson) {
productInService.reIssueTask(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/confirmTask")
@Log("完成任务")
@ApiOperation("完成任务")
public ResponseEntity<Object> confirmTask(@RequestBody Map whereJson) {
productInService.confirmTask(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/cancelTask")
@Log("取消完成任务")
@ApiOperation("取消完成任务")
public ResponseEntity<Object> cancelTask(@RequestBody Map whereJson) {
productInService.cancelTask(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/confirm")
@Log("完成单据")
@ApiOperation("完成单据")
public ResponseEntity<Object> confirm(@RequestBody Map whereJson) {
productInService.confirm(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/backConfirm")
@Log("完成入库负单")
@ApiOperation("完成入库负单")
public ResponseEntity<Object> backConfirm(@RequestBody Map whereJson) {
productInService.backConfirm(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/autoDis")
@Log("自动分配")
@ApiOperation("自动分配")
public ResponseEntity<Object> autoDis(@RequestBody JSONObject whereJson) {
productInService.autoDis(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
}

View File

@@ -0,0 +1,91 @@
package org.nl.wms.st.in.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.springframework.data.domain.Pageable;
import java.util.Map;
public interface ProductInService {
/**
* 查询数据分页
*
* @param whereJson 条件
* @param page 分页参数
* @return Map<String, Object>
*/
Map<String, Object> pageQuery(Map whereJson, Pageable page);
Map<String, Object> getBillDtl(Map whereJson,Pageable page);
/**
* 新增单据
* @param whereJson /
* @return iostorinv_id
*/
String insertDtl (JSONObject whereJson);
/**
* 删除单据
* @param ids /
*/
void deleteAll(Long[] ids);
void delDis(JSONObject whereJson);
JSONArray queryBoxMater(JSONArray rows);
/**
* 修改单据
* @param whereJson /
*/
void update(JSONObject whereJson);
void commit(Map whereJson);
/**
* 查询出入库单明细
* @param whereJson /
* @return JSONArray
*/
JSONArray getIODtl(JSONObject whereJson);
void divStruct(Map whereJson);
void unDivStruct(Map whereJson);
void divPoint(Map whereJson);
void updateTask(Map whereJson);
void delTask(Map whereJson);
void reIssueTask(Map whereJson);
void confirmTask(Map whereJson);
void cancelTask(Map whereJson);
void confirm(Map whereJson);
void backConfirm(Map whereJson);
/**
* 查询入库分配明细
* @param whereJson /
* @return JSONArray
*/
JSONArray getDisDtl(JSONObject whereJson);
JSONArray queryTask(Map whereJson);
JSONObject autoDis(JSONObject whereJson);
JSONObject autoDisMove(JSONObject whereJson);
/**
* 查询仓库
* @return JSONArray
*/
JSONArray queryStor();
}

View File

@@ -0,0 +1,134 @@
[交易说明]
交易名: 成品入库分页查询
所属模块:
功能简述:
版权所有:
表引用:
版本经历:
[数据库]
--指定数据库为空采用默认值默认为db.properties中列出的第一个库
[IO定义]
#################################################
## 表字段对应输入参数
#################################################
输入.flag TYPEAS s_string
输入.stor_id TYPEAS s_string
输入.begin_time TYPEAS s_string
输入.end_time TYPEAS s_string
输入.bill_status TYPEAS s_string
输入.bill_type TYPEAS s_string
输入.bill_code TYPEAS s_string
输入.iostorinvdtl_id TYPEAS s_string
[临时表]
--这边列出来的临时表就会在运行期动态创建
[临时变量]
--所有中间过程变量均可在此处定义
[业务过程]
##########################################
# 1、输入输出检查 #
##########################################
##########################################
# 2、主过程前处理 #
##########################################
##########################################
# 3、业务主过程 #
##########################################
IF 输入.flag = "1"
PAGEQUERY
SELECT
*
FROM
ST_IVT_IOStorInv
WHERE
io_type = '0'
AND is_delete = '0'
OPTION 输入.stor_id <> ""
stor_id = 输入.stor_id
ENDOPTION
OPTION 输入.begin_time <> ""
input_time <= 输入.begin_time
ENDOPTION
OPTION 输入.end_time <> ""
input_time >= 输入.end_time
ENDOPTION
OPTION 输入.bill_status <> ""
bill_status = 输入.bill_status
ENDOPTION
OPTION 输入.bill_type <> ""
bill_type = 输入.bill_type
ENDOPTION
OPTION 输入.bill_code <> ""
bill_code LIKE 输入.bill_code
ENDOPTION
ENDSELECT
ENDPAGEQUERY
ENDIF
IF 输入.flag = "2"
QUERY
SELECT
dtl.*,
mater.material_code,
mater.material_name,
mater.material_spec
FROM
ST_IVT_IOStorInvDtl dtl
LEFT JOIN ST_IVT_IOStorInv mst ON mst.iostorinv_id = dtl.iostorinv_id
LEFT JOIN md_me_materialbase mater ON mater.material_id = dtl.material_id
WHERE
mst.io_type = '0'
AND mst.is_delete = '0'
OPTION 输入.bill_code <> ""
mst.bill_code = 输入.bill_code
ENDOPTION
order by dtl.seq_no ASC
ENDSELECT
ENDQUERY
ENDIF
IF 输入.flag = "3"
QUERY
SELECT
dis.*,
mater.material_code,
mater.material_name,
mater.material_spec,
point.point_code
FROM
ST_IVT_IOStorInvDis dis
LEFT JOIN sch_base_point point ON point.point_id = dis.point_id
LEFT JOIN md_me_materialbase mater ON mater.material_id = dis.material_id
WHERE
IFNULL(dis.task_id,'') = ''
OPTION 输入.iostorinvdtl_id <> ""
dis.iostorinvdtl_id = 输入.iostorinvdtl_id
ENDOPTION
order by dis.seq_no ASC
ENDSELECT
ENDQUERY
ENDIF

View File

@@ -48,4 +48,12 @@ export function getPointTypeSelectByCode(code) {
})
}
export default { add, edit, del, changeActive, getPointStatusSelectByCode, getPointTypeSelectByCode }
export function getRegionSelect(data) {
return request({
url: 'api/region/getRegionSelect',
method: 'post',
data
})
}
export default { add, edit, del, changeActive, getPointStatusSelectByCode, getPointTypeSelectByCode, getRegionSelect }

View File

@@ -0,0 +1,202 @@
<template>
<el-dialog
title="货位选择"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
width="1000px"
@close="close"
@open="open"
>
<!-- 搜索 -->
<el-row>
<el-col :span="6">
<el-cascader
v-model="query.sect"
placeholder="所属库区"
:options="sects"
:props="{ checkStrictly: true }"
clearable
@change="sectQueryChange"
/>
</el-col>
<el-col :span="6">
<el-input
v-model="query.search"
clearable
style="width: 200px"
size="mini"
placeholder="输入货位编码、名称"
prefix-icon="el-icon-search"
class="filter-item"
/> </el-col>
<el-col :span="6">
<rrOperation />
</el-col>
</el-row>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
style="width: 100%;"
border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@select="handleSelectionChange"
@select-all="onSelectAll"
>
<el-table-column type="selection" width="55" />
<el-table-column prop="struct_code" label="货位编码" />
<el-table-column prop="struct_name" label="货位名称" />
<el-table-column prop="sect_name" label="库区名称" />
</el-table>
<!--分页组件-->
<pagination />
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</span>
</el-dialog>
</template>
<script>
import CRUD, { header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
import crudSectattr from '@/api/wms/basedata/st/sectattr'
export default {
name: 'StructDialog',
components: { rrOperation, pagination },
cruds() {
return CRUD({
title: '点位',
optShow: {},
url: 'api/point/getPoint',
idField: 'point_id',
sort: 'point_id,desc',
query: { search: '', is_lock: '1', lock_type: '', sect_id: '', stor_id: '' }
})
},
mixins: [presenter(), header()],
props: {
dialogShow: {
type: Boolean,
default: false
},
sectProp: {
type: Object
},
storId: {
type: String,
default: null
}
},
data() {
return {
sects: [],
classes: [],
dialogVisible: false,
sect: {},
checkrow: {},
rows: [],
dialogDis: true,
lock: ''
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
},
sectProp: {
handler(newValue, oldValue) {
this.sect = newValue
}
}
},
methods: {
/**
* 接受父组件传值
* @param msg
*/
getMsg(msg) {
this.dialogDis = msg
this.lock = '1'
},
[CRUD.HOOK.beforeRefresh]() {
this.query.lock_type = this.lock
return true
},
open() {
crudSectattr.getSect({ 'stor_id': this.storId }).then(res => {
this.sects = res.content
})
if (this.sect) {
this.query.sect = this.sect
if (this.sect.length === 1) {
this.query.stor_id = this.sect[0]
this.query.stor_id = this.storId
}
if (this.sect.length === 0) {
this.query.sect_id = ''
this.query.stor_id = ''
}
if (this.sect.length === 2) {
this.query.stor_id = this.sect[0]
this.query.sect_id = this.sect[1]
}
}
this.query.is_lock = '1'
this.query.lock_type = this.lock
this.query.is_used = '1'
debugger
this.query.stor_id = this.storId
this.crud.toQuery()
},
handleSelectionChange(val, row) {
if (val.length > 1) {
this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(val.pop())
} else {
this.checkrow = row
}
},
sectQueryChange(val) {
if (val.length === 1) {
this.crud.query.stor_id = val[0]
this.crud.query.sect_id = ''
}
if (val.length === 0) {
this.crud.query.sect_id = ''
this.crud.query.stor_id = ''
}
if (val.length === 2) {
this.crud.query.stor_id = val[0]
this.crud.query.sect_id = val[1]
}
},
onSelectAll() {
this.$refs.table.clearSelection()
},
close() {
this.crud.resetQuery()
this.query.sect = null
this.$emit('update:dialogShow', false)
},
submit() {
this.rows = this.$refs.table.selection
if (this.rows.length <= 0) {
this.$message('请先勾选仓位')
return
}
this.$emit('update:dialogShow', false)
this.$emit('tableChanged', this.checkrow)
}
}
}
</script>

View File

@@ -0,0 +1,348 @@
<template>
<el-dialog
:title="crud.status.title"
append-to-body
fullscreen
:before-close="crud.cancelCU"
:visible.sync="crud.status.cu > 0 || crud.status.view > 0"
width="1200px"
@open="open"
@close="close"
>
<el-row v-show="crud.status.cu > 0" :gutter="20">
<el-col :span="20" style="border: 1px solid white">
<span />
</el-col>
<el-col :span="4">
<span>
<el-button icon="el-icon-check" size="mini" :loading="crud.cu === 2" type="primary" @click="crud.submitCU">保存</el-button>
<el-button icon="el-icon-close" size="mini" type="info" @click="crud.cancelCU">关闭</el-button>
</span>
</el-col>
</el-row>
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" :rules="rules" size="mini" label-width="85px" label-suffix=":">
<el-form-item label="单据号" prop="bill_code">
<label slot="label">单&nbsp;&nbsp;据&nbsp;号:</label>
<el-input v-model="form.bill_code" disabled placeholder="系统生成" clearable style="width: 210px" />
</el-form-item>
<el-form-item label="仓库" prop="product_code">
<label slot="label">生产区域:</label>
<el-select
v-model="form.product_code"
clearable
class="filter-item"
style="width: 210px"
:disabled="crud.status.view > 0"
>
<el-option
v-for="item in dict.product_area"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="业务类型" prop="bill_type">
<el-select
v-model="form.bill_type"
clearable
placeholder="业务类型"
style="width: 210px"
class="filter-item"
:disabled="crud.status.view > 0"
>
<el-option
v-for="item in dict.ST_INV_IN_TYPE"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="单据状态" prop="bill_status">
<el-select
v-model="form.bill_status"
clearable
style="width: 210px"
placeholder="单据状态"
class="filter-item"
disabled
>
<el-option
v-for="item in dict.IO_BILL_STATUS"
:key="item.id"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="明细数" prop="detail_count">
<label slot="label">明&nbsp;&nbsp;细&nbsp;数:</label>
<el-input v-model="form.detail_count" size="mini" disabled style="width: 210px" />
</el-form-item>
<el-form-item label="总重量" prop="total_qty">
<label slot="label">总&nbsp;&nbsp;重&nbsp;量:</label>
<el-input-number
v-model="form.total_qty"
:controls="false"
:precision="3"
:min="0"
disabled
style="width: 210px"
/>
</el-form-item>
<el-form-item label="业务日期" prop="biz_date">
<el-date-picker v-model="form.biz_date" type="date" placeholder="选择日期" style="width: 210px" value-format="yyyy-MM-dd" :disabled="crud.status.view > 0" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<label slot="label">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注:</label>
<el-input v-model="form.remark" style="width: 380px;" rows="2" type="textarea" :disabled="crud.status.view > 0" />
</el-form-item>
</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"
size="mini"
@click="insertEvent()"
>
添加物料
</el-button>
</span>
</div>
<!--表格渲染-->
<el-table
ref="table"
:data="form.tableData"
style="width: 100%;"
border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
>
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" />
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" />
<el-table-column show-overflow-tooltip prop="material_spec" label="物料规格" />
<el-table-column show-overflow-tooltip prop="pcsn" label="订单号">
<template slot-scope="scope">
<el-input
v-model="form.tableData[scope.$index].pcsn"
clearable
:controls="false"
controls-position="right"
size="small"
/>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="plan_qty" label="数量">
<template slot-scope="scope">
<el-input-number
v-model="form.tableData[scope.$index].plan_qty"
size="small"
:controls="false"
controls-position="right"
precision="3"
:min="0"
@change="changeQty"
/>
</template>
</el-table-column>
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="170" 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>
<MaterDtl
:dialog-show.sync="materShow"
:is-single="false"
:mater-opt-code="materType"
@setMaterValue="tableChanged"
/>
</el-dialog>
</template>
<script>
import CRUD, { crud, form } from '@crud/crud'
import crudProductIn from '@/views/wms/st/productIn/productin'
import MaterDtl from '@/views/wms/pub/MaterDialog'
const defaultForm = {
bill_code: '',
product_code: '',
bill_status: '10',
total_qty: '0',
detail_count: '0',
bill_type: '',
remark: '',
biz_date: new Date(),
create_mode: '',
tableData: []
}
export default {
name: 'AddDialog',
components: { MaterDtl },
mixins: [crud(), form(defaultForm)],
dicts: ['IO_BILL_STATUS', 'ST_QUALITY_SCODE', 'ST_INV_IN_TYPE', 'product_area'],
props: {
dialogShow: {
type: Boolean,
default: false
},
openParam: {
type: Object
}
},
data() {
return {
dialogVisible: false,
materShow: false,
dtlShow: false,
opendtlParam: null,
materType: '03', // 关键成品
storlist: [],
billtypelist: [],
rules: {
product_code: [
{ required: true, message: '生产区域不能为空', trigger: 'blur' }
],
bill_type: [
{ required: true, message: '业务类型不能为空', trigger: 'blur' }
],
biz_date: [
{ required: true, message: '业务日期不能为空', trigger: 'blur' }
]
}
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
}
},
methods: {
open() {
crudProductIn.queryStor().then(res => {
this.storlist = res
})
},
close() {
this.$emit('AddChanged')
},
[CRUD.HOOK.afterToEdit]() {
// 获取入库单明细
crudProductIn.getIODtl({ 'bill_code': this.form.bill_code }).then(res => {
this.form.tableData = res
// 将明细变成不可编辑
for (let i = 0; i < this.form.tableData.length; i++) {
const row = this.form.tableData[i]
this.form.tableData.splice(i, 1, row)
}
})
},
[CRUD.HOOK.afterToView]() {
crudProductIn.getIODtl({ 'bill_code': this.form.bill_code }).then(res => {
this.form.tableData = res
// 将明细变成不可编辑
for (let i = 0; i < this.form.tableData.length; i++) {
const row = this.form.tableData[i]
this.form.tableData.splice(i, 1, row)
}
})
},
[CRUD.HOOK.beforeSubmit]() {
// 提交前校验
if (this.form.tableData.length === 0) {
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.pcsn || !row.plan_qty) {
this.crud.notify('订单号、数量不能为空', 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(rows) {
// 对新增的行进行校验不能存在相同物料批次
rows.forEach((item) => {
let same_mater = true
this.form.tableData.forEach((row) => {
if (row.material_code === item.material_code) {
same_mater = false
}
})
if (same_mater) {
item.quality_scode = '01'
item.ivt_level = '01'
item.is_active = '1'
item.plan_qty = '1'
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.plan_qty)
this.form.tableData.splice(-1, 0, item)
}
})
this.form.detail_count = this.form.tableData.length
},
insertEvent(row) {
this.materShow = 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)
})
}
}
}
</script>
<style>
.crud-opts2 {
padding: 4px 0;
display: -webkit-flex;
display: flex;
align-items: center;
}
.crud-opts2 .crud-opts-right2 {
margin-left: auto;
}
</style>

View File

@@ -0,0 +1,182 @@
<template>
<el-dialog
title="物料新增"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
width="1000px"
@close="close"
@open="open"
>
<div class="head-container">
<div v-if="crud.props.searchToggle">
<!-- 搜索 -->
<date-range-picker v-model="query.createTime" class="date-item" value-format="yyyy-MM-dd" />
<el-input
v-model="query.bill_code"
clearable
size="mini"
placeholder="单据号"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
<el-input
v-model="query.package_box_sn"
clearable
size="mini"
placeholder="箱号"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
<el-input
v-model="query.container_name"
clearable
size="mini"
placeholder="子卷号"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
<el-input
v-model="query.material_search"
clearable
size="mini"
placeholder="物料编码"
style="width: 230px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
<el-input
v-model="query.sap_pcsn"
clearable
size="mini"
placeholder="sap批次"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
<rrOperation />
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation />
<!--表格渲染-->
<el-table
ref="multipleTable"
v-loading="crud.loading"
:data="crud.data"
style="width: 100%;"
@selection-change="crud.selectionChangeHandler"
>
<el-table-column type="selection" width="55" />
<el-table-column show-overflow-tooltip width="150" prop="sale_order_name" label="订单号" />
<el-table-column show-overflow-tooltip width="150" prop="customer_name" label="客户编号" />
<el-table-column width="200" prop="customer_description" label="客户名称" />
<el-table-column show-overflow-tooltip prop="package_box_sn" width="250" label="箱号" />
<el-table-column show-overflow-tooltip width="100" prop="quanlity_in_box" label="箱内子卷数" />
<el-table-column show-overflow-tooltip width="150" prop="container_name" label="子卷号" />
<el-table-column show-overflow-tooltip width="150" prop="sap_pcsn" label="sap批次" />
<el-table-column show-overflow-tooltip width="150" prop="product_name" label="物料编码" />
<el-table-column show-overflow-tooltip width="170" prop="product_description" label="物料描述" />
<el-table-column show-overflow-tooltip prop="width" label="幅宽" />
<el-table-column show-overflow-tooltip prop="thickness" label="产品厚度" />
</el-table>
<!--分页组件-->
<pagination />
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</span>
</el-dialog>
</template>
<script>
import CRUD, { crud, header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination'
import DateRangePicker from '@/components/DateRangePicker/index'
import crudProductIn from '@/views/wms/st/productIn/productin'
const start = new Date()
export default {
name: 'AddDtl',
components: { crudOperation, rrOperation, pagination, DateRangePicker },
cruds() {
return CRUD({
title: '用户',
url: '/api/in/rawAssist/getBillDtl',
crudMethod: {},
optShow: {
reset: true
}
})
},
mixins: [presenter(), header(), crud()],
props: {
dialogShow: {
type: Boolean,
default: false
},
opendtlParam: {
type: Object
}
},
data() {
return {
dialogVisible: false,
rows: [],
tableData: []
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
}
},
methods: {
[CRUD.HOOK.beforeRefresh]() {
this.crud.query.bill_type = '000101'
return true
},
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
if (columnIndex === 0) {
if (rowIndex % 2 === 0) {
return {
rowspan: 2,
colspan: 1
}
} else {
return {
rowspan: 0,
colspan: 0
}
}
}
},
open() {
this.crud.toQuery()
},
close() {
this.$emit('update:dialogShow', false)
},
submit() {
debugger
this.$emit('update:dialogShow', false)
this.rows = this.$refs.multipleTable.selection
crudProductIn.queryBoxMater(this.rows).then(res => {
this.rows = res
this.$emit('tableChanged', this.rows)
})
// this.form = this.$options.data().form
}
}
}
</script>

View File

@@ -0,0 +1,573 @@
<template>
<el-dialog
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
:show-close="false"
fullscreen
@close="close"
@open="open"
>
<span slot="title" class="dialog-footer">
<div class="crud-opts2">
<span class="el-dialog__title2">入库分配</span>
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left"/>
<el-button slot="left" type="info" @click="dialogVisible = false">关闭</el-button>
</span>
</div>
</span>
<div class="crud-opts2">
<span class="role-span">入库明细项</span>
</div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
<!--表格渲染-->
<el-table
ref="dtl_table"
:data="this.openParam"
style="width: 100%;"
max-height="300"
border
highlight-current-row
:row-class-name="tableRowClassName"
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@row-click="clcikRow"
>
<el-table-column prop="bill_status" label="状态" align="center" width="110px">
<template slot-scope="scope">
<el-select
v-model="scope.row.bill_status"
class="filter-item"
:disabled="true"
>
<el-option
v-for="item in dict.IO_BILL_STATUS"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
<el-table-column show-overflow-tooltip prop="material_spec" label="物料规格" align="center" />
<el-table-column show-overflow-tooltip prop="pcsn" label="订单号" align="center" />
<el-table-column show-overflow-tooltip prop="plan_qty" :formatter="crud.formatNum3" label="数量" align="center" />
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="单位" align="center" />
</el-table>
</el-card>
<el-card class="box-card" shadow="never" :body-style="{padding:'20px 20px 0 20px'}">
<el-form ref="form2" :inline="true" :model="form" :rules="rules" size="mini">
<el-form-item label="入库点" prop="point_code">
<el-select
v-model="form.point_code"
clearable
placeholder="请选择"
class="filter-item"
style="width: 200px;"
>
<el-option
v-for="item in pointlist"
:key="item.point_code"
:label="item.point_name"
:value="item.point_code"
/>
</el-select>
</el-form-item>
</el-form>
</el-card>
<div class="crud-opts2">
<span class="role-span">载具物料明细</span>
<div class="crud-opts-form">
<el-form ref="form" :inline="true" :model="form" size="mini">
<el-form-item label="区域" prop="gender5">
<el-cascader
placeholder="请选择"
:options="sects"
:props="{ checkStrictly: true }"
clearable
@change="sectQueryChange"
/>
</el-form-item>
<el-form-item prop="checked">
<el-checkbox v-model="form.checked">自动分配货位</el-checkbox>
</el-form-item>
</el-form>
</div>
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left"/>
<!-- <el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="confirmvehicle()"
>
组盘确认
</el-button>-->
<el-button
slot="left"
:loading="divBtn"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="divStruct()"
>
分配货位
</el-button>
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="unDivStruct()"
>
取消分配
</el-button>
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-delete"
size="mini"
@click="divPoint()"
>
设置起点
</el-button>
</span>
</div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
<!--表格渲染-->
<el-table
ref="dis_table"
:data="form.tableMater"
style="width: 100%;"
max-height="300"
border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
>
<el-table-column show-overflow-tooltip type="index" label="序号" align="center" />
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
<el-table-column show-overflow-tooltip prop="material_spec" label="物料规格" align="center" />
<el-table-column show-overflow-tooltip prop="pcsn" label="订单号" align="center" />
<el-table-column show-overflow-tooltip prop="plan_qty" :formatter="crud.formatNum3" label="数量" align="center" />
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具号" align="center">
<template slot-scope="scope">
<el-input
v-model="form.tableMater[scope.$index].storagevehicle_code"
clearable
:controls="false"
controls-position="right"
size="small"
/>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="point_code" label="入库点" align="center" />
<el-table-column show-overflow-tooltip prop="struct_code" label="货位" align="center" />
</el-table>
</el-card>
<!-- <StructDiv ref="child" :stor-id="storId" :dialog-show.sync="structShow" :sect-prop="sectProp"-->
<!-- @tableChanged="tableChanged"/>-->
</el-dialog>
</template>
<script>
import CRUD, { crud } from '@crud/crud'
// import StructDiv from '@/views/wms/pub/StructDialog'
import crudProductIn from '@/views/wms/st/productIn/productin'
import crudPoint from '@/api/wms/sch/point'
import crudRegion from '@/api/wms/sch/region'
export default {
name: 'DivDialog',
components: { },
mixins: [crud()],
dicts: ['IO_BILL_STATUS'],
props: {
dialogShow: {
type: Boolean,
default: false
},
bussConfig: {
type: Object
},
openParam: {
type: Array,
default: () => {
return []
}
},
billType: {
type: String,
default: null
},
storId: {
type: String,
default: null
}
},
data() {
return {
dialogVisible: false,
stor_id: '',
sect_id: '',
sectProp: null,
bucketProp: {},
structShow: false,
bucketObj: null,
divBtn: false,
bucketShow: false,
sects: [],
sect_val: null,
form: {
dtl_row: null,
bucketunique: '',
storage_qty: '',
point_code: null,
storagevehicle_code: '',
checked: true,
tableMater: []
},
storlist: [],
pointlist: [],
rules: {}
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
}
},
methods: {
open() {
crudRegion.getRegionSelect({ 'stor_id': this.storId }).then(res => {
this.sects = res.content
})
const area_type = 'RK01'
crudPoint.getPoint({ 'area_type': area_type }).then(res => {
this.pointlist = res
})
},
toDelete(data) {
data.pop = true
},
close() {
this.form.tableMater = []
this.form.dtl_row = null
this.sectProp = null
this.$emit('update:dialogShow', false)
this.$emit('AddChanged')
this.crud.refresh()
this.$refs['form2'].resetFields()
},
clcikRow(row, column, event) {
this.form.dtl_row = row
crudProductIn.getIODtl({ 'bill_code': this.form.dtl_row.bill_code }).then(res => {
this.openParam = res
this.form.dtl_row = res[row.index]
})
crudProductIn.getDisDtl(row).then(res => {
this.form.tableMater = res
})
},
vehicleCheck() {
if (!this.form.dtl_row) {
this.crud.notify('请选择一条入库明细', CRUD.NOTIFICATION_TYPE.INFO)
this.form.storagevehicle_code = ''
return
}
crudProductIn.checkVehicle({
'storagevehicle_code': this.form.storagevehicle_code,
'dis_num': this.form.tableMater.length,
'iostorinv_id': this.form.dtl_row.iostorinv_id
}).then(res => {
}).catch(err => {
this.form.storagevehicle_code = ''
})
},
tableRowClassName({ row, rowIndex }) {
row.index = rowIndex
},
insertvehicle() {
if (!this.form.dtl_row) {
this.crud.notify('请选择一条入库明细', CRUD.NOTIFICATION_TYPE.INFO)
return
}
if (!this.form.storagevehicle_code) {
this.crud.notify('请输入托盘号', CRUD.NOTIFICATION_TYPE.INFO)
return
}
// 判断是否选择了桶号
if (this.bucketObj) {
if (!(this.bucketObj.status === '01')) {
this.crud.notify('请校验桶状态!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
const dis_dtl = JSON.parse(JSON.stringify(this.bucketObj))
// 判断选择的桶是否已经被选过
const flag = this.form.tableMater.some(mater => mater.bucketunique === dis_dtl.bucketunique)
if (!flag) {
const flag = this.form.tableMater.some(mater => mater.storagevehicle_code !== this.form.storagevehicle_code)
if (flag) {
this.crud.notify('存在不同载具号', CRUD.NOTIFICATION_TYPE.INFO)
return
}
dis_dtl.storagevehicle_code = this.form.storagevehicle_code
dis_dtl.pop = false
this.form.tableMater.splice(this.form.tableMater.length, 0, dis_dtl)
if (this.form.dtl_row.assign_qty) {
this.form.dtl_row.assign_qty = parseFloat(this.form.dtl_row.assign_qty) + parseFloat(this.form.storage_qty)
} else {
this.form.dtl_row.assign_qty = parseFloat(this.form.storage_qty)
}
if (parseFloat(this.form.dtl_row.unassign_qty) - parseFloat(this.form.storage_qty) > 0) {
this.form.dtl_row.unassign_qty = parseFloat(this.form.dtl_row.unassign_qty) - parseFloat(this.form.storage_qty)
} else {
this.form.dtl_row.unassign_qty = 0
}
this.openParam.splice(this.form.dtl_row.index, 1, this.form.dtl_row)
}
if (flag) {
this.crud.notify('该桶已被加入明细中', CRUD.NOTIFICATION_TYPE.INFO)
}
} else {
this.crud.notify('请选择桶号', CRUD.NOTIFICATION_TYPE.INFO)
return
}
},
confirmvehicle() {
if (this.form.tableMater.length <= 0) {
this.crud.notify('至少添加一条载具明细', CRUD.NOTIFICATION_TYPE.INFO)
return
}
const carrier_no = this.form.tableMater[0].storagevehicle_code
const flag = this.form.tableMater.every(mater => mater.storagevehicle_code === carrier_no)
if (!flag) {
this.crud.notify('请选择唯一载具进行组盘!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
const flag2 = this.form.tableMater.some(mater => mater.point_code !== this.form.point_code && mater.point_code)
if (flag2) {
this.crud.notify('请选择相同入库点!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
crudProductIn.confirmvehicle(this.form).then(res => {
crudProductIn.getIODtl({ 'bill_code': this.form.dtl_row.bill_code }).then(res => {
this.openParam = res
})
crudProductIn.getDisDtl(this.form.dtl_row).then(res => {
this.form.tableMater = res
this.crud.notify('组盘成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
})
})
},
deleteRow(index, rows) {
// 如果桶状态不是生成调后台逻辑
if (rows[index].status !== '01') {
crudProductIn.deleteDisDtl(rows[index]).then(res => {
crudProductIn.getIODtl({ 'bill_code': this.form.dtl_row.bill_code, 'open_flag': '1' }).then(res => {
this.openParam = res
})
crudProductIn.getDisDtl(this.form.dtl_row).then(res => {
this.form.tableMater = res
})
rows[index].pop = false
}).catch(err => {
rows[index].pop = false
return
})
}
this.form.dtl_row.assign_qty = parseFloat(this.form.dtl_row.assign_qty) - parseFloat(rows[index].storage_qty)
this.form.dtl_row.unassign_qty = parseFloat(this.form.dtl_row.unassign_qty) + parseFloat(rows[index].storage_qty)
this.openParam.splice(this.form.dtl_row.index, 1, this.form.dtl_row)
rows.splice(index, 1)
},
sectQueryChange(val) {
this.sectProp = val
if (val.length === 1) {
this.stor_id = val[0]
this.sect_id = ''
}
if (val.length === 0) {
this.sect_id = ''
this.stor_id = ''
}
if (val.length === 2) {
this.stor_id = val[0]
this.sect_id = val[1]
}
},
tableChanged(row) {
// 新增一行物料时,给行进行赋值
for (let i = 0; i < this.form.tableMater.length; i++) {
this.form.tableMater[i].struct_code = row.struct_code
this.form.tableMater[i].sect_id = row.sect_id
this.form.tableMater[i].struct_id = row.struct_id
this.form.tableMater[i].struct_name = row.struct_name
this.form.tableMater[i].sect_code = row.sect_code
this.form.tableMater[i].sect_name = row.sect_name
this.form.tableMater.splice(i, 1, this.form.tableMater[i]) // 通过splice 替换数据 触发视图更新
}
crudProductIn.divStruct(this.form).then(res => {
crudProductIn.getIODtl({ 'bill_code': this.form.dtl_row.bill_code, 'open_flag': '1' }).then(res => {
this.openParam = res
})
this.form.tableMater = []
})
},
bucketChange(row) {
debugger
this.bucketObj = row
this.form.bucketunique = row.bucketunique
this.form.storage_qty = row.storage_qty
},
divPoint() {
if (!this.form.point_code) {
this.crud.notify('请选择入库点', CRUD.NOTIFICATION_TYPE.INFO)
return
}
debugger
if (this.form.tableMater.length === 0) {
this.crud.notify('请先选择一条明细!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
crudProductIn.divPoint(this.form).then(res => {
crudProductIn.getIODtl({ 'bill_code': this.form.dtl_row.bill_code, 'open_flag': '1' }).then(res => {
this.openParam = res
})
crudProductIn.getDisDtl(this.form.dtl_row).then(res => {
this.form.tableMater = res
this.crud.notify('设置起点成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
})
})
},
divStruct() {
if (this.form.tableMater.length === 0) {
this.crud.notify('请先选择一条明细!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
// 如果勾选了,直接跳后台
if (this.form.checked) {
if (!this.sect_id) {
this.crud.notify('请先选择区域!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
this.divBtn = true
this.form.sect_id = this.sect_id
this.form.stor_id = this.stor_id
this.form.is_pc = '1'
crudProductIn.divStruct(this.form).then(res => {
crudProductIn.getIODtl({ 'bill_code': this.form.dtl_row.bill_code, 'open_flag': '1' }).then(res => {
this.openParam = res
})
crudProductIn.getDisDtl(this.form.dtl_row).then(res => {
this.form.tableMater = res
this.divBtn = false
this.crud.notify('分配货位成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
})
}).finally(() => {
this.divBtn = false
})
} else {
this.structShow = true
this.$refs.child.getMsg(false)
}
},
doCancel(data) {
data.pop = false
},
unDivStruct() {
if (this.form.tableMater.length <= 0) {
this.crud.notify('不存在载具明细!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
const flag = this.form.tableMater.some(mater => !mater.struct_code)
if (flag) {
this.crud.notify('明细存在未分配货位!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
// 如果勾选了,直接跳后台
crudProductIn.unDivStruct(this.form).then(res => {
crudProductIn.getIODtl({ 'bill_code': this.form.dtl_row.bill_code, 'open_flag': '1' }).then(res => {
this.openParam = res
})
crudProductIn.getDisDtl(this.form.dtl_row).then(res => {
this.form.tableMater = res
this.crud.notify('取消分配成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
})
})
},
dialogBucket() {
if (!this.form.dtl_row) {
this.crud.notify('请选择一条入库明细', CRUD.NOTIFICATION_TYPE.INFO)
return
}
/* const material_dtl_scode = this.form.dtl_row.material_dtl_scode
let type = ''
if (material_dtl_scode.slice(0, 4) === '0903') {
type = '01'
}
if (material_dtl_scode.slice(0, 4) === '0904') {
type = '02'
}
if (material_dtl_scode.slice(0, 6) === '090202') {
type = '04'
}
if (material_dtl_scode.slice(0, 6) === '090201') {
type = '03'
}*/
const bucket = {
'material_code': this.form.dtl_row.material_code,
'pcsn': this.form.dtl_row.pcsn,
'quality_scode': this.form.dtl_row.quality_scode,
'ivt_level': this.form.dtl_row.ivt_level,
'is_active': this.form.dtl_row.is_active,
// 'storagevehicle_type': type,
'bucket_status': '01'
}
this.bucketProp = bucket
this.bucketShow = true
}
}
}
</script>
<style>
.crud-opts2 {
padding: 0;
display: -webkit-flex;
display: flex;
align-items: center;
}
.crud-opts2 .el-dialog__title2 {
line-height: 24px;
font-size: 20px;
color: #303133;
}
.crud-opts2 .role-span {
padding: 10px 0px 10px 0px;
}
.crud-opts2 .crud-opts-form {
padding: 10px 0px 0px 20px;
}
.input-with-select {
background-color: #fff;
}
</style>

View File

@@ -0,0 +1,268 @@
<template>
<el-dialog
title="任务修改"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
fullscreen
width="1000px"
@close="close"
@open="open"
>
<el-row :gutter="20">
<el-col :span="20" style="border: 1px solid white">
<span />
</el-col>
<el-col :span="4">
<span>
<el-button icon="el-icon-check" size="mini" :loading="crud.cu === 2" type="primary" @click="submit">确定</el-button>
<el-button icon="el-icon-close" size="mini" type="info" @click="dialogVisible = false">关闭</el-button>
</span>
</el-col>
</el-row>
<el-form ref="taskForm" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" size="mini" label-width="85px" label-suffix=":">
<el-form-item label="任务号" prop="task_code">
<label slot="label">&nbsp;&nbsp;&nbsp;:</label>
<el-input v-model="form.task_code" disabled style="width: 210px" />
</el-form-item>
<el-form-item label="存储载具" prop="storagevehicle_code">
<el-input v-model="form.storagevehicle_code" disabled style="width: 210px" />
</el-form-item>
<el-form-item label="原入库点" prop="point_code">
<el-input v-model="form.point_code" disabled style="width: 210px" />
</el-form-item>
<el-form-item label="入库点" prop="new_point_code">
<label slot="label">&nbsp;&nbsp;&nbsp;:</label>
<el-select
v-model="form.new_point_code"
clearable
placeholder="请选择"
class="filter-item"
style="width: 210px"
>
<el-option
v-for="item in pointlist"
:key="item.point_code"
:label="item.point_code"
:value="item.point_code"
/>
</el-select>
</el-form-item>
<el-form-item label="原货位" prop="struct_code">
<label slot="label">&nbsp;&nbsp;&nbsp;:</label>
<el-input v-model="form.struct_code" disabled style="width: 210px" />
</el-form-item>
<el-form-item label="新货位" prop="new_struct_code">
<label slot="label">&nbsp;&nbsp;&nbsp;:</label>
<el-input v-model="form.new_struct_code" disabled style="width: 210px" />
</el-form-item>
<el-form-item label="所属库区" prop="new_struct_code">
<el-cascader
v-model="query.sect"
style="width: 210px"
placeholder="所属库区"
:options="sects"
:props="{ checkStrictly: true }"
clearable
@change="sectQueryChange"
/>
</el-form-item>
<el-form-item label="模糊查询" prop="struct_code">
<el-input
v-model="query.search"
clearable
style="width: 200px"
size="mini"
placeholder="输入货位编码、名称"
prefix-icon="el-icon-search"
class="filter-item"
/>
</el-form-item>
<rrOperation />
</el-form>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
style="width: 100%"
:row-class-name="tableRowClassName"
highlight-current-row
border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@row-click="clcikRow"
@select="handleSelectionChange"
@select-all="onSelectAll"
>
<el-table-column prop="struct_code" label="货位编码" />
<el-table-column prop="struct_name" label="货位名称" />
<el-table-column prop="material_height_type_name" label="高度类型" />
<el-table-column prop="sect_name" label="库区名称" />
</el-table>
<!--分页组件-->
<pagination />
</el-dialog>
</template>
<script>
import CRUD, { header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination'
// import crudStructattr from '@/views/wms/basedata/st/struct/structattr'
// import crudSectattr from '@/views/wms/basedata/st/sect/sectattr'
import crudProductIn from '@/views/wms/st/productIn/productin'
import crudPoint from '@/views/wms/sch/point'
export default {
name: 'StructDiv',
components: { crudOperation, rrOperation, pagination },
cruds() {
return CRUD({
title: '仓位',
optShow: {},
url: 'api/structattr',
idField: 'struct_id',
sort: 'struct_id,desc',
crudMethod: { ...crudStructattr }
})
},
mixins: [presenter(), header()],
props: {
dialogShow: {
type: Boolean,
default: false
},
sectProp: {
type: Object,
default: null
},
bucketForm: {
type: Object,
default: null
}
},
data() {
return {
sects: [],
classes: [],
pointlist: [],
dialogVisible: false,
// sectProp: null,
checkrow: {},
form: {
task_id: '',
task_code: '',
storagevehicle_code: '',
point_code: '',
new_point_code: '',
struct_code: '',
new_struct_code: ''
},
rows: []
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
},
sectProp: {
handler(newValue, oldValue) {
this.sectProp = newValue
}
},
bucketForm: {
handler(newValue, oldValue) {
this.form = newValue
}
}
},
methods: {
[CRUD.HOOK.beforeRefresh]() {
this.crud.query.lock_type = '1'
},
open() {
crudSectattr.getSect({ 'is_materialstore': '1', 'sect_type_attr': '00' }).then(res => {
this.sects = res.content
})
crudPoint.getPoint({ 'area_type': '21' }).then(res => {
this.pointlist = res
})
if (this.sectProp) {
this.query.sect = this.sectProp
if (this.sectProp.length === 1) {
this.query.stor_id = this.sectProp[0]
this.query.sect_id = ''
}
if (this.sectProp.length === 0) {
this.query.sect_id = ''
this.query.stor_id = ''
}
if (this.sectProp.length === 2) {
this.query.stor_id = this.sectProp[0]
this.query.sect_id = this.sectProp[1]
}
}
this.crud.toQuery()
},
clcikRow(row, column, event) {
this.form.new_struct_code = row.struct_code
},
tableRowClassName({ row, rowIndex }) {
row.index = rowIndex
},
sectQueryChange(val) {
if (val.length === 1) {
this.query.stor_id = val[0]
this.query.sect_id = ''
}
if (val.length === 0) {
this.query.sect_id = ''
this.query.stor_id = ''
}
if (val.length === 2) {
this.query.stor_id = val[0]
this.query.sect_id = val[1]
}
},
handleSelectionChange(val, row) {
if (val.length > 1) {
this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(val.pop())
} else {
this.checkrow = row
}
},
onSelectAll() {
this.$refs.table.clearSelection()
},
close() {
this.crud.resetQuery()
this.query.sect = null
this.$emit('update:dialogShow', false)
},
submit() {
this.crud.resetQuery()
crudProductIn.updateTask(this.form).then(res => {
this.$emit('update:dialogShow', false)
this.$emit('updateCommit', this.checkrow)
})
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-dialog__body {
padding-top: 0px;
}
</style>

View File

@@ -0,0 +1,287 @@
<template>
<el-dialog
append-to-body
title="入库详情"
:visible.sync="dialogVisible"
destroy-on-close
fullscreen
@close="close"
@open="open"
>
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" size="mini" label-width="85px" label-suffix=":">
<el-form-item label="单据号" prop="bill_code">
<label slot="label">&nbsp;&nbsp;&nbsp;:</label>
<el-input v-model="form.bill_code" disabled placeholder="系统生成" clearable style="width: 210px" />
</el-form-item>
<el-form-item label="仓库" prop="stor_id">
<label slot="label">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
<el-select
v-model="form.stor_id"
clearable
placeholder="仓库"
class="filter-item"
style="width: 210px"
:disabled="true"
>
<el-option
v-for="item in storlist"
:key="item.stor_id"
:label="item.stor_name"
:value="item.stor_id"
/>
</el-select>
</el-form-item>
<el-form-item label="业务类型" prop="bill_type">
<el-select
v-model="form.bill_type"
clearable
placeholder="业务类型"
style="width: 210px"
class="filter-item"
:disabled="true"
>
<el-option
v-for="item in dict.INANDOUT_BILL_TYPE"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="单据状态" prop="bill_status">
<el-select
v-model="form.bill_status"
clearable
style="width: 210px"
placeholder="单据状态"
class="filter-item"
disabled
>
<el-option
v-for="item in dict.io_bill_status"
:key="item.id"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="明细数" prop="detail_count">
<label slot="label">&nbsp;&nbsp;&nbsp;:</label>
<el-input v-model="form.detail_count" size="mini" disabled style="width: 210px" />
</el-form-item>
<el-form-item label="总重量" prop="total_qty">
<label slot="label">&nbsp;&nbsp;&nbsp;:</label>
<el-input-number
v-model="form.total_qty"
:controls="false"
:precision="3"
:min="0"
disabled
style="width: 210px"
/>
</el-form-item>
<el-form-item label="业务日期" prop="biz_date">
<el-date-picker v-model="form.biz_date" type="date" placeholder="选择日期" style="width: 210px" value-format="yyyy-MM-dd" :disabled="true" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<label slot="label">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
<el-input v-model="form.remark" style="width: 380px;" rows="2" type="textarea" :disabled="true" />
</el-form-item>
</el-form>
<div class="crud-opts2">
<span class="role-span2">入库明细</span>
</div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
<!--表格渲染-->
<el-table
ref="table"
:data="tableDtl"
style="width: 100%;"
max-height="300"
size="mini"
border
:highlight-current-row="true"
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@current-change="handleDtlCurrentChange"
>
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column min-width="120" show-overflow-tooltip prop="bill_code" label="单据号" align="center" />
<el-table-column :formatter="bill_statusFormat" prop="bill_status" label="状态" />
<el-table-column min-width="120" show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
<el-table-column min-width="120" show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
<el-table-column prop="pcsn" label="子卷号" width="150" align="center" />
<el-table-column prop="sap_pcsn" label="SAP批次号" width="150" align="center" />
<el-table-column prop="plan_qty" :formatter="crud.formatNum3" label="重量" align="center" />
<el-table-column prop="qty_unit_name" label="单位" align="center" />
<el-table-column prop="source_bill_type" label="源单类型" align="center" width="130px" :formatter="invtypeFormat" />
<el-table-column prop="source_bill_code" label="源单号" align="center" width="130px" />
<el-table-column show-overflow-tooltip prop="remark" label="明细备注" align="center" />
</el-table>
</el-card>
<div class="crud-opts2">
<span class="role-span">作业明细</span>
</div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
<!--表格渲染-->
<el-table
ref="table2"
:data="tabledis"
style="width: 100%;"
max-height="300"
size="mini"
border
:highlight-current-row="true"
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@current-change="handleDisCurrentChange"
>
<el-table-column min-width="120" show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
<el-table-column min-width="120" show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
<el-table-column prop="pcsn" label="子卷号" align="center" width="150"/>
<el-table-column prop="sap_pcsn" label="SAP批次号" align="center" />
<el-table-column prop="box_no" label="载具号" align="center" />
<el-table-column prop="plan_qty" :formatter="crud.formatNum3" label="重量" align="center" />
<el-table-column prop="next_point_code" label="起始位置" align="center" />
<el-table-column prop="struct_code" label="目的位置" align="center" />
<el-table-column prop="task_code" label="任务号" align="center" />
<el-table-column prop="task_type_name" label="任务类型" align="center" width="150px" />
</el-table>
</el-card>
</el-dialog>
</template>
<script>
import { crud } from '@crud/crud'
// import checkoutbill from '@/views/wms/st/outbill/checkoutbill'
// import crudUserStor from '@/views/wms/basedata/st/userStor/userStor'
export default {
name: 'ViewDialog',
components: { },
mixins: [crud()],
dicts: ['io_bill_status', 'work_status', 'task_status', 'SCH_TASK_TYPE_DTL', 'INANDOUT_BILL_TYPE'],
props: {
dialogShow: {
type: Boolean,
default: false
},
rowmst: {
type: Object
}
},
data() {
return {
dialogVisible: false,
tableDtl: [],
tabledis: [],
billtypelist: [],
storlist: [],
currentdtl: null,
currentDis: {},
form: {}
}
},
watch: {
dialogShow: {
handler(newValue) {
this.dialogVisible = newValue
}
},
rowmst: {
handler(newValue) {
this.form = newValue
}
}
},
created() {
checkoutbill.getInvTypes().then(res => {
this.billtypelist = res
})
crudUserStor.getUserStor().then(res => {
this.storlist = res
})
},
methods: {
open() {
this.queryTableDtl()
},
close() {
this.$emit('update:dialogShow', false)
this.currentDis = {}
this.currentdtl = null
this.tableDtl = []
this.tabledis = []
this.$emit('TaskChanged')
},
bill_statusFormat(row) {
return this.dict.label.io_bill_status[row.bill_status]
},
taskdtl_typeFormat(row) {
return this.dict.label.SCH_TASK_TYPE_DTL[row.taskdtl_type]
},
task_statusFormat(row) {
return this.dict.label.task_status[row.task_status]
},
work_statusFormat(row) {
return this.dict.label.work_status[row.work_status]
},
handleDtlCurrentChange(current) {
if (current !== null) {
this.tabledis = []
this.currentdtl = current
this.queryTableDdis()
} else {
this.tabledis = []
this.currentdtl = {}
}
},
invtypeFormat(row, column) {
for (const item of this.billtypelist) {
if (item.code === row.source_bill_type) {
return item.name
}
}
},
handleDisCurrentChange(current) {
this.currentDis = current
},
queryTableDtl() {
checkoutbill.getOutBillDtl({ 'iostorinv_id': this.form.iostorinv_id }).then(res => {
this.tableDtl = res
})
},
queryTableDdis() {
if (this.currentdtl !== null) {
checkoutbill.getOutBillTask({ 'iostorinvdtl_id': this.currentdtl.iostorinvdtl_id }).then(res => {
this.tabledis = res
}).catch(() => {
this.tabledis = []
})
}
}
}
}
</script>
<style>
.crud-opts2 {
padding: 0;
display: -webkit-flex;
display: flex;
align-items: center;
}
.crud-opts2 .el-dialog__title2 {
line-height: 24px;
font-size:20px;
color:#303133;
}
.crud-opts2 .role-span2 {
padding: 0px 0px 20px 0px;
}
.crud-opts2 {
padding: 10px 0px 0px 50px;
}
</style>

View File

@@ -0,0 +1,321 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<div v-if="crud.props.searchToggle">
<!-- 搜索 -->
<el-form
:inline="true"
class="demo-form-inline"
label-position="right"
label-width="80px"
label-suffix=":"
>
<el-form-item label="模糊查询">
<el-input
v-model="query.bill_code"
size="mini"
clearable
placeholder="单据号"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="生产区域">
<el-select
v-model="query.product_code"
clearable
size="mini"
placeholder="全部"
class="filter-item"
@change="crud.toQuery"
>
<el-option
v-for="item in dict.product_area"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker
v-model="query.createTime"
type="daterange"
value-format="yyyy-MM-dd HH:mm:ss"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']"
@change="crud.toQuery"
/>
</el-form-item>
<el-form-item label="单据状态">
<el-select
v-model="query.bill_status"
clearable
size="mini"
placeholder="单据状态"
class="filter-item"
@change="crud.toQuery"
>
<el-option
v-for="item in dict.IO_BILL_STATUS"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="业务类型">
<el-select
v-model="query.bill_type"
clearable
filterable
size="mini"
placeholder="业务类型"
class="filter-item"
@change="crud.toQuery"
>
<el-option
v-for="item in dict.ST_INV_IN_TYPE"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<rrOperation />
</el-form>
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission">
<el-button
slot="right"
class="filter-item"
type="success"
:disabled="dis_flag"
icon="el-icon-position"
size="mini"
@click="divOpen"
>
分配
</el-button>
<el-button
slot="right"
class="filter-item"
type="warning"
icon="el-icon-check"
size="mini"
:disabled="confirm_flag"
@click="confirm"
>
强制确认
</el-button>
</crudOperation>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
size="mini"
:data="crud.data"
highlight-current-row
style="width: 100%;"
@selection-change="crud.selectionChangeHandler"
@current-change="handleCurrentChange"
@select="handleSelectionChange"
@select-all="onSelectAll"
>
<el-table-column type="selection" width="55" />
<el-table-column show-overflow-tooltip prop="bill_code" width="130" label="单据号">
<template slot-scope="scope">
<el-link type="warning" @click="toView(scope.row)">{{ scope.row.bill_code }}</el-link>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip :formatter="stateFormat" prop="bill_status" label="单据状态" />
<el-table-column prop="product_name" label="生产区域" width="130" show-overflow-tooltip />
<el-table-column show-overflow-tooltip prop="bill_type" min-width="120" label="业务类型" :formatter="bill_typeFormat"/>
<el-table-column show-overflow-tooltip min-width="120" prop="biz_date" label="业务日期" />
<el-table-column label="明细数" align="center" prop="detail_count" />
<el-table-column label="总重量" align="center" prop="total_qty">
<template slot-scope="scope">
{{ fun(scope.row.total_qty) }}
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="制单人" align="center" prop="input_optname" />
<el-table-column label="制单时间" align="center" prop="input_time" width="150" />
<el-table-column label="修改人" align="center" prop="update_optname" />
<el-table-column label="修改时间" align="center" prop="update_time" width="150" />
<el-table-column label="分配人" align="center" prop="dis_optname" width="140px" />
<el-table-column label="分配时间" align="center" prop="dis_time" width="150" />
<el-table-column label="确认人" align="center" prop="confirm_optname" width="150" />
<el-table-column label="确认时间" align="center" prop="confirm_time" width="150" />
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
<template slot-scope="scope">
<udOperation
:data="scope.row"
:permission="permission"
:disabled-edit="canUd(scope.row)"
:disabled-dle="canUd(scope.row)"
/>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<pagination />
</div>
<AddDialog @AddChanged="querytable" />
<ViewDialog :dialog-show.sync="viewShow" :rowmst="mstrow" @AddChanged="querytable" />
<DivDialog :dialog-show.sync="divShow" :stor-id="storId" :open-param="openParam" @AddChanged="querytable" />
</div>
</template>
<script>
import productIn from '@/views/wms/st/productIn/productin'
import crudProductIn from '@/views/wms/st/productIn/productin'
import CRUD, { crud, header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import DateRangePicker from '@/components/DateRangePicker/index'
import AddDialog from '@/views/wms/st/productIn/AddDialog'
import DivDialog from '@/views/wms/st/productIn/DivDialog'
import ViewDialog from '@/views/wms/st/productIn/ViewDialog'
import { mapGetters } from 'vuex'
export default {
name: 'ProductIn',
components: { ViewDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination, DateRangePicker, DivDialog },
cruds() {
return CRUD({
title: '',
optShow: { add: true, reset: true },
idField: 'iostorinv_id',
url: '/api/in/productIn',
crudMethod: { ...productIn }
})
},
mixins: [presenter(), header(), crud()],
// 数据字典
dicts: ['IO_BILL_STATUS', 'ST_INV_IN_TYPE', 'product_area'],
data() {
return {
height: document.documentElement.clientHeight - 180 + 'px;',
permission: {},
dis_flag: true,
confirm_flag: true,
disShow: false,
viewShow: false,
mstrow: {},
divShow: false,
openParam: [],
currentRow: null,
storlist: [],
storId: null
}
},
computed: {
...mapGetters([
'user'
])
},
mounted: function() {
const that = this
window.onresize = function temp() {
that.height = document.documentElement.clientHeight - 180 + 'px;'
}
},
created() {
crudProductIn.queryStor().then(res => {
this.storlist = res
})
},
methods: {
fun(val) {
return Number(val).toFixed(3)
},
canUd(row) {
return row.bill_status !== '10'
},
handleSelectionChange(val, row) {
if (val.length > 1) {
this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(val.pop())
this.buttonChange(row)
} else if (val.length === 1) {
this.buttonChange(row)
} else {
this.handleCurrentChange(null)
}
},
onSelectAll() {
this.$refs.table.clearSelection()
this.handleCurrentChange(null)
},
buttonChange(currentRow) {
if (currentRow !== null) {
this.currentRow = currentRow
if (currentRow.bill_status === '10' || currentRow.bill_status === '20' || currentRow.bill_status === '30') {
this.dis_flag = false
} else {
this.dis_flag = true
}
if (currentRow.bill_status === '30') {
this.confirm_flag = false
} else {
this.confirm_flag = true
}
}
},
handleCurrentChange(currentRow) {
if (currentRow === null) {
this.dis_flag = true
this.confirm_flag = true
this.currentRow = {}
}
},
bill_typeFormat(row, column) {
return this.dict.label.ST_INV_IN_TYPE[row.bill_type]
},
toView(row) {
this.mstrow = row
this.viewShow = true
},
confirm() {
if (!this.currentRow) {
this.crud.notify('请选择一条单据', CRUD.NOTIFICATION_TYPE.INFO)
return
}
crudProductIn.confirm(this.currentRow).then(res => {
this.crud.notify('单据确认成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.toQuery()
})
},
stateFormat(row, column) {
return this.dict.label.IO_BILL_STATUS[row.bill_status]
},
divOpen() {
crudProductIn.getIODtl({ 'bill_code': this.currentRow.bill_code, 'open_flag': '1' }).then(res => {
this.openParam = res
debugger
this.storId = this.currentRow.product_code
this.billType = this.currentRow.bill_type
this.divShow = true
})
},
querytable() {
this.onSelectAll()
this.crud.toQuery()
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-dialog__body {
padding-top: 10px;
}
</style>

View File

@@ -0,0 +1,220 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: '/api/in/productIn',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: '/api/in/productIn',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: '/api/in/productIn',
method: 'put',
data
})
}
export function getType(params) {
return request({
url: '/api/in/productIn/getType',
method: 'get',
params
})
}
export function getBillDtl(params) {
return request({
url: '/api/in/productIn/getBillDtl',
method: 'get',
params
})
}
export function getIODtl(data) {
return request({
url: '/api/in/productIn/getIODtl',
method: 'post',
data
})
}
export function insertDtl(data) {
return request({
url: '/api/in/productIn/insertDtl',
method: 'post',
data
})
}
export function commit(data) {
return request({
url: '/api/in/productIn/commit',
method: 'post',
data
})
}
export function checkVehicle(data) {
return request({
url: '/api/in/productIn/checkVehicle',
method: 'post',
data
})
}
export function confirmvehicle(data) {
return request({
url: '/api/in/productIn/confirmvehicle',
method: 'post',
data
})
}
export function deleteDisDtl(data) {
return request({
url: '/api/in/productIn/deleteDisDtl',
method: 'post',
data
})
}
export function getDisDtl(data) {
return request({
url: '/api/in/productIn/getDisDtl',
method: 'post',
data
})
}
export function divStruct(data) {
return request({
url: '/api/in/productIn/divStruct',
method: 'post',
data
})
}
export function unDivStruct(data) {
return request({
url: '/api/in/productIn/unDivStruct',
method: 'post',
data
})
}
export function divPoint(data) {
return request({
url: '/api/in/productIn/divPoint',
method: 'post',
data
})
}
export function queryTask(data) {
return request({
url: '/api/in/productIn/queryTask',
method: 'post',
data
})
}
export function bucketDtl(data) {
return request({
url: '/api/in/productIn/bucketDtl',
method: 'post',
data
})
}
export function updateTask(data) {
return request({
url: '/api/in/productIn/updateTask',
method: 'post',
data
})
}
export function delTask(data) {
return request({
url: '/api/in/productIn/delTask',
method: 'post',
data
})
}
export function reIssueTask(data) {
return request({
url: '/api/in/productIn/reIssueTask',
method: 'post',
data
})
}
export function confirmTask(data) {
return request({
url: '/api/in/productIn/confirmTask',
method: 'post',
data
})
}
export function cancelTask(data) {
return request({
url: '/api/in/productIn/cancelTask',
method: 'post',
data
})
}
export function confirm(data) {
return request({
url: '/api/in/productIn/confirm',
method: 'post',
data
})
}
export function backConfirm(data) {
return request({
url: '/api/in/productIn/backConfirm',
method: 'post',
data
})
}
export function delDis(data) {
return request({
url: '/api/in/productIn/delDis',
method: 'post',
data
})
}
export function queryBoxMater(data) {
return request({
url: '/api/in/productIn/queryBoxMater',
method: 'post',
data
})
}
export function queryStor() {
return request({
url: '/api/in/productIn/queryStor',
method: 'post'
})
}
export default { add, edit, del, getType, getBillDtl, insertDtl, getIODtl, commit, checkVehicle,
confirmvehicle, deleteDisDtl, getDisDtl, divStruct, unDivStruct, divPoint, delDis, queryBoxMater,
queryTask, bucketDtl, updateTask, delTask, reIssueTask, confirmTask, cancelTask, confirm, backConfirm, queryStor }