同步代码
This commit is contained in:
commit
3dfc1de705
44
src/api/mes/md/sip.js
Normal file
44
src/api/mes/md/sip.js
Normal file
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询产品Sip列表
|
||||
export function listSip(query) {
|
||||
return request({
|
||||
url: '/mes/md/sip/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询产品Sip详细
|
||||
export function getSip(sipId) {
|
||||
return request({
|
||||
url: '/mes/md/sip/' + sipId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增产品Sip
|
||||
export function addSip(data) {
|
||||
return request({
|
||||
url: '/mes/md/sip',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改产品Sip
|
||||
export function updateSip(data) {
|
||||
return request({
|
||||
url: '/mes/md/sip',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除产品Sip
|
||||
export function delSip(sipId) {
|
||||
return request({
|
||||
url: '/mes/md/sip/' + sipId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
44
src/api/mes/wm/oursourcerecptline.js
Normal file
44
src/api/mes/wm/oursourcerecptline.js
Normal file
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询外协入库单行列表
|
||||
export function listOursourcerecptline(query) {
|
||||
return request({
|
||||
url: '/mes/wm/oursourcerecptline/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询外协入库单行详细
|
||||
export function getOursourcerecptline(lineId) {
|
||||
return request({
|
||||
url: '/mes/wm/oursourcerecptline/' + lineId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增外协入库单行
|
||||
export function addOursourcerecptline(data) {
|
||||
return request({
|
||||
url: '/mes/wm/oursourcerecptline',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改外协入库单行
|
||||
export function updateOursourcerecptline(data) {
|
||||
return request({
|
||||
url: '/mes/wm/oursourcerecptline',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除外协入库单行
|
||||
export function delOursourcerecptline(lineId) {
|
||||
return request({
|
||||
url: '/mes/wm/oursourcerecptline/' + lineId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
52
src/api/mes/wm/outsourceissue.js
Normal file
52
src/api/mes/wm/outsourceissue.js
Normal file
@ -0,0 +1,52 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询外协领料单头列表
|
||||
export function listOutsourceissue(query) {
|
||||
return request({
|
||||
url: '/mes/wm/outsourceissue/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询外协领料单头详细
|
||||
export function getOutsourceissue(issueId) {
|
||||
return request({
|
||||
url: '/mes/wm/outsourceissue/' + issueId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增外协领料单头
|
||||
export function addOutsourceissue(data) {
|
||||
return request({
|
||||
url: '/mes/wm/outsourceissue',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改外协领料单头
|
||||
export function updateOutsourceissue(data) {
|
||||
return request({
|
||||
url: '/mes/wm/outsourceissue',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除外协领料单头
|
||||
export function delOutsourceissue(issueId) {
|
||||
return request({
|
||||
url: '/mes/wm/outsourceissue/' + issueId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
//执行发料
|
||||
export function execute(issueId) {
|
||||
return request({
|
||||
url: '/mes/wm/outsourceissue/' + issueId,
|
||||
method: 'put'
|
||||
})
|
||||
}
|
44
src/api/mes/wm/outsourceissueline.js
Normal file
44
src/api/mes/wm/outsourceissueline.js
Normal file
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询外协领料单行列表
|
||||
export function listOutsourceissueline(query) {
|
||||
return request({
|
||||
url: '/mes/wm/outsourceissueline/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询外协领料单行详细
|
||||
export function getOutsourceissueline(lineId) {
|
||||
return request({
|
||||
url: '/mes/wm/outsourceissueline/' + lineId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增外协领料单行
|
||||
export function addOutsourceissueline(data) {
|
||||
return request({
|
||||
url: '/mes/wm/outsourceissueline',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改外协领料单行
|
||||
export function updateOutsourceissueline(data) {
|
||||
return request({
|
||||
url: '/mes/wm/outsourceissueline',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除外协领料单行
|
||||
export function delOutsourceissueline(lineId) {
|
||||
return request({
|
||||
url: '/mes/wm/outsourceissueline/' + lineId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
53
src/api/mes/wm/outsourcerecpt.js
Normal file
53
src/api/mes/wm/outsourcerecpt.js
Normal file
@ -0,0 +1,53 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询外协入库单列表
|
||||
export function listOutsourcerecpt(query) {
|
||||
return request({
|
||||
url: '/mes/wm/outsourcerecpt/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询外协入库单详细
|
||||
export function getOutsourcerecpt(recptId) {
|
||||
return request({
|
||||
url: '/mes/wm/outsourcerecpt/' + recptId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增外协入库单
|
||||
export function addOutsourcerecpt(data) {
|
||||
return request({
|
||||
url: '/mes/wm/outsourcerecpt',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改外协入库单
|
||||
export function updateOutsourcerecpt(data) {
|
||||
return request({
|
||||
url: '/mes/wm/outsourcerecpt',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除外协入库单
|
||||
export function delOutsourcerecpt(recptId) {
|
||||
return request({
|
||||
url: '/mes/wm/outsourcerecpt/' + recptId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//执行入库
|
||||
export function execute(recptId) {
|
||||
return request({
|
||||
url: '/mes/wm/outsourcerecpt/' + recptId,
|
||||
method: 'put'
|
||||
})
|
||||
}
|
@ -86,14 +86,14 @@
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['pro:protask:edit']"
|
||||
v-hasPermi="['mes:pro:protask:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['pro:protask:remove']"
|
||||
v-hasPermi="['mes:pro:protask:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -103,7 +103,7 @@
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['wm:wmstock:export']"
|
||||
v-hasPermi="['mes:wm:wmstock:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
|
@ -103,6 +103,13 @@
|
||||
name: 'WorkOrderSelectSingle',
|
||||
components: {},
|
||||
dicts: ['mes_order_status','mes_workorder_sourcetype'],
|
||||
props:{
|
||||
workorder: {
|
||||
type: Object,
|
||||
default: function(){
|
||||
return {'workorderType': 'SELF'}
|
||||
}} //外部传入的工单过滤信息
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showFlag: false,
|
||||
@ -129,6 +136,7 @@
|
||||
queryParams: {
|
||||
workorderCode: null,
|
||||
workorderName: null,
|
||||
workorderType: this.workorder.workorderType,
|
||||
orderSource: null,
|
||||
sourceCode: null,
|
||||
productId: null,
|
||||
|
@ -180,7 +180,7 @@ export const dynamicRoutes = [
|
||||
path: "/mes/pro/schedule",
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
permissions: ["mes:pro:schedule:edit"],
|
||||
permissions: ['mes:pro:protask:edit'],
|
||||
children: [
|
||||
{
|
||||
path: "ganttedit",
|
||||
@ -226,7 +226,7 @@ export const dynamicRoutes = [
|
||||
children: [
|
||||
{
|
||||
path: 'iqc',
|
||||
component: () => import('@/views/mes/qc/iqc/iqc'),
|
||||
component: () => import('@/views/mes/qc/pendinginspect/iqc'),
|
||||
name: 'iqcadd',
|
||||
props: true,
|
||||
meta: {title: '来料检验', activeMenu: '/mes/qc/pendinginspect/iqc'}
|
||||
|
@ -42,7 +42,7 @@
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button type="primary" v-hasPermi="['mes:cal:calholiday:edit']" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
@ -47,14 +47,14 @@
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['dv:machinerytype:edit']"
|
||||
v-hasPermi="['mes:dv:machinerytype:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-plus"
|
||||
@click="handleAdd(scope.row)"
|
||||
v-hasPermi="['dv:machinerytype:add']"
|
||||
v-hasPermi="['mes:dv:machinerytype:add']"
|
||||
>新增</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.parentTypeId != 0"
|
||||
@ -62,7 +62,7 @@
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['dv:machinerytype:remove']"
|
||||
v-hasPermi="['mes:dv:machinerytype:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -60,7 +60,7 @@
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['mes:md:item:add']"
|
||||
v-hasPermi="['mes:md:mditem:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
@ -71,7 +71,7 @@
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['mes:md:item:edit']"
|
||||
v-hasPermi="['mes:md:mditem:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
@ -82,7 +82,7 @@
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['mes:md:item:remove']"
|
||||
v-hasPermi="['mes:md:mditem:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
@ -92,7 +92,7 @@
|
||||
icon="el-icon-upload2"
|
||||
size="mini"
|
||||
@click="handleImport"
|
||||
v-hasPermi="['mes:md:item:import']"
|
||||
v-hasPermi="['mes:md:mditem:import']"
|
||||
>导入</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
@ -102,7 +102,7 @@
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['mes:md:item:export']"
|
||||
v-hasPermi="['mes:md:mditem:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
||||
@ -148,14 +148,14 @@
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['mes:md:item:edit']"
|
||||
v-hasPermi="['mes:md:mditem:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['mes:md:item:remove']"
|
||||
v-hasPermi="['mes:md:mditem:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
231
src/views/mes/md/mditem/components/sip.vue
Normal file
231
src/views/mes/md/mditem/components/sip.vue
Normal file
@ -0,0 +1,231 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row v-if="optType != 'view'" :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['mes:md:mditem:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="header">
|
||||
<el-dialog :title="title" :visible.sync="open" width="960px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="标题" prop="sipTitle">
|
||||
<el-input v-model="form.sipTitle" placeholder="请输入标题"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="展示顺序">
|
||||
<el-input-number :min="1" v-model="form.orderNum"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="内容说明">
|
||||
<el-input type="textarea" v-model="form.sipDescription" placeholder="请输入说明信息"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属工序" prop="processId">
|
||||
<el-select v-model="form.processId" placeholder="请选择工序">
|
||||
<el-option
|
||||
v-for="item in processOptions"
|
||||
:key="item.processId"
|
||||
:label="item.processName"
|
||||
:value="item.processId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="图片">
|
||||
<ImageUpload :limit="1" :value="form.sipUrl" :fileSize="5" @onUploaded="handleImgUplaoded" @onRemoved="handleImgRemoved" ></ImageUpload>
|
||||
</el-form-item>
|
||||
</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>
|
||||
</div>
|
||||
<div class="images">
|
||||
<div v-for="(item,index) in sipList" :key="index" class="image-middle">
|
||||
<el-card shadow="hover" :body-style="{pading: '10px'}">
|
||||
<el-popover>
|
||||
<img :src="sipList[index].sipUrl" slot="reference" class="image"/>
|
||||
<el-image class="imagePreview" :src="sipList[index].sopUrl" :preview-src-list="imageList"></el-image>
|
||||
</el-popover>
|
||||
<div style="text-align:center;padding-top:12px">
|
||||
<span>
|
||||
{{sipList[index].sopTitle}}
|
||||
</span>
|
||||
<el-button @click="handleUpdate(sipList[index])" v-hasPermi="['mes:md:mditem:edit']" v-if="optType !='view'" type="primary" icon="el-icon-edit"></el-button>
|
||||
<el-button @click="handleDelete(sipList[index])" v-hasPermi="['mes:md:mditem:edit']" v-if="optType !='view'" type="danger" icon="el-icon-delete"></el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { listSip, getSip, delSip, addSip, updateSip } from "@/api/mes/md/sip";
|
||||
import ImageUpload from "@/components/ImageUpload/index.vue"
|
||||
import {listAllProcess} from "@/api/mes/pro/process";
|
||||
export default{
|
||||
name: "SOPTab",
|
||||
components: {ImageUpload},
|
||||
props:{
|
||||
itemId: null,
|
||||
optType: null,
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
title: "新增SIP信息",
|
||||
loading: true,
|
||||
open: false,
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
itemId: [
|
||||
{ required: true, message: "物料产品ID不能为空", trigger: "blur" }
|
||||
],
|
||||
},
|
||||
// 产品SOP表格数据
|
||||
sipList: [],
|
||||
//用于图片预览的清单
|
||||
imageList: [],
|
||||
//工序选项
|
||||
processOptions:[],
|
||||
queryParams: {
|
||||
itemId: this.itemId
|
||||
}
|
||||
}
|
||||
},
|
||||
created(){
|
||||
this.getList();
|
||||
this.getProcess();
|
||||
},
|
||||
methods: {
|
||||
//获取当前产品的SOP资料清单
|
||||
getList(){
|
||||
listSip(this.queryParams).then(response =>{
|
||||
debugger;
|
||||
this.imageList = [];
|
||||
this.sipList = response.rows;
|
||||
this.sipList.forEach(row => {
|
||||
this.imageList.push(row.sipUrl);
|
||||
});
|
||||
});
|
||||
},
|
||||
//查询工序信息
|
||||
getProcess(){
|
||||
listAllProcess().then( response =>{
|
||||
this.processOptions = response.data;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
sopId: null,
|
||||
itemId: this.itemId,
|
||||
orderNum: null,
|
||||
processId: null,
|
||||
processCode: null,
|
||||
processName: null,
|
||||
sopTitle: null,
|
||||
sopDescription: null,
|
||||
sopUrl: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/**
|
||||
* 新增操作
|
||||
*/
|
||||
handleAdd(){
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加产品SIP";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const sipId = row.sipId || this.ids
|
||||
getSip(sipId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改产品SIP";
|
||||
});
|
||||
},
|
||||
//图片上传成功
|
||||
handleImgUplaoded(imgUrl){
|
||||
this.form.sipUrl = imgUrl;
|
||||
},
|
||||
//图片移除
|
||||
handleImgRemoved(imgUrl){
|
||||
this.form.sipUrl = null;
|
||||
},
|
||||
//提交
|
||||
submitForm(){
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.sipId != null) {
|
||||
updateSip(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addSip(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const sipIds = row.sipId || this.ids;
|
||||
this.$modal.confirm('是否确认删除产品SIP编号为"' + sipIds + '"的数据项?').then(function() {
|
||||
return delSip(sipIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.header {
|
||||
margin-left: 15px;
|
||||
font-size: 30px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.images {
|
||||
display: flex;
|
||||
margin-top: 20px;
|
||||
margin-left: 21px;
|
||||
margin-right: 20px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.image-middle{
|
||||
margin-right: 15px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.image{
|
||||
width:110px;
|
||||
height: 110px;
|
||||
}
|
||||
|
||||
.imagePreview {
|
||||
width: 600px;
|
||||
height: 500px;
|
||||
}
|
||||
</style>
|
@ -72,8 +72,8 @@
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-refresh" circle="" @click="getList"></el-button>
|
||||
<el-button type="primary" icon="el-icon-edit" circle="" @click="handleOpenGantt"></el-button>
|
||||
<el-button type="primary" icon="el-icon-refresh" v-hasPermi="['mes:pro:protask:list']" circle="" @click="getList"></el-button>
|
||||
<el-button type="primary" icon="el-icon-edit" v-hasPermi="['mes:pro:protask:edit']" circle="" @click="handleOpenGantt"></el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="wrapper">
|
||||
@ -94,7 +94,7 @@
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="handleView(scope.row)"
|
||||
v-hasPermi="['mes:pro:workorder:query']"
|
||||
v-hasPermi="['mes:pro:protask:query']"
|
||||
>{{scope.row.workorderCode}}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -132,7 +132,7 @@
|
||||
icon="el-icon-edit"
|
||||
v-if="scope.row.status =='CONFIRMED'"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['mes:pro:workorder:edit']"
|
||||
v-hasPermi="['mes:pro:protask:edit']"
|
||||
>排产</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -322,6 +322,7 @@ export default {
|
||||
pageSize: 10,
|
||||
workorderCode: null,
|
||||
workorderName: null,
|
||||
workorderType: 'SELF', //这里的排产要排除自产之外的外协和外购
|
||||
orderSource: null,
|
||||
sourceCode: null,
|
||||
productId: null,
|
||||
|
@ -42,7 +42,7 @@
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleAddSubWorkorder(scope.row)"
|
||||
v-if="workorder.status == 'CONFIRMED' && scope.row.itemOrProduct=='PRODUCT'"
|
||||
v-if="workorder.status == 'CONFIRMED' && scope.row.itemOrProduct=='PRODUCT' && workorder.workorderType =='SELF'"
|
||||
v-hasPermi="['mes:pro:workorder:edit']"
|
||||
>生成工单</el-button>
|
||||
</template>
|
||||
@ -143,7 +143,7 @@ export default {
|
||||
},
|
||||
props: {
|
||||
optType: undefined,
|
||||
workorder: undefined
|
||||
workorder: undefined,
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
|
@ -59,6 +59,14 @@
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="工单类型" prop="workorderType">
|
||||
<el-input
|
||||
v-model="queryParams.workorderType"
|
||||
placeholder="请选择工单类型"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="需求日期" prop="requestDate">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.requestDate"
|
||||
@ -137,6 +145,11 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工单名称" width="200" align="center" prop="workorderName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="工单类型" align="center" prop="workorderType" >
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.mes_workorder_type" :value="scope.row.workorderType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工单来源" align="center" prop="orderSource" >
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.mes_workorder_sourcetype" :value="scope.row.orderSource"/>
|
||||
@ -177,7 +190,7 @@
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-plus"
|
||||
v-if="scope.row.status =='CONFIRMED'"
|
||||
v-if="scope.row.status =='CONFIRMED' && scope.row.workorderType =='SELF'"
|
||||
@click="handleAdd(scope.row)"
|
||||
v-hasPermi="['mes:pro:workorder:add']"
|
||||
>新增</el-button>
|
||||
@ -202,7 +215,7 @@
|
||||
|
||||
<!-- 添加或修改生产工单对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="960px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="工单编号" prop="workorderCode">
|
||||
@ -262,7 +275,19 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="工单类型" prop="workorderType">
|
||||
<el-select v-model="form.workorderType" placeholder="请选择类型">
|
||||
<el-option
|
||||
v-for="dict in dict.type.mes_workorder_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="产品编号" prop="productCode">
|
||||
<el-input v-model="form.productCode" placeholder="请选择产品" >
|
||||
<el-button slot="append" @click="handleSelectProduct" icon="el-icon-search"></el-button>
|
||||
@ -270,7 +295,7 @@
|
||||
<ItemSelect ref="itemSelect" @onSelected="onItemSelected" > </ItemSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="产品名称" prop="productName">
|
||||
<el-input v-model="form.productName" placeholder="请选择产品" disabled/>
|
||||
</el-form-item>
|
||||
@ -313,7 +338,7 @@
|
||||
<el-row v-if="form.orderSource == 'ORDER'">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="客户编码" prop="clientCode">
|
||||
<el-input v-model="form.clientCode" placeholder="请输入客户编码" >
|
||||
<el-input v-model="form.clientCode" placeholder="请选择客户" >
|
||||
<el-button slot="append" @click="handleSelectClient" icon="el-icon-search"></el-button>
|
||||
</el-input>
|
||||
<ClientSelect ref="clientSelect" @onSelected="onClientSelected" > </ClientSelect>
|
||||
@ -326,6 +351,22 @@
|
||||
</el-col>
|
||||
<el-col></el-col>
|
||||
</el-row>
|
||||
<el-row v-if="form.workorderType == 'OUTSOURCE' || form.workorderType == 'PURCHASE'">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="供应商编码" prop="vendorCode">
|
||||
<el-input v-model="form.vendorCode" placeholder="请选择供应商" >
|
||||
<el-button slot="append" @click="handleSelectVendor" icon="el-icon-search"></el-button>
|
||||
</el-input>
|
||||
<VendorSelect ref="vendorSelect" @onSelected="onVendorSelected" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="供应商名称" prop="vendorName">
|
||||
<el-input v-model="form.vendorName" readonly="readonly" placeholder="请选择供应商" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col></el-col>
|
||||
<el-col></el-col>
|
||||
@ -349,8 +390,8 @@
|
||||
</el-tabs>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="cancel" v-if="optType =='view' || form.status !='PREPARE' ">返回</el-button>
|
||||
<el-button type="primary" @click="submitForm" v-if="form.status =='PREPARE' && optType !='view' ">确 定</el-button>
|
||||
<el-button type="success" @click="handleFinish" v-if="form.status =='PREPARE' && optType !='view' && form.workorderId !=null">完成</el-button>
|
||||
<el-button type="primary" @click="submitForm" v-if="form.status =='PREPARE' && optType !='view' ">保 存</el-button>
|
||||
<el-button type="success" @click="handleConfirm" v-if="form.status =='PREPARE' && optType !='view' && form.workorderId !=null">确 认</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
@ -363,17 +404,19 @@ import Workorderbom from "./bom/bom.vue";
|
||||
import WorkorderItemList from "./items/item.vue";
|
||||
import ItemSelect from "@/components/itemSelect/single.vue";
|
||||
import ClientSelect from "@/components/clientSelect/single.vue";
|
||||
import VendorSelect from "@/components/vendorSelect/single.vue";
|
||||
import {genCode} from "@/api/system/autocode/rule"
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
|
||||
export default {
|
||||
name: "Workorder",
|
||||
dicts: ['mes_order_status','mes_workorder_sourcetype'],
|
||||
dicts: ['mes_order_status','mes_workorder_sourcetype','mes_workorder_type'],
|
||||
components: {
|
||||
Treeselect,
|
||||
ItemSelect ,
|
||||
ClientSelect,
|
||||
VendorSelect,
|
||||
Workorderbom,
|
||||
WorkorderItemList
|
||||
},
|
||||
@ -435,6 +478,9 @@ export default {
|
||||
workorderName: [
|
||||
{ required: true, message: "工单名称不能为空", trigger: "blur" }
|
||||
],
|
||||
workorderType: [
|
||||
{ required: true, message: "请选择生产工单类型", trigger: "blur" }
|
||||
],
|
||||
orderSource: [
|
||||
{ required: true, message: "来源类型不能为空", trigger: "blur" }
|
||||
],
|
||||
@ -500,6 +546,7 @@ export default {
|
||||
workorderId: null,
|
||||
workorderCode: null,
|
||||
workorderName: null,
|
||||
workorderType: 'SELF',
|
||||
orderSource: null,
|
||||
sourceCode: null,
|
||||
productId: null,
|
||||
@ -514,6 +561,9 @@ export default {
|
||||
clientId: null,
|
||||
clientCode: null,
|
||||
clientName: null,
|
||||
vendorId: null,
|
||||
vendorCode: null,
|
||||
vendorName: null,
|
||||
requestDate: null,
|
||||
parentId: null,
|
||||
status: "PREPARE",
|
||||
@ -664,6 +714,19 @@ export default {
|
||||
this.form.clientName = obj.clientName;
|
||||
}
|
||||
},
|
||||
//供应商选择
|
||||
handleSelectVendor(){
|
||||
this.$refs.vendorSelect.showFlag = true;
|
||||
},
|
||||
//供应商选择弹出框
|
||||
onVendorSelected(obj){
|
||||
debugger;
|
||||
if(obj != undefined && obj != null){
|
||||
this.form.vendorId = obj.vendorId;
|
||||
this.form.vendorCode = obj.vendorCode;
|
||||
this.form.vendorName = obj.vendorName;
|
||||
}
|
||||
},
|
||||
//自动生成编码
|
||||
handleAutoGenChange(autoGenFlag){
|
||||
if(autoGenFlag){
|
||||
|
@ -24,7 +24,7 @@
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleDefect(scope.row)"
|
||||
v-hasPermi="['mes:qc:iqcline:edit']"
|
||||
v-hasPermi="['mes:qc:iqc:edit']"
|
||||
v-if="optType !='view'"
|
||||
>缺陷记录</el-button>
|
||||
</template>
|
||||
|
@ -54,7 +54,7 @@
|
||||
icon="el-icon-edit"
|
||||
@click="handleAddIQC(scope.row)"
|
||||
v-if="scope.row.qcType == 'IQC'"
|
||||
v-hasPermi="['mes:qc:qcindex:edit']"
|
||||
v-hasPermi="['mes:qc:iqc:edit']"
|
||||
>来料检验</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
@ -62,7 +62,7 @@
|
||||
icon="el-icon-edit"
|
||||
v-if="scope.row.qcType == 'PQC'"
|
||||
@click="handleAddPQC(scope.row)"
|
||||
v-hasPermi="['mes:qc:qcindex:edit']"
|
||||
v-hasPermi="['mes:qc:ipqc:edit']"
|
||||
>过程检验</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
@ -70,7 +70,7 @@
|
||||
icon="el-icon-edit"
|
||||
v-if="scope.row.qcType == 'OQC'"
|
||||
@click="handleAddOQC(scope.row)"
|
||||
v-hasPermi="['mes:qc:qcindex:edit']"
|
||||
v-hasPermi="['mes:qc:oqc:edit']"
|
||||
>出货检验</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -90,7 +90,7 @@
|
||||
<el-button
|
||||
type="text"
|
||||
@click="handleView(scope.row)"
|
||||
v-hasPermi="['mes:qc:template:query']"
|
||||
v-hasPermi="['mes:qc:qctemplate:query']"
|
||||
>{{scope.row.templateCode}}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -8,7 +8,7 @@
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['mes:qc:templateindex:add']"
|
||||
v-hasPermi="['mes:qc:qctemplate:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
@ -19,7 +19,7 @@
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['mes:qc:templateindex:edit']"
|
||||
v-hasPermi="['mes:qc:qctemplate:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
@ -30,7 +30,7 @@
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['mes:qc:templateindex:remove']"
|
||||
v-hasPermi="['mes:qc:qctemplate:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
@ -57,14 +57,14 @@
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['mes:qc:templateindex:edit']"
|
||||
v-hasPermi="['mes:qc:qctemplate:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['mes:qc:templateindex:remove']"
|
||||
v-hasPermi="['mes:qc:qctemplate:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -8,7 +8,7 @@
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['mes:qc:templateproduct:add']"
|
||||
v-hasPermi="['mes:qc:qctemplate:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
@ -19,7 +19,7 @@
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['mes:qc:templateproduct:edit']"
|
||||
v-hasPermi="['mes:qc:qctemplate:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
@ -30,7 +30,7 @@
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['mes:qc:templateproduct:remove']"
|
||||
v-hasPermi="['mes:qc:qctemplate:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
@ -66,14 +66,14 @@
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['mes:qc:templateproduct:edit']"
|
||||
v-hasPermi="['mes:qc:qctemplate:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['mes:qc:templateproduct:remove']"
|
||||
v-hasPermi="['mes:qc:qctemplate:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -126,15 +126,16 @@
|
||||
<el-table v-loading="loading" :data="toolList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="编号" align="center" prop="toolCode" >
|
||||
</el-table-column>
|
||||
<el-table-column label="名称" align="center" prop="toolName" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
@click="handleView(scope.row)"
|
||||
v-hasPermi="['mes:tm:tool:query']"
|
||||
>{{scope.row.toolCode}}</el-button>
|
||||
>{{scope.row.toolName}}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="名称" align="center" prop="toolName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="品牌" align="center" prop="brand" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="型号" align="center" prop="spec" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="类型" align="center" prop="toolTypeName" />
|
||||
|
@ -125,7 +125,7 @@
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
icon="el-icon-video-play"
|
||||
v-if="scope.row.status =='PREPARE'"
|
||||
@click="handleExecute(scope.row)"
|
||||
v-hasPermi="['mes:wm:issueheader:edit']"
|
||||
|
@ -122,7 +122,7 @@
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
icon="el-icon-video-play"
|
||||
v-if="scope.row.status =='PREPARE'"
|
||||
@click="handleExecute(scope.row)"
|
||||
v-hasPermi="['mes:wm:itemrecpt:edit']"
|
||||
@ -439,7 +439,6 @@ export default {
|
||||
this.reset();
|
||||
const recptIds = row.recptId
|
||||
getItemrecpt(recptIds).then(response => {
|
||||
debugger;
|
||||
this.form = response.data;
|
||||
this.warehouseInfo[0] = response.data.warehouseId;
|
||||
this.warehouseInfo[1] = response.data.locationId;
|
||||
|
509
src/views/mes/wm/outsourceissue/index.vue
Normal file
509
src/views/mes/wm/outsourceissue/index.vue
Normal file
@ -0,0 +1,509 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="发料单编号" prop="issueCode">
|
||||
<el-input
|
||||
v-model="queryParams.issueCode"
|
||||
placeholder="请输入发料单编号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<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="vendorName">
|
||||
<el-input
|
||||
v-model="queryParams.vendorName"
|
||||
placeholder="请输入供应商名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="发料日期" prop="issueDate">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.issueDate"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择发料日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['mes:wm:outsourceissue:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['mes:wm:outsourceissue:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['mes:wm:outsourceissue:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="outsourceissueList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="发料单编号" align="center" prop="issueCode" >
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
@click="handleView(scope.row)"
|
||||
v-hasPermi="['mes:wm:outsourceissue:query']"
|
||||
>{{scope.row.issueCode}}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="发料单名称" align="center" prop="issueName" />
|
||||
<el-table-column label="生产工单编码" align="center" prop="workorderCode" />
|
||||
<el-table-column label="供应商名称" align="center" prop="vendorName" />
|
||||
<el-table-column label="发料日期" align="center" prop="issueDate" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.issueDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单据状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.mes_order_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-video-play"
|
||||
v-if="scope.row.status =='PREPARE'"
|
||||
@click="handleExecute(scope.row)"
|
||||
v-hasPermi="['mes:wm:outsourceissue:edit']"
|
||||
>执行发料</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-if="scope.row.status =='PREPARE'"
|
||||
v-hasPermi="['mes:wm:outsourceissue:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-if="scope.row.status =='PREPARE'"
|
||||
v-hasPermi="['mes:wm:outsourceissue:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改外协领料单头对话框 -->
|
||||
<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="8">
|
||||
<el-form-item label="发料单编号" prop="issueCode">
|
||||
<el-input v-model="form.issueCode" placeholder="请输入发料单编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label-width="80">
|
||||
<el-switch v-model="autoGenFlag"
|
||||
active-color="#13ce66"
|
||||
active-text="自动生成"
|
||||
@change="handleAutoGenChange(autoGenFlag)" v-if="optType != 'view' && form.status =='PREPARE'">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="发料单名称" prop="issueName">
|
||||
<el-input v-model="form.issueName" placeholder="请输入发料单名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="发料日期" prop="issueDate">
|
||||
<el-date-picker clearable
|
||||
v-model="form.issueDate"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择发料日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="发料仓库">
|
||||
<el-cascader v-model="warehouseInfo"
|
||||
:options="warehouseOptions"
|
||||
:props="warehouseProps"
|
||||
@change="handleWarehouseChanged"
|
||||
>
|
||||
</el-cascader>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单据状态" prop="status">
|
||||
<el-select v-model="form.status" disabled>
|
||||
<el-option
|
||||
v-for="dict in dict.type.mes_order_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="外协工单" prop="workorderCode">
|
||||
<el-input v-model="form.workorderCode" placeholder="请选择外协工单" >
|
||||
<el-button slot="append" icon="el-icon-search" @click="handleWorkorderSelect"></el-button>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<WorkorderSelect ref="woSelect" :workorder="workorder" @onSelected="onWorkorderSelected"></WorkorderSelect>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商" prop="vendorCode">
|
||||
<el-input v-model="form.vendorCode" readonly="readonly">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商名称" >
|
||||
<el-input v-model="form.vendorName" placeholder="请选择外协工单" >
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-divider v-if="form.issueId !=null" content-position="center">物料信息</el-divider>
|
||||
<el-card shadow="always" v-if="form.issueId !=null" class="box-card">
|
||||
<Issueline ref="line" :issueId="form.issueId" :warehouseId="form.warehouseId" :locationId="form.locationId" :areaId="form.areaId" :optType="optType"></Issueline>
|
||||
</el-card>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="cancel" v-if="optType =='view' || form.status !='PREPARE' ">返回</el-button>
|
||||
<el-button type="primary" @click="submitForm" v-if="form.status =='PREPARE' && optType !='view' ">保 存</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listOutsourceissue, getOutsourceissue, delOutsourceissue, addOutsourceissue, updateOutsourceissue, execute } from "@/api/mes/wm/outsourceissue";
|
||||
import WorkorderSelect from "@/components/workorderSelect/single.vue"
|
||||
import {getTreeList} from "@/api/mes/wm/warehouse"
|
||||
import {genCode} from "@/api/system/autocode/rule"
|
||||
import Issueline from "./line.vue";
|
||||
export default {
|
||||
name: "Outsourceissue",
|
||||
dicts: ['mes_order_status'],
|
||||
components: {Issueline,WorkorderSelect},
|
||||
data() {
|
||||
return {
|
||||
autoGenFlag:false,
|
||||
optType: undefined,
|
||||
warehouseInfo:[],
|
||||
warehouseOptions:[],
|
||||
warehouseProps:{
|
||||
multiple: false,
|
||||
value: 'pId',
|
||||
label: 'pName',
|
||||
},
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 外协领料单头表格数据
|
||||
outsourceissueList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
//工单弹出框结果过滤参数
|
||||
workorder: { workorderType: 'OUTSOURCE'},
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
issueCode: null,
|
||||
issueName: null,
|
||||
workorderId: null,
|
||||
workorderCode: null, vendorId: null, vendorCode: null, vendorName: null, vendorNick: null, warehouseId: null, warehouseCode: null, warehouseName: null, locationId: null, locationCode: null, locationName: null, areaId: null, areaCode: null, areaName: null, issueDate: null, status: null, },
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
issueCode: [
|
||||
{ required: true, message: "发料单编号不能为空", trigger: "blur" }
|
||||
],
|
||||
issueName: [
|
||||
{ required: true, message: "发料单名称不能为空", trigger: "blur" }
|
||||
],
|
||||
workorderCode: [
|
||||
{ required: true, message: "请选择外协工单", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getWarehouseList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询外协领料单头列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listOutsourceissue(this.queryParams).then(response => {
|
||||
this.outsourceissueList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
getWarehouseList(){
|
||||
getTreeList().then( response =>{
|
||||
if(response.data){
|
||||
this.warehouseOptions = response.data.filter((el) =>{
|
||||
return el.warehouseCode.indexOf('VIR') == -1;
|
||||
});;
|
||||
}
|
||||
this.warehouseOptions.map(w =>{
|
||||
w.children.map(l =>{
|
||||
let lstr =JSON.stringify(l.children).replace(/locationId/g,'lId').replace(/areaId/g, 'pId').replace(/areaName/g,'pName');
|
||||
l.children = JSON.parse(lstr);
|
||||
});
|
||||
|
||||
let wstr = JSON.stringify(w.children).replace(/warehouseId/g,'wId').replace(/locationId/g, 'pId').replace(/locationName/g,'pName');
|
||||
w.children = JSON.parse(wstr);
|
||||
|
||||
});
|
||||
let ostr=JSON.stringify(this.warehouseOptions).replace(/warehouseId/g,'pId').replace(/warehouseName/g, 'pName');
|
||||
this.warehouseOptions = JSON.parse(ostr);
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
issueId: null,
|
||||
issueCode: null,
|
||||
issueName: null,
|
||||
workorderId: null,
|
||||
workorderCode: null,
|
||||
vendorId: null,
|
||||
vendorCode: null,
|
||||
vendorName: null,
|
||||
vendorNick: null,
|
||||
warehouseId: null,
|
||||
warehouseCode: null,
|
||||
warehouseName: null,
|
||||
locationId: null,
|
||||
locationCode: null,
|
||||
locationName: null,
|
||||
areaId: null,
|
||||
areaCode: null,
|
||||
areaName: null,
|
||||
issueDate: new Date(),
|
||||
status: "PREPARE",
|
||||
remark: null,
|
||||
attr1: null,
|
||||
attr2: null,
|
||||
attr3: null,
|
||||
attr4: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
};
|
||||
this.autoGenFlag = false;
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.issueId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加外协发料单头";
|
||||
this.optType = "add";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const issueId = row.issueId || this.ids
|
||||
getOutsourceissue(issueId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改外协发料单头";
|
||||
this.optType = "edit";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.issueId != null) {
|
||||
updateOutsourceissue(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addOutsourceissue(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const issueIds = row.issueId || this.ids;
|
||||
this.$modal.confirm('是否确认删除外协发料单头编号为"' + issueIds + '"的数据项?').then(function() {
|
||||
return delOutsourceissue(issueIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
// 查询明细按钮操作
|
||||
handleView(row){
|
||||
this.reset();
|
||||
const issueIds = row.issueId
|
||||
getOutsourceissue(issueIds).then(response => {
|
||||
this.form = response.data;
|
||||
this.warehouseInfo[0] = response.data.warehouseId;
|
||||
this.warehouseInfo[1] = response.data.locationId;
|
||||
this.warehouseInfo[2] = response.data.areaId;
|
||||
this.open = true;
|
||||
this.title = "查看外协发料单信息";
|
||||
this.optType = "view";
|
||||
});
|
||||
},
|
||||
//执行发料
|
||||
handleExecute(row){
|
||||
const issueIds = row.issueId || this.ids;
|
||||
this.$modal.confirm('确认执行发料?').then(function() {
|
||||
return execute(issueIds)
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("出库成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
//选择生产工单
|
||||
handleWorkorderSelect(){
|
||||
this.$refs.woSelect.showFlag = true;
|
||||
},
|
||||
onWorkorderSelected(row){
|
||||
if(row != undefined && row != null){
|
||||
this.form.workorderId = row.workorderId;
|
||||
this.form.workorderCode = row.workorderCode;
|
||||
this.form.workorderName = row.workorderName;
|
||||
this.form.vendorId = row.vendorId;
|
||||
this.form.vendorCode = row.vendorCode;
|
||||
this.form.vendorName = row.vendorName;
|
||||
}
|
||||
},
|
||||
//供应商选择
|
||||
handleSelectVendor(){
|
||||
this.$refs.vendorSelect.showFlag = true;
|
||||
},
|
||||
//供应商选择弹出框
|
||||
onVendorSelected(obj){
|
||||
if(obj != undefined && obj != null){
|
||||
this.form.vendorId = obj.vendorId;
|
||||
this.form.vendorCode = obj.vendorCode;
|
||||
this.form.vendorName = obj.vendorName;
|
||||
this.form.vendorNick = obj.vendorNick;
|
||||
}
|
||||
},
|
||||
//自动生成编码
|
||||
handleAutoGenChange(autoGenFlag){
|
||||
if(autoGenFlag){
|
||||
genCode('OUTSOURCE_ISSUE_CODE').then(response =>{
|
||||
this.form.issueCode = response;
|
||||
});
|
||||
}else{
|
||||
this.form.issueCode = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
368
src/views/mes/wm/outsourceissue/line.vue
Normal file
368
src/views/mes/wm/outsourceissue/line.vue
Normal file
@ -0,0 +1,368 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row v-if="optType != 'view'" :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['mes:wm:outsourceissue:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['mes:wm:outsourceissue:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['mes:wm:outsourceissue:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="outsourceissuelineList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="产品物料编码" width="120px" align="center" prop="itemCode" />
|
||||
<el-table-column label="产品物料名称" width="120px" align="center" prop="itemName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="规格型号" align="center" prop="specification" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="单位" align="center" prop="unitOfMeasure" />
|
||||
<el-table-column label="领料数量" align="center" prop="quantityIssued" />
|
||||
<el-table-column label="批次号" align="center" prop="batchCode" />
|
||||
<el-table-column label="仓库名称" align="center" prop="warehouseName" />
|
||||
<el-table-column label="库区名称" align="center" prop="locationName" />
|
||||
<el-table-column label="库位名称" align="center" prop="areaName" />
|
||||
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="操作" align="center" v-if="optType != 'view'" width="100px" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-if="optType != 'view'"
|
||||
v-hasPermi="['mes:wm:outsourceissue:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-if="optType != 'view'"
|
||||
v-hasPermi="['mes:wm:outsourceissue:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改生产领料单行对话框 -->
|
||||
<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="8">
|
||||
<el-form-item label="产品物料编码" prop="itemCode">
|
||||
<el-input v-model="form.itemCode" readonly="readonly" placeholder="请选择产品物料编码" >
|
||||
<el-button slot="append" @click="handleSelectStock" icon="el-icon-search"></el-button>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<StockSelect ref="stockSelect" :batchCode="form.batchCode" :vendorId="form.vendorId" @onSelected="onStockSelected"></StockSelect>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="产品物料名称" prop="itemName">
|
||||
<el-input v-model="form.itemName" readonly="readonly" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="领料数量" prop="quantityIssued">
|
||||
<el-input-number :max="form.quantityMax" v-model="form.quantityIssued" placeholder="请输入领料数量" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="规格型号" prop="specification">
|
||||
<el-input v-model="form.specification" readonly="readonly" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单位" prop="unitOfMeasure">
|
||||
<el-input v-model="form.unitOfMeasure" readonly="readonly" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="批次号" prop="batchCode">
|
||||
<el-input v-model="form.batchCode" readonly="readonly" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="仓库" prop="warehouseName">
|
||||
<el-input v-model="form.warehouseName" readonly="readonly" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="库区" prop="locationName">
|
||||
<el-input v-model="form.locationName" readonly="readonly" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="库位" prop="areaName">
|
||||
<el-input v-model="form.areaName" readonly="readonly" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" />
|
||||
</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>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listOutsourceissueline, getOutsourceissueline, delOutsourceissueline, addOutsourceissueline, updateOutsourceissueline } from "@/api/mes/wm/outsourceissueline";
|
||||
import StockSelect from "@/components/stockSelect/single.vue"
|
||||
|
||||
export default {
|
||||
name: "Outsourceissueline",
|
||||
components:{StockSelect},
|
||||
props:{
|
||||
optType: null,
|
||||
issueId: null,
|
||||
warehouseId: null,
|
||||
locationId: null,
|
||||
areaId: null
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 外协领料单行表格数据
|
||||
outsourceissuelineList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
issueId: this.issueId,
|
||||
itemId: null,
|
||||
itemCode: null,
|
||||
itemName: null,
|
||||
specification: null,
|
||||
unitOfMeasure: null,
|
||||
quantityIssued: null,
|
||||
batchCode: null,
|
||||
warehouseId: null,
|
||||
warehouseCode: null,
|
||||
warehouseName: null,
|
||||
locationId: null,
|
||||
locationCode: null,
|
||||
locationName: null,
|
||||
areaId: null,
|
||||
areaCode: null,
|
||||
areaName: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
itemId: [
|
||||
{ required: true, message: "产品物料不能为空", trigger: "blur" }
|
||||
], quantityIssued: [
|
||||
{ required: true, message: "领料数量不能为空", trigger: "blur" }
|
||||
], }
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询外协领料单行列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listOutsourceissueline(this.queryParams).then(response => {
|
||||
this.outsourceissuelineList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
lineId: null,
|
||||
issueId: this.issueId,
|
||||
itemId: null,
|
||||
itemCode: null,
|
||||
itemName: null,
|
||||
specification: null,
|
||||
unitOfMeasure: null,
|
||||
quantityIssued: null,
|
||||
batchCode: null,
|
||||
warehouseId: null,
|
||||
warehouseCode: null,
|
||||
warehouseName: null,
|
||||
locationId: null,
|
||||
locationCode: null,
|
||||
locationName: null,
|
||||
areaId: null,
|
||||
areaCode: null,
|
||||
areaName: null,
|
||||
remark: null,
|
||||
attr1: null,
|
||||
attr2: null,
|
||||
attr3: null,
|
||||
attr4: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.lineId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加外协发料单行";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const lineId = row.lineId || this.ids
|
||||
getOutsourceissueline(lineId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改外协发料单行";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.lineId != null) {
|
||||
updateOutsourceissueline(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addOutsourceissueline(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const lineIds = row.lineId || this.ids;
|
||||
this.$modal.confirm('是否确认删除外协发料单行编号为"' + lineIds + '"的数据项?').then(function() {
|
||||
return delOutsourceissueline(lineIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
handleSelectStock(){
|
||||
this.$refs.stockSelect.showFlag = true;
|
||||
this.$refs.stockSelect.getList();
|
||||
},
|
||||
//物料选择弹出框
|
||||
onStockSelected(obj){
|
||||
if(obj != undefined && obj != null){
|
||||
this.form.materialStockId = obj.materialStockId;
|
||||
this.form.itemId = obj.itemId;
|
||||
this.form.itemCode = obj.itemCode;
|
||||
this.form.itemName = obj.itemName;
|
||||
this.form.specification = obj.specification;
|
||||
this.form.unitOfMeasure = obj.unitOfMeasure;
|
||||
this.form.batchCode = obj.batchCode;
|
||||
this.form.warehouseId = obj.warehouseId;
|
||||
this.form.warehouseCode = obj.warehouseCode;
|
||||
this.form.warehouseName = obj.warehouseName;
|
||||
this.form.locationId = obj.locationId;
|
||||
this.form.locationCode = obj.locationCode;
|
||||
this.form.locationName = obj.locationName;
|
||||
this.form.areaId = obj.areaId;
|
||||
this.form.areaCode = obj.areaCode;
|
||||
this.form.areaName = obj.areaName;
|
||||
this.form.quantityIssued = obj.quantityOnhand;
|
||||
this.form.quantityMax = obj.quantityOnhand;
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
468
src/views/mes/wm/outsourcerecpt/index.vue
Normal file
468
src/views/mes/wm/outsourcerecpt/index.vue
Normal file
@ -0,0 +1,468 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="入库单编号" prop="recptCode">
|
||||
<el-input
|
||||
v-model="queryParams.recptCode"
|
||||
placeholder="请输入入库单编号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<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="vendorName">
|
||||
<el-input
|
||||
v-model="queryParams.vendorName"
|
||||
placeholder="请输入供应商名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="入库日期" prop="recptDate">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.recptDate"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择入库日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['mes:wm:outsourcerecpt:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['mes:wm:outsourcerecpt:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['mes:wm:outsourcerecpt:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="outsourcerecptList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="入库单编号" align="center" prop="recptCode" >
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
@click="handleView(scope.row)"
|
||||
v-hasPermi="['mes:wm:outsourcerecpt:query']"
|
||||
>{{scope.row.recptCode}}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="入库单名称" align="center" prop="recptName" />
|
||||
<el-table-column label="外协工单编号" align="center" prop="workorderCode" />
|
||||
<el-table-column label="供应商编码" align="center" prop="vendorCode" />
|
||||
<el-table-column label="供应商名称" align="center" prop="vendorName" />
|
||||
<el-table-column label="入库日期" align="center" prop="recptDate" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.recptDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单据状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.mes_order_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-video-play"
|
||||
v-if="scope.row.status =='PREPARE'"
|
||||
@click="handleExecute(scope.row)"
|
||||
v-hasPermi="['mes:wm:outsourcerecpt:edit']"
|
||||
>执行入库</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
v-if="scope.row.status =='PREPARE'"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['mes:wm:outsourcerecpt:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
v-if="scope.row.status =='PREPARE'"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['mes:wm:outsourcerecpt:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改外协入库单对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="入库单编号" prop="recptCode">
|
||||
<el-input v-model="form.recptCode" placeholder="请输入入库单编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label-width="80">
|
||||
<el-switch v-model="autoGenFlag"
|
||||
active-color="#13ce66"
|
||||
active-text="自动生成"
|
||||
@change="handleAutoGenChange(autoGenFlag)" v-if="optType != 'view' && form.status =='PREPARE'">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="入库单名称" prop="recptName">
|
||||
<el-input v-model="form.recptName" placeholder="请输入入库单名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="入库日期" prop="recptDate">
|
||||
<el-date-picker clearable
|
||||
v-model="form.recptDate"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择入库日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="外协工单" prop="workorderCode">
|
||||
<el-input v-model="form.workorderCode" placeholder="请选择外协工单" >
|
||||
<el-button slot="append" icon="el-icon-search" @click="handleWorkorderSelect"></el-button>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<WorkorderSelect ref="woSelect" :workorder="workorder" @onSelected="onWorkorderSelected"></WorkorderSelect>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单据状态" prop="status">
|
||||
<el-select v-model="form.status" disabled placeholder="请选择单据状态">
|
||||
<el-option
|
||||
v-for="dict in dict.type.mes_order_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="采购订单号" prop="poCode">
|
||||
<el-input v-model="form.poCode" placeholder="请输入采购订单号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商" prop="vendorName">
|
||||
<el-input v-model="form.vendorName" readonly="readonly">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="入库仓库">
|
||||
<el-cascader v-model="warehouseInfo"
|
||||
:options="warehouseOptions"
|
||||
:props="warehouseProps"
|
||||
@change="handleWarehouseChanged"
|
||||
>
|
||||
</el-cascader>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-divider v-if="form.recptId !=null" content-position="center">物料信息</el-divider>
|
||||
<el-card shadow="always" v-if="form.recptId !=null" class="box-card">
|
||||
<Itemrecptline ref=line :recptId="form.recptId" :warehouseId="form.warehouseId" :locationId="form.locationId" :areaId="form.areaId" :optType="optType"></Itemrecptline>
|
||||
</el-card>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="cancel" v-if="optType =='view' || form.status !='PREPARE' ">返回</el-button>
|
||||
<el-button type="primary" @click="submitForm" v-if="form.status =='PREPARE' && optType !='view' ">保 存</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listOutsourcerecpt, getOutsourcerecpt, delOutsourcerecpt, addOutsourcerecpt, updateOutsourcerecpt, execute } from "@/api/mes/wm/outsourcerecpt";
|
||||
import {getTreeList} from "@/api/mes/wm/warehouse"
|
||||
import {genCode} from "@/api/system/autocode/rule"
|
||||
import WorkorderSelect from "@/components/workorderSelect/single.vue"
|
||||
import IqcSelect from "@/components/iqcSelect/single.vue";
|
||||
import Itemrecptline from "./line.vue";
|
||||
export default {
|
||||
name: "Outsourcerecpt",
|
||||
dicts:['mes_order_status'],
|
||||
components :{WorkorderSelect,IqcSelect,Itemrecptline},
|
||||
data() {
|
||||
return {
|
||||
//自动生成编码
|
||||
autoGenFlag:false,
|
||||
optType: undefined,
|
||||
warehouseInfo:[],
|
||||
warehouseOptions:[],
|
||||
warehouseProps:{
|
||||
multiple: false,
|
||||
value: 'pId',
|
||||
label: 'pName',
|
||||
},
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 外协入库单表格数据
|
||||
outsourcerecptList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
//工单弹出框结果过滤参数
|
||||
workorder: { workorderType: 'OUTSOURCE'},
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
recptCode: null, recptName: null, iqcId: null, iqcCode: null, workorderId: null, workorderCode: null, vendorId: null, vendorCode: null, vendorName: null, vendorNick: null, warehouseId: null, warehouseCode: null, warehouseName: null, locationId: null, locationCode: null, locationName: null, areaId: null, areaCode: null, areaName: null, recptDate: null, status: null, },
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
recptCode: [
|
||||
{ required: true, message: "入库单编号不能为空", trigger: "blur" }
|
||||
], recptName: [
|
||||
{ required: true, message: "入库单名称不能为空", trigger: "blur" }
|
||||
],
|
||||
workorderCode: [
|
||||
{ required: true, message: "请选择外协工单", trigger: "blur" }
|
||||
], }
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询外协入库单列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listOutsourcerecpt(this.queryParams).then(response => {
|
||||
this.outsourcerecptList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
recptId: null,
|
||||
recptCode: null,
|
||||
recptName: null,
|
||||
iqcId: null,
|
||||
iqcCode: null,
|
||||
workorderId: null,
|
||||
workorderCode: null,
|
||||
vendorId: null,
|
||||
vendorCode: null,
|
||||
vendorName: null,
|
||||
vendorNick: null,
|
||||
warehouseId: null,
|
||||
warehouseCode: null,
|
||||
warehouseName: null,
|
||||
locationId: null,
|
||||
locationCode: null,
|
||||
locationName: null,
|
||||
areaId: null, areaCode: null, areaName: null, recptDate: new Date(),
|
||||
status: "PREPARE", remark: null, attr1: null, attr2: null, attr3: null, attr4: null, createBy: null, createTime: null, updateBy: null, updateTime: null
|
||||
};
|
||||
this.autoGenFlag = false;
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.recptId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加外协入库单";
|
||||
this.optType = "add";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const recptId = row.recptId || this.ids
|
||||
getOutsourcerecpt(recptId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改外协入库单";
|
||||
this.optType = "edit";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.recptId != null) {
|
||||
updateOutsourcerecpt(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addOutsourcerecpt(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const recptIds = row.recptId || this.ids;
|
||||
this.$modal.confirm('是否确认删除外协入库单编号为"' + recptIds + '"的数据项?').then(function() {
|
||||
return delOutsourcerecpt(recptIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
// 查询明细按钮操作
|
||||
handleView(row){
|
||||
this.reset();
|
||||
const recptIds = row.recptId
|
||||
getOutsourcerecpt(recptIds).then(response => {
|
||||
this.form = response.data;
|
||||
this.warehouseInfo[0] = response.data.warehouseId;
|
||||
this.warehouseInfo[1] = response.data.locationId;
|
||||
this.warehouseInfo[2] = response.data.areaId;
|
||||
this.open = true;
|
||||
this.title = "查看外协入库单信息";
|
||||
this.optType = "view";
|
||||
});
|
||||
},
|
||||
//执行入库
|
||||
handleExecute(row){
|
||||
const recptIds = row.recptId || this.ids;
|
||||
this.$modal.confirm('确认执行入库?').then(function() {
|
||||
return execute(recptIds)//执行入库
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("入库成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
//选择生产工单
|
||||
handleWorkorderSelect(){
|
||||
this.$refs.woSelect.showFlag = true;
|
||||
},
|
||||
onWorkorderSelected(row){
|
||||
if(row != undefined && row != null){
|
||||
this.form.workorderId = row.workorderId;
|
||||
this.form.workorderCode = row.workorderCode;
|
||||
this.form.workorderName = row.workorderName;
|
||||
this.form.poCode = row.sourceCode;
|
||||
this.form.vendorId = row.vendorId;
|
||||
this.form.vendorCode = row.vendorCode;
|
||||
this.form.vendorName = row.vendorName;
|
||||
}
|
||||
},
|
||||
//自动生成编码
|
||||
handleAutoGenChange(autoGenFlag){
|
||||
if(autoGenFlag){
|
||||
genCode('OUTSOURCE_RECPT_CODE').then(response =>{
|
||||
this.form.recptCode = response;
|
||||
});
|
||||
}else{
|
||||
this.form.recptCode = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
442
src/views/mes/wm/outsourcerecpt/line.vue
Normal file
442
src/views/mes/wm/outsourcerecpt/line.vue
Normal file
@ -0,0 +1,442 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row v-if="optType !='view'" :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['mes:wm:oursourcerecpt:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['mes:wm:oursourcerecpt:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['mes:wm:oursourcerecpt:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="oursourcerecptlineList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="产品物料编码" width="120" align="center" prop="itemCode" />
|
||||
<el-table-column label="产品物料名称" width="150" align="center" prop="itemName" />
|
||||
<el-table-column label="规格型号" align="center" prop="specification" />
|
||||
<el-table-column label="单位" align="center" prop="unitOfMeasure" />
|
||||
<el-table-column label="入库数量" align="center" prop="quantityRecived" />
|
||||
<el-table-column label="批次号" width="100" align="center" prop="batchCode" />
|
||||
<el-table-column label="仓库" width="100" align="center" prop="warehouseName" />
|
||||
<el-table-column label="库区" width="100" align="center" prop="locationName" />
|
||||
<el-table-column label="库位" align="center" prop="areaName" />
|
||||
<el-table-column label="有效期" align="center" prop="expireDate" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.expireDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否检验" align="center" prop="iqcCheck">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.iqcCheck"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="检验单编号" width="120" align="center" prop="iqcCode" />
|
||||
<el-table-column label="操作" width="100" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['mes:wm:oursourcerecpt:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['mes:wm:oursourcerecpt:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改外协入库单行对话框 -->
|
||||
<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="8">
|
||||
<el-form-item label="物料编码" prop="itemCode">
|
||||
<el-input v-model="form.itemCode" readonly="readonly" placeholder="请选择物料编码" >
|
||||
<el-button slot="append" @click="handleSelectProduct" icon="el-icon-search"></el-button>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<ItemSelect ref="itemSelect" @onSelected="onItemSelected" > </ItemSelect>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物料名称" prop="itemName">
|
||||
<el-input v-model="form.itemName" readonly="readonly" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单位" prop="unitOfMeasure">
|
||||
<el-input v-model="form.unitOfMeasure" readonly="readonly" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="入库数量" prop="quantityRecived">
|
||||
<el-input-number :min="0.01" v-model="form.quantityRecived" placeholder="请输入入库数量" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="入库批次号" prop="batchCode">
|
||||
<el-input v-model="form.batchCode" placeholder="请输入入库批次号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="有效期" prop="expireDate">
|
||||
<el-date-picker clearable
|
||||
v-model="form.expireDate"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择有效期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="入库仓库" prop="warehouseId">
|
||||
<el-cascader v-model="warehouseInfo"
|
||||
:options="warehouseOptions"
|
||||
:props="warehouseProps"
|
||||
@change="handleWarehouseChanged"
|
||||
>
|
||||
</el-cascader>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="是否检验">
|
||||
<el-radio-group v-model="form.iqcCheck" disabled v-if="optType=='view'">
|
||||
<el-radio
|
||||
v-for="dict in dict.type.sys_yes_no"
|
||||
:key="dict.value"
|
||||
:label="dict.value"
|
||||
>{{dict.label}}</el-radio>
|
||||
</el-radio-group>
|
||||
|
||||
<el-radio-group v-model="form.iqcCheck" v-else>
|
||||
<el-radio
|
||||
v-for="dict in dict.type.sys_yes_no"
|
||||
:key="dict.value"
|
||||
:label="dict.value"
|
||||
>{{dict.label}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span ="8">
|
||||
<el-form-item v-if="form.iqcCheck == 'Y'" label="来料检验单" prop="iqcCode">
|
||||
<el-input v-model="form.iqcCode" readonly="readonly" placeholder="请选择来料检验单" >
|
||||
<el-button slot="append" @click="handleSelectIqc" icon="el-icon-search"></el-button>
|
||||
</el-input>
|
||||
<IqcSelect ref="iqcSelect" @onSelected="onIqcSelected"></IqcSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</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>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listOursourcerecptline, getOursourcerecptline, delOursourcerecptline, addOursourcerecptline, updateOursourcerecptline } from "@/api/mes/wm/oursourcerecptline";
|
||||
import ItemSelect from "@/components/itemSelect/single.vue";
|
||||
import IqcSelect from "@/components/iqcSelect/single.vue";
|
||||
import {getTreeList} from "@/api/mes/wm/warehouse"
|
||||
export default {
|
||||
name: "Oursourcerecptline",
|
||||
dicts: ['sys_yes_no'],
|
||||
components :{ItemSelect,IqcSelect},
|
||||
props:{
|
||||
recptId: null,
|
||||
optType: null,
|
||||
warehouseId: null,
|
||||
locationId: null,
|
||||
areaId: null
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
warehouseInfo:[],
|
||||
warehouseOptions:[],
|
||||
warehouseProps:{
|
||||
multiple: false,
|
||||
value: 'pId',
|
||||
label: 'pName',
|
||||
},
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 外协入库单行表格数据
|
||||
oursourcerecptlineList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
recptId: this.recptId,
|
||||
itemId: null,
|
||||
itemCode: null,
|
||||
itemName: null,
|
||||
specification: null,
|
||||
unitOfMeasure: null,
|
||||
quantityRecived: null,
|
||||
batchCode: null,
|
||||
warehouseId: null,
|
||||
warehouseCode: null,
|
||||
warehouseName: null,
|
||||
locationId: null,
|
||||
locationCode: null,
|
||||
locationName: null,
|
||||
areaId: null,
|
||||
areaCode: null,
|
||||
areaName: null,
|
||||
expireDate: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
itemCode: [
|
||||
{ required: true, message: "产品物料不能为空", trigger: "blur" }
|
||||
],
|
||||
quantityRecived: [
|
||||
{ required: true, message: "入库数量不能为空", trigger: "blur" }
|
||||
],
|
||||
warehouseId:[
|
||||
{ required: true, message: "请选择入库的仓库" }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getWarehouseList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询外协入库单行列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listOursourcerecptline(this.queryParams).then(response => {
|
||||
this.oursourcerecptlineList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
getWarehouseList(){
|
||||
getTreeList().then( response =>{
|
||||
if(response.data){
|
||||
this.warehouseOptions = response.data.filter((el) =>{
|
||||
return el.warehouseCode.indexOf('VIR') == -1;
|
||||
});;
|
||||
}
|
||||
this.warehouseOptions.map(w =>{
|
||||
debugger;
|
||||
w.children.map(l =>{
|
||||
let lstr =JSON.stringify(l.children).replace(/locationId/g,'lId').replace(/areaId/g, 'pId').replace(/areaName/g,'pName');
|
||||
l.children = JSON.parse(lstr);
|
||||
});
|
||||
|
||||
let wstr = JSON.stringify(w.children).replace(/warehouseId/g,'wId').replace(/locationId/g, 'pId').replace(/locationName/g,'pName');
|
||||
w.children = JSON.parse(wstr);
|
||||
|
||||
});
|
||||
let ostr=JSON.stringify(this.warehouseOptions).replace(/warehouseId/g,'pId').replace(/warehouseName/g, 'pName');
|
||||
this.warehouseOptions = JSON.parse(ostr);
|
||||
debugger;
|
||||
});
|
||||
},
|
||||
//选择仓库、库区、库位
|
||||
handleWarehouseChanged(obj){
|
||||
if(obj !=null){
|
||||
this.form.warehouseId = obj[0];
|
||||
this.form.locationId = obj[1];
|
||||
this.form.areaId = obj[2];
|
||||
}
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
lineId: null,
|
||||
recptId: this.recptId,
|
||||
itemId: null,
|
||||
itemCode: null,
|
||||
itemName: null,
|
||||
specification: null,
|
||||
unitOfMeasure: null,
|
||||
quantityRecived: null,
|
||||
batchCode: null,
|
||||
warehouseId: this.warehouseId,
|
||||
warehouseCode: null,
|
||||
warehouseName: null,
|
||||
locationId: this.locationId,
|
||||
locationCode: null,
|
||||
locationName: null,
|
||||
areaId: this.areaId,
|
||||
areaCode: null,
|
||||
areaName: null,
|
||||
expireDate: null,
|
||||
iqcCheck: 'N',
|
||||
iqcId: null,
|
||||
iqcCode: null,
|
||||
remark: null,
|
||||
attr1: null, attr2: null, attr3: null, attr4: null, createBy: null, createTime: null, updateBy: null, updateTime: null };
|
||||
|
||||
|
||||
this.resetForm("form");
|
||||
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.lineId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加外协入库单行";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const lineId = row.lineId || this.ids
|
||||
getOursourcerecptline(lineId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改外协入库单行";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.lineId != null) {
|
||||
updateOursourcerecptline(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addOursourcerecptline(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const lineIds = row.lineId || this.ids;
|
||||
this.$modal.confirm('是否确认删除外协入库单行编号为"' + lineIds + '"的数据项?').then(function() {
|
||||
return delOursourcerecptline(lineIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
handleSelectProduct(){
|
||||
this.$refs.itemSelect.showFlag = true;
|
||||
},
|
||||
//物料选择弹出框
|
||||
onItemSelected(obj){
|
||||
debugger;
|
||||
if(obj != undefined && obj != null){
|
||||
this.form.itemId = obj.itemId;
|
||||
this.form.itemCode = obj.itemCode;
|
||||
this.form.itemName = obj.itemName;
|
||||
this.form.specification = obj.specification;
|
||||
this.form.unitOfMeasure = obj.unitOfMeasure;
|
||||
}
|
||||
},
|
||||
//IQC检验单选择
|
||||
handleSelectIqc(){
|
||||
this.$refs.iqcSelect.showFlag = true;
|
||||
},
|
||||
//IQC检验单选择弹出框
|
||||
onIqcSelected(obj){
|
||||
if(obj != undefined && obj != null){
|
||||
this.form.iqcId = obj.iqcId;
|
||||
this.form.iqcCode = obj.iqcCode;
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
@ -8,7 +8,7 @@
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['mes:wm:packageline:add']"
|
||||
v-hasPermi="['mes:wm:package:add']"
|
||||
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
@ -20,7 +20,7 @@
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['mes:wm:packageline:remove']"
|
||||
v-hasPermi="['mes:wm:package:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
@ -47,14 +47,14 @@
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['mes:wm:packageline:edit']"
|
||||
v-hasPermi="['mes:wm:package:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['mes:wm:packageline:remove']"
|
||||
v-hasPermi="['mes:wm:package:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -107,7 +107,7 @@
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
icon="el-icon-video-play"
|
||||
v-if="scope.row.status =='PREPARE'"
|
||||
@click="handleExecute(scope.row)"
|
||||
v-hasPermi="['mes:wm:productrecpt:edit']"
|
||||
|
@ -98,7 +98,7 @@
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
icon="el-icon-video-play"
|
||||
v-if="scope.row.status =='PREPARE'"
|
||||
@click="handleExecute(scope.row)"
|
||||
v-hasPermi="['mes:wm:rtissue:edit']"
|
||||
|
@ -115,7 +115,7 @@
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
icon="el-icon-video-play"
|
||||
v-if="scope.row.status =='PREPARE'"
|
||||
@click="handleExecute(scope.row)"
|
||||
v-hasPermi="['mes:wm:rtvendor:edit']"
|
||||
|
@ -76,12 +76,12 @@
|
||||
type="text"
|
||||
@click="handleView(scope.row)"
|
||||
v-hasPermi="['mes:wm:sn:query']"
|
||||
>{{scope.row.genDate}}</el-button>
|
||||
>{{scope.row.snNum}}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="生成时间" align="center" prop="genDate" width="120">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.rtDate, '{y}-{m}-{d} {h}:{mi}:{s}') }}</span>
|
||||
<span>{{ parseTime(scope.row.genDate, '{y}-{m}-{d} {h}:{mi}:{s}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
@ -90,7 +90,7 @@
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
@click="handleExport(scope.row)"
|
||||
v-hasPermi="['mes:wm:sn:edit']"
|
||||
>导出/打印</el-button>
|
||||
<el-button
|
||||
@ -208,6 +208,7 @@ export default {
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listSn(this.queryParams).then(response => {
|
||||
debugger;
|
||||
this.snList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
@ -283,8 +284,10 @@ export default {
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('wm/sn/export', {
|
||||
handleExport(row) {
|
||||
this.queryParams.itemCode = row.itemCode;
|
||||
this.queryParams.gen_date = row.genDate;
|
||||
this.download('/mes/wm/sn/export', {
|
||||
...this.queryParams
|
||||
}, `sn_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
|
@ -1,6 +1,16 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="盘点类型" prop="takingType">
|
||||
<el-select v-model="queryParams.takingType" placeholder="请选择盘点类型" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.mes_stocktaking_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="盘点单编号" prop="takingCode">
|
||||
<el-input
|
||||
v-model="queryParams.takingCode"
|
||||
@ -25,48 +35,6 @@
|
||||
placeholder="请选择盘点日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="盘点人用户名" prop="userName">
|
||||
<el-input
|
||||
v-model="queryParams.userName"
|
||||
placeholder="请输入盘点人用户名"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="盘点人" prop="nickName">
|
||||
<el-input
|
||||
v-model="queryParams.nickName"
|
||||
placeholder="请输入盘点人"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="盘点类型" prop="takingType">
|
||||
<el-select v-model="queryParams.takingType" placeholder="请选择盘点类型" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.mes_stocktaking_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库ID" prop="warehouseId">
|
||||
<el-input
|
||||
v-model="queryParams.warehouseId"
|
||||
placeholder="请输入仓库ID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库编码" prop="warehouseCode">
|
||||
<el-input
|
||||
v-model="queryParams.warehouseCode"
|
||||
placeholder="请输入仓库编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库名称" prop="warehouseName">
|
||||
<el-input
|
||||
v-model="queryParams.warehouseName"
|
||||
@ -86,92 +54,31 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['wm:stocktaking:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['wm:stocktaking:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['wm:stocktaking:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['wm:stocktaking:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="stocktakingList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="盘点单ID" align="center" prop="takingId" />
|
||||
<el-table-column label="盘点单编号" align="center" prop="takingCode" />
|
||||
<el-table-column label="盘点单名称" align="center" prop="takingName" />
|
||||
<el-table-column label="盘点日期" align="center" prop="takingDate" width="180">
|
||||
<el-table-column label="盘点单编号" align="center" prop="takingCode" >
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.takingDate, '{y}-{m}-{d}') }}</span>
|
||||
<el-button
|
||||
type="text"
|
||||
@click="handleView(scope.row)"
|
||||
v-hasPermi="['mes:wm:stocktaking:query']"
|
||||
>{{scope.row.takingCode}}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="盘点人用户名" align="center" prop="userName" />
|
||||
<el-table-column label="盘点人" align="center" prop="nickName" />
|
||||
<el-table-column label="盘点单名称" align="center" prop="takingName" />
|
||||
<el-table-column label="盘点类型" align="center" prop="takingType">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.mes_stocktaking_type" :value="scope.row.takingType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="仓库ID" align="center" prop="warehouseId" />
|
||||
<el-table-column label="仓库编码" align="center" prop="warehouseCode" />
|
||||
<el-table-column label="仓库名称" align="center" prop="warehouseName" />
|
||||
<el-table-column label="单据状态" align="center" prop="status" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<el-table-column label="盘点日期" align="center" prop="takingDate" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['wm:stocktaking:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['wm:stocktaking:remove']"
|
||||
>删除</el-button>
|
||||
<span>{{ parseTime(scope.row.takingDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="盘点人" align="center" prop="nickName" />
|
||||
<el-table-column label="仓库名称" align="center" prop="warehouseName" />
|
||||
<el-table-column label="单据状态" align="center" prop="status" />
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
@ -233,6 +140,14 @@
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-tabs type="border-card" v-if="form.takingId != null">
|
||||
<el-tab-pane v-if="form.takingType=='OPEN'" label="盘点清单">
|
||||
<TakingLine></TakingLine>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="盘点结果">
|
||||
<TakingResult></TakingResult>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
@ -242,10 +157,12 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listStocktaking, getStocktaking, delStocktaking, addStocktaking, updateStocktaking } from "@/api/mes/wm/stocktaking";
|
||||
|
||||
import { listStocktaking, getStocktaking, delStocktaking, addStocktaking, updateStocktaking ,execute} from "@/api/mes/wm/stocktaking";
|
||||
import TakingLine from './line.vue';
|
||||
import TakingResult from './result.vue';
|
||||
export default {
|
||||
name: "Stocktaking",
|
||||
components: {TakingLine,TakingResult},
|
||||
dicts: ['mes_stocktaking_type'],
|
||||
data() {
|
||||
return {
|
||||
@ -376,7 +293,17 @@ export default {
|
||||
this.download('wm/stocktaking/export', {
|
||||
...this.queryParams
|
||||
}, `stocktaking_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
},
|
||||
//执行盘点
|
||||
handleExecute(row){
|
||||
const takingIds = row.takingId || this.ids;
|
||||
this.$modal.confirm('确认执行盘点?').then(function() {
|
||||
return execute(takingIds)//执行入库
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("盘点完成");
|
||||
}).catch(() => {});
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -164,7 +164,7 @@
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['wm:stocktakingline:add']"
|
||||
v-hasPermi="['mes:wm:stocktaking:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
@ -175,7 +175,7 @@
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['wm:stocktakingline:edit']"
|
||||
v-hasPermi="['mes:wm:stocktaking:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
@ -186,7 +186,7 @@
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['wm:stocktakingline:remove']"
|
||||
v-hasPermi="['mes:wm:stocktaking:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
@ -196,7 +196,7 @@
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['wm:stocktakingline:export']"
|
||||
v-hasPermi="['mes:wm:stocktaking:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
@ -233,14 +233,14 @@
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['wm:stocktakingline:edit']"
|
||||
v-hasPermi="['mes:wm:stocktaking:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['wm:stocktakingline:remove']"
|
||||
v-hasPermi="['mes:wm:stocktaking:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -336,6 +336,10 @@ import { listStocktakingline, getStocktakingline, delStocktakingline, addStockta
|
||||
|
||||
export default {
|
||||
name: "Stocktakingline",
|
||||
props:{
|
||||
optType: null,
|
||||
takingId: null,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
@ -360,7 +364,7 @@ export default {
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
takingId: null, materialStockId: null, itemId: null, itemCode: null, itemName: null, specification: null, unitOfMeasure: null, unitName: null, quantity: null, takingQuantity: null, warehouseId: null, warehouseCode: null, warehouseName: null, locationId: null, locationCode: null, locationName: null, areaId: null, areaCode: null, areaName: null, takingStatus: null, },
|
||||
takingId: this.takingId, materialStockId: null, itemId: null, itemCode: null, itemName: null, specification: null, unitOfMeasure: null, unitName: null, quantity: null, takingQuantity: null, warehouseId: null, warehouseCode: null, warehouseName: null, locationId: null, locationCode: null, locationName: null, areaId: null, areaCode: null, areaName: null, takingStatus: null, },
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
|
@ -84,7 +84,7 @@
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['wm:stocktakingresult:add']"
|
||||
v-hasPermi="['mes:wm:stocktaking:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
@ -95,7 +95,7 @@
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['wm:stocktakingresult:edit']"
|
||||
v-hasPermi="['mes:wm:stocktaking:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
@ -106,7 +106,7 @@
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['wm:stocktakingresult:remove']"
|
||||
v-hasPermi="['mes:wm:stocktaking:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
@ -116,7 +116,7 @@
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['wm:stocktakingresult:export']"
|
||||
v-hasPermi="['mes:wm:stocktaking:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
@ -142,14 +142,14 @@
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['wm:stocktakingresult:edit']"
|
||||
v-hasPermi="['mes:wm:stocktaking:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['wm:stocktakingresult:remove']"
|
||||
v-hasPermi="['mes:wm:stocktaking:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -212,6 +212,10 @@ import { listStocktakingresult, getStocktakingresult, delStocktakingresult, addS
|
||||
|
||||
export default {
|
||||
name: "Stocktakingresult",
|
||||
props:{
|
||||
optType: null,
|
||||
takingId: null,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
@ -236,7 +240,7 @@ export default {
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
takingId: null, itemId: null, itemCode: null, itemName: null, specification: null, unitOfMeasure: null, unitName: null, quantity: null, takingQuantity: null, takingStatus: null, },
|
||||
takingId: this.takingId, itemId: null, itemCode: null, itemName: null, specification: null, unitOfMeasure: null, unitName: null, quantity: null, takingQuantity: null, takingStatus: null, },
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
|
@ -86,7 +86,7 @@
|
||||
type="text"
|
||||
icon="el-icon-s-shop"
|
||||
@click="handleLocation(scope.row.warehouseId)"
|
||||
v-hasPermi="['mes:wm:warehouse:edit','mes:wm:warehouse:list']"
|
||||
v-hasPermi="['mes:wm:location:edit','mes:wm:location:list']"
|
||||
>库区</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
|
Loading…
Reference in New Issue
Block a user