Commit d97b60b7 authored by 沈翠玲's avatar 沈翠玲

保密发料单

parent 0293a0aa
<template>
<div class="app-container">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">
新增</el-button>
<el-table v-loading="loading" :data="tableData" @selection-change="handleSelectionChange">
<!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column label="物料编码" align="center" prop="sapItemCode" />
<el-table-column label="物料名称" align="center" prop="itemName" />
<el-table-column label="申请数量" align="center" prop="applyNum" />
<el-table-column width="150px" label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="{ $index}">
<el-button size="mini" type="text" icon="el-icon-delete" @click="deleteRow($index)">删除</el-button>
<el-button size="mini" type="text" icon="el-icon-update" @click="updateRow($index)">修改</el-button>
</template>
</el-table-column>
</el-table>
<!-- 添加或修改调拨料申请对话框 -->
<el-dialog :title="title" :visible.sync="open" width="960px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-row>
<el-col :span="12">
<el-form-item label="产品编码" prop="sapItemCode">
<el-input v-model="form.sapItemCode" placeholder="请输入产品编码">
<el-button slot="append" icon="el-icon-search" @click="handleItemSelect" />
</el-input>
<itemSelect ref="brSelectpro" @onSelected="onItemSelect">
</itemSelect>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="产品名称" prop="itemName">
<el-input disabled v-model="form.itemName" placeholder="请输入产品名称" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="申请数量" prop="applyNum">
<el-input-number v-model="form.applyNum" :min="0" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
<!--
<pagination v-show="total > 0 && $attrs.optType !== 'add'" :total="total" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" @pagination="getList" /> -->
</div>
</template>
<script>
import WorkstationSelect from "@/components/workstationSelect/simpletableSingle.vue";
import ItemSelect from "@/components/itemSelect/single.vue";
export default {
name: "TmToolRequestItem",
dicts: [
"warehouse_desc"
],
components: { ItemSelect, WorkstationSelect },
props: {
id: {
type: String,
default: ''
}
},
data() {
return {
// 遮罩层
loading: false,
// 选中数组
ids: [],
/**表格数据 */
tableData: [],
indexs: null,
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
optType: "add",
// 总条数
total: 0,
// 刀模版物料申请单表格数据
tmToolRequestItemList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
itemId: null,
sapItemCode: null,
itemName: null,
applyNum: null,
workstationCode: null,
workunitCode: null,
workstationCode: null,
workstationId: null,
workstationName: null,
},
// 表单参数
form: {
itemId: null,
sapItemCode: null,
itemName: null,
applyNum: null,
workstationCode: null,
workunitCode: null,
workstationCode: null,
workstationId: null,
workstationName: null,
},
currentRowIdx: undefined,
// 表单校验
rules: {
sapItemCode: [
{ required: true, message: "产品编码不能为空", trigger: "blur" }
],
workstationCode: [
{ required: true, message: "工作中心编码不能为空", trigger: "blur" }
],
workunitCode: [
{ required: true, message: "工作单元编码不能为空", trigger: "blur" }
],
applyNum: [
{ required: true, message: "申请数量不能为空", trigger: "blur" }
],
}
};
},
watch: {
},
created() {
},
methods: {
// onItemSelect(list) {
// // console.log(list, 'list')
// const datas = list.map(item => {
// return {
// toolWarehouseId: item.toolWarehouseId,
// toolMachinesId: item.toolMachinesId,
// type: item.type,
// toolCode: item.toolCode,
// toolName: item.toolName,
// itemCode: item.itemCode,
// sapItemCode: item.sapItemCode,
// itemName: item.itemName,
// local: item.local,
// processId: Number(item.processId),
// processName: item.processName,
// warehouse: item.warehouse,
// warehouseDesc: item.warehouseDesc,
// }
// })
// this.tmToolRequestItemList = this.tmToolRequestItemList.concat(datas)
// this.$emit('sum')
// },
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加表体";
this.optType = "add";
},
handleItemSelect() {
this.$refs.brSelectpro.showFlag = true;
},
onItemSelect(row) {
if (row != undefined && row != null) {
this.form.itemId = row.itemId;
this.form.sapItemCode = row.sapItemCode;
this.form.itemName = row.itemName;
}
},
/**表单提交 */
submitForm() {
if(this.form.applyNum==0){
this.open = true;
this.$modal.confirm('申请数量需要输入数字');
return;
}
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.optType == "add") {
this.tableData.unshift(JSON.parse(JSON.stringify(this.form)));
}else if(this.optType == "edit"){
this.$set(this.tableData, this.indexs, JSON.parse(JSON.stringify(this.form)))
}
this.showFlag = false;
}
});
this.open = false;
},
handleWorkstationSelect() {
this.$refs.brSelectworkstation.showFlag = true;
},
onWorkstationSelect(row, type) {
console.log('row', type, row)
if (row != undefined && row != null) {
if (type === 'unit') {
// this.form.workunitName = row.workunitName
this.$set(this.form, 'workunitCode', row.workunitCode)
this.form.workstationId = row.workstationId;
this.form.workstationCode = row.workstationCode;
this.form.workstationName = row.workstationName;
} else {
this.form.workstationId = row.workstationId;
this.form.workstationCode = row.workstationCode;
this.form.workstationName = row.workstationName;
}
}
},
/**删除行 */
deleteRow(index) {
this.tableData.splice(index, 1);
},
/**修改*/
updateRow(index){
console.log(index);
this.indexs=index;
this.form = JSON.parse(JSON.stringify(this.tableData[index]));
this.open = true;
this.optType = "edit";
},
handleRemove(row, index) {
console.log(row, index)
// this.tags.splice(this.tags.indexOf(tag), 1)
this.tmToolRequestItemList.splice(this.tmToolRequestItemList.indexOf(row), 1)
this.$emit('sum')
},
// 取消按钮
cancel() {
this.open = false;
// this.reset();
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
},
// 表单重置
reset() {
this.form = {
itemId: null,
sapItemCode: null,
itemName: null,
applyNum: null,
workunitId: null,
workunitName: null,
workunitCode: null,
workstationCode: null,
workstationId: null,
workstationName: null,
};
this.resetForm("form");
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.toolRequestItemId)
this.single = selection.length !== 1
this.multiple = !selection.length
}
}
};
</script>
\ No newline at end of file
<template>
<el-dialog title="工单选择"
v-if="showFlag"
:visible.sync="showFlag"
:modal= false
width="80%"
center
>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="工单编码" prop="workorderCode">
<el-input
v-model="queryParams.workorderCode"
placeholder="请输入工单编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="工单名称" prop="workorderName">
<el-input
v-model="queryParams.workorderName"
placeholder="请输入工单名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="产品编号" prop="productCode">
<el-input
v-model="queryParams.productCode"
placeholder="请输入产品编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="产品名称" prop="productName">
<el-input
v-model="queryParams.productName"
placeholder="请输入产品名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="客户名称" prop="clientName">
<el-input
v-model="queryParams.clientName"
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-table v-loading="loading" :data="workorderList" @current-change="handleCurrent" @row-dblclick="handleRowDbClick">
<el-table-column width="55" align="center" >
<template v-slot="scope">
<el-radio v-model="selectedWorkorderId" :label="scope.row.workorderId" @change="handleRowChange(scope.row)">{{""}}</el-radio>
</template>
</el-table-column>
<el-table-column label="工单编码" width="180" prop="workorderCode" >
</el-table-column>
<el-table-column label="工单名称" width="200" align="center" prop="workorderName" :show-overflow-tooltip="true"/>
<el-table-column label="工单来源" align="center" prop="orderSource" >
<template slot-scope="scope">
<dict-tag :options="dict.type.mes_workorder_sourcetype" :value="scope.row.orderSource"/>
</template>
</el-table-column>
<el-table-column label="订单编号" width="140" align="center" prop="sourceCode" />
<el-table-column label="产品编号" width="120" align="center" prop="productCode" />
<el-table-column label="产品名称" width="200" align="center" prop="productName" :show-overflow-tooltip="true"/>
<el-table-column label="规格型号" align="center" prop="productSpc" :show-overflow-tooltip="true"/>
<el-table-column label="单位" align="center" prop="unitOfMeasure" />
<el-table-column label="工单数量" align="center" prop="quantity" />
<el-table-column label="客户编码" align="center" prop="clientCode" />
<el-table-column label="客户名称" align="center" prop="clientName" :show-overflow-tooltip="true"/>
<el-table-column label="需求日期" align="center" prop="requestDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.requestDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="confirmSelect"> </el-button>
<el-button @click="showFlag=false"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { listWorkorder} from "@/api/mes/pro/workorder";
export default {
name: 'WorkOrderSelectSingle',
components: {},
dicts: ['mes_order_status','mes_workorder_sourcetype'],
props:{
arrangeCode: undefined,
workorderCode: undefined
},
watch: {
arrangeCode(v){
this.queryParams.arrangeCode = v;
this.getList();
},
workorderCode(v){
this.queryParams.workorderCode = v;
this.getList();
}
},
data() {
return {
showFlag: false,
// 遮罩层
loading: true,
// 选中数组
selectedWorkorderId: undefined,
selectedRows: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 生产工单表格数据
workorderList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
workorderCode: this.workorderCode,
workorderName: null,
workorderType: null,
orderSource: null,
sourceCode: null,
productId: null,
productCode: null,
productName: null,
productSpc: null,
unitOfMeasure: null,
quantity: null,
arrangeCode: this.arrangeCode,
quantityProduced: null,
quantityChanged: null,
quantityScheduled: null,
clientId: null,
clientCode: null,
clientName: null,
requestDate: null,
parentId: null,
ancestors: null,
status: null,
},
}
},
created() {
this.getList();
},
methods:{
/** 查询生产工单列表 */
getList() {
this.loading = true;
listWorkorder(this.queryParams).then(response => {
this.workorderList = response.rows;
this.loading = false;
this.total = response.total
});
},
/** 搜索按钮操作 */
handleQuery() {
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams = {
pageNum: 1,
pageSize: 10,
workorderCode: null,
workorderName: null,
workorderType: null,
orderSource: null,
sourceCode: null,
productId: null,
productCode: null,
productName: null,
productSpc: null,
unitOfMeasure: null,
quantity: null,
arrangeCode: null,
quantityProduced: null,
quantityChanged: null,
quantityScheduled: null,
clientId: null,
clientCode: null,
clientName: null,
requestDate: null,
parentId: null,
ancestors: null,
status: null,
}
this.handleQuery();
},
handleCurrent(row){
if(row){
this.selectedRows = row;
}
},
// 单选选中数据
handleRowChange(row) {
if(row){
this.selectedRows = row;
}
},
//双击选中
handleRowDbClick(row){
if(row){
this.selectedRows = row;
this.$emit('onSelected',this.selectedRows);
this.showFlag = false;
}
},
//确定选中
confirmSelect(){
if(this.selectedWorkorderId == null || this.selectedWorkorderId == 0){
this.$notify({
title:'提示',
type:'warning',
message: '请至少选择一条数据!'
});
return;
}
this.$emit('onSelected',this.selectedRows);
this.showFlag = false;
}
}
}
</script>
......@@ -103,12 +103,83 @@
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加领料申请对话框 -->
<el-dialog :title="title" :visible.sync="open" width="900px" append-to-body>
<el-form ref="form" :model="form" :rules="rules"
label-width="100px">
<el-row>
<el-col :span="12">
<el-form-item label="申请号" prop="applyNo">
<el-input v-model="form.applyNo" placeholder="请输入申请号" disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="工作中心" prop="workstationCode">
<el-input v-model="form.workstationCode" placeholder="工作中心">
<el-button slot="append" icon="el-icon-search" @click="handleWorkstationSelect"
:disabled="form.workstationMaterialId"></el-button>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="工单号" prop="workorderCode">
<el-input v-model="form.workorderCode" disabled>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="申请时间" prop="createTime">
<el-date-picker clearable v-model="form.createTime" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择申请时间" disabled>
</el-date-picker>
</el-form-item>
</el-col>
<WorkstationSelect ref="workstationSelect"
@onSelected="onWorkstationSelect"></WorkstationSelect>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="需求日期" prop="startTime">
<el-date-picker clearable v-model="form.startTime" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择需求日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="预计结束时间" prop="endTime">
<el-date-picker clearable v-model="form.endTime" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择需预计结束时间" >
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-divider content-position="center">申请单物料</el-divider>
<el-card shadow="always" class="box-card">
<requestIndex v-if="open" ref="materialRequestRef" :quantity="form.requestNum"
:id="form.materialRequestId"></requestIndex>
</el-card>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { addMaterial } from "@/api/mes/pro/material";
import requestIndex from "./components/requestIndex.vue";
import { genCode } from "@/api/system/autocode/rule";
import dayjs from 'dayjs';
import WorkstationSelect from "@/components/workstationSelect/simpletableSingle.vue";
import { listSecrecyissue, putSecrecyissue } from "@/api/mes/pro/secretSend";
export default {
dicts: ['se_issue_table_status'],
components: { requestIndex,WorkstationSelect },
name: "secretSend",
data() {
return {
......@@ -143,13 +214,41 @@ export default {
form: {},
// 表单校验
rules: {
}
taskCode: [
{ required: true, message: "任务单号称不能为空", trigger: "blur" }
],
arrangeCode: [
{ required: true, message: "编排单号称不能为空", trigger: "blur" }
],
createTime: [
{ required: true, message: "编排单号称不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
{
const itemList = this.$refs.materialRequestRef.tableData;
const params = {
... this.form,
itemList,
secrecyIssueCode: this.form.secrecyIssueCode
}
addMaterial(params).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
getList() {
this.loading = true;
listSecrecyissue(this.queryParams).then(response => {
......@@ -180,17 +279,24 @@ export default {
this.getList();
},
handleSend(row) {
const ids = row.id ? [row.id] : this.ids;
this.$modal.confirm('是否发料?').then(function() {
return putSecrecyissue({
status: 0,
ids: ids
});
}).then((res) => {
if(res.code === 200) {
this.getList()
}
})
// const ids = row.id ? [row.id] : this.ids;
// this.$modal.confirm('是否发料?').then(function() {
// return putSecrecyissue({
// status: 0,
// ids: ids
// });
// }).then((res) => {
// if(res.code === 200) {
// this.getList()
// }
// })
this.reset();
this.form.createTime = dayjs().format('YYYY-MM-DD HH:mm:ss')
this.form.workorderCode = row.workorderCode
this.form.secrecyIssueCode = row.secrecyIssueCode
this.open = true;
this.gCode();
this.title = "发料申请";
},
handleSubmit(row) {
const ids = row.id ? [row.id] : this.ids;
......@@ -215,7 +321,71 @@ export default {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
}
},
handleWorkstationSelect() {
this.$refs.workstationSelect.showFlag = true;
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
workstationMaterialId: null,
applyNo: null,
itemId: null,
taskId: null,
taskWorkunitId: null,
applyType: null,
applyNum: null,
workorderCode: null,
pickingReason: null,
workstationCode: null,
workstationName: null,
windCase: null,
grantNum: null,
remak: null,
attr1: null,
attr2: null,
attr3: null,
attr4: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
workunitId: null,
workunitName: null,
workunitCode: null,
startTime: null,
endTime: null,
arrangeCode: null,
itemName: null,
taskCode: null
};
this.resetForm("form");
},
onWorkstationSelect(row) {
if (row != undefined && row != null) {
// this.form.workunitName = row.workunitName
this.$set(this.form, 'workunitCode', row.workunitCode)
this.form.workstationId = row.workstationId;
this.form.workstationCode = row.workstationCode;
this.form.workstationName = row.workstationName;
}
},
gCode() {
genCode("WORKSTATION_MATERIAL").then((response) => {
this.form.applyNo = response;
});
},
onWorkorderSelect(row){
if (row != undefined && row!= null) {
this.$set(this.form,'workorderCode',row.workorderCode)
}
},
}
}
</script>
\ No newline at end of file
......@@ -88,7 +88,6 @@
</template>
<script>
import codeSelect from "./codeSelect.vue";
import WorkstationSelect from "@/components/workstationSelect/simpletableSingle.vue";
import ItemSelect from "@/components/itemSelect/single.vue";
export default {
......@@ -96,7 +95,7 @@ export default {
dicts: [
"warehouse_desc"
],
components: { ItemSelect, WorkstationSelect, codeSelect },
components: { ItemSelect, WorkstationSelect },
props: {
id: {
type: String,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment