添加营销系统模块
This commit is contained in:
229
src/views/404.vue
Normal file
229
src/views/404.vue
Normal file
@@ -0,0 +1,229 @@
|
||||
<template>
|
||||
<div style="background:#f0f2f5;margin-top: -20px;">
|
||||
<div class="wscn-http404">
|
||||
<div class="pic-404">
|
||||
<img :src="img_404" class="pic-404__parent" alt="404">
|
||||
<img :src="img_404_cloud" class="pic-404__child left" alt="404">
|
||||
<img :src="img_404_cloud" class="pic-404__child mid" alt="404">
|
||||
<img :src="img_404_cloud" class="pic-404__child right" alt="404">
|
||||
</div>
|
||||
<div class="bullshit">
|
||||
<div class="bullshit__oops">OOPS!</div>
|
||||
<div class="bullshit__info">版权所有<a class="link-type" href="http://www.meswork.com/" target="_blank">迈思科技</a></div>
|
||||
<div class="bullshit__headline">{{ message }}</div>
|
||||
<div class="bullshit__info">请检查您输入的网址是否正确,请点击以下按钮返回主页或者发送错误报告</div>
|
||||
<a href="/" class="bullshit__return-home">返回首页</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import img_404 from '@/assets/404_images/404.png'
|
||||
import img_404_cloud from '@/assets/404_images/404_cloud.png'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
img_404,
|
||||
img_404_cloud
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
message() {
|
||||
return '这个页面你不能进......'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
.wscn-http404 {
|
||||
position: relative;
|
||||
width: 1200px;
|
||||
margin: 20px auto 60px;
|
||||
padding: 0 100px;
|
||||
overflow: hidden;
|
||||
.pic-404 {
|
||||
position: relative;
|
||||
float: left;
|
||||
width: 600px;
|
||||
padding: 150px 0;
|
||||
overflow: hidden;
|
||||
&__parent {
|
||||
width: 100%;
|
||||
}
|
||||
&__child {
|
||||
position: absolute;
|
||||
&.left {
|
||||
width: 80px;
|
||||
top: 17px;
|
||||
left: 220px;
|
||||
opacity: 0;
|
||||
animation-name: cloudLeft;
|
||||
animation-duration: 2s;
|
||||
animation-timing-function: linear;
|
||||
animation-fill-mode: forwards;
|
||||
animation-delay: 1s;
|
||||
}
|
||||
&.mid {
|
||||
width: 46px;
|
||||
top: 10px;
|
||||
left: 420px;
|
||||
opacity: 0;
|
||||
animation-name: cloudMid;
|
||||
animation-duration: 2s;
|
||||
animation-timing-function: linear;
|
||||
animation-fill-mode: forwards;
|
||||
animation-delay: 1.2s;
|
||||
}
|
||||
&.right {
|
||||
width: 62px;
|
||||
top: 100px;
|
||||
left: 500px;
|
||||
opacity: 0;
|
||||
animation-name: cloudRight;
|
||||
animation-duration: 2s;
|
||||
animation-timing-function: linear;
|
||||
animation-fill-mode: forwards;
|
||||
animation-delay: 1s;
|
||||
}
|
||||
@keyframes cloudLeft {
|
||||
0% {
|
||||
top: 17px;
|
||||
left: 220px;
|
||||
opacity: 0;
|
||||
}
|
||||
20% {
|
||||
top: 33px;
|
||||
left: 188px;
|
||||
opacity: 1;
|
||||
}
|
||||
80% {
|
||||
top: 81px;
|
||||
left: 92px;
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
top: 97px;
|
||||
left: 60px;
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
@keyframes cloudMid {
|
||||
0% {
|
||||
top: 10px;
|
||||
left: 420px;
|
||||
opacity: 0;
|
||||
}
|
||||
20% {
|
||||
top: 40px;
|
||||
left: 360px;
|
||||
opacity: 1;
|
||||
}
|
||||
70% {
|
||||
top: 130px;
|
||||
left: 180px;
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
top: 160px;
|
||||
left: 120px;
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
@keyframes cloudRight {
|
||||
0% {
|
||||
top: 100px;
|
||||
left: 500px;
|
||||
opacity: 0;
|
||||
}
|
||||
20% {
|
||||
top: 120px;
|
||||
left: 460px;
|
||||
opacity: 1;
|
||||
}
|
||||
80% {
|
||||
top: 180px;
|
||||
left: 340px;
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
top: 200px;
|
||||
left: 300px;
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.bullshit {
|
||||
position: relative;
|
||||
float: left;
|
||||
width: 300px;
|
||||
padding: 150px 0;
|
||||
overflow: hidden;
|
||||
&__oops {
|
||||
font-size: 32px;
|
||||
font-weight: bold;
|
||||
line-height: 40px;
|
||||
color: #1482f0;
|
||||
opacity: 0;
|
||||
margin-bottom: 20px;
|
||||
animation-name: slideUp;
|
||||
animation-duration: 0.5s;
|
||||
animation-fill-mode: forwards;
|
||||
}
|
||||
&__headline {
|
||||
font-size: 20px;
|
||||
line-height: 24px;
|
||||
color: #1482f0;
|
||||
opacity: 0;
|
||||
margin-bottom: 10px;
|
||||
animation-name: slideUp;
|
||||
animation-duration: 0.5s;
|
||||
animation-delay: 0.1s;
|
||||
animation-fill-mode: forwards;
|
||||
}
|
||||
&__info {
|
||||
font-size: 13px;
|
||||
line-height: 21px;
|
||||
color: grey;
|
||||
opacity: 0;
|
||||
margin-bottom: 30px;
|
||||
animation-name: slideUp;
|
||||
animation-duration: 0.5s;
|
||||
animation-delay: 0.2s;
|
||||
animation-fill-mode: forwards;
|
||||
}
|
||||
&__return-home {
|
||||
display: block;
|
||||
float: left;
|
||||
width: 110px;
|
||||
height: 36px;
|
||||
background: #1482f0;
|
||||
border-radius: 100px;
|
||||
text-align: center;
|
||||
color: #ffffff;
|
||||
opacity: 0;
|
||||
font-size: 14px;
|
||||
line-height: 36px;
|
||||
cursor: pointer;
|
||||
animation-name: slideUp;
|
||||
animation-duration: 0.5s;
|
||||
animation-delay: 0.3s;
|
||||
animation-fill-mode: forwards;
|
||||
}
|
||||
@keyframes slideUp {
|
||||
0% {
|
||||
transform: translateY(60px);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
transform: translateY(0);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
1245
src/views/BasicData/PersonnelManagement/123.vue
Normal file
1245
src/views/BasicData/PersonnelManagement/123.vue
Normal file
File diff suppressed because it is too large
Load Diff
580
src/views/BasicData/PersonnelManagement/index.vue
Normal file
580
src/views/BasicData/PersonnelManagement/index.vue
Normal file
@@ -0,0 +1,580 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-card>
|
||||
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" @click="handleAdd()">新增</el-button>
|
||||
<el-button type="warning" icon="el-icon-edit" size="small" @click="handleEdit()">编辑</el-button>
|
||||
<el-button type="danger" icon="el-icon-delete" size="small" @click="deleteTable()">删除</el-button>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="18">
|
||||
<el-card>
|
||||
<span>人员名称:</span>
|
||||
<el-input v-model="Name" placeholder="请输入人员名称" class="input-with-select" size="small" style="width: 200px; margin-right: 15px" clearable>
|
||||
<el-button slot="append" icon="el-icon-search" @click="fetchPeopleForName"/>
|
||||
</el-input>
|
||||
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" @click="addPeople()">新增</el-button>
|
||||
<!--<el-button v-popover:popover4 type="success" icon="el-icon-sort" size="small" @click="moveGroup">移动</el-button>-->
|
||||
<!--<el-button size="small" @click="postMaintain()">岗位维护</el-button>-->
|
||||
<!--<el-popover-->
|
||||
<!--ref="popover4"-->
|
||||
<!--width="178"-->
|
||||
<!--placement="right"-->
|
||||
<!--trigger="click"-->
|
||||
<!--@hide="hide()">-->
|
||||
<!--<el-dropdown size="small" placement="bottom-start" style="margin-right: 0">-->
|
||||
<!--<el-input-->
|
||||
<!--v-model="nodeName1"-->
|
||||
<!--:disabled="true"-->
|
||||
<!--size="small"-->
|
||||
<!--placeholder="请选择部门"/>-->
|
||||
<!--<el-button type="text" size="small" style="margin-left: 60px; margin-top: 15px" @click="moveGroupConfim">确认</el-button>-->
|
||||
<!--<el-dropdown-menu slot="dropdown">-->
|
||||
<!--<el-tree-->
|
||||
<!--ref="treeForm"-->
|
||||
<!--:data="departmentData"-->
|
||||
<!--:props="defaultProps"-->
|
||||
<!--style="width: 150px"-->
|
||||
<!--node-key="id"-->
|
||||
<!--accordion-->
|
||||
<!--@node-click="NodeClick"/>-->
|
||||
<!--</el-dropdown-menu>-->
|
||||
<!--</el-dropdown>-->
|
||||
<!--</el-popover>-->
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-card class="box-card" style="min-height: 743px; max-height: 743px">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>部门维护</span>
|
||||
<el-button style="float: right; padding: 3px 0" type="text" @click="expandALL()">展开</el-button>
|
||||
</div>
|
||||
<div style="height: 650px">
|
||||
<el-tree
|
||||
ref="treeForm"
|
||||
:data="departmentData"
|
||||
:props="defaultProps"
|
||||
show-checkbox
|
||||
node-key="id"
|
||||
check-strictly
|
||||
default-expand-all
|
||||
@check-change="handleClick"/>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="18">
|
||||
<el-card>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="List"
|
||||
stripe
|
||||
tooltip-effect="dark"
|
||||
style="width: 100%"
|
||||
height="679"
|
||||
highlight-current-row
|
||||
border
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="55"/>
|
||||
<el-table-column align="center" label="部门名称" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.节点名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="考勤编号" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.考勤编号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="密码" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.密码 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="姓名" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.姓名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="性别" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.性别 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="身份证号" width="165">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.身份证号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="学历" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.学历名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="入职时间" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.入公司时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="出生日期" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.出生日期 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="联系方式" width="110">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.联系电话 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="岗位工种" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.岗位名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="民族" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.民族 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="家庭住址" width="200">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.家庭住址 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
@click="handleEditPeople(scope.row)">编辑</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@click="deletePeopleTable(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:current-page="PageCurrent"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="10"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!--新增和编辑部门-->
|
||||
<!--<el-dialog :title="department_Title" :visible.sync="department_DFV" center style="min-height: 200px" width="400px">-->
|
||||
<!--<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="110px" class="demo-ruleForm">-->
|
||||
<!--<el-form-item label="部门名称" prop="DepartmentName">-->
|
||||
<!--<el-input v-model="department_Form.DepartmentName" size="small" style="width:200px"/>-->
|
||||
<!--</el-form-item>-->
|
||||
<!--</el-form>-->
|
||||
<!--<div slot="footer" class="dialog-footer">-->
|
||||
<!--<el-button @click="cancel">取消</el-button>-->
|
||||
<!--<el-button v-if="department_Title==='新增部门'" type="primary" @click="submitAdd">确定</el-button>-->
|
||||
<!--<el-button v-else-if="department_Title==='编辑部门'" type="primary" @click="submitEdit">确定</el-button>-->
|
||||
<!--</div>-->
|
||||
<!--</el-dialog>-->
|
||||
|
||||
<el-dialog :title="people_title" :visible.sync="people_DFV" center style="min-height: 200px" width="800px">
|
||||
<el-form ref="people_form" :rules="rules" :model="people_form" label-position="left" label-width="110px" class="demo-ruleForm">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="考勤编号" prop="AccountNumber">
|
||||
<el-input v-model="people_form.AccountNumber" size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="密码" prop="Password">
|
||||
<el-input v-model="people_form.Password" size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="姓名" prop="Name">
|
||||
<el-input v-model="people_form.Name" size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="性别" prop="Sex">
|
||||
<el-select v-model="people_form.Sex" clearable placeholder="请选择性别" style="width: 200px" size="small">
|
||||
<el-option
|
||||
v-for="item in SexData"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="出生日期" prop="Birthday">
|
||||
<el-date-picker
|
||||
v-model="people_form.Birthday"
|
||||
value-format="yyyy-MM-dd"
|
||||
size="small"
|
||||
type="date"
|
||||
placeholder="请选择出生日期"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="身份证号" prop="IDcard">
|
||||
<el-input v-model="people_form.IDcard" size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="入职时间" prop="TimeOfEntry">
|
||||
<el-date-picker
|
||||
v-model="people_form.TimeOfEntry"
|
||||
value-format="yyyy-MM-dd"
|
||||
size="small"
|
||||
type="date"
|
||||
placeholder="请选择入职时间"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系方式" prop="ContactInformation">
|
||||
<el-input v-model="people_form.ContactInformation" size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="学历" prop="Education">
|
||||
<el-select v-model="people_form.Education" clearable placeholder="请选择学历" style="width: 200px" size="small">
|
||||
<el-option
|
||||
v-for="item in EducationDate"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="家庭住址" prop="Address">
|
||||
<el-input v-model="people_form.Address" size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="民族" prop="Nation">
|
||||
<el-input v-model="people_form.Nation" size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="岗位" prop="Post">
|
||||
<el-select v-model="people_form.Post" clearable placeholder="请选择岗位" style="width: 200px" size="small">
|
||||
<el-option
|
||||
v-for="item in PostData"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
<el-button v-if="people_title === '新增人员'" type="primary" @click="submitAddPeople">确定</el-button>
|
||||
<el-button v-else-if="people_title === '编辑人员'" type="primary" @click="submitEditPeople">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getTree, tree, getTablePeople, getTablePeopleForName, addDepartmentName, delList, editList, delPeopleList, fetchEducationData, fetchPostData, addPeople, editPeople } from '@/api/BasicData/PersonnelManagement'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
departmentData: [],
|
||||
expandAll: true,
|
||||
i: 1,
|
||||
id: '',
|
||||
PageCurrent: 1,
|
||||
PageSize: 10,
|
||||
List: [],
|
||||
total: null,
|
||||
nodeName: '',
|
||||
department_DFV: false,
|
||||
department_Form: {
|
||||
DepartmentName: ''
|
||||
},
|
||||
department_Title: '',
|
||||
Name: '',
|
||||
people_title: '',
|
||||
people_DFV: false,
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'label'
|
||||
},
|
||||
people_form: {
|
||||
Name: '',
|
||||
AccountNumber: '',
|
||||
Password: '',
|
||||
Sex: null,
|
||||
Birthday: '',
|
||||
IDcard: '',
|
||||
TimeOfEntry: '',
|
||||
ContactInformation: '',
|
||||
Address: null,
|
||||
Nation: '',
|
||||
ForeignLanguageLevel: null,
|
||||
Title: null,
|
||||
PositionStatus: null,
|
||||
Education: null,
|
||||
Post: null,
|
||||
PeopleID: null
|
||||
},
|
||||
rules: {
|
||||
Name: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
AccountNumber: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
Password: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
Sex: [{ required: true, message: '请输入', trigger: 'change' }],
|
||||
Birthday: [{ required: true, message: '请输入', trigger: 'change' }],
|
||||
IDcard: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
TimeOfEntry: [{ required: true, message: '请输入', trigger: 'change' }],
|
||||
ContactInformation: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
Address: [{ required: true, message: '请输入', trigger: 'change' }],
|
||||
Nation: [{ required: true, message: '请输入', trigger: 'change' }],
|
||||
ForeignLanguageLevel: [{ required: true, message: '请输入', trigger: 'change' }],
|
||||
Title: [{ required: true, message: '请输入', trigger: 'change' }],
|
||||
PositionStatus: [{ required: true, message: '请输入', trigger: 'change' }],
|
||||
Education: [{ required: true, message: '请输入', trigger: 'change' }],
|
||||
Post: [{ required: true, message: '请输入', trigger: 'change' }]
|
||||
},
|
||||
SexData: [{
|
||||
value: 1,
|
||||
label: '男'
|
||||
}, {
|
||||
value: 2,
|
||||
label: '女'
|
||||
}],
|
||||
EducationDate: [],
|
||||
PostData: [],
|
||||
multipleSelection: [],
|
||||
nodeName1: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getTreeData()
|
||||
this.fetchEducationData()
|
||||
this.fetchPostData()
|
||||
},
|
||||
methods: {
|
||||
fetchEducationData() {
|
||||
this.getSelect(fetchEducationData, ['学历名称', '学历编号'], 'EducationDate')
|
||||
},
|
||||
fetchPostData() {
|
||||
this.people_form.Post = ''
|
||||
this.PostData = []
|
||||
this.getSelect(fetchPostData, ['岗位名称', '岗位编号'], 'PostData')
|
||||
},
|
||||
getTreeData() {
|
||||
getTree().then(response => {
|
||||
const data = response.data
|
||||
this.departmentData = tree(data, 0)
|
||||
})
|
||||
},
|
||||
expandALL() {
|
||||
this.expandAll = !this.expandAll
|
||||
for (let i = 0; i < this.$refs.treeForm.store._getAllNodes().length; i++) {
|
||||
this.$refs.treeForm.store._getAllNodes()[i].expanded = this.expandAll
|
||||
}
|
||||
},
|
||||
handleNodeClick() {
|
||||
this.getTable(getTablePeople, [this.id, this.PageCurrent, this.PageSize], ['List', 'total'])
|
||||
},
|
||||
handleClick(data, checked) {
|
||||
if (this.$refs.treeForm.getCheckedKeys().length !== 0 && this.$refs.treeForm.getCheckedNodes().length !== 0) {
|
||||
const data = this.$refs.treeForm.getCheckedKeys()
|
||||
if (data.length === 1) {
|
||||
this.id = data[0]
|
||||
this.handleNodeClick()
|
||||
}
|
||||
this.nodeName = this.$refs.treeForm.getCheckedNodes()[0].label
|
||||
} else {
|
||||
this.id = ''
|
||||
this.handleNodeClick()
|
||||
}
|
||||
this.i++
|
||||
if (this.i % 2 === 1) {
|
||||
if (checked) {
|
||||
this.$refs.treeForm.setCheckedNodes([data])
|
||||
} else {
|
||||
this.$refs.treeForm.setCheckedNodes([])
|
||||
}
|
||||
}
|
||||
},
|
||||
handleAdd() {
|
||||
this.department_Title = '新增部门'
|
||||
this.department_DFV = true
|
||||
this.addForm('department_Form')
|
||||
},
|
||||
handleEdit() {
|
||||
this.addForm('department_Form')
|
||||
if (this.id) {
|
||||
this.department_Title = '编辑部门'
|
||||
this.department_DFV = true
|
||||
this.department_Form.DepartmentName = this.nodeName
|
||||
} else {
|
||||
this.$message.warning(`请选择要修改的部门`)
|
||||
}
|
||||
},
|
||||
submitAdd() {
|
||||
this.department_DFV = false
|
||||
if (this.id) {
|
||||
addDepartmentName(this.id, this.department_Form.DepartmentName, 0).then(response => {
|
||||
console.log(response.data[0].result === '1')
|
||||
if (response.data[0].result === '1') {
|
||||
this.getTreeData()
|
||||
this.$message.success('添加成功')
|
||||
} else {
|
||||
this.$message.error('添加失败')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
addDepartmentName(0, this.department_Form.DepartmentName, 0).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.getTreeData()
|
||||
this.$message.success('添加成功')
|
||||
} else {
|
||||
this.$message.error('添加失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
submitEdit() {
|
||||
this.department_DFV = false
|
||||
editList(this.id, this.department_Form.DepartmentName).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.getTreeData()
|
||||
this.$message.success('编辑成功')
|
||||
} else {
|
||||
this.$message.error('编辑失败')
|
||||
}
|
||||
})
|
||||
},
|
||||
deleteTable() {
|
||||
if (this.id) {
|
||||
this.deleteRow(delList, this.id, function() { this.getTreeData() })
|
||||
} else {
|
||||
this.$message.warning(`请选择部门`)
|
||||
}
|
||||
},
|
||||
cancel() {
|
||||
this.department_DFV = false
|
||||
this.people_DFV = false
|
||||
},
|
||||
fetchPeopleForName() {
|
||||
if (this.Name) {
|
||||
getTablePeopleForName(this.Name).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
// let Data = response.data
|
||||
if (response.data[i].入公司时间) {
|
||||
response.data[i].入公司时间 = response.data[i].入公司时间.split(' ')[0]
|
||||
}
|
||||
if (response.data[i].出生日期) {
|
||||
response.data[i].出生日期 = response.data[i].出生日期.split(' ')[0]
|
||||
}
|
||||
}
|
||||
this.List = response.data
|
||||
})
|
||||
} else {
|
||||
this.$message.warning(`请输入人员姓名`)
|
||||
this.List = []
|
||||
}
|
||||
},
|
||||
addPeople() {
|
||||
this.people_title = '新增人员'
|
||||
this.people_DFV = true
|
||||
this.addForm('people_form')
|
||||
},
|
||||
submitAddPeople() {
|
||||
this.people_DFV = false
|
||||
if (this.id) {
|
||||
addPeople(this.id, this.people_form.Sex, this.people_form.Education, this.people_form.Address, this.people_form.Nation, this.people_form.Post, this.people_form.AccountNumber, this.people_form.Password, this.people_form.Name, this.people_form.IDcard, this.people_form.TimeOfEntry, this.people_form.Birthday, this.people_form.ContactInformation).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.handleNodeClick()
|
||||
this.$message.success('添加成功')
|
||||
} else {
|
||||
this.$message.error('添加失败')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.warning(`请选择部门名称`)
|
||||
}
|
||||
},
|
||||
handleEditPeople(row) {
|
||||
this.people_title = '编辑人员'
|
||||
this.people_DFV = true
|
||||
this.addForm('people_form')
|
||||
this.people_form.PeopleID = row.人员编号
|
||||
this.people_form.Sex = parseInt(row.性别编号)
|
||||
this.people_form.Education = parseInt(row.学历编号)
|
||||
this.people_form.Address = row.家庭住址
|
||||
this.people_form.Nation = row.民族
|
||||
this.people_form.Post = parseInt(row.岗位编号)
|
||||
this.people_form.AccountNumber = row.考勤编号
|
||||
this.people_form.Password = row.密码
|
||||
this.people_form.Name = row.姓名
|
||||
this.people_form.IDcard = row.身份证号
|
||||
this.people_form.TimeOfEntry = row.入公司时间
|
||||
this.people_form.Birthday = row.出生日期
|
||||
this.people_form.ContactInformation = row.联系电话
|
||||
},
|
||||
submitEditPeople() {
|
||||
this.people_DFV = false
|
||||
editPeople(this.people_form.PeopleID, this.people_form.Sex, this.people_form.Education, this.people_form.Address, this.people_form.Nation, this.people_form.Post, this.people_form.AccountNumber, this.people_form.Password, this.people_form.Name, this.people_form.IDcard, this.people_form.TimeOfEntry, this.people_form.Birthday, this.people_form.ContactInformation).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
if (this.id !== '' && this.Name === '') {
|
||||
this.handleNodeClick()
|
||||
} else {
|
||||
this.feathPeopleForName()
|
||||
}
|
||||
this.$message.success('编辑成功')
|
||||
} else {
|
||||
this.$message.error('编辑失败')
|
||||
}
|
||||
})
|
||||
},
|
||||
deletePeopleTable(row) {
|
||||
this.deleteRow(delPeopleList, row.人员编号, function() { this.id ? this.handleNodeClick() : this.feathPeopleForName() })
|
||||
},
|
||||
postMaintain() {
|
||||
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.PageSize = val
|
||||
this.PageCurrent = 1
|
||||
getTablePeople(this.id, this.PageCurrent, this.PageSize).then(response => {
|
||||
this.List = response.data.rows
|
||||
this.total = response.data.total
|
||||
})
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.PageCurrent = val
|
||||
getTablePeople(this.id, this.PageCurrent, this.PageSize).then(response => {
|
||||
this.List = response.data.rows
|
||||
this.total = response.data.total
|
||||
})
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
259
src/views/BasicData/UserRightsManagement/index.vue
Normal file
259
src/views/BasicData/UserRightsManagement/index.vue
Normal file
@@ -0,0 +1,259 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<div style="margin: 0 auto;width: 850px">
|
||||
<span>角色名称:</span>
|
||||
<el-select v-model="roleName" placeholder="请选择" size="small" style="width:200px;margin-left:10px" filterable clearable @change="getmodule">
|
||||
<el-option
|
||||
v-for="item in roleNames"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<el-button type="primary" size="small" style="float: right" @click="openModelWin">添加模块(开发使用)</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<div style="margin: 0 auto;width: 850px">
|
||||
<el-transfer
|
||||
:filter-method="filterMoudles"
|
||||
v-model="value1"
|
||||
:titles="['权限列表','角色对应权限列表']"
|
||||
:props="{key: 'value'}"
|
||||
:data="modelNames"
|
||||
filterable
|
||||
@change="roleChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-dialog :title="title" :visible.sync="dialogFormVisible" center style="min-height: 300px" width="400px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="110px" class="demo-ruleForm">
|
||||
<el-row>
|
||||
<el-form-item label="选择模块名称" prop="选择模块名称">
|
||||
<el-select v-model="modelName" size="mini" clearable placeholder="请选择模块名称" filterable @change="getModelData">
|
||||
<el-option
|
||||
v-for="item in modelNames"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<div style="font-size: 12px;color: red;margin: -15px 0">选择模块名称是修改,没选择是增加</div>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-form-item label="组件" prop="组件">
|
||||
<el-input
|
||||
v-model="form.组件"
|
||||
size="small"
|
||||
style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-form-item label="标题" prop="标题">
|
||||
<el-input
|
||||
v-model="form.标题"
|
||||
size="small"
|
||||
style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-form-item label="图标" prop="图标">
|
||||
<el-input
|
||||
v-model="form.图标"
|
||||
size="small"
|
||||
style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="cancel('form')">取消</el-button>
|
||||
<el-button type="primary" @click="submit('form')">确定</el-button>
|
||||
<el-button v-if="show" type="danger" @click="deleteModule()">删除模块</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getRole, getModule, addModule, deleteModule, getModelData, addModelData, editModelData } from '@/api/BasicData/UserRightsManagement'
|
||||
import { arrayUnique2 } from '@/utils/tool'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
modelNames: [],
|
||||
value4: [],
|
||||
value1: [],
|
||||
addnum: 0,
|
||||
deletenum: 0,
|
||||
roleName: null,
|
||||
roleNames: [],
|
||||
data1: [],
|
||||
dialogFormVisible: false,
|
||||
title: '',
|
||||
form: {
|
||||
组件: '',
|
||||
标题: '',
|
||||
图标: ''
|
||||
},
|
||||
rules: {
|
||||
组件: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
标题: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
图标: [{ required: true, message: '请输入', trigger: 'blur' }]
|
||||
},
|
||||
modelName: '',
|
||||
show: false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getRoleName()
|
||||
this.getAllModules()
|
||||
},
|
||||
methods: {
|
||||
getRoleName() {
|
||||
getRole().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.roleNames.push({
|
||||
value: response.data[i].角色编号,
|
||||
label: response.data[i].角色功能
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getAllModules() {
|
||||
this.modelName = ''
|
||||
this.modelNames = []
|
||||
getModule().then(response => {
|
||||
const data = response.data
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
this.modelNames.push({
|
||||
value: response.data[i].主模块编号,
|
||||
label: response.data[i].标题,
|
||||
disabled: true
|
||||
})
|
||||
if (i === data.length - 1) {
|
||||
this.modelNames = arrayUnique2(this.modelNames, 'value')
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
filterMoudles(query, item) {
|
||||
return item.label.indexOf(query) > -1
|
||||
},
|
||||
getmodule() {
|
||||
this.value1 = []
|
||||
if (this.roleName) {
|
||||
for (let i = 0; i < this.modelNames.length; i++) {
|
||||
this.modelNames[i].disabled = false
|
||||
}
|
||||
getModule(1, this.roleName).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.value1.push(parseInt(response.data[i].主模块编号))
|
||||
}
|
||||
})
|
||||
} else {
|
||||
for (let i = 0; i < this.modelNames.length; i++) {
|
||||
this.modelNames[i].disabled = true
|
||||
}
|
||||
this.value1 = []
|
||||
}
|
||||
},
|
||||
roleChange(value, direction, movedKeys) {
|
||||
for (let i = 0; i < movedKeys.length; i++) {
|
||||
if (direction === 'right') {
|
||||
this.addnum = 0
|
||||
addModule(movedKeys[i], this.roleName).then(response => {
|
||||
this.addnum = this.addnum + parseInt(response.data[0].result)
|
||||
if (this.addnum === movedKeys.length) {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: '分配成功',
|
||||
type: 'success'
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.deletenum = 0
|
||||
deleteModule(movedKeys[i], this.roleName).then(response => {
|
||||
this.deletenum = this.deletenum + parseInt(response.data[0].result)
|
||||
console.log(this.deletenum, movedKeys.length)
|
||||
if (this.deletenum === movedKeys.length) {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: '分配成功',
|
||||
type: 'success'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
// 开发者
|
||||
getModelData() {
|
||||
if (typeof this.modelName === 'number') {
|
||||
getModelData(this.modelName).then(response => {
|
||||
const data = response.data[0]
|
||||
this.form.组件 = data.子组件
|
||||
this.form.标题 = data.标题
|
||||
this.form.图标 = data.图标
|
||||
})
|
||||
}
|
||||
},
|
||||
openModelWin() {
|
||||
this.dialogFormVisible = true
|
||||
this.addForm('form')
|
||||
},
|
||||
cancel() { // 取消
|
||||
this.modelName = ''
|
||||
this.dialogFormVisible = false
|
||||
},
|
||||
submit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
this.dialogFormVisible = false
|
||||
if (typeof this.modelName === 'string') {
|
||||
addModelData(this.form.组件, this.form.标题, this.form.图标).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('添加成功')
|
||||
this.getAllModules()
|
||||
} else {
|
||||
this.$message.error('添加失败')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
editModelData(this.modelName, this.form.组件, this.form.标题, this.form.图标).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('修改成功')
|
||||
this.getAllModules()
|
||||
} else {
|
||||
this.$message.error('修改失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
console.log('error submit!!')
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
deleteModule() {
|
||||
console.log(1)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.el-transfer-panel {
|
||||
width:300px;
|
||||
}
|
||||
.el-transfer-panel__body {
|
||||
height: 500px;
|
||||
width: 300px;
|
||||
}
|
||||
.el-transfer-panel__list {
|
||||
height: 500px;
|
||||
width: 300px;
|
||||
}
|
||||
.el-transfer-panel__list.is-filterable{
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
399
src/views/ManufacturingCenter/DiscardedPartsInquiry/index.vue
Normal file
399
src/views/ManufacturingCenter/DiscardedPartsInquiry/index.vue
Normal file
@@ -0,0 +1,399 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<el-row>
|
||||
<span>项目名称:</span>
|
||||
<el-select
|
||||
v-model="entryNameValue"
|
||||
:remote-method="remoteMethod"
|
||||
placeholder="项目名称"
|
||||
style="margin-right: 10px"
|
||||
size="small"
|
||||
clearable
|
||||
filterable
|
||||
remote
|
||||
@change="projectChange"
|
||||
@focus="projectInit">
|
||||
<el-option
|
||||
v-for="item in entryName"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span>机床图号:</span>
|
||||
<el-select v-model="machineNameValue" placeholder="机床号" style="margin-right: 10px" size="small" clearable @change="machineChange">
|
||||
<el-option
|
||||
v-for="item in machineName"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 15px" @click="total1=0;pageSize1 = 10;pageCurrent1 = 1;searchData1()">查询</el-button>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<el-card style="margin-top: 15px">
|
||||
<el-table
|
||||
v-loading="listLoading2"
|
||||
:data="tableData2"
|
||||
style="width: 100%;max-height: 400px;"
|
||||
height="400"
|
||||
highlight-current-row
|
||||
border
|
||||
@row-click="searchSpareParts">
|
||||
<el-table-column align="center" label="机床流水号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机床流水号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="机床图号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机床图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="停产零件种类">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.停产零件种类 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="停产零件数量">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.停产零件数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="已加工工时">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.已加工工时 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px">
|
||||
<el-pagination
|
||||
:current-page="pageCurrent1"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="pageSize1"
|
||||
:total="total1"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange1"
|
||||
@current-change="handleCurrentChange1"/>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card style="margin-top: 15px">
|
||||
<el-row>
|
||||
<span>组号:</span>
|
||||
<el-select v-model="GroupNumValue" placeholder="组号" style="margin-right: 10px" size="small" clearable>
|
||||
<el-option
|
||||
v-for="item in GroupNum"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span>零件图号:</span>
|
||||
<el-input v-model="PartDrawingNumber" placeholder="零件图号" size="small" clearable style="width:200px"/>
|
||||
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 15px" @click="total=0;pageSize = 10;pageCurrent = 1;searchData()">查询</el-button>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<el-card style="margin-top: 15px">
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
:data="tableData"
|
||||
style="width: 100%;max-height: 400px;"
|
||||
height="400"
|
||||
highlight-current-row
|
||||
border
|
||||
@row-click="searchProcedure">
|
||||
<el-table-column align="center" label="组号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.组号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="零件图号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="零件名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="零件数量">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.投产数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="停产时间">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.停产时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="停产原因">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.停产原因 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="加工工时">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.加工工时 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px">
|
||||
<el-pagination
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card style="margin-top: 15px">
|
||||
<el-table
|
||||
v-loading="listLoading1"
|
||||
:data="tableData1"
|
||||
style="width: 100%;max-height: 400px;"
|
||||
height="400"
|
||||
highlight-current-row
|
||||
border>
|
||||
<el-table-column align="center" label="工序顺序" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工序顺序 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工艺名称" width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工艺名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工艺要求">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工艺要求 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="单件定额工时" width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.单件定额工时 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="准结定额工时" width="130">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.准结定额工时 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工艺是否完成" width="130">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工序状态 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工时" width="80">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工序工时 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { initProject, searchMachine, searchGroupNum, searchTable, searchTable1, searchTable2 } from '@/api/ManufacturingCenter/DiscardedPartsInquiry'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
pageCurrent: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
pageCurrent1: 1,
|
||||
pageSize1: 10,
|
||||
total1: 0,
|
||||
list: [],
|
||||
check3: '',
|
||||
PartDrawingNumber: '',
|
||||
remoteLoading: false,
|
||||
listLoading: false,
|
||||
listLoading1: false,
|
||||
listLoading2: false,
|
||||
entryName: [],
|
||||
check: '',
|
||||
entryNameValue: '', // 项目名称
|
||||
entryValue: '', // 项目流水号
|
||||
machineName: [],
|
||||
check1: '',
|
||||
machineNameValue: '', // 机床图号
|
||||
machineValue: '', // 机床图号
|
||||
GroupNum: [],
|
||||
check2: '',
|
||||
GroupNumValue: '', // 组号
|
||||
tableData: [],
|
||||
tableData1: [],
|
||||
tableData2: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.projectInit()
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.list = []
|
||||
initProject().then(response => { // 初始化项目名称
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.list.push({
|
||||
label: response.data[i].项目名称,
|
||||
value: response.data[i].项目流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
remoteMethod(query) {
|
||||
if (query !== '') {
|
||||
setTimeout(() => {
|
||||
this.entryName = this.list.filter(item => {
|
||||
return item.label.toLowerCase()
|
||||
.indexOf(query.toLowerCase()) > -1
|
||||
})
|
||||
}, 1000)
|
||||
} else {
|
||||
this.entryName = []
|
||||
}
|
||||
},
|
||||
projectInit() { // 初始化项目
|
||||
this.entryName = []
|
||||
initProject().then(response => { // 初始化项目名称
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.entryName.push({
|
||||
label: response.data[i].项目名称,
|
||||
value: response.data[i].项目流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
projectChange() {
|
||||
this.machineName = []
|
||||
this.machineNameValue = ''
|
||||
this.GroupNum = []
|
||||
this.GroupNumValue = ''
|
||||
searchMachine(this.entryNameValue).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.machineName.push({
|
||||
label: response.data[i].机床图号,
|
||||
value: response.data[i].机床流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
machineChange() {
|
||||
this.GroupNum = []
|
||||
this.GroupNumValue = ''
|
||||
searchGroupNum(this.machineNameValue).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.GroupNum.push({
|
||||
label: response.data[i].组号,
|
||||
value: response.data[i].组件流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
searchData1() {
|
||||
if (this.entryNameValue !== '' && this.entryNameValue !== null) {
|
||||
this.listLoading2 = true
|
||||
if (this.entryNameValue !== '' && this.entryNameValue !== null) {
|
||||
this.check = 1
|
||||
} else {
|
||||
this.check = 0
|
||||
}
|
||||
if (this.machineNameValue !== '' && this.machineNameValue !== null) {
|
||||
this.check1 = 1
|
||||
} else {
|
||||
this.check1 = 0
|
||||
}
|
||||
searchTable2(this.check, this.entryNameValue, this.check1, this.machineNameValue, this.pageCurrent1, this.pageSize1).then(response => {
|
||||
console.log(response)
|
||||
this.tableData2 = response.data.rows
|
||||
this.total1 = response.data.total
|
||||
this.listLoading2 = false
|
||||
})
|
||||
} else {
|
||||
this.$message.warning('请选择项目')
|
||||
}
|
||||
},
|
||||
handleSizeChange1(val) {
|
||||
this.pageSize1 = val
|
||||
this.pageCurrent1 = 1
|
||||
this.searchData1()
|
||||
},
|
||||
handleCurrentChange1(val) {
|
||||
this.pageCurrent1 = val
|
||||
this.searchData1()
|
||||
},
|
||||
searchSpareParts(row) {
|
||||
this.tableData1 = []
|
||||
this.machineValue = row.机床流水号
|
||||
this.initGroup()
|
||||
},
|
||||
initGroup() {
|
||||
this.GroupNum = []
|
||||
this.GroupNumValue = ''
|
||||
searchGroupNum(this.machineValue).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.GroupNum.push({
|
||||
label: response.data[i].组号,
|
||||
value: response.data[i].组件流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
this.searchData()
|
||||
},
|
||||
searchData() {
|
||||
this.listLoading = true
|
||||
this.tableData1 = []
|
||||
if (this.GroupNumValue !== '' && this.GroupNumValue !== null) {
|
||||
this.check2 = 1
|
||||
} else {
|
||||
this.check2 = 0
|
||||
}
|
||||
if (this.PartDrawingNumber !== '' && this.PartDrawingNumber !== null) {
|
||||
this.check3 = 1
|
||||
} else {
|
||||
this.check3 = 0
|
||||
}
|
||||
searchTable(this.entryNameValue, this.machineValue, this.check2, this.GroupNumValue, this.check3, this.PartDrawingNumber, this.pageCurrent, this.pageSize).then(response => {
|
||||
console.log(response)
|
||||
this.tableData = response.data.rows
|
||||
this.total = response.data.total
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.pageSize = val
|
||||
this.pageCurrent = 1
|
||||
this.searchData()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.searchData()
|
||||
},
|
||||
searchProcedure(row) {
|
||||
this.listLoading1 = true
|
||||
searchTable1(row.工艺计划流水号).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
if (response.data[i].工序状态 === 4) {
|
||||
response.data[i].工序状态 = '完成'
|
||||
} else {
|
||||
response.data[i].工序状态 = '未完成'
|
||||
}
|
||||
}
|
||||
this.tableData1 = response.data
|
||||
this.listLoading1 = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
468
src/views/ManufacturingCenter/GroupMatching/index.vue
Normal file
468
src/views/ManufacturingCenter/GroupMatching/index.vue
Normal file
@@ -0,0 +1,468 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<span>项目名称:</span>
|
||||
<el-select
|
||||
v-model="entryNameValue"
|
||||
:remote-method="remoteMethod"
|
||||
placeholder="项目名称"
|
||||
style="width:200px"
|
||||
size="small"
|
||||
clearable
|
||||
filterable
|
||||
remote
|
||||
@change="empty">
|
||||
<el-option
|
||||
v-for="item in entryName"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span>机床号:</span>
|
||||
<el-input v-model="machineToolNumber" placeholder="机床号" size="small" clearable style="width:200px" @change="empty1" @dblclick.native="SearchMachine"/>
|
||||
<span>组号:</span>
|
||||
<el-input v-model="groupNumber" placeholder="组号" size="small" clearable style="width:200px" @dblclick.native="searchGroupList"/>
|
||||
<span>年:</span>
|
||||
<el-date-picker
|
||||
v-model="year"
|
||||
type="year"
|
||||
size="small"
|
||||
format="yyyy"
|
||||
value-format="yyyy"
|
||||
placeholder="选择年"/>
|
||||
<span>月:</span>
|
||||
<el-select v-model="month" placeholder="选择月" size="small" clearable style="width:180px">
|
||||
<el-option
|
||||
v-for="item in monthes"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span>入库时间:</span>
|
||||
<el-date-picker
|
||||
v-model="time"
|
||||
type="date"
|
||||
size="small"
|
||||
style="margin-top: 20px;width: 200px"
|
||||
format="yyyy-MM-dd"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择日期"/>
|
||||
<el-button type="success" icon="el-icon-search" size="small" style="margin-top: 15px;margin-left: 10px" @click="searchData">查询</el-button>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
style="width: 100%;max-height: 600px"
|
||||
height="600"
|
||||
highlight-current-row
|
||||
border>
|
||||
<el-table-column align="center" label="序号" type="index" width="60"/>
|
||||
<el-table-column align="center" label="零件图号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="零件名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="投产数量">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.投产数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="入库数量">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.入库数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="类别">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.类别 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="计划完成时间">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计划完成时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="入库时间">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.入库时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[10, 20, 30, 40, 50]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-dialog :visible.sync="dialogFormVisible2" title="选择机床" center style="min-height: 300px">
|
||||
<el-table
|
||||
:data="tableData6"
|
||||
style="width:100%;max-height: 300px;display: inline-block"
|
||||
height="300"
|
||||
highlight-current-row
|
||||
border
|
||||
@row-click="selectMachine">
|
||||
<el-table-column align="center" label="机床图号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机床图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="机床名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机床名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="机床开始时间">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机床开始时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="机床结束时间">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机床结束时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工位属性">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位属性 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="机床主管">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机床主管 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:current-page="pageCurrent1"
|
||||
:page-sizes="[10, 20, 30, 40, 50]"
|
||||
:page-size="pageSize1"
|
||||
:total="total1"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange1"
|
||||
@current-change="handleCurrentChange1"/>
|
||||
</div>
|
||||
<el-button type="primary" style="margin-left: 350px;margin-top: 20px" @click="submitName">提交</el-button>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :visible.sync="dialogFormVisible3" title="选择组号" center style="min-height: 300px">
|
||||
<el-table
|
||||
:data="tableData7"
|
||||
style="width:100%;max-height: 300px;display: inline-block"
|
||||
height="300"
|
||||
highlight-current-row
|
||||
border
|
||||
@row-click="selectGroup">
|
||||
<el-table-column align="center" label="机床图号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机床图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="机床名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机床名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="组号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.组号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="组件名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.组件名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="组件介绍">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.组件介绍 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:current-page="pageCurrent2"
|
||||
:page-sizes="[10, 20, 30, 40, 50]"
|
||||
:page-size="pageSize2"
|
||||
:total="total2"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange3"
|
||||
@current-change="handleCurrentChange3"/>
|
||||
</div>
|
||||
<el-button type="primary" style="margin-left: 350px;margin-top: 20px" @click="submitGroup">提交</el-button>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { initProject, searchTable, searchmachine, searchgroup } from '@/api/ManufacturingCenter/GroupMatching'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
entryNameValue: null, // 项目流水号
|
||||
entryName: [], // 项目数组
|
||||
machineToolNumber: '', // 机床图号
|
||||
machineNumber: '',
|
||||
machine: null, // 机床流水号
|
||||
groupNumber: '', // 组号
|
||||
groupNumber1: '',
|
||||
groupNum: null, // 组件流水号
|
||||
partNumber: '', // 零件号
|
||||
num: null,
|
||||
pageCurrent: 1,
|
||||
pageSize: 10,
|
||||
pageCurrent1: 1,
|
||||
pageSize1: 10,
|
||||
pageCurrent2: 1,
|
||||
pageSize2: 10,
|
||||
tableData7: [],
|
||||
tableData6: [],
|
||||
tableData: [],
|
||||
state: null,
|
||||
total: null,
|
||||
total1: null,
|
||||
total2: null,
|
||||
title: '',
|
||||
dialogFormVisible2: false,
|
||||
dialogFormVisible3: false,
|
||||
List: [],
|
||||
check: null,
|
||||
check1: null,
|
||||
check2: null,
|
||||
check3: null,
|
||||
check4: null,
|
||||
check5: null,
|
||||
month: null,
|
||||
year: null,
|
||||
time: '',
|
||||
loading: false,
|
||||
monthes: [{
|
||||
value: 1,
|
||||
label: '1'
|
||||
}, {
|
||||
value: 2,
|
||||
label: '2'
|
||||
}, {
|
||||
value: 3,
|
||||
label: '3'
|
||||
}, {
|
||||
value: 4,
|
||||
label: '4'
|
||||
}, {
|
||||
value: 5,
|
||||
label: '5'
|
||||
}, {
|
||||
value: 6,
|
||||
label: '6'
|
||||
}, {
|
||||
value: 7,
|
||||
label: '7'
|
||||
}, {
|
||||
value: 8,
|
||||
label: '8'
|
||||
}, {
|
||||
value: 9,
|
||||
label: '9'
|
||||
}, {
|
||||
value: 10,
|
||||
label: '10'
|
||||
}, {
|
||||
value: 11,
|
||||
label: '11'
|
||||
}, {
|
||||
value: 12,
|
||||
label: '12'
|
||||
}]
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
searchData() {
|
||||
this.loading = true
|
||||
if (this.entryNameValue !== null && this.entryNameValue !== '') {
|
||||
if (this.entryNameValue !== null && this.entryNameValue !== '') {
|
||||
this.check = 1
|
||||
} else {
|
||||
this.check = 0
|
||||
}
|
||||
if (this.machineToolNumber !== '') {
|
||||
this.check1 = 1
|
||||
} else {
|
||||
this.check1 = 0
|
||||
}
|
||||
if (this.groupNumber !== '') {
|
||||
this.check2 = 1
|
||||
} else {
|
||||
this.check2 = 0
|
||||
}
|
||||
if (this.year !== null && this.year !== '') {
|
||||
this.check3 = 1
|
||||
} else {
|
||||
this.check3 = 0
|
||||
}
|
||||
if (this.month !== null && this.month !== '') {
|
||||
this.check4 = 1
|
||||
} else {
|
||||
this.check4 = 0
|
||||
}
|
||||
if (this.time !== '' && this.time !== null) {
|
||||
this.check5 = 1
|
||||
} else {
|
||||
this.check5 = 0
|
||||
}
|
||||
searchTable(this.check, this.entryNameValue, this.check1, this.machine, this.check2, this.groupNum, this.check3, this.year, this.check4, this.month, this.check5, this.time, this.pageCurrent, this.pageSize).then(response => {
|
||||
for (let i = 0; i < response.data.rows.length; i++) {
|
||||
if (response.data.rows[i].入库时间 !== null) {
|
||||
response.data.rows[i].入库时间 = response.data.rows[i].入库时间.split(' ', 2)[0]
|
||||
}
|
||||
if (response.data.rows[i].计划完成时间 !== null) {
|
||||
response.data.rows[i].计划完成时间 = response.data.rows[i].计划完成时间.split(' ', 2)[0]
|
||||
}
|
||||
}
|
||||
this.tableData = response.data.rows
|
||||
this.total = parseInt(response.data.total)
|
||||
this.loading = false
|
||||
})
|
||||
} else {
|
||||
this.loading = false
|
||||
this.$message.warning('请先选择项目')
|
||||
}
|
||||
},
|
||||
getList() { // 初始化项目名称
|
||||
this.list = []
|
||||
initProject().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.list.push({
|
||||
label: response.data[i].项目名称,
|
||||
value: response.data[i].项目流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
remoteMethod(query) {
|
||||
if (query !== '') {
|
||||
setTimeout(() => {
|
||||
this.entryName = this.list.filter(item => {
|
||||
if (item.label !== null) {
|
||||
return item.label.toLowerCase()
|
||||
.indexOf(query.toLowerCase()) > -1
|
||||
}
|
||||
})
|
||||
}, 1000)
|
||||
} else {
|
||||
this.entryName = []
|
||||
}
|
||||
},
|
||||
empty() {
|
||||
this.machineToolNumber = ''
|
||||
this.groupNumber = ''
|
||||
},
|
||||
SearchMachine() { // 查询机床
|
||||
if (this.entryNameValue !== null && this.entryNameValue !== '') {
|
||||
this.dialogFormVisible2 = true
|
||||
this.check6 = 1
|
||||
searchmachine(this.entryNameValue, this.check6, this.pageCurrent1, this.pageSize1).then(response => {
|
||||
for (let i = 0; i < response.data.result; i++) {
|
||||
if (response.data.result[i].机床开始时间 !== '') {
|
||||
response.data.result[i].机床开始时间 = response.data.result[i].机床开始时间.substr(0, 10)
|
||||
}
|
||||
if (response.data.result[i].机床结束时间 !== '') {
|
||||
response.data.result[i].机床结束时间 = response.data.result[i].机床结束时间.substr(0, 10)
|
||||
}
|
||||
}
|
||||
this.tableData6 = response.data.result
|
||||
this.total1 = parseInt(response.data.output[0].ItemCount)
|
||||
})
|
||||
} else {
|
||||
this.$message.warning('请先选择项目')
|
||||
}
|
||||
},
|
||||
selectMachine(row) { // 选择机床号
|
||||
this.machine = row.机床流水号
|
||||
this.machineNumber = row.机床图号
|
||||
},
|
||||
submitName() { // 提交机床号
|
||||
this.machineToolNumber = this.machineNumber
|
||||
this.dialogFormVisible2 = false
|
||||
},
|
||||
empty1() {
|
||||
this.groupNumber = ''
|
||||
},
|
||||
searchGroupList() { // 查询组号
|
||||
if (this.machineToolNumber !== '') {
|
||||
this.dialogFormVisible3 = true
|
||||
searchgroup(this.machine, this.pageCurrent2, this.pageSize2).then(response => {
|
||||
this.tableData7 = response.data.result
|
||||
this.total2 = parseInt(response.data.output[0].ItemCount)
|
||||
})
|
||||
} else {
|
||||
this.$message.warning('请先选择机床')
|
||||
}
|
||||
},
|
||||
selectGroup(row) { // 选择组号
|
||||
this.groupNumber1 = row.组号
|
||||
this.groupNum = row.组件流水号
|
||||
},
|
||||
submitGroup() { // 提交组号
|
||||
this.groupNumber = this.groupNumber1
|
||||
this.dialogFormVisible3 = false
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = val
|
||||
this.searchData()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.searchData()
|
||||
},
|
||||
handleSizeChange1(val) {
|
||||
this.pageCurrent1 = 1
|
||||
this.pageSize1 = val
|
||||
this.SearchMachine()
|
||||
},
|
||||
handleCurrentChange1(val) {
|
||||
this.pageCurrent1 = val
|
||||
this.SearchMachine()
|
||||
},
|
||||
handleSizeChange3(val) {
|
||||
this.pageCurrent2 = 1
|
||||
this.pageSize2 = val
|
||||
this.searchGroupList()
|
||||
},
|
||||
handleCurrentChange3(val) {
|
||||
this.pageCurrent2 = val
|
||||
this.searchGroupList()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-card{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.el-date-editor{
|
||||
width:150px
|
||||
}
|
||||
span{
|
||||
margin: 10px 0 10px 10px;
|
||||
}
|
||||
</style>
|
||||
968
src/views/ManufacturingCenter/InitialProduction/index.vue
Normal file
968
src/views/ManufacturingCenter/InitialProduction/index.vue
Normal file
@@ -0,0 +1,968 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<el-card>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form label-width="270px" label-position="right" class="Time">
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="radio" size="small">
|
||||
<el-radio :label="0">正常件投产</el-radio>
|
||||
<el-radio :label="1">整改件投产</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目名称">
|
||||
<el-select v-model="entryNameValue" filterable size="small" style="margin-bottom:10px" placeholder="项目名称" @change="typeChange()">
|
||||
<el-option
|
||||
v-for="item in entryName"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="机床号">
|
||||
<el-select v-model="toolNumValue" filterable size="small" placeholder="机床号" style="margin-bottom:10px" @change="typeChange1()">
|
||||
<el-option
|
||||
v-for="item in toolNum"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="机床组号">
|
||||
<el-select v-model="NumValue" filterable size="small" style="margin-bottom:10px" placeholder="机床组号">
|
||||
<el-option
|
||||
v-for="item in Num"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<el-button type="success" size="small" icon="el-icon-search" style="margin-left:10px" @click="total = 0;pageSize = 10;pageList = 1;getTable()">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-col>
|
||||
|
||||
<el-col style="width: 530px">
|
||||
<el-form label-width="70px" label-position="left" class="Time">
|
||||
<el-form-item label="计划下达">
|
||||
<el-col :span="11">
|
||||
<el-date-picker v-model="time_planStart" size="small" type="datetime" class="time" readonly/>
|
||||
</el-col>
|
||||
<el-col :span="1" class="line">~</el-col>
|
||||
<el-col :span="11">
|
||||
<el-date-picker v-model="time_planFinish" size="small" type="datetime" class="time" readonly/>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="工艺">
|
||||
<el-col :span="11">
|
||||
<el-date-picker v-model="time_gongyiStart" size="small" type="datetime" class="time" readonly/>
|
||||
</el-col>
|
||||
<el-col :span="1" class="line">~</el-col>
|
||||
<el-col :span="11">
|
||||
<el-date-picker v-model="time_gongyiFinish" size="small" type="datetime" class="time" readonly/>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="定额">
|
||||
<el-col :span="11">
|
||||
<el-date-picker v-model="time_dingeStart" size="small" type="datetime" class="time" readonly/>
|
||||
</el-col>
|
||||
<el-col :span="1" class="line">~</el-col>
|
||||
<el-col :span="11">
|
||||
<el-date-picker v-model="time_dingeFinish" size="small" type="datetime" class="time" readonly/>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划平衡">
|
||||
<el-col :span="11">
|
||||
<el-date-picker v-model="time_planpinghengStart" size="small" type="datetime" class="time" readonly/>
|
||||
</el-col>
|
||||
<el-col :span="1" class="line">~</el-col>
|
||||
<el-col :span="11">
|
||||
<el-date-picker v-model="time_planpinghengFinish" size="small" type="datetime" class="time" readonly/>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="加工">
|
||||
<el-col :span="11">
|
||||
<el-date-picker v-model="time_machiningStart" size="small" type="datetime" class="time" readonly/>
|
||||
</el-col>
|
||||
<el-col :span="1" class="line">~</el-col>
|
||||
<el-col :span="11">
|
||||
<el-date-picker v-model="time_machiningFinish" size="small" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" style="margin-bottom:20px;width:200px"/>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-col>
|
||||
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<div>
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
:data="tableData"
|
||||
border
|
||||
style="width: 100%;max-height: 400px"
|
||||
height="400"
|
||||
@selection-change="handleSelectionChange"
|
||||
@row-click="handleCurrentChange1">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
align="center"
|
||||
width="35"/>
|
||||
<el-table-column label="零件号" align="center" min-width="220">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件名称" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="投产" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.投产总数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="批次" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.最大投产批次 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="已投" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.已投产数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="未投" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.未投产数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件类型" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件类型名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否外协" align="center" width="90">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox v-model="tableData[scope.$index].checked_waixie" @change="gaibianwaixie(scope.$index, scope.row)"/>
|
||||
外协
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否带料" align="center" width="90">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox :disabled="!tableData[scope.$index].checked_waixie" v-model="tableData[scope.$index].checked_dailiao"/>
|
||||
带料
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否着急" align="center" width="90">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox v-model="tableData[scope.$index].checked_zhaoji"/>
|
||||
着急
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!--<el-table-column prop="name" label="打回原因" width="170" align="center">-->
|
||||
<!--<template slot-scope="scope">-->
|
||||
<!--<el-input v-model="tableData[scope.$index].name" type="textarea" :rows="1" style="width:150px" placeholder="原因">-->
|
||||
<!--</el-input>-->
|
||||
<!--</template>-->
|
||||
<!--</el-table-column>-->
|
||||
<el-table-column label="操作" width="300px" fixed="right" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
@click="handleEdit(scope.$index, scope.row, 'form')">分批投产</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
@click="handleDele(scope.$index, scope.row, 'form1')">打回档案</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:current-page="currentPage"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
style="width:50%;display:inline-block;"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
<el-checkbox v-model="checked_baitu" style="margin-top:0px">是否白图</el-checkbox>
|
||||
<el-checkbox v-model="checked_gaonandu">是否高难度</el-checkbox>
|
||||
<el-button type="primary" size="small" style="float:right;margin-top:10px" @click="production">投产</el-button>
|
||||
</div>
|
||||
|
||||
<!--<el-row>-->
|
||||
<!--<el-checkbox v-model="checked_baitu" style="margin-top:20px">是否白图</el-checkbox>-->
|
||||
<!--<el-checkbox v-model="checked_gaonandu">是否高难度</el-checkbox>-->
|
||||
<!--<el-button type="primary" size="small" @click="production" style="float:right;margin-top:10px">投产</el-button>-->
|
||||
<!--</el-row>-->
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<div>
|
||||
<el-table
|
||||
v-loading="listLoading1"
|
||||
:data="tableData1"
|
||||
stripe
|
||||
size="mini"
|
||||
tooltip-effect="dark"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
label="零件号">
|
||||
<template slot-scope="scope">{{ scope.row.零件图号 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="零件名称">
|
||||
<template slot-scope="scope">{{ scope.row.零件名称 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="投产总数量">
|
||||
<template slot-scope="scope">{{ scope.row.投产总数量 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="未投产数量">
|
||||
<template slot-scope="scope">{{ scope.row.未投产数量 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="投产批次">
|
||||
<template slot-scope="scope">{{ scope.row.投产批次 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="批次数量">
|
||||
<template slot-scope="scope">{{ scope.row.批次数量 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="是否外协">
|
||||
<template slot-scope="scope">{{ scope.row.是否外协 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="是否带料">
|
||||
<template slot-scope="scope">{{ scope.row.是否带料 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="机加工开始时间">
|
||||
<template slot-scope="scope">{{ scope.row.机加工开始时间 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="机加工结束时间">
|
||||
<template slot-scope="scope">{{ scope.row.机加工结束时间 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="200px">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
fixed="rihgt"
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
@click="handleEdit1(tableData1, scope.$index, scope.row, 'form')">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:current-page="currentPage3"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="pageSize3"
|
||||
:total="total3"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange3"
|
||||
@current-change="handleCurrentChange3"/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-dialog :visible.sync="dialogFormVisible2" title="打回档案" center width="28%">
|
||||
<el-form ref="form1" :model="form1" :rules="rules" label-position="left" label-width="110px" class="demo-ruleForm">
|
||||
<el-form-item label="打回原因" prop="reason">
|
||||
<el-input v-model="form1.reason" size="small" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="callOff1('form1')">取消</el-button>
|
||||
<el-button size="small" type="primary" @click="submit1('form1')">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :title="title" :visible.sync="dialogFormVisible1" center width="24%">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="110px" class="demo-ruleForm">
|
||||
<el-form-item label="零件图号" prop="PDnumber">
|
||||
<el-input v-model="form.PDnumber" size="small" readonly style="width:250px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="投产总数量" prop="quantity">
|
||||
<el-input v-model="form.quantity" size="small" readonly style="width:250px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="未投产数量" prop="unputquantity">
|
||||
<el-input v-model="form.unputquantity" size="small" readonly style="width:250px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="投产批次" prop="productionBatch">
|
||||
<el-input v-model="form.productionBatch" size="small" readonly style="width:250px" placeholder="请输入投产批次"/>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="temp === 1" label="批次数量1" prop="batchQuantity">
|
||||
<el-input-number v-model="form.batchQuantity" :min="1" :max="parseInt(form.unputquantity)" size="small" style="width:250px" label="批次数量"/>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="temp === 2" label="批次数量2" prop="batchQuantity2">
|
||||
<el-input-number v-model="form.batchQuantity2" :min="1" :max="parseInt(maxmax)" size="small" style="width:250px" label="批次数量"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="加工开始时间">
|
||||
<el-date-picker
|
||||
v-model="form.startDate_F"
|
||||
size="small"
|
||||
readonly
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
style="top: 1px;width:250px"
|
||||
placeholder="选择开始日期"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="加工结束时间" prop="endDate_F">
|
||||
<el-date-picker
|
||||
:readonly="readonly"
|
||||
v-model="form.endDate_F"
|
||||
size="small"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
style="top: 1px;width:250px"
|
||||
placeholder="选择结束日期"/>
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="14"/>
|
||||
<el-form-item >
|
||||
<el-button size="small" @click="callOff('form')">取消</el-button>
|
||||
<el-button size="small" type="primary" @click="submit('form')">确 定</el-button>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getEntryNameValue, getToolNum, getNum, getTable, production, getTable1, revisionBatch, editList, dele } from '@/api/ManufacturingCenter/InitialProduction'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
maxmax: '',
|
||||
clearTable: 0,
|
||||
readonly: true,
|
||||
gongyirenwuzhuangtai: '',
|
||||
count: 0, // 表单计数器
|
||||
count2: 0,
|
||||
count3: 0,
|
||||
midcode: 0, // 查询表2的中间变量
|
||||
shijiancuo: 0,
|
||||
shijiancuo1: 0,
|
||||
jieguo: 0,
|
||||
value: '',
|
||||
title: null,
|
||||
temp: 0,
|
||||
ComponentflowNumber: '', // 组件零件基本件流水号
|
||||
TypeflowNumber: '',
|
||||
dataType: '', // 数据类型
|
||||
productionQuantity: '', // 投产总数量
|
||||
checked_waixie1: '',
|
||||
MaterialflowNumber: '', // 材料流水号
|
||||
checked_zhaoji1: '',
|
||||
time_planStart: '',
|
||||
time_planFinish: '',
|
||||
time_gongyiFinish: '',
|
||||
time_gongyiStart: '',
|
||||
time_dingeFinish: '',
|
||||
time_dingeStart: '',
|
||||
time_planpinghengFinish: '',
|
||||
time_planpinghengStart: '',
|
||||
time_machiningFinish: '',
|
||||
time_machiningStart: '',
|
||||
form: { // 修改表单
|
||||
PDnumber: '',
|
||||
quantity: '',
|
||||
unputquantity: '',
|
||||
productionBatch: '',
|
||||
batchQuantity: '',
|
||||
batchQuantity2: '',
|
||||
startDate_F: '',
|
||||
endDate_F: ''
|
||||
},
|
||||
form1: {
|
||||
reason: ''
|
||||
},
|
||||
rules: { // 表单验证规则
|
||||
batchQuantity: [{ required: true, message: '请输入批次数量', trigger: 'blur' }],
|
||||
// startDate_F: [{ required: true, message: '请选择加工开始时间', trigger: 'change' }],
|
||||
endDate_F: [{ required: true, message: '请选择加工结束时间', trigger: 'change' }],
|
||||
reason: [{ required: true, message: '请输入打回原因', trigger: 'blur' }]
|
||||
},
|
||||
// value1: '',
|
||||
result: 0,
|
||||
dialogFormVisible1: false,
|
||||
dialogFormVisible2: false,
|
||||
date: '',
|
||||
a: false,
|
||||
multipleSelection: [],
|
||||
checked_baitu: false,
|
||||
checked_gaonandu: false,
|
||||
tableData: [], // 表1
|
||||
tableData1: [], // 表2
|
||||
entryNameValue: '',
|
||||
entryName: [], // 项目名称
|
||||
toolNumValue: '',
|
||||
toolNum: [], // 机床号
|
||||
NumValue: '',
|
||||
Num: [], // 机床后什么号
|
||||
liushuihao: '',
|
||||
gongyijihua: '',
|
||||
radio: 0, // 第一组
|
||||
total: 0, // 总条数
|
||||
pageSize: 10, // 每页显示条数
|
||||
pageList: 1, // 后台获取页
|
||||
currentPage: 1, // 显示当前页
|
||||
total3: 0, // 总条数
|
||||
pageSize3: 10, // 每页显示条数
|
||||
pageList3: 1, // 后台获取页
|
||||
currentPage3: 1, // 显示当前页
|
||||
listLoading: false,
|
||||
listLoading1: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'sidebar',
|
||||
'avatar',
|
||||
'name',
|
||||
'id'
|
||||
])
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
this.getCurrentTime()
|
||||
this.getNowTime()
|
||||
},
|
||||
methods: {
|
||||
gaibianwaixie(index, row) {
|
||||
if (row.checked_waixie === false) {
|
||||
row.checked_dailiao = false
|
||||
}
|
||||
},
|
||||
select(rows) {
|
||||
if (rows) {
|
||||
rows.forEach(row => {
|
||||
this.$refs.multipleTable.toggleRowSelection(row)
|
||||
})
|
||||
} else {
|
||||
this.$refs.multipleTable.clearSelection()
|
||||
}
|
||||
},
|
||||
getCurrentTime() {
|
||||
this.time_planFinish = this.getTime0(0)
|
||||
this.time_gongyiFinish = this.getTime0(2)
|
||||
this.time_gongyiStart = this.getTime0(0)
|
||||
this.time_dingeFinish = this.getTime0(2)
|
||||
this.time_dingeStart = this.getTime0(2)
|
||||
this.time_planpinghengFinish = this.getTime0(3)
|
||||
this.time_planpinghengStart = this.getTime0(2)
|
||||
this.time_machiningStart = this.getTime0(3)
|
||||
const _this = this
|
||||
setTimeout(() => {
|
||||
_this.getCurrentTime()
|
||||
}, 1000)
|
||||
},
|
||||
getTime0(num) {
|
||||
var date0 = new Date()
|
||||
var date = new Date(date0.getTime() + num * 24 * 60 * 60 * 1000)
|
||||
var month = this.zeroFill(date.getMonth() + 1)
|
||||
var day = this.zeroFill(date.getDate())
|
||||
var hour = this.zeroFill(date.getHours())
|
||||
var minute = this.zeroFill(date.getMinutes())
|
||||
var second = this.zeroFill(date.getSeconds())
|
||||
return date.getFullYear() + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second
|
||||
},
|
||||
getNowTime() {
|
||||
var date = new Date()
|
||||
var month = this.zeroFill(date.getMonth() + 1)
|
||||
var day = this.zeroFill(date.getDate())
|
||||
var hour = this.zeroFill(date.getHours())
|
||||
var minute = this.zeroFill(date.getMinutes())
|
||||
var second = this.zeroFill(date.getSeconds())
|
||||
this.time_planStart = date.getFullYear() + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second
|
||||
},
|
||||
zeroFill(i) {
|
||||
if (i >= 0 && i <= 9) {
|
||||
return '0' + i
|
||||
} else {
|
||||
return i
|
||||
}
|
||||
},
|
||||
// 初始化获取项目名称
|
||||
fetchData() {
|
||||
getEntryNameValue().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.entryName.push({
|
||||
label: response.data[i].项目名称,
|
||||
value: response.data[i].项目流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
typeChange() {
|
||||
this.toolNumValue = ''
|
||||
this.toolNum = []
|
||||
this.NumValue = ''
|
||||
this.Num = []
|
||||
getToolNum(this.entryNameValue).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.toolNum.push({
|
||||
label: response.data[i].机床图号,
|
||||
value: response.data[i].机床流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
typeChange1() {
|
||||
this.NumValue = ''
|
||||
this.Num = []
|
||||
getNum(this.toolNumValue).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.Num.push({
|
||||
label: response.data[i].组号,
|
||||
value: response.data[i].组件流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getTable() {
|
||||
if (this.NumValue === '') {
|
||||
this.$message.error('请选择机床组号')
|
||||
} else {
|
||||
this.listLoading = true
|
||||
this.tableData = []
|
||||
this.tableData1 = []
|
||||
getTable(this.NumValue, this.pageList, this.pageSize).then(response => {
|
||||
this.total = parseInt(response.data.total)
|
||||
for (let i = 0; i < response.data.rows.length; i++) {
|
||||
this.tableData.push({
|
||||
零件图号: response.data.rows[i].零件图号,
|
||||
零件名称: response.data.rows[i].零件名称,
|
||||
投产总数量: response.data.rows[i].投产总数量,
|
||||
最大投产批次: response.data.rows[i].最大投产批次,
|
||||
已投产数量: response.data.rows[i].已投产数量,
|
||||
未投产数量: response.data.rows[i].未投产数量,
|
||||
零件类型名称: response.data.rows[i].零件类型名称,
|
||||
组件零件基本件流水号: response.data.rows[i].组件零件基本件流水号,
|
||||
投产类型流水号: response.data.rows[i].投产类型流水号,
|
||||
数据类型: response.data.rows[i].数据类型,
|
||||
材料流水号: response.data.rows[i].材料流水号,
|
||||
checked_dailiao: false,
|
||||
checked_waixie: false,
|
||||
checked_zhaoji: false
|
||||
})
|
||||
}
|
||||
}).then(() => {
|
||||
this.listLoading = false
|
||||
})
|
||||
}
|
||||
},
|
||||
// 点击Table查询设备信息
|
||||
handleCurrentChange1(row) {
|
||||
this.tableData1 = []
|
||||
this.listLoading1 = true
|
||||
getTable1(row.组件零件基本件流水号, this.pageList3, this.pageSize3).then(response => {
|
||||
if (response.data.total !== 0) {
|
||||
this.gongyirenwuzhuangtai = response.data.rows[0].工艺任务分配状态
|
||||
this.midcode = row.组件零件基本件流水号
|
||||
this.total3 = parseInt(response.data.total)
|
||||
this.tableData1 = response.data.rows
|
||||
}
|
||||
this.listLoading1 = false
|
||||
})
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val
|
||||
},
|
||||
// 打开分批投产
|
||||
handleEdit(index, row, formName) {
|
||||
this.temp = 1
|
||||
this.title = '分批投产'
|
||||
this.readonly = true
|
||||
this.midcode = row.组件零件基本件流水号
|
||||
if (this.time_machiningFinish === '') {
|
||||
this.$message.error('请选择加工结束时间')
|
||||
} else {
|
||||
this.count = this.count + 1
|
||||
if (this.count !== 1) {
|
||||
this.$refs[formName].resetFields()
|
||||
}
|
||||
this.form.endDate_F = this.time_machiningFinish
|
||||
this.form.PDnumber = row.零件图号
|
||||
this.form.quantity = row.投产总数量
|
||||
if (row.未投产数量 !== '' && row.未投产数量 !== null) {
|
||||
this.form.unputquantity = row.未投产数量
|
||||
} else {
|
||||
this.form.unputquantity = row.投产总数量
|
||||
}
|
||||
if (row.最大投产批次 !== '' && row.最大投产批次 !== null) {
|
||||
this.form.productionBatch = parseInt(row.最大投产批次) + 1
|
||||
} else {
|
||||
this.form.productionBatch = 1
|
||||
}
|
||||
this.form.startDate_F = this.time_machiningStart
|
||||
this.ComponentflowNumber = row.组件零件基本件流水号
|
||||
this.TypeflowNumber = row.投产类型流水号
|
||||
this.dataType = row.数据类型
|
||||
this.productionQuantity = row.投产总数量
|
||||
this.checked_waixie1 = row.checked_waixie
|
||||
this.MaterialflowNumber = row.材料流水号
|
||||
this.checked_zhaoji1 = row.checked_zhaoji
|
||||
this.dialogFormVisible1 = true
|
||||
}
|
||||
},
|
||||
// 打开编辑
|
||||
handleEdit1(tableData, index, row, formName) {
|
||||
let Sum = null
|
||||
this.temp = 2
|
||||
this.title = '编辑'
|
||||
this.readonly = false
|
||||
this.count3 = this.count3 + 1
|
||||
if (this.count3 !== 1) {
|
||||
this.$refs[formName].resetFields()
|
||||
}
|
||||
this.form.endDate_F = row.机加工结束时间
|
||||
this.dialogFormVisible1 = true
|
||||
this.form.PDnumber = row.零件图号
|
||||
this.form.quantity = row.投产总数量
|
||||
if (row.最大投产批次 !== '' && row.最大投产批次 !== null) {
|
||||
this.form.productionBatch = row.最大投产批次
|
||||
} else {
|
||||
this.form.productionBatch = 1
|
||||
}
|
||||
this.form.startDate_F = row.机加工开始时间
|
||||
this.ComponentflowNumber = row.组件零件基本件流水号
|
||||
this.TypeflowNumber = row.投产类型流水号
|
||||
this.dataType = row.数据类型
|
||||
this.productionQuantity = row.投产总数量
|
||||
this.checked_waixie1 = row.checked_waixie
|
||||
this.MaterialflowNumber = row.材料流水号
|
||||
this.checked_zhaoji1 = row.checked_zhaoji
|
||||
this.form.batchQuantity2 = parseInt(row.批次数量)
|
||||
this.form.batchQuantity = parseInt(row.批次数量)
|
||||
this.gongyijihua = row.工艺计划流水号
|
||||
this.form.unputquantity = row.投产总数量 - row.已投产数量
|
||||
for (let i = 0; i < tableData.length; i++) {
|
||||
Sum += parseInt(tableData[i].批次数量)
|
||||
if (i === tableData.length - 1) {
|
||||
Sum -= parseInt(row.批次数量)
|
||||
this.maxmax = row.投产总数量 - Sum
|
||||
}
|
||||
}
|
||||
},
|
||||
// 提交编辑
|
||||
submitEdit() {
|
||||
this.shijiancuo1 = Date.parse(this.form.startDate_F)
|
||||
this.shijiancuo = Date.parse(this.form.endDate_F)
|
||||
this.jieguo = this.shijiancuo1 - this.shijiancuo
|
||||
if (this.jieguo >= 0) {
|
||||
this.$message.error('加工结束时间应大于开始时间')
|
||||
} else {
|
||||
this.temp = null
|
||||
if (this.gongyirenwuzhuangtai === '1') {
|
||||
editList(this.gongyijihua, this.form.batchQuantity2, this.form.startDate_F, this.form.endDate_F).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.dialogFormVisible1 = false
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '信息更新成功!'
|
||||
})
|
||||
getTable1(this.midcode, this.pageList3, this.pageSize3).then(response => {
|
||||
this.total3 = parseInt(response.data.total)
|
||||
this.tableData1 = response.data.rows
|
||||
this.listLoading1 = false
|
||||
})
|
||||
this.total = 0
|
||||
this.pageSize = 10
|
||||
this.pageList = 1
|
||||
this.getTable()
|
||||
} else {
|
||||
this.dialogFormVisible1 = false
|
||||
this.$message.error('信息更新失败')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.dialogFormVisible1 = false
|
||||
this.$message.error('零件任务已经分配,无法更改')
|
||||
}
|
||||
this.shijiancuo1 = 0
|
||||
this.shijiancuo = 0
|
||||
this.jieguo = 0
|
||||
}
|
||||
},
|
||||
// 分批投产确定
|
||||
revisionBatch() {
|
||||
if (this.checked_waixie1 === false) {
|
||||
this.checked_waixie1 = 1
|
||||
} else {
|
||||
this.checked_waixie1 = 2
|
||||
}
|
||||
if (this.checked_zhaoji1 === false) {
|
||||
this.checked_zhaoji1 = 0
|
||||
} else {
|
||||
this.checked_zhaoji1 = 1
|
||||
}
|
||||
if (this.checked_gaonandu === false) {
|
||||
this.checked_gaonandu = 0
|
||||
} else {
|
||||
this.checked_gaonandu = 1
|
||||
}
|
||||
if (this.checked_baitu === false) {
|
||||
this.checked_baitu = 0
|
||||
} else {
|
||||
this.checked_baitu = 1
|
||||
}
|
||||
if (this.checked_dailiao === true) {
|
||||
this.checked_dailiao = 2
|
||||
} else {
|
||||
this.checked_dailiao = 1
|
||||
}
|
||||
this.shijiancuo1 = Date.parse(this.time_machiningStart)
|
||||
this.shijiancuo = Date.parse(this.form.endDate_F)
|
||||
this.jieguo = this.shijiancuo1 - this.shijiancuo
|
||||
if (this.jieguo >= 0) {
|
||||
this.$message.error('加工结束时间应大于开始时间')
|
||||
} else {
|
||||
this.temp = null
|
||||
this.listLoading = true
|
||||
revisionBatch(this.ComponentflowNumber, this.TypeflowNumber, this.dataType, this.form.productionBatch, this.form.batchQuantity, this.time_planStart, this.time_planFinish, this.time_gongyiStart, this.time_gongyiFinish, this.time_dingeStart, this.time_dingeFinish, this.time_planpinghengStart, this.time_planpinghengFinish, this.time_machiningStart, this.time_machiningFinish, this.time_planStart, this.checked_waixie1, this.checked_dailiao, this.id, this.MaterialflowNumber, this.radio, this.checked_gaonandu, this.checked_zhaoji1, this.checked_baitu).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.dialogFormVisible1 = false
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '分批投产成功!'
|
||||
})
|
||||
this.clearTable = this.total
|
||||
this.checked_baitu = false
|
||||
this.checked_gaonandu = false
|
||||
this.total = 0
|
||||
this.pageSize = 10
|
||||
this.pageList = 1
|
||||
this.shijiancuo1 = 0
|
||||
this.shijiancuo = 0
|
||||
this.checked_dailiao = 0
|
||||
this.jieguo = 0
|
||||
this.tableData = []
|
||||
getTable(this.NumValue, this.pageList, this.pageSize).then(response => {
|
||||
this.total = parseInt(response.data.total)
|
||||
for (let i = 0; i < response.data.rows.length; i++) {
|
||||
this.tableData.push({
|
||||
零件图号: response.data.rows[i].零件图号,
|
||||
零件名称: response.data.rows[i].零件名称,
|
||||
投产总数量: response.data.rows[i].投产总数量,
|
||||
最大投产批次: response.data.rows[i].最大投产批次,
|
||||
已投产数量: response.data.rows[i].已投产数量,
|
||||
未投产数量: response.data.rows[i].未投产数量,
|
||||
零件类型名称: response.data.rows[i].零件类型名称,
|
||||
组件零件基本件流水号: response.data.rows[i].组件零件基本件流水号,
|
||||
投产类型流水号: response.data.rows[i].投产类型流水号,
|
||||
数据类型: response.data.rows[i].数据类型,
|
||||
材料流水号: response.data.rows[i].材料流水号,
|
||||
checked_dailiao: false,
|
||||
checked_waixie: false,
|
||||
checked_zhaoji: false
|
||||
})
|
||||
}
|
||||
return this.total
|
||||
}).then((total) => {
|
||||
this.listLoading = false
|
||||
getTable1(this.midcode, this.pageList3, this.pageSize3).then(response => {
|
||||
const data = response.data.rows
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
data[i].批次数量 = parseInt(data[i].批次数量)
|
||||
}
|
||||
this.total3 = parseInt(response.data.total)
|
||||
if (this.clearTable === total) {
|
||||
this.tableData1 = data
|
||||
} else {
|
||||
this.tableData1 = []
|
||||
}
|
||||
this.listLoading1 = false
|
||||
})
|
||||
})
|
||||
} else {
|
||||
this.dialogFormVisible1 = false
|
||||
this.$message.error('分批投产失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
// 投产
|
||||
production() {
|
||||
this.result = 0
|
||||
if (this.time_machiningFinish === '' || this.time_machiningFinish === null) {
|
||||
this.$message.error('请输入加工结束时间')
|
||||
} else {
|
||||
this.shijiancuo1 = Date.parse(this.time_machiningStart)
|
||||
this.shijiancuo = Date.parse(this.time_machiningFinish)
|
||||
this.jieguo = this.shijiancuo1 - this.shijiancuo
|
||||
if (this.jieguo >= 0) {
|
||||
this.$message.error('加工结束时间应大于开始时间')
|
||||
} else {
|
||||
if (this.multipleSelection.length === 0) {
|
||||
this.$message.error('请至少选择一个零件')
|
||||
} else {
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) {
|
||||
if (this.multipleSelection[i].checked_waixie === false) {
|
||||
this.multipleSelection[i].checked_waixie = 1
|
||||
} else {
|
||||
this.multipleSelection[i].checked_waixie = 2
|
||||
}
|
||||
if (this.multipleSelection[i].checked_zhaoji === false) {
|
||||
this.multipleSelection[i].checked_zhaoji = 0
|
||||
} else {
|
||||
this.multipleSelection[i].checked_zhaoji = 1
|
||||
}
|
||||
if (this.multipleSelection[i].checked_dailiao === true) {
|
||||
this.multipleSelection[i].checked_dailiao = 2
|
||||
} else {
|
||||
this.multipleSelection[i].checked_dailiao = 1
|
||||
}
|
||||
if (this.checked_gaonandu === false) {
|
||||
this.checked_gaonandu = 0
|
||||
} else {
|
||||
this.checked_gaonandu = 1
|
||||
}
|
||||
if (this.checked_baitu === false) {
|
||||
this.checked_baitu = 0
|
||||
} else {
|
||||
this.checked_baitu = 1
|
||||
}
|
||||
production(this.multipleSelection[i].组件零件基本件流水号, this.multipleSelection[i].投产类型流水号, this.multipleSelection[i].数据类型, this.multipleSelection[i].投产总数量, this.time_planStart, this.time_planFinish, this.time_gongyiStart, this.time_gongyiFinish, this.time_dingeStart, this.time_dingeFinish, this.time_planpinghengStart, this.time_planpinghengFinish, this.time_machiningStart, this.time_machiningFinish, this.time_planStart, this.multipleSelection[i].checked_waixie, this.multipleSelection[i].checked_dailiao, this.id, this.multipleSelection[i].材料流水号, this.radio, this.checked_gaonandu, this.multipleSelection[i].checked_zhaoji, this.checked_baitu).then(response => {
|
||||
this.result += parseInt(response.data[0].result)
|
||||
if (this.result === this.multipleSelection.length) {
|
||||
this.$message.success('投产成功')
|
||||
this.total = 0
|
||||
this.pageSize = 10
|
||||
this.pageList = 1
|
||||
this.getTable()
|
||||
this.checked_baitu = false
|
||||
this.checked_gaonandu = false
|
||||
this.tableData1 = []
|
||||
} else if (response.data[0].result === '0') {
|
||||
this.$message.error('投产失败')
|
||||
}
|
||||
})
|
||||
this.shijiancuo1 = 0
|
||||
this.shijiancuo = 0
|
||||
this.jieguo = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// 打回档案
|
||||
handleDele(index, row, formName) {
|
||||
this.count2 = this.count2 + 1
|
||||
if (this.count2 !== 1) {
|
||||
this.$refs[formName].resetFields()
|
||||
}
|
||||
this.temp = 3
|
||||
this.liushuihao = row.组件零件基本件流水号
|
||||
this.form1.reason = ''
|
||||
this.dialogFormVisible2 = true
|
||||
},
|
||||
Dele() {
|
||||
dele(this.liushuihao, this.form1.reason, this.time_gongyiStart).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.dialogFormVisible2 = false
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '打回档案成功!'
|
||||
})
|
||||
this.total = 0
|
||||
this.pageSize = 10
|
||||
this.pageList = 1
|
||||
this.getTable()
|
||||
} else {
|
||||
this.dialogFormVisible2 = false
|
||||
this.$message.error('打回档案失败')
|
||||
}
|
||||
})
|
||||
},
|
||||
submit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.temp === 1) {
|
||||
this.revisionBatch()
|
||||
} else if (this.temp === 2) {
|
||||
this.submitEdit()
|
||||
// this.temp = null
|
||||
}
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 重置表单
|
||||
callOff(formName) {
|
||||
this.dialogFormVisible1 = false
|
||||
this.$refs[formName].resetFields()
|
||||
},
|
||||
submit1(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
this.Dele()
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 重置表单
|
||||
callOff1(formName) {
|
||||
this.dialogFormVisible2 = false
|
||||
this.$refs[formName].resetFields()
|
||||
},
|
||||
// 分页
|
||||
handleSizeChange(val) {
|
||||
this.pageSize = val
|
||||
this.getTable()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageList = val
|
||||
this.getTable()
|
||||
},
|
||||
handleSizeChange3(val) {
|
||||
this.pageSize3 = val
|
||||
this.getTable1()
|
||||
},
|
||||
handleCurrentChange3(val) {
|
||||
this.pageList3 = val
|
||||
this.getTable1()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-card{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.el-date-editor{
|
||||
width:150px
|
||||
}
|
||||
.el-select{
|
||||
width:200px
|
||||
}
|
||||
span{
|
||||
margin: 10px 0 10px 10px;
|
||||
}
|
||||
.time{
|
||||
width: 200px;
|
||||
}
|
||||
.Time>.el-form-item{
|
||||
margin:2px;
|
||||
/*margin-left: 120px;*/
|
||||
}
|
||||
</style>
|
||||
202
src/views/ManufacturingCenter/OwnTimeStatistics/index.vue
Normal file
202
src/views/ManufacturingCenter/OwnTimeStatistics/index.vue
Normal file
@@ -0,0 +1,202 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<el-row>
|
||||
<span>项目名称:</span>
|
||||
<el-select v-model="projectValue" size="small" filterable clearable placeholder="项目名称">
|
||||
<el-option
|
||||
v-for="item in project"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span>开始日期:</span>
|
||||
<el-date-picker
|
||||
v-model="date1"
|
||||
size="small"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
placeholder="选择日期"/>
|
||||
<span>结束日期:</span>
|
||||
<el-date-picker
|
||||
v-model="date2"
|
||||
size="small"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
placeholder="选择日期"/>
|
||||
<el-radio-group v-model="radio" size="small" style="margin: 10px;">
|
||||
<el-radio :label="1">天</el-radio>
|
||||
<el-radio :label="2">周</el-radio>
|
||||
<el-radio :label="3">月</el-radio>
|
||||
</el-radio-group>
|
||||
<el-button type="success" icon="el-icon-search" style="margin: 10px;" size="small" @click="search">查询</el-button>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<el-card v-loading="loading">
|
||||
<div id="myChart" :style="{width: '100%', height: '470px', margin: 'auto'}"/>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { initProject, searchData } from '@/api/ManufacturingCenter/OwnTimeStatistics'
|
||||
import echarts from 'echarts'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
projectValue: '',
|
||||
project: [],
|
||||
date1: '',
|
||||
date2: '',
|
||||
radio: 1,
|
||||
check1: 0,
|
||||
dataX: [],
|
||||
series: [],
|
||||
delayOkTime: [],
|
||||
planOkTime: [],
|
||||
preOkTime: [],
|
||||
noOkTime: [],
|
||||
totalTime: [],
|
||||
totalAblity: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
fetchData() {
|
||||
this.project = []
|
||||
initProject().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.project.push({
|
||||
label: response.data[i].项目名称,
|
||||
value: response.data[i].项目流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.loading = true
|
||||
var myChart = echarts.init(document.getElementById('myChart'))
|
||||
myChart.clear()
|
||||
if (this.projectValue === '' || this.projectValue === null) {
|
||||
this.check1 = 0
|
||||
} else {
|
||||
this.check1 = 1
|
||||
}
|
||||
if (this.date1 === '' || this.date1 === null || this.date2 === '' || this.date2 === null) {
|
||||
this.check2 = 0
|
||||
} else {
|
||||
this.check2 = 1
|
||||
}
|
||||
searchData(this.check1, this.projectValue, this.check2, this.date1, this.date2, this.radio).then(response => {
|
||||
console.log(response.data)
|
||||
if (response.data.length !== 0 && !response.data[0].hasOwnProperty('result')) {
|
||||
this.drawLine(response.data)
|
||||
} else {
|
||||
this.$message.warning('没有数据或数据量太大,请重新选择查询条件')
|
||||
this.loading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
drawLine(data) {
|
||||
this.dataX = []
|
||||
this.delayOkTime = []
|
||||
this.planOkTime = []
|
||||
this.preOkTime = []
|
||||
this.noOkTime = []
|
||||
this.totalTime = []
|
||||
this.totalAblity = []
|
||||
this.series = []
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
this.dataX.push(data[i].计划日期)
|
||||
this.delayOkTime.push(data[i].拖延完成工时)
|
||||
this.planOkTime.push(data[i].按计划完成工时)
|
||||
this.preOkTime.push(data[i].提前完成工时)
|
||||
this.noOkTime.push(data[i].未完成工时)
|
||||
this.totalTime.push(data[i].计划总工时)
|
||||
this.totalAblity.push(data[i].设备总能力)
|
||||
}
|
||||
var myChart = echarts.init(document.getElementById('myChart'))
|
||||
myChart.setOption({
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
data: ['提前完成工时', '按计划完成工时', '未完成工时', '拖延完成工时', '设备总能力']
|
||||
},
|
||||
dataZoom: { // 实现缩放功能
|
||||
show: true,
|
||||
realtime: true,
|
||||
start: 0,
|
||||
end: 100
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
name: '计划日期',
|
||||
data: this.dataX,
|
||||
axisLabel: {
|
||||
interval: 0,
|
||||
rotate: 0,
|
||||
margin: 10
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
name: '工时',
|
||||
min: 0,
|
||||
scale: 'true'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '提前完成工时',
|
||||
type: 'bar',
|
||||
// stack: '工时',
|
||||
data: this.preOkTime
|
||||
},
|
||||
{
|
||||
name: '按计划完成工时',
|
||||
type: 'bar',
|
||||
data: this.planOkTime
|
||||
},
|
||||
{
|
||||
name: '未完成工时',
|
||||
type: 'bar',
|
||||
data: this.noOkTime
|
||||
},
|
||||
{
|
||||
name: '拖延完成工时',
|
||||
type: 'bar',
|
||||
data: this.delayOkTime
|
||||
},
|
||||
{
|
||||
name: '设备总能力',
|
||||
type: 'bar',
|
||||
data: this.totalAblity
|
||||
}
|
||||
]
|
||||
})
|
||||
this.loading = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-card{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.el-date-editor{
|
||||
width:200px
|
||||
}
|
||||
span{
|
||||
margin: 10px 0 10px 10px;
|
||||
}
|
||||
</style>
|
||||
773
src/views/ManufacturingCenter/PartAssignment/index.vue
Normal file
773
src/views/ManufacturingCenter/PartAssignment/index.vue
Normal file
@@ -0,0 +1,773 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<el-row>
|
||||
<span>项目名称:</span>
|
||||
<el-select v-model="projectValue" filterable clearable size="small" placeholder="项目名称" @change="projectChange">
|
||||
<el-option
|
||||
v-for="item in project"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span>机床编号:</span>
|
||||
<el-select v-model="machineNumberValue" placeholder="机床编号" size="small" clearable @change="machineChange">
|
||||
<el-option
|
||||
v-for="item in machineNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span>组号:</span>
|
||||
<el-select v-model="groupNumberValue" placeholder="组号" size="small" clearable>
|
||||
<el-option
|
||||
v-for="item in groupNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 15px" @click="searchTable()">查询</el-button>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<el-table :data="tableData" border size="mini" highlight-current-row style="width: 100%;margin-top: 15px" height="250px" @row-click="searchPart">
|
||||
<el-table-column label="项目名称" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.项目名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="机床编号" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机床图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="机床名称" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机床名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="组号" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.组号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="组件名称" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.组件名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--<div class="block" style="margin-top: 10px;">-->
|
||||
<!--<el-pagination-->
|
||||
<!--@size-change="handleSizeChange"-->
|
||||
<!--@current-change="handleCurrentChange"-->
|
||||
<!--:current-page="pageCurrent"-->
|
||||
<!--:page-sizes="[10, 20, 30, 40, 50]"-->
|
||||
<!--:page-size="pageSize"-->
|
||||
<!--layout="total, sizes, prev, pager, next, jumper"-->
|
||||
<!--:total="total">-->
|
||||
<!--</el-pagination>-->
|
||||
<!--</div>-->
|
||||
</el-card>
|
||||
<el-card>
|
||||
<el-tabs type="border-card" @tab-click="selectPart">
|
||||
<el-tab-pane label="基本件">
|
||||
<el-table :data="tableData1" border size="mini" style="width: 100%" height="300px" @selection-change="handleSelectionChange">
|
||||
<el-table-column align="center" width="50" type="selection"/>
|
||||
<el-table-column label="物料名称" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物料规格" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料规格 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物料型号" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料型号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件数量" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="库存量" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.库存量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.备注 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="外购件">
|
||||
<el-table :data="tableData2" border size="mini" style="width: 100%" height="300px" @selection-change="handleSelectionChange">
|
||||
<el-table-column align="center" width="50" type="selection"/>
|
||||
<el-table-column label="物料名称" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物料规格" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料规格 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物料型号" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料型号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件数量" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="库存量" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.库存量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.备注 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="标准件">
|
||||
<el-table :data="tableData3" border size="mini" style="width: 100%" height="300px" @selection-change="handleSelectionChange">
|
||||
<el-table-column align="center" width="50" type="selection"/>
|
||||
<el-table-column label="物料名称" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物料规格" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料规格 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物料型号" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料型号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件数量" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="库存量" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.库存量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.备注 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<span>物料计划到货时间:</span>
|
||||
<el-date-picker
|
||||
v-model="time"
|
||||
size="small"
|
||||
type="date"
|
||||
format="yyyy-MM-dd"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择日期"/>
|
||||
<el-button type="success" size="small" icon="el-icon-star-off" style="margin-top: 15px; margin-left: 15px" @click="purchaseRequisition()">车间请购</el-button>
|
||||
<el-button type="primary" size="small" icon="el-icon-star-off" style="margin-top: 15px; margin-left: 15px" @click="PurchasingDepartment()">采购部门采购</el-button>
|
||||
<el-button type="warning" size="small" icon="el-icon-star-off" style="margin-top: 15px; margin-left: 15px" @click="Production()">车间生产</el-button>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<el-row>
|
||||
<span>请购单号:</span>
|
||||
<el-input v-model="PurchaseOrder" size="small" style="width: 200px" placeholder="请购单号" clearable/>
|
||||
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 15px" @click="searchTable1()">查询</el-button>
|
||||
<el-button type="primary" size="small" icon="el-icon-circle-plus-outline" style="margin-left: 15px" @click="handleAdd()">创建</el-button>
|
||||
<el-button type="warning" size="small" icon="el-icon-download">导出Excel</el-button>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<el-table :data="tableData4" border size="mini" style="width: 100%" height="200px" highlight-current-row @row-click="searchDetailed">
|
||||
<el-table-column label="请购单号" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.请购单编号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="请购车间" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.请购车间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="请购人" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.请购人 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="请购时间" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.请购时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="250px" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" icon="el-icon-edit" @click="handleEdit(scope.row)">编辑</el-button>
|
||||
<el-button type="danger" size="mini" icon="el-icon-delete" style="margin-left: 15px" @click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<el-table :data="tableData5" border size="mini" style="width: 100%" height="300px">
|
||||
<el-table-column label="物料名称" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物料规格" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料规格 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物料型号" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料型号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件数量" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件类型" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件类型 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物料计划到货时间" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料计划到货时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="项目名称" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.项目名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="机床编号" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机床图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="组号" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.组号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="250px" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="danger" size="mini" icon="el-icon-delete" @click="MoveOut(scope.row)">移出</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<el-dialog :title="title" :visible.sync="dialogFormVisible" center style="min-height: 300px" width="400px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="110px" class="demo-ruleForm">
|
||||
<el-form-item label="请购单编号" prop="请购单编号">
|
||||
<el-input
|
||||
v-model="form.请购单编号"
|
||||
size="small"
|
||||
style="width:200px"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="请购车间" prop="请购车间">
|
||||
<el-input
|
||||
v-model="form.请购车间"
|
||||
size="small"
|
||||
style="width:200px"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="请购人" prop="请购人">
|
||||
<el-input
|
||||
v-model="name"
|
||||
size="small"
|
||||
readonly
|
||||
style="width:200px"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="请购时间" prop="请购时间">
|
||||
<el-date-picker
|
||||
v-model="form.请购时间"
|
||||
size="small"
|
||||
type="date"
|
||||
format="yyyy-MM-dd"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择日期"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="cancel('form')">取消</el-button>
|
||||
<el-button v-show="title==='增加'" type="primary" @click="submitAdd('form')">确定</el-button>
|
||||
<el-button v-show="title==='编辑'" type="primary" @click="submitEdit('form')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { initProject, searchmachine, searchgroup, searchTable, searchPart, searchPart1, searchTable1, addData, editData, deleteData, searchDetailed, purchaseRequisition, purchaseRequisition1, MoveOut, MoveOut1, PurchasingDepartment, Production } from '@/api/ManufacturingCenter/PartAssignment'
|
||||
import { mapGetters } from 'vuex'
|
||||
export default {
|
||||
inject: ['reload'],
|
||||
data() {
|
||||
return {
|
||||
projectValue: '',
|
||||
projectFloatValue: '',
|
||||
project: [],
|
||||
machineNumberValue: '',
|
||||
machineFloatValue: '',
|
||||
machineNumber: [],
|
||||
machineName: '',
|
||||
groupNumberValue: '',
|
||||
groupFloatValue: '',
|
||||
groupNumber: [],
|
||||
PurchaseOrder: '',
|
||||
PartType: '基本件',
|
||||
tableData: [],
|
||||
tableData1: [],
|
||||
tableData2: [],
|
||||
tableData3: [],
|
||||
tableData4: [],
|
||||
tableData5: [],
|
||||
loading: false,
|
||||
title: '',
|
||||
dialogFormVisible: false,
|
||||
RequisitionList: '',
|
||||
form: {
|
||||
请购单编号: '',
|
||||
请购车间: '',
|
||||
请购时间: ''
|
||||
},
|
||||
rules: {
|
||||
请购单编号: [{ required: true, message: '请输入请购单编号', trigger: 'blur' }],
|
||||
请购车间: [{ required: true, message: '请输入请购车间', trigger: 'blur' }],
|
||||
请购时间: [{ required: true, message: '请选择请购时间', trigger: 'change' }]
|
||||
},
|
||||
BasicPartsNumber: [],
|
||||
StandardPartsAndOutsourcing: [],
|
||||
MaterialNum: [],
|
||||
MaterialName: [],
|
||||
MaterialSpecification: [],
|
||||
MaterialModel: [],
|
||||
NumberOfParts: [],
|
||||
projectName: '',
|
||||
MachineToolNumber: '',
|
||||
groupName: '',
|
||||
time: '',
|
||||
result: 0,
|
||||
pageSize: '',
|
||||
pageCurrent: '',
|
||||
total: '',
|
||||
check: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'sidebar',
|
||||
'avatar',
|
||||
'name',
|
||||
'id'
|
||||
])
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
fetchData() {
|
||||
this.getSelect(initProject, ['项目名称', '项目流水号'], 'project')
|
||||
},
|
||||
projectChange() {
|
||||
this.machineNumberValue = ''
|
||||
this.machineNumber = []
|
||||
this.groupNumberValue = ''
|
||||
this.groupNumber = []
|
||||
if (this.projectValue !== '') {
|
||||
this.check = 1
|
||||
searchmachine(this.projectValue, this.check).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.machineNumber.push({
|
||||
label: response.data[i].机床图号,
|
||||
value: response.data[i].机床流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.check = 0
|
||||
}
|
||||
},
|
||||
machineChange() {
|
||||
this.groupNumberValue = ''
|
||||
this.groupNumber = []
|
||||
searchgroup(this.machineNumberValue).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.groupNumber.push({
|
||||
label: response.data[i].组号,
|
||||
value: response.data[i].组件流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
searchTable() {
|
||||
this.loading = true
|
||||
if (this.projectValue !== '') {
|
||||
this.check1 = 1
|
||||
} else { this.check1 = 0 }
|
||||
if (this.machineNumberValue !== '') {
|
||||
this.check2 = 1
|
||||
} else { this.check2 = 0 }
|
||||
if (this.groupNumberValue !== '') {
|
||||
this.check3 = 1
|
||||
} else { this.check3 = 0 }
|
||||
searchTable(this.projectValue, this.check1, this.machineNumberValue, this.check2, this.groupNumberValue, this.check3).then(response => {
|
||||
this.tableData = response.data
|
||||
this.tableData1 = []
|
||||
this.tableData2 = []
|
||||
this.tableData3 = []
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
selectPart(val) {
|
||||
this.PartType = val.label
|
||||
if (this.PartType === '基本件') {
|
||||
searchPart(this.groupFloatValue).then(response => {
|
||||
this.tableData1 = response.data
|
||||
})
|
||||
} else if (this.PartType === '外购件') {
|
||||
searchPart1(this.groupFloatValue, 1).then(response => {
|
||||
this.tableData2 = response.data
|
||||
})
|
||||
} else if (this.PartType === '标准件') {
|
||||
searchPart1(this.groupFloatValue, 2).then(response => {
|
||||
this.tableData3 = response.data
|
||||
})
|
||||
}
|
||||
},
|
||||
searchPart(row) {
|
||||
this.tableData1 = []
|
||||
this.tableData2 = []
|
||||
this.tableData3 = []
|
||||
this.projectName = row.项目名称
|
||||
this.projectFloatValue = row.项目流水号
|
||||
this.MachineToolNumber = row.机床图号
|
||||
this.machineFloatValue = row.机床流水号
|
||||
this.groupName = row.组号
|
||||
this.groupFloatValue = row.组件流水号
|
||||
if (this.PartType === '基本件') {
|
||||
searchPart(row.组件流水号).then(response => {
|
||||
this.tableData1 = response.data
|
||||
})
|
||||
} else if (this.PartType === '外购件') {
|
||||
searchPart1(row.组件流水号, 1).then(response => {
|
||||
this.tableData2 = response.data
|
||||
})
|
||||
} else if (this.PartType === '标准件') {
|
||||
searchPart1(row.组件流水号, 2).then(response => {
|
||||
this.tableData3 = response.data
|
||||
})
|
||||
}
|
||||
},
|
||||
searchTable1() {
|
||||
if (this.PurchaseOrder !== '') {
|
||||
this.check4 = 1
|
||||
} else {
|
||||
this.check4 = 0
|
||||
}
|
||||
searchTable1(this.PurchaseOrder, this.check4).then(response => {
|
||||
this.tableData4 = response.data
|
||||
})
|
||||
},
|
||||
handleAdd() {
|
||||
this.addForm('form', [this.dialogFormVisible = true, this.title = '增加'])
|
||||
},
|
||||
submitAdd(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
addData(this.form.请购单编号, this.form.请购车间, this.name, this.id, this.form.请购时间).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('增加成功')
|
||||
this.dialogFormVisible = false
|
||||
this.tableData5 = []
|
||||
this.searchTable1()
|
||||
} else { this.$message.error('增加失败') }
|
||||
})
|
||||
} else {
|
||||
console.log('error submit!!')
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
handleEdit(row) { // 弹出单据编辑
|
||||
if (this.$refs['form'] !== undefined) {
|
||||
this.$refs['form'].resetFields()
|
||||
}
|
||||
this.title = '编辑'
|
||||
this.dialogFormVisible = true
|
||||
this.RequisitionList = row.请购单流水号
|
||||
this.form.请购单编号 = row.请购单编号
|
||||
this.form.请购车间 = row.请购车间
|
||||
this.form.请购时间 = row.请购时间
|
||||
},
|
||||
submitEdit(formName) { // 提交单据编辑
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
console.log(this.form.请购时间)
|
||||
editData(this.RequisitionList, this.form.请购单编号, this.form.请购车间, this.form.请购时间).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('编辑成功')
|
||||
this.dialogFormVisible = false
|
||||
this.tableData5 = []
|
||||
this.searchTable1()
|
||||
} else { this.$message.error('编辑失败') }
|
||||
})
|
||||
} else {
|
||||
console.log('error submit!!')
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
handleDelete(row) { // 删除单据
|
||||
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteData(row.请购单流水号).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('删除成功')
|
||||
this.tableData5 = []
|
||||
this.searchTable1()
|
||||
} else { this.$message.error('删除失败') }
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
},
|
||||
cancel(formName) {
|
||||
this.form = {}
|
||||
this.dialogFormVisible = false
|
||||
this.$refs[formName].resetFields()
|
||||
},
|
||||
searchDetailed(row) {
|
||||
this.RequisitionList = row.请购单流水号
|
||||
searchDetailed(row.请购单流水号).then(response => {
|
||||
this.tableData5 = response.data
|
||||
})
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
console.log(val)
|
||||
if (this.PartType === '基本件') {
|
||||
this.BasicPartsNumber = []
|
||||
this.MaterialName = []
|
||||
this.MaterialSpecification = []
|
||||
this.MaterialModel = []
|
||||
this.NumberOfParts = []
|
||||
for (let i = 0; i < val.length; i++) {
|
||||
this.MaterialNum[i] = val[i].物料流水号
|
||||
this.BasicPartsNumber[i] = val[i].基本件流水号
|
||||
this.MaterialName[i] = val[i].零件名称
|
||||
this.NumberOfParts[i] = val[i].零件数量
|
||||
}
|
||||
} else if (this.PartType === '外购件') {
|
||||
this.StandardPartsAndOutsourcing = []
|
||||
this.MaterialName = []
|
||||
this.MaterialSpecification = []
|
||||
this.MaterialModel = []
|
||||
this.NumberOfParts = []
|
||||
for (let i = 0; i < val.length; i++) {
|
||||
this.StandardPartsAndOutsourcing[i] = val[i].标准件和外购件流水号
|
||||
this.MaterialNum[i] = val[i].物料流水号
|
||||
this.MaterialName[i] = val[i].物料名称
|
||||
this.MaterialSpecification[i] = val[i].物料规格
|
||||
this.MaterialModel[i] = val[i].物料型号
|
||||
this.NumberOfParts[i] = val[i].零件数量
|
||||
}
|
||||
} else if (this.PartType === '标准件') {
|
||||
this.StandardPartsAndOutsourcing = []
|
||||
for (let i = 0; i < val.length; i++) {
|
||||
this.StandardPartsAndOutsourcing[i] = val[i].标准件和外购件流水号
|
||||
this.MaterialNum[i] = val[i].物料流水号
|
||||
this.MaterialName[i] = val[i].物料名称
|
||||
this.MaterialSpecification[i] = val[i].物料规格
|
||||
this.MaterialModel[i] = val[i].物料型号
|
||||
this.NumberOfParts[i] = val[i].零件数量
|
||||
}
|
||||
}
|
||||
},
|
||||
purchaseRequisition() {
|
||||
if (this.RequisitionList !== '') {
|
||||
if (this.time !== '') {
|
||||
this.result = 0
|
||||
if (this.PartType === '基本件') {
|
||||
for (let i = 0; i < this.BasicPartsNumber.length; i++) {
|
||||
purchaseRequisition(this.RequisitionList, this.projectName, this.projectFloatValue, this.MachineToolNumber, this.machineFloatValue, this.groupName, this.groupFloatValue, this.BasicPartsNumber[i], this.MaterialName[i], this.NumberOfParts[i], this.PartType, this.time, this.MaterialNum[i]).then(response => {
|
||||
this.result += parseInt(response.data[0].result)
|
||||
if (this.result === this.BasicPartsNumber.length) {
|
||||
this.$message.success('请购成功')
|
||||
searchPart(this.groupFloatValue).then(response => {
|
||||
this.tableData1 = response.data
|
||||
})
|
||||
searchDetailed(this.RequisitionList).then(response => {
|
||||
this.tableData5 = response.data
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
} else if (this.PartType === '外购件') {
|
||||
for (let i = 0; i < this.StandardPartsAndOutsourcing.length; i++) {
|
||||
purchaseRequisition1(this.RequisitionList, this.projectName, this.projectFloatValue, this.MachineToolNumber, this.machineFloatValue, this.groupName, this.groupFloatValue, this.StandardPartsAndOutsourcing[i], this.MaterialName[i], this.MaterialSpecification[i], this.MaterialModel[i], this.NumberOfParts[i], this.PartType, this.time, this.MaterialNum[i]).then(response => {
|
||||
this.result += parseInt(response.data[0].result)
|
||||
if (this.result === this.StandardPartsAndOutsourcing.length) {
|
||||
this.$message.success('请购成功')
|
||||
searchPart1(this.groupFloatValue, 1).then(response => {
|
||||
this.tableData2 = response.data
|
||||
})
|
||||
searchDetailed(this.RequisitionList).then(response => {
|
||||
this.tableData5 = response.data
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
} else if (this.PartType === '标准件') {
|
||||
for (let i = 0; i < this.StandardPartsAndOutsourcing.length; i++) {
|
||||
purchaseRequisition1(this.RequisitionList, this.projectName, this.projectFloatValue, this.MachineToolNumber, this.machineFloatValue, this.groupName, this.groupFloatValue, this.StandardPartsAndOutsourcing[i], this.MaterialName[i], this.MaterialSpecification[i], this.MaterialModel[i], this.NumberOfParts[i], this.PartType, this.time, this.MaterialNum[i]).then(response => {
|
||||
this.result += parseInt(response.data[0].result)
|
||||
if (this.result === this.StandardPartsAndOutsourcing.length) {
|
||||
this.$message.success('请购成功')
|
||||
searchPart1(this.groupFloatValue, 2).then(response => {
|
||||
this.tableData3 = response.data
|
||||
})
|
||||
searchDetailed(this.RequisitionList).then(response => {
|
||||
this.tableData5 = response.data
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.$message.warning('请选择计划到货时间')
|
||||
}
|
||||
} else {
|
||||
this.$message.warning('请先选择请购单')
|
||||
}
|
||||
},
|
||||
PurchasingDepartment() {
|
||||
if (this.time !== '') {
|
||||
for (let i = 0; i < this.StandardPartsAndOutsourcing.length; i++) {
|
||||
PurchasingDepartment(this.groupFloatValue, this.StandardPartsAndOutsourcing[i], this.time, this.MaterialNum[i], this.NumberOfParts[i], this.projectFloatValue, this.machineFloatValue).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('请购成功')
|
||||
if (this.PartType === '外购件') {
|
||||
searchPart1(this.groupFloatValue, 1).then(response => {
|
||||
this.tableData2 = response.data
|
||||
})
|
||||
} else {
|
||||
searchPart1(this.groupFloatValue, 2).then(response => {
|
||||
this.tableData3 = response.data
|
||||
})
|
||||
}
|
||||
} else { this.$message.error('请购失败') }
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.$message.warning('请选择计划到货时间')
|
||||
}
|
||||
},
|
||||
Production() {
|
||||
if (this.PartType === '基本件' && this.BasicPartsNumber.length !== 0) {
|
||||
for (let i = 0; i < this.BasicPartsNumber.length; i++) {
|
||||
Production(this.groupFloatValue, this.BasicPartsNumber[i], this.projectFloatValue, this.machineFloatValue).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('投产成功')
|
||||
searchPart(this.groupFloatValue).then(response => {
|
||||
this.tableData1 = response.data
|
||||
})
|
||||
} else {
|
||||
this.$message.error('投产失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.$message.warning('请选择基本件')
|
||||
}
|
||||
},
|
||||
MoveOut(row) {
|
||||
this.$confirm('此操作将该物料移出, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
if (row.零件类型 === '基本件') {
|
||||
MoveOut(row.请购单明细流水号, row.基本件流水号).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('移出成功')
|
||||
searchPart(this.groupFloatValue).then(response => {
|
||||
this.tableData1 = response.data
|
||||
})
|
||||
} else { this.$message.error('移出失败') }
|
||||
})
|
||||
} else if (row.零件类型 === '外购件') {
|
||||
MoveOut1(row.请购单明细流水号, row.标准件和外购件流水号).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('移出成功')
|
||||
searchPart1(this.groupFloatValue, 1).then(response => {
|
||||
this.tableData2 = response.data
|
||||
})
|
||||
} else { this.$message.error('移出失败') }
|
||||
})
|
||||
} else if (row.零件类型 === '标准件') {
|
||||
MoveOut1(row.请购单明细流水号, row.标准件和外购件流水号).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('移出成功')
|
||||
searchPart1(this.groupFloatValue, 2).then(response => {
|
||||
this.tableData3 = response.data
|
||||
})
|
||||
} else { this.$message.error('移出失败') }
|
||||
})
|
||||
}
|
||||
searchDetailed(this.RequisitionList).then(response => {
|
||||
this.tableData5 = response.data
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消移出'
|
||||
})
|
||||
})
|
||||
},
|
||||
handleSizeChange(val) {},
|
||||
handleCurrentChange(val) {}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
span{
|
||||
margin: 10px 0px 10px 10px;
|
||||
}
|
||||
</style>
|
||||
721
src/views/ManufacturingCenter/PartWorkCraftSelect_rdlc/index.vue
Normal file
721
src/views/ManufacturingCenter/PartWorkCraftSelect_rdlc/index.vue
Normal file
@@ -0,0 +1,721 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<span>零件号:</span>
|
||||
<el-input v-model="PrNum" size="small" placeholder="零件号" clearable style="width: 200px"/>
|
||||
<el-button type="success" size="small" style="margin-left: 10px" icon="el-icon-search" @click="pageCurrent=1;pageSize=10;total=0;searchData()">查询</el-button>
|
||||
<el-button type="primary" size="small" style="margin-left: 10px" icon="el-icon-download" @click="downLoadCjn('cjn')">导出工艺定额卡</el-button>
|
||||
<el-button type="primary" size="small" style="margin-left: 10px" icon="el-icon-download" @click="downLoadCjn1('cjn1')">导出加工路线单</el-button>
|
||||
|
||||
</el-card>
|
||||
<el-card>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
style="max-height: 300px"
|
||||
height="300px"
|
||||
border
|
||||
highlight-current-row
|
||||
@row-click="click">
|
||||
<el-table-column label="零件图号" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件名称" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件投产数量" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.投产总数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[5, 10, 20]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<table id="cjn" style="width: 975px;" border="2px" cellspacing="0px" align="center">
|
||||
<thead>
|
||||
<tr height="25px">
|
||||
<td colspan="4" rowspan="2" style="text-align:center;font-size: 30px;font-weight: bold">GAOJING</td>
|
||||
<td rowspan="4" style="font-size: 30px;font-weight: bold;width: 210px">工艺、定额卡</td>
|
||||
<td>零件图号</td>
|
||||
<td colspan="3">{{ 零件图号 }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>零件名称</td>
|
||||
<td>{{ 零件名称 }}</td>
|
||||
<td>数量</td>
|
||||
<td>{{ 投产数量 }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4" style="text-align:center;">江苏高精机电装备有限公司</td>
|
||||
<td colspan="2">材料</td>
|
||||
<td colspan="2">原材料规格</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>机床号</td>
|
||||
<td>{{ 机床号 }}</td>
|
||||
<td>组号</td>
|
||||
<td>{{ 组号 }}</td>
|
||||
<td colspan="2">{{ 材料 }}</td>
|
||||
<td colspan="2">{{ 原材料规格 }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="2" style="text-align:center;">序次</td>
|
||||
<td rowspan="2" colspan="2" style="text-align:center;">工艺名称</td>
|
||||
<td rowspan="2" colspan="4" style="text-align:center;width: 550px">工艺要求</td>
|
||||
<td colspan="2" style="text-align:center;">定额工时</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:center;">单件</td>
|
||||
<td style="text-align:center;">准结</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr id="1">
|
||||
<td>1</td>
|
||||
<td colspan="2"/>
|
||||
<td colspan="4" style="text-align:left;"/>
|
||||
<td/>
|
||||
<td/>
|
||||
</tr>
|
||||
<tr id="2">
|
||||
<td>2</td>
|
||||
<td colspan="2"/>
|
||||
<td colspan="4" style="text-align:left;"/>
|
||||
<td/>
|
||||
<td/>
|
||||
</tr>
|
||||
<tr id="3">
|
||||
<td>3</td>
|
||||
<td colspan="2"/>
|
||||
<td colspan="4" style="text-align:left;"/>
|
||||
<td/>
|
||||
<td/>
|
||||
</tr>
|
||||
<tr id="4">
|
||||
<td>4</td>
|
||||
<td colspan="2"/>
|
||||
<td colspan="4" style="text-align:left;"/>
|
||||
<td/>
|
||||
<td/>
|
||||
</tr>
|
||||
<tr id="5">
|
||||
<td>5</td>
|
||||
<td colspan="2"/>
|
||||
<td colspan="4" style="text-align:left;"/>
|
||||
<td/>
|
||||
<td/>
|
||||
</tr>
|
||||
<tr id="6">
|
||||
<td>6</td>
|
||||
<td colspan="2"/>
|
||||
<td colspan="4" style="text-align:left;"/>
|
||||
<td/>
|
||||
<td/>
|
||||
</tr>
|
||||
<tr id="7">
|
||||
<td>7</td>
|
||||
<td colspan="2"/>
|
||||
<td colspan="4" style="text-align:left;"/>
|
||||
<td/>
|
||||
<td/>
|
||||
</tr>
|
||||
<tr id="8">
|
||||
<td>8</td>
|
||||
<td colspan="2"/>
|
||||
<td colspan="4" style="text-align:left;"/>
|
||||
<td/>
|
||||
<td/>
|
||||
</tr>
|
||||
<tr id="9">
|
||||
<td>9</td>
|
||||
<td colspan="2"/>
|
||||
<td colspan="4" style="text-align:left;"/>
|
||||
<td/>
|
||||
<td/>
|
||||
</tr>
|
||||
<tr id="10">
|
||||
<td>10</td>
|
||||
<td colspan="2"/>
|
||||
<td colspan="4" style="text-align:left;"/>
|
||||
<td/>
|
||||
<td/>
|
||||
</tr>
|
||||
<tr id="11">
|
||||
<td>11</td>
|
||||
<td colspan="2"/>
|
||||
<td colspan="4" style="text-align:left;"/>
|
||||
<td/>
|
||||
<td/>
|
||||
</tr>
|
||||
<tr id="12">
|
||||
<td>12</td>
|
||||
<td colspan="2"/>
|
||||
<td colspan="4" style="text-align:left;"/>
|
||||
<td/>
|
||||
<td/>
|
||||
</tr>
|
||||
<tr id="13">
|
||||
<td>13</td>
|
||||
<td colspan="2"/>
|
||||
<td colspan="4" style="text-align:left;"/>
|
||||
<td/>
|
||||
<td/>
|
||||
</tr>
|
||||
<tr id="14">
|
||||
<td>14</td>
|
||||
<td colspan="2"/>
|
||||
<td colspan="4" style="text-align:left;"/>
|
||||
<td/>
|
||||
<td/>
|
||||
</tr>
|
||||
<tr id="15">
|
||||
<td>15</td>
|
||||
<td colspan="2"/>
|
||||
<td colspan="4" style="text-align:left;"/>
|
||||
<td/>
|
||||
<td/>
|
||||
</tr>
|
||||
<tr id="16">
|
||||
<td>16</td>
|
||||
<td colspan="2"/>
|
||||
<td colspan="4" style="text-align:left;"/>
|
||||
<td/>
|
||||
<td/>
|
||||
</tr>
|
||||
<tr id="17">
|
||||
<td>17</td>
|
||||
<td colspan="2"/>
|
||||
<td colspan="4" style="text-align:left;"/>
|
||||
<td/>
|
||||
<td/>
|
||||
</tr>
|
||||
<tr id="18">
|
||||
<td>18</td>
|
||||
<td colspan="2"/>
|
||||
<td colspan="4" style="text-align:left;"/>
|
||||
<td/>
|
||||
<td/>
|
||||
</tr>
|
||||
<tr id="19">
|
||||
<td>19</td>
|
||||
<td colspan="2"/>
|
||||
<td colspan="4" style="text-align:left;"/>
|
||||
<td/>
|
||||
<td/>
|
||||
</tr>
|
||||
<tr id="20">
|
||||
<td>20</td>
|
||||
<td colspan="2"/>
|
||||
<td colspan="4" style="text-align:left;"/>
|
||||
<td/>
|
||||
<td/>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td>工艺员:</td>
|
||||
<td colspan="2">{{ 工艺员 }}</td>
|
||||
<td>定额员:</td>
|
||||
<td>{{ 定额员 }}</td>
|
||||
<td>日期:</td>
|
||||
<td colspan="3">{{ 日期 }}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<table id="cjn1" style="width: 800px;" border="2px" cellspacing="0px" align="center">
|
||||
<thead>
|
||||
<tr height="60px">
|
||||
<td colspan="6" style="text-align:center;width: 33%">江苏高精机电<br>装备有限公司</td>
|
||||
<td colspan="6" style="font-size: 30px;font-weight: bold;text-align:center;width: 34%">零件加工路线单</td>
|
||||
<td colspan="6" style="text-align:center;width: 33%">毛 坯 别 <br> 铸 锻 铆 锯 材</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" style="text-align:center">材料</td>
|
||||
<td colspan="4" style="text-align:center">{{ 材料 }}</td>
|
||||
<td colspan="3" style="text-align:center;width: 17%">材料规格</td>
|
||||
<td colspan="9" style="text-align:center">{{ 原材料规格 }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4" style="text-align:center">机床号</td>
|
||||
<td colspan="4" style="text-align:center">组号</td>
|
||||
<td colspan="6" style="text-align:center">零件图号</td>
|
||||
<td colspan="3" style="text-align:center">零件名称</td>
|
||||
<td style="text-align:center">数量</td>
|
||||
</tr>
|
||||
<tr height="80px">
|
||||
<td colspan="4" style="text-align:center">{{ 机床号 }}</td>
|
||||
<td colspan="4" style="text-align:center">{{ 组号 }}</td>
|
||||
<td colspan="6" style="text-align:center">{{ 零件图号 }}</td>
|
||||
<td colspan="3" style="text-align:center">{{ 零件名称 }}</td>
|
||||
<td style="text-align:center">{{ 投产数量 }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4" style="text-align:center">工序</td>
|
||||
<td colspan="2" style="text-align:center">工时定额</td>
|
||||
<td colspan="3" rowspan="3" style="text-align:center">工作者<br>(设备)</td>
|
||||
<td colspan="4" style="text-align:center">检查结果</td>
|
||||
<td colspan="2" rowspan="3" style="text-align:center">检章</td>
|
||||
<td colspan="2" rowspan="3" style="text-align:center">计划完成日期</td>
|
||||
<td rowspan="3" style="text-align:center">月/日</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="2" style="text-align:center">次序</td>
|
||||
<td colspan="3" rowspan="2" style="text-align:center;width: 15%">名称</td>
|
||||
<td rowspan="2" style="text-align:center">单件</td>
|
||||
<td rowspan="2" style="text-align:center">准结</td>
|
||||
<td rowspan="2" style="text-align:center">合格</td>
|
||||
<td rowspan="2" style="text-align:center">回用</td>
|
||||
<td colspan="2" style="text-align:center">废品</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:center;width: 5%">工</td>
|
||||
<td style="text-align:center;width: 5%">料</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr id="21">
|
||||
<td style="text-align:center">1</td>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
</tr>
|
||||
<tr id="22">
|
||||
<td style="text-align:center">2</td>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
</tr>
|
||||
<tr id="23">
|
||||
<td style="text-align:center">3</td>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
</tr>
|
||||
<tr id="24">
|
||||
<td style="text-align:center">4</td>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
</tr>
|
||||
<tr id="25">
|
||||
<td style="text-align:center">5</td>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
</tr>
|
||||
<tr id="26">
|
||||
<td style="text-align:center">6</td>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
</tr>
|
||||
<tr id="27">
|
||||
<td style="text-align:center">7</td>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
</tr>
|
||||
<tr id="28">
|
||||
<td style="text-align:center">8</td>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
</tr>
|
||||
<tr id="29">
|
||||
<td style="text-align:center">9</td>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
</tr>
|
||||
<tr id="30">
|
||||
<td style="text-align:center">10</td>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
</tr>
|
||||
<tr id="31">
|
||||
<td style="text-align:center">11</td>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
</tr>
|
||||
<tr id="32">
|
||||
<td style="text-align:center">12</td>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
</tr>
|
||||
<tr id="33">
|
||||
<td style="text-align:center">13</td>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
</tr>
|
||||
<tr id="34">
|
||||
<td style="text-align:center">14</td>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
</tr>
|
||||
<tr id="35">
|
||||
<td style="text-align:center">15</td>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
</tr>
|
||||
<tr id="36">
|
||||
<td style="text-align:center">16</td>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
</tr>
|
||||
<tr id="37">
|
||||
<td style="text-align:center">17</td>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
</tr>
|
||||
<tr id="38">
|
||||
<td style="text-align:center">18</td>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
</tr>
|
||||
<tr id="39">
|
||||
<td style="text-align:center">19</td>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
</tr>
|
||||
<tr id="40">
|
||||
<td style="text-align:center">20</td>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="3" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td colspan="2" style="text-align:center"/>
|
||||
<td style="text-align:center"/>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { search, searchtable1, searchtable2 } from '@/api/ManufacturingCenter/PartWorkCraftSelect_rdlc'
|
||||
import { getExplorer, method5, Cleanup } from '@/vendor/exportExcel'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
cell: [],
|
||||
pageCurrent: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
tableData: [],
|
||||
loading: false,
|
||||
PrNum: '027W191482-0001',
|
||||
tableData2: [],
|
||||
tableData3: [],
|
||||
机床号: '',
|
||||
组号: '',
|
||||
零件图号: '',
|
||||
零件名称: '',
|
||||
投产数量: '',
|
||||
材料: '',
|
||||
原材料规格: '',
|
||||
工艺员: '',
|
||||
定额员: '',
|
||||
日期: ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
fetchData() {
|
||||
for (let i = 0; i < 9; i++) {
|
||||
for (let j = 1; j < 28; j++) {
|
||||
this.cell.push(String.fromCharCode(65 + i) + j)
|
||||
}
|
||||
}
|
||||
},
|
||||
searchData() {
|
||||
this.loading = true
|
||||
search(this.pageCurrent, this.pageSize, this.PrNum).then(response => {
|
||||
this.tableData = response.data.rows
|
||||
this.total = response.data.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
click(row) {
|
||||
searchtable1(row.工艺计划流水号).then(response => {
|
||||
this.tableData2 = response.data
|
||||
this.tableData2[0].工艺实际完成时间 = response.data[0].工艺实际完成时间.substr(0, 10) // 只处理了要显示的时间格式
|
||||
this.机床号 = response.data[0].机床图号
|
||||
this.组号 = response.data[0].组号
|
||||
this.零件图号 = response.data[0].零件图号
|
||||
this.零件名称 = response.data[0].零件名称
|
||||
this.投产数量 = response.data[0].投产数量
|
||||
this.材料 = response.data[0].材料
|
||||
this.原材料规格 = response.data[0].原材料规格
|
||||
this.工艺员 = response.data[0].工艺员
|
||||
this.定额员 = response.data[0].定额员
|
||||
this.日期 = response.data[0].工艺实际完成时间.substr(0, 10)
|
||||
}).then(() => {
|
||||
for (let j = 0; j < 20; j++) {
|
||||
document.getElementById(String(j + 1)).children[1].innerHTML = ''
|
||||
document.getElementById(String(j + 1)).children[2].innerHTML = ''
|
||||
document.getElementById(String(j + 1)).children[3].innerHTML = ''
|
||||
document.getElementById(String(j + 1)).children[4].innerHTML = ''
|
||||
}
|
||||
for (let j = 0; j < this.tableData2.length; j++) {
|
||||
document.getElementById(String(j + 1)).children[1].innerHTML = this.tableData2[j].工艺名称
|
||||
document.getElementById(String(j + 1)).children[2].innerHTML = this.tableData2[j].工艺要求
|
||||
document.getElementById(String(j + 1)).children[3].innerHTML = this.tableData2[j].单件定额工时
|
||||
document.getElementById(String(j + 1)).children[4].innerHTML = this.tableData2[j].准结定额工时
|
||||
}
|
||||
})
|
||||
searchtable2(row.工艺计划流水号).then(response => {
|
||||
this.tableData3 = response.data
|
||||
}).then(() => {
|
||||
for (let j = 0; j < 20; j++) {
|
||||
document.getElementById(String(j + 21)).children[1].innerHTML = ''
|
||||
document.getElementById(String(j + 21)).children[2].innerHTML = ''
|
||||
document.getElementById(String(j + 21)).children[3].innerHTML = ''
|
||||
document.getElementById(String(j + 21)).children[10].innerHTML = ''
|
||||
}
|
||||
for (let j = 0; j < this.tableData3.length; j++) {
|
||||
document.getElementById(String(j + 21)).children[1].innerHTML = this.tableData3[j].工艺名称
|
||||
document.getElementById(String(j + 21)).children[2].innerHTML = this.tableData3[j].单件定额工时
|
||||
document.getElementById(String(j + 21)).children[3].innerHTML = this.tableData3[j].准结定额工时
|
||||
document.getElementById(String(j + 21)).children[10].innerHTML = this.tableData3[j].计划日期.substr(5, 5)
|
||||
}
|
||||
})
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = val
|
||||
this.searchData()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.searchData()
|
||||
},
|
||||
handleDownload() {
|
||||
if (this.tableData2.length === 0) {
|
||||
this.$message.error('请选择一个零件')
|
||||
} else {
|
||||
require.ensure([], () => {
|
||||
const { export_json_to_excel } = require('@/vendor/Export2Excel1')
|
||||
const list = this.tableData2
|
||||
export_json_to_excel(list, '工艺定额卡', this.cell)
|
||||
})
|
||||
}
|
||||
},
|
||||
downLoadCjn(tableid) { // 下载工艺定额卡
|
||||
getExplorer()
|
||||
method5(tableid)
|
||||
Cleanup()
|
||||
},
|
||||
downLoadCjn1(tableid) { // 下载零件加工路线单
|
||||
getExplorer()
|
||||
method5(tableid)
|
||||
Cleanup()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
td{
|
||||
width: 100px;
|
||||
height: 30px;
|
||||
text-align:center;
|
||||
}
|
||||
</style>
|
||||
<style scoped>
|
||||
span{
|
||||
margin: 10px 0 10px 10px;
|
||||
}
|
||||
.el-card{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.el-table {
|
||||
max-height: 250px;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
1109
src/views/ManufacturingCenter/ProcessPlanning/index.vue
Normal file
1109
src/views/ManufacturingCenter/ProcessPlanning/index.vue
Normal file
File diff suppressed because it is too large
Load Diff
375
src/views/ManufacturingCenter/ProcessTaskAssignment/index.vue
Normal file
375
src/views/ManufacturingCenter/ProcessTaskAssignment/index.vue
Normal file
@@ -0,0 +1,375 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<el-radio-group v-show="false" v-model="radio" size="small" style="margin: 10px;" @change="radioChange()">
|
||||
<el-radio :label="1">当天</el-radio>
|
||||
<el-radio :label="2">全部</el-radio>
|
||||
</el-radio-group>
|
||||
<span>项目名称:</span>
|
||||
<el-select
|
||||
v-loading="loading"
|
||||
v-model="projectNameValue"
|
||||
element-loading-text="拼命加载中"
|
||||
element-loading-spinner="el-icon-loading"
|
||||
filterable
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="请选择项目名称"
|
||||
style="width: 200px;margin-right:10px"
|
||||
@change="getGraphNum()">
|
||||
<el-option
|
||||
v-for="item in projectName"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span>机床图号:</span>
|
||||
<el-select v-model="graphNumValue" filterable clearable size="small" placeholder="机床图号" style="width: 200px;margin-right:10px" @change="getGroupNum()">
|
||||
<el-option
|
||||
v-for="item in graphNum"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span>组号:</span>
|
||||
<el-select v-model="GroupNumValue" filterable clearable size="small" placeholder="组号" style="width: 200px" @change="total=0;PageCurrent=1;PageSize=10;getTable()">
|
||||
<el-option
|
||||
v-for="item in GroupNum"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<el-button type="primary" size="small" style="margin-left: 10px" @click="selectAll(tableData)">全选</el-button>
|
||||
<el-button type="primary" size="small" icon="el-icon-cjn-09" style="" @click="save">保存</el-button>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
style="width: 100%;max-height: 440px;"
|
||||
height="440"
|
||||
highlight-current-row
|
||||
border
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column align="center" type="selection"/>
|
||||
<el-table-column align="center" label="零件号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="零件名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工艺开始时间" width="160">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工艺开始时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工艺结束时间" width="160">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工艺结束时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工艺员" width="230px">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].工艺员" size="mini" style="width:150px" placeholder="工艺员" @click.native="selectPerson(scope.$index)"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="数量" width="80">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="投产时间" width="160">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.投产时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
v-show="!loading0"
|
||||
:current-page="PageCurrent"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="PageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-dialog :visible.sync="dialogFormVisible" title="工艺定额人员选择" center>
|
||||
<el-table
|
||||
:data="tableData2"
|
||||
style="width: 100%;max-height: 200px"
|
||||
border
|
||||
height="200px"
|
||||
highlight-current-row
|
||||
@row-click="confirmPerson">
|
||||
<el-table-column align="center" label="考勤编号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.考勤编号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="姓名">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.姓名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="性别">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.性别 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工作岗位">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.岗位名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="dialogFormVisible=false">提交</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getProject0, getProject, getGraphNum, getGroupNum, getTable0, getGraphNum0, getGroupNum0, getTable00, save, initPerson } from '@/api/ManufacturingCenter/ProcessTaskAssignment'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
loading0: false,
|
||||
projectNameValue: '',
|
||||
projectName: [],
|
||||
// machineToolNum: '',
|
||||
radio: 2,
|
||||
graphNumValue: '',
|
||||
graphNum: [],
|
||||
GroupNumValue: '',
|
||||
GroupNum: [],
|
||||
tableData: [],
|
||||
dialogFormVisible: false,
|
||||
tableData2: [],
|
||||
dialogPerson: '',
|
||||
index: '',
|
||||
multipleSelection: [],
|
||||
result: 0,
|
||||
PageCurrent: 1,
|
||||
PageSize: 10,
|
||||
total: 0
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
this.initPerson()
|
||||
},
|
||||
methods: {
|
||||
fetchData() {
|
||||
getProject().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.projectName.push({
|
||||
label: response.data[i].项目名称,
|
||||
value: response.data[i].项目流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
initPerson() { // 初始化工艺员
|
||||
initPerson().then(response => {
|
||||
this.tableData2 = response.data
|
||||
})
|
||||
},
|
||||
radioChange() { // radio改变
|
||||
this.loading = true
|
||||
this.projectName = []
|
||||
this.projectNameValue = ''
|
||||
this.graphNumValue = ''
|
||||
this.GroupNumValue = ''
|
||||
this.GroupNum = []
|
||||
this.tableData = []
|
||||
this.total = 0
|
||||
if (this.radio === 1) {
|
||||
getProject0().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.projectName.push({
|
||||
label: response.data[i].项目名称,
|
||||
value: response.data[i].项目流水号
|
||||
})
|
||||
}
|
||||
this.loading = false
|
||||
})
|
||||
} else {
|
||||
getProject().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.projectName.push({
|
||||
label: response.data[i].项目名称,
|
||||
value: response.data[i].项目流水号
|
||||
})
|
||||
}
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
},
|
||||
getGraphNum() { // 获取下拉图号
|
||||
this.tableData = []
|
||||
this.total = 0
|
||||
this.graphNum = []
|
||||
this.graphNumValue = ''
|
||||
this.GroupNumValue = ''
|
||||
this.GroupNum = []
|
||||
if (this.radio === 2) { // 全部
|
||||
getGraphNum(this.projectNameValue).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.graphNum.push({
|
||||
label: response.data[i].机床图号,
|
||||
value: response.data[i].机床流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
} else { // 当天
|
||||
getGraphNum0(this.projectNameValue).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.graphNum.push({
|
||||
label: response.data[i].机床图号,
|
||||
value: response.data[i].机床流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
getGroupNum() { // 获取下拉组号
|
||||
this.tableData = []
|
||||
this.total = 0
|
||||
this.GroupNum = []
|
||||
this.GroupNumValue = ''
|
||||
if (this.radio === 2) { // 全部
|
||||
getGroupNum(this.graphNumValue).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.GroupNum.push({
|
||||
label: response.data[i].组号,
|
||||
value: response.data[i].组件流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
} else { // 当天
|
||||
getGroupNum0(this.graphNumValue).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.GroupNum.push({
|
||||
label: response.data[i].组号,
|
||||
value: response.data[i].组件流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
getTable() { // 获取主表
|
||||
this.loading0 = true
|
||||
this.tableData = []
|
||||
if (this.radio === 2) { // 全部
|
||||
getTable0(this.PageCurrent, this.PageSize, this.GroupNumValue).then(response => {
|
||||
this.total = response.data.total
|
||||
for (let i = 0; i < response.data.rows.length; i++) {
|
||||
this.tableData.push({
|
||||
零件号: response.data.rows[i].零件图号,
|
||||
零件名称: response.data.rows[i].零件名称,
|
||||
工艺开始时间: response.data.rows[i].工艺计划开始时间,
|
||||
工艺结束时间: response.data.rows[i].工艺计划结束时间,
|
||||
数量: response.data.rows[i].批次数量,
|
||||
投产时间: response.data.rows[i].操作时间,
|
||||
工艺员: '',
|
||||
人员编号: '',
|
||||
工艺计划流水号: response.data.rows[i].工艺计划流水号
|
||||
})
|
||||
}
|
||||
this.loading0 = false
|
||||
})
|
||||
} else { // 当天
|
||||
getTable00(this.PageCurrent, this.PageSize, this.GroupNumValue).then(response => {
|
||||
this.total = response.data.total
|
||||
for (let i = 0; i < response.data.rows.length; i++) {
|
||||
this.tableData.push({
|
||||
零件号: response.data.rows[i].零件图号,
|
||||
零件名称: response.data.rows[i].零件名称,
|
||||
工艺开始时间: response.data.rows[i].工艺计划开始时间,
|
||||
工艺结束时间: response.data.rows[i].工艺计划结束时间,
|
||||
数量: response.data.rows[i].批次数量,
|
||||
投产时间: response.data.rows[i].操作时间,
|
||||
工艺员: '',
|
||||
人员编号: '',
|
||||
工艺计划流水号: response.data.rows[i].工艺计划流水号
|
||||
})
|
||||
}
|
||||
this.loading0 = false
|
||||
})
|
||||
}
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.PageCurrent = 1
|
||||
this.PageSize = val
|
||||
this.getTable()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.PageCurrent = val
|
||||
this.getTable()
|
||||
},
|
||||
selectPerson(index) { // 点击查询按钮
|
||||
this.index = index
|
||||
this.dialogFormVisible = true
|
||||
},
|
||||
confirmPerson(row) { // 选择一行
|
||||
this.tableData[this.index].工艺员 = row.姓名
|
||||
this.tableData[this.index].人员编号 = row.人员编号
|
||||
},
|
||||
selectAll(rows) {
|
||||
if (this.tableData[0].工艺员 !== '') {
|
||||
for (let i = 0; i < rows.length; i++) {
|
||||
rows[i].工艺员 = this.tableData[0].工艺员
|
||||
rows[i].人员编号 = this.tableData[0].人员编号
|
||||
}
|
||||
this.$refs.multipleTable.clearSelection()
|
||||
rows.forEach(row => {
|
||||
this.$refs.multipleTable.toggleRowSelection(row)
|
||||
})
|
||||
} else { this.$message.error('请在第一行中填写工艺员姓名') }
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val
|
||||
console.log(this.multipleSelection)
|
||||
},
|
||||
save() {
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) {
|
||||
if (this.multipleSelection[i].人员编号 === '') {
|
||||
this.$message.error('请选择工艺员')
|
||||
} else {
|
||||
save(this.multipleSelection[i].工艺计划流水号, this.multipleSelection[i].人员编号, this.multipleSelection[i].零件号).then(response => {
|
||||
this.result += parseInt(response.data[0].result)
|
||||
if (this.result === this.multipleSelection.length) {
|
||||
this.$message.success('保存成功')
|
||||
this.PageCurrent = 1
|
||||
this.PageSize = 10
|
||||
this.getTable()
|
||||
} else if (i === this.multipleSelection.length - 1 && this.result !== this.multipleSelection.length) {
|
||||
this.$message.error('存在保存失败项')
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-card{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
span{
|
||||
margin: 10px 0 10px 10px;
|
||||
}
|
||||
</style>
|
||||
564
src/views/ManufacturingCenter/ProcessingStatus/index.vue
Normal file
564
src/views/ManufacturingCenter/ProcessingStatus/index.vue
Normal file
@@ -0,0 +1,564 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<el-row>
|
||||
<span>项目名称:</span>
|
||||
<el-select v-model="project" size="small" filterable clearable placeholder="项目名称" @change="getMachine">
|
||||
<el-option
|
||||
v-for="item in projects"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span>机床号:</span>
|
||||
<el-select v-model="Machine" size="small" clearable placeholder="机床号" @change="getGroup">
|
||||
<el-option
|
||||
v-for="item in Machines"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span>组号:</span>
|
||||
<el-select v-model="Group" size="small" clearable placeholder="组号">
|
||||
<el-option
|
||||
v-for="item in Groups"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<span>是否外协:</span>
|
||||
<el-select v-model="part" size="small" placeholder="是否外协">
|
||||
<el-option
|
||||
v-for="item in parts"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span>零件号:</span>
|
||||
<el-input v-model="number" placeholder="零件号" clearable size="small" style="width: 200px;"/>
|
||||
<el-button type="success" class="el-icon-search" size="small" style="margin: 10px 0 0 10px" @click="getTableData();pageCurrent=1;pageSize=10;total = 0">查询</el-button>
|
||||
<span>进度颜色:</span>
|
||||
<el-radio v-model="radioList" label="0" style="background-color: white">全部</el-radio>
|
||||
<el-radio v-model="radioList" label="1" style="background-color: red">拖期</el-radio>
|
||||
<el-radio v-model="radioList" label="2" style="background-color: yellow">即将拖期</el-radio>
|
||||
<el-radio v-model="radioList" label="3" style="background-color: lawngreen">如期</el-radio>
|
||||
<el-radio v-model="radioList" label="4" style="background-color: deepskyblue">工序外协</el-radio>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<el-table
|
||||
v-loading="listLoading1"
|
||||
:data="tableData1"
|
||||
class="table"
|
||||
border
|
||||
height="650">
|
||||
<el-table-column
|
||||
label="序号"
|
||||
align="center"
|
||||
width="50"
|
||||
type="index"/>
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="零件图号"
|
||||
width="200px">
|
||||
<template slot-scope="scope">{{ 零件图号[scope.$index] }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="零件名称"
|
||||
width="120px">
|
||||
<template slot-scope="scope"> {{ 零件名称[scope.$index] }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="address"
|
||||
label="数量">
|
||||
<template slot-scope="scope">{{ 投产数量[scope.$index] }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件加工计划进度(工艺名称,计划完成时间,实际完成时间,员工名称)" >
|
||||
<el-table-column label="[1]" align="center" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<div :class="colorCode[scope.$index][0]">
|
||||
<h4>{{ process[scope.$index][0] }}</h4><h4>{{ planDate[scope.$index][0] }} </h4><h4> {{ realDate[scope.$index][0] }}</h4><h4> {{ worker[scope.$index][0] }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="[2]" align="center" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<div :class="colorCode[scope.$index][1]">
|
||||
<h4>{{ process[scope.$index][1] }}</h4><h4>{{ planDate[scope.$index][1] }} </h4><h4> {{ realDate[scope.$index][1] }}</h4><h4> {{ worker[scope.$index][1] }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="[3]" align="center" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<div :class="colorCode[scope.$index][2]">
|
||||
<h4>{{ process[scope.$index][2] }}</h4><h4>{{ planDate[scope.$index][2] }} </h4><h4> {{ realDate[scope.$index][2] }}</h4><h4> {{ worker[scope.$index][2] }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="[4]" align="center" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<div :class="colorCode[scope.$index][3]">
|
||||
<h4>{{ process[scope.$index][3] }}</h4><h4>{{ planDate[scope.$index][3] }} </h4><h4> {{ realDate[scope.$index][3] }}</h4><h4> {{ worker[scope.$index][3] }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="[5]" align="center" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<div :class="colorCode[scope.$index][4]">
|
||||
<h4>{{ process[scope.$index][4] }}</h4><h4>{{ planDate[scope.$index][4] }} </h4><h4> {{ realDate[scope.$index][4] }}</h4><h4> {{ worker[scope.$index][4] }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="[6]" align="center" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<div :class="colorCode[scope.$index][5]">
|
||||
<h4>{{ process[scope.$index][5] }}</h4><h4>{{ planDate[scope.$index][5] }} </h4><h4> {{ realDate[scope.$index][5] }}</h4><h4> {{ worker[scope.$index][5] }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="[7]" align="center" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<div :class="colorCode[scope.$index][6]">
|
||||
<h4>{{ process[scope.$index][6] }}</h4><h4>{{ planDate[scope.$index][6] }} </h4><h4> {{ realDate[scope.$index][6] }}</h4><h4> {{ worker[scope.$index][6] }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="[8]" align="center" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<div :class="colorCode[scope.$index][7]">
|
||||
<h4>{{ process[scope.$index][7] }}</h4><h4>{{ planDate[scope.$index][7] }} </h4><h4> {{ realDate[scope.$index][7] }}</h4><h4> {{ worker[scope.$index][7] }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="[9]" align="center" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<div :class="colorCode[scope.$index][8]">
|
||||
<h4>{{ process[scope.$index][8] }}</h4><h4>{{ planDate[scope.$index][8] }} </h4><h4> {{ realDate[scope.$index][8] }}</h4><h4> {{ worker[scope.$index][8] }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="[10]" align="center" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<div :class="colorCode[scope.$index][9]">
|
||||
<h4>{{ process[scope.$index][9] }}</h4><h4>{{ planDate[scope.$index][9] }} </h4><h4> {{ realDate[scope.$index][9] }}</h4><h4> {{ worker[scope.$index][9] }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="[11]" align="center" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<div :class="colorCode[scope.$index][10]">
|
||||
<h4>{{ process[scope.$index][10] }}</h4><h4>{{ planDate[scope.$index][10] }} </h4><h4> {{ realDate[scope.$index][10] }}</h4><h4> {{ worker[scope.$index][10] }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="[12]" align="center" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<div :class="colorCode[scope.$index][11]">
|
||||
<h4>{{ process[scope.$index][11] }}</h4><h4>{{ planDate[scope.$index][11] }} </h4><h4> {{ realDate[scope.$index][11] }}</h4><h4> {{ worker[scope.$index][11] }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="[13]" align="center" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<div :class="colorCode[scope.$index][12]">
|
||||
<h4>{{ process[scope.$index][12] }}</h4><h4>{{ planDate[scope.$index][12] }} </h4><h4> {{ realDate[scope.$index][12] }}</h4><h4> {{ worker[scope.$index][12] }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="[14]" align="center" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<div :class="colorCode[scope.$index][13]">
|
||||
<h4>{{ process[scope.$index][13] }}</h4><h4>{{ planDate[scope.$index][13] }} </h4><h4> {{ realDate[scope.$index][13] }}</h4><h4> {{ worker[scope.$index][13] }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="[15]" align="center" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<div :class="colorCode[scope.$index][14]">
|
||||
<h4>{{ process[scope.$index][14] }}</h4><h4>{{ planDate[scope.$index][14] }} </h4><h4> {{ realDate[scope.$index][14] }}</h4><h4> {{ worker[scope.$index][14] }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="[16]" align="center" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<div :class="colorCode[scope.$index][15]">
|
||||
<h4>{{ process[scope.$index][15] }}</h4><h4>{{ planDate[scope.$index][15] }} </h4><h4> {{ realDate[scope.$index][15] }}</h4><h4> {{ worker[scope.$index][15] }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="[17]" align="center" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<div :class="colorCode[scope.$index][16]">
|
||||
<h4>{{ process[scope.$index][16] }}</h4><h4>{{ planDate[scope.$index][16] }} </h4><h4> {{ realDate[scope.$index][16] }}</h4><h4> {{ worker[scope.$index][16] }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="[18]" align="center" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<div :class="colorCode[scope.$index][17]">
|
||||
<h4>{{ process[scope.$index][17] }}</h4><h4>{{ planDate[scope.$index][17] }} </h4><h4> {{ realDate[scope.$index][17] }}</h4><h4> {{ worker[scope.$index][17] }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="[19]" align="center" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<div :class="colorCode[scope.$index][18]">
|
||||
<h4>{{ process[scope.$index][18] }}</h4><h4>{{ planDate[scope.$index][18] }} </h4><h4> {{ realDate[scope.$index][18] }}</h4><h4> {{ worker[scope.$index][18] }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="[20]" align="center" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<div :class="colorCode[scope.$index][19]">
|
||||
<h4>{{ process[scope.$index][19] }}</h4><h4>{{ planDate[scope.$index][19] }} </h4><h4> {{ realDate[scope.$index][19] }}</h4><h4> {{ worker[scope.$index][19] }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="[21]" align="center" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<div :class="colorCode[scope.$index][20]">
|
||||
<h4>{{ process[scope.$index][20] }}</h4><h4>{{ planDate[scope.$index][20] }} </h4><h4> {{ realDate[scope.$index][20] }}</h4><h4> {{ worker[scope.$index][20] }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="[22]" align="center" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<div :class="colorCode[scope.$index][21]">
|
||||
<h4>{{ process[scope.$index][21] }}</h4><h4>{{ planDate[scope.$index][21] }} </h4><h4> {{ realDate[scope.$index][21] }}</h4><h4> {{ worker[scope.$index][21] }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="[23]" align="center" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<div :class="colorCode[scope.$index][22]">
|
||||
<h4>{{ process[scope.$index][22] }}</h4><h4>{{ planDate[scope.$index][22] }} </h4><h4> {{ realDate[scope.$index][22] }}</h4><h4> {{ worker[scope.$index][22] }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="[24]" align="center" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<div :class="colorCode[scope.$index][23]">
|
||||
<h4>{{ process[scope.$index][23] }}</h4><h4>{{ planDate[scope.$index][23] }} </h4><h4> {{ realDate[scope.$index][23] }}</h4><h4> {{ worker[scope.$index][23] }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="[25]" align="center" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<div :class="colorCode[scope.$index][24]">
|
||||
<h4>{{ process[scope.$index][24] }}</h4><h4>{{ planDate[scope.$index][24] }} </h4><h4> {{ realDate[scope.$index][24] }}</h4><h4> {{ worker[scope.$index][24] }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="[26]" align="center" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<div :class="colorCode[scope.$index][25]">
|
||||
<h4>{{ process[scope.$index][25] }}</h4><h4>{{ planDate[scope.$index][25] }} </h4><h4> {{ realDate[scope.$index][25] }}</h4><h4> {{ worker[scope.$index][25] }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="[27]" align="center" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<div :class="colorCode[scope.$index][26]">
|
||||
<h4>{{ process[scope.$index][26] }}</h4><h4>{{ planDate[scope.$index][26] }} </h4><h4> {{ realDate[scope.$index][26] }}</h4><h4> {{ worker[scope.$index][26] }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="[28]" align="center" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<div :class="colorCode[scope.$index][27]">
|
||||
<h4>{{ process[scope.$index][27] }}</h4><h4>{{ planDate[scope.$index][27] }} </h4><h4> {{ realDate[scope.$index][27] }}</h4><h4> {{ worker[scope.$index][27] }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="[29]" align="center" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<div :class="colorCode[scope.$index][28]">
|
||||
<h4>{{ process[scope.$index][28] }}</h4><h4>{{ planDate[scope.$index][28] }} </h4><h4> {{ realDate[scope.$index][28] }}</h4><h4> {{ worker[scope.$index][28] }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="[30]" align="center" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<div :class="colorCode[scope.$index][29]">
|
||||
<h4>{{ process[scope.$index][29] }}</h4><h4>{{ planDate[scope.$index][29] }} </h4><h4> {{ realDate[scope.$index][29] }}</h4><h4> {{ worker[scope.$index][29] }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getNames, getMachines, getGroups, getTable, getTable2 } from '@/api/ManufacturingCenter/ProcessingStatus'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
liushuihao: '',
|
||||
// value2: null,
|
||||
radioList: '0',
|
||||
length: 0,
|
||||
listLoading1: false,
|
||||
tableData1: [],
|
||||
project: '',
|
||||
projects: [],
|
||||
Machine: '',
|
||||
Machines: [],
|
||||
Group: '',
|
||||
Groups: [],
|
||||
part: '',
|
||||
parts: [{
|
||||
value: 0,
|
||||
label: '全部零件'
|
||||
}, {
|
||||
value: 1,
|
||||
label: '自家生产'
|
||||
}, {
|
||||
value: 2,
|
||||
label: '外协生产'
|
||||
}],
|
||||
Speed: '',
|
||||
Speeds: [{
|
||||
value: 5,
|
||||
label: '全部'
|
||||
}, {
|
||||
value: 1,
|
||||
label: '拖期'
|
||||
}, {
|
||||
value: 2,
|
||||
label: '即将拖期'
|
||||
}, {
|
||||
value: 3,
|
||||
label: '如期'
|
||||
}, {
|
||||
value: 4,
|
||||
label: '工序外协'
|
||||
}],
|
||||
number: '',
|
||||
checkbox_project: false,
|
||||
checkbox_Machine: false,
|
||||
checkbox_Group: false,
|
||||
checkbox_part: false,
|
||||
checkbox_number: false,
|
||||
零件图号: [],
|
||||
零件名称: [],
|
||||
投产数量: [],
|
||||
result: [],
|
||||
process: [[]],
|
||||
planDate: [[]],
|
||||
worker: [[]],
|
||||
colorCode: [[]],
|
||||
realDate: [[]],
|
||||
// waixie: [[]],
|
||||
total: 0, // 总条数
|
||||
pageSize: 10,
|
||||
pageCurrent: 1
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
// 查询供应商名称
|
||||
fetchData() {
|
||||
this.projects = []
|
||||
getNames().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.projects.push({
|
||||
label: response.data[i].项目名称,
|
||||
value: response.data[i].项目流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
this.part = 1
|
||||
},
|
||||
getMachine() {
|
||||
this.Machine = ''
|
||||
this.Machines = []
|
||||
this.Group = ''
|
||||
this.Groups = []
|
||||
if (this.project !== '') {
|
||||
getMachines(this.project).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.Machines.push({
|
||||
label: response.data[i].机床图号,
|
||||
value: response.data[i].机床流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
getGroup() {
|
||||
this.Group = ''
|
||||
this.Groups = []
|
||||
getGroups(this.Machine).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.Groups.push({
|
||||
label: response.data[i].组号,
|
||||
value: response.data[i].组件流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 按条件查询
|
||||
getTableData() {
|
||||
this.listLoading1 = true
|
||||
if (this.project === '') {
|
||||
this.checkbox_project = false
|
||||
} else {
|
||||
this.checkbox_project = true
|
||||
}
|
||||
if (this.Machine === '') {
|
||||
this.checkbox_Machine = false
|
||||
} else {
|
||||
this.checkbox_Machine = true
|
||||
}
|
||||
if (this.Group === '') {
|
||||
this.checkbox_Group = false
|
||||
} else {
|
||||
this.checkbox_Group = true
|
||||
}
|
||||
if (this.part === '') {
|
||||
this.checkbox_part = false
|
||||
} else {
|
||||
this.checkbox_part = true
|
||||
}
|
||||
if (this.number === '') {
|
||||
this.checkbox_number = false
|
||||
} else {
|
||||
this.checkbox_number = true
|
||||
}
|
||||
this.tableData1 = []
|
||||
this.零件图号 = []
|
||||
this.零件名称 = []
|
||||
this.投产数量 = []
|
||||
this.result = []
|
||||
this.process = [[]]
|
||||
this.planDate = [[]]
|
||||
this.worker = [[]]
|
||||
this.colorCode = [[]]
|
||||
this.realDate = [[]]
|
||||
this.length = 0
|
||||
getTable(this.checkbox_project, this.project, this.checkbox_Machine, this.Machine, this.checkbox_Group, this.Group, this.checkbox_number, this.number, this.part, this.pageCurrent, this.pageSize).then(response => {
|
||||
this.length = parseInt(response.data.total)
|
||||
for (let i = 0; i < response.data.rows.length; i++) { // 声明二维数组
|
||||
this.零件图号.push(response.data.rows[i].零件图号)
|
||||
this.零件名称.push(response.data.rows[i].零件名称)
|
||||
this.投产数量.push(response.data.rows[i].投产数量)
|
||||
this.process[i] = []
|
||||
this.planDate[i] = []
|
||||
this.worker[i] = []
|
||||
this.colorCode[i] = []
|
||||
this.realDate[i] = []
|
||||
this.result.push(response.data.rows[i])
|
||||
}
|
||||
if (this.零件图号.length !== 0) {
|
||||
for (let i = 0; i < this.零件图号.length; i++) {
|
||||
getTable2(this.checkbox_project, this.project, this.checkbox_Machine, this.Machine, this.checkbox_Group, this.Group, this.零件图号[i], this.part).then(response => {
|
||||
this.liushuihao = response.data[0].工艺计划流水号
|
||||
for (let k = 0; k < response.data.length; k++) {
|
||||
if (response.data[k].工艺计划流水号 === this.liushuihao) {
|
||||
this.process[i][k] = response.data[k].工艺名称简称
|
||||
this.planDate[i][k] = response.data[k].计划日期_短
|
||||
this.worker[i][k] = response.data[k].员工姓名
|
||||
this.realDate[i][k] = response.data[k].完成日期_短
|
||||
if (response.data[k].工序状态 === 5) { // 灰色是已经完成 未入库
|
||||
this.colorCode[i][k] = 'grey'
|
||||
} else {
|
||||
this.colorCode[i][k] = response.data[k].进度颜色
|
||||
}
|
||||
if (response.data[k].工序间是否外协 === 2) {
|
||||
this.colorCode[i][k] = 'lightblue'
|
||||
}
|
||||
}
|
||||
}
|
||||
}).then(() => {
|
||||
this.tableData1.push(this.result[i])
|
||||
this.listLoading1 = false
|
||||
this.total = this.length
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.tableData1 = []
|
||||
this.listLoading1 = false
|
||||
this.total = 0
|
||||
}
|
||||
})
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.pageSize = val
|
||||
this.getTableData()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.getTableData()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.white{
|
||||
background-color: ghostwhite;
|
||||
border: 1px solid #1f2d3d;
|
||||
}
|
||||
.grey{
|
||||
background-color: grey;
|
||||
border: 1px solid #1f2d3d;
|
||||
}
|
||||
.red{
|
||||
background-color: orangered;
|
||||
border: 1px solid #1f2d3d;
|
||||
}
|
||||
.lightblue{
|
||||
background-color: deepskyblue;
|
||||
border: 1px solid #1f2d3d;
|
||||
}
|
||||
.yellow{
|
||||
background-color: yellow;
|
||||
border: 1px solid #1f2d3d;
|
||||
}
|
||||
.blank{
|
||||
background-color: transparent;
|
||||
border: 0px solid white;
|
||||
}
|
||||
.lightgreen{
|
||||
background-color: lightgreen;
|
||||
border: 1px solid #1f2d3d;
|
||||
}
|
||||
</style>
|
||||
<style scoped>
|
||||
.el-form-item{
|
||||
margin-bottom: 22px;
|
||||
}
|
||||
.el-card{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
span{
|
||||
margin: 10px 0 10px 10px;
|
||||
}
|
||||
.table h4{
|
||||
border: 1px solid transparent;
|
||||
margin: 0;
|
||||
font-weight: normal;
|
||||
width: 100px;
|
||||
height: 24px;
|
||||
}
|
||||
</style>
|
||||
352
src/views/ManufacturingCenter/QuotaFormulation/index.vue
Normal file
352
src/views/ManufacturingCenter/QuotaFormulation/index.vue
Normal file
@@ -0,0 +1,352 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<div style="margin-top: -10px;">
|
||||
<el-radio-group v-model="radio" style="margin: 10px;" @change="radioChange">
|
||||
<el-radio :label="1">未编制</el-radio>
|
||||
<el-radio :label="2">已编制</el-radio>
|
||||
</el-radio-group>
|
||||
<span style="margin: 10px">定额员:</span>
|
||||
<el-select v-model="personValue" size="small" placeholder="定额员" @change="personChange">
|
||||
<el-option
|
||||
v-for="item in person"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span style="margin: 10px">零件号:</span>
|
||||
<el-select v-model="partNumValue" size="small" filterable placeholder="零件号" style="margin: 10px">
|
||||
<el-option
|
||||
v-for="item in partNum"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<el-button type="success" size="small" icon="el-icon-search" style="margin: 10px" @click="typeChange()">查询</el-button>
|
||||
<span v-if="radio === 1" style="color: #53A3F7;font-size: 14px"> 未编制的数量{{ partNum.length }}</span>
|
||||
<span v-if="radio === 2" style="color: #53A3F7;font-size: 14px"> {{ shuliang }}</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<span>种类:</span>
|
||||
<el-input
|
||||
v-model="typeValue"
|
||||
size="small"
|
||||
placeholder="种类"
|
||||
readonly
|
||||
style="margin: 10px;width:180px"/>
|
||||
<span>零件名称:</span>
|
||||
<el-input
|
||||
v-model="partName"
|
||||
size="small"
|
||||
placeholder="零件名称"
|
||||
readonly
|
||||
style="margin: 10px;width:180px"/>
|
||||
<span>投产总数量:</span>
|
||||
<el-input
|
||||
v-model="batchNum"
|
||||
size="small"
|
||||
placeholder="投产总数量"
|
||||
readonly
|
||||
style="margin: 10px;width:180px"/>
|
||||
<span>材质:</span>
|
||||
<el-input
|
||||
v-model="material"
|
||||
size="small"
|
||||
placeholder="材质"
|
||||
readonly
|
||||
style="margin: 10px;width:180px"/>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<div>
|
||||
<el-table v-loading="listLoading" :data="tableData" border style="width: 100%;" height="550px">
|
||||
<el-table-column type="index" label="序号" width="50" align="center"/>
|
||||
<el-table-column prop="name" label="工艺名称" width="180" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].name" style="width:150px" placeholder="工艺名称" readonly/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="request" label="工艺要求" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].request" :rows="1" placeholder="工艺要求" type="textarea" readonly/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="singleton" label="单件" width="180" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].singleton" :readonly="tableData[scope.$index].name===''" style="width:150px" placeholder="单件"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="Settlement" label="准结" width="180" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].Settlement" :readonly="tableData[scope.$index].name===''" style="width:150px" placeholder="准结"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="isShow" prop="budget" label="外协预算" width="180" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].budget" style="width:150px" placeholder="外协预算" readonly/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-button v-if="radio === 2" type="primary" icon="el-icon-cjn-09" size="small" style="float:right;margin: 10px" @click="ADD">保存</el-button>
|
||||
<el-button v-if="radio === 1" type="primary" icon="el-icon-cjn-09" size="small" style="float:right;margin: 10px" @click="ADD1">保存</el-button>
|
||||
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getPerson, mainTable, getPartnames1, getPartnames2, detailInfo, mainTable1, TableAddLi, TableAddLi1 } from '@/api/ManufacturingCenter/QuotaFormulation'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
listLoading: false,
|
||||
shuliang: '',
|
||||
q: 0,
|
||||
result: 0,
|
||||
budget1: [],
|
||||
personValue: '',
|
||||
person: [],
|
||||
radio: 1, // 第一组
|
||||
radio1: 1, // 第二组
|
||||
partNumValue: '', // 零件号值
|
||||
partNum: [], // 零件号
|
||||
typeValue: '', // 种类
|
||||
CraftsmenValue: '', // 工艺员值
|
||||
Craftsmen: [], // 工艺员
|
||||
CraftmanValue: '', // 完艺表单工艺员值
|
||||
Craftman: [], // 完艺表单工艺员
|
||||
partName: '', // 零件名称
|
||||
batchNum: '', // 投产总数量
|
||||
material: '', // 材质
|
||||
// materialClass: [], // 材质类
|
||||
typicalClassValue: '', // 典型工艺零件分类值
|
||||
typicalClass: [], // 典型工艺零件分类
|
||||
partNameValue1: '', // 典型工艺零件名称值
|
||||
partName1: [], // 典型工艺零件名称
|
||||
partNameValue1check: false, // 典型工艺零件名称check
|
||||
processNumValue: '', // 典型工艺号值
|
||||
processNum: [], // 典型工艺号
|
||||
processNumValuecheck: false, // 典型工艺号check
|
||||
remark: '', // 备注
|
||||
remark1: '', // 完艺零件名称
|
||||
numVal: '', // 输入数值
|
||||
tolerance: '', // 公差
|
||||
tableData: [],
|
||||
tableData3: null, // 工艺定额人员
|
||||
tableData4: null, // 完艺表格
|
||||
processSelect: [], // 工艺分类流水号
|
||||
processNameClass: [], // 工艺名称分类
|
||||
processNameClassValue: '',
|
||||
processName: [], // 工艺名称
|
||||
processNameValue: '',
|
||||
processRequest: [], // 工艺要求
|
||||
processRequestValue: '',
|
||||
processN1: [], // 工艺编号
|
||||
str: '', // 拼接字符串用的
|
||||
value: '', // 第一个select的
|
||||
input1: '', // 种类
|
||||
checked: false, // 是否核准
|
||||
checked1: false, // 修改
|
||||
input: '', // 规格
|
||||
isShow: false, // 2的可见性
|
||||
date0: ['', ''], // 完艺时间段
|
||||
PN: '0000', // 零件号0000
|
||||
num: '', // 工艺计划流水号
|
||||
num0: '', // 主表工艺计划流水号
|
||||
perNum: [],
|
||||
tuhao: [],
|
||||
tuhaoValue: '',
|
||||
check1: '',
|
||||
check2: '',
|
||||
check3: '',
|
||||
check4: '',
|
||||
input2: '',
|
||||
list: null,
|
||||
value7: '',
|
||||
restaurants: [],
|
||||
state4: '',
|
||||
timeout: null
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
fetchData() { // 初始化未编制零件号、材料、公差
|
||||
getPerson().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.person.push({
|
||||
label: response.data[i].姓名,
|
||||
value: response.data[i].人员编号
|
||||
})
|
||||
}
|
||||
})
|
||||
getPartnames1().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.partNum.push({
|
||||
label: response.data[i].零件图号,
|
||||
value: response.data[i].工艺计划流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
personChange() {
|
||||
if (this.radio === 2) {
|
||||
this.shuliang = '加载中...'
|
||||
this.partNumValue = ''
|
||||
this.partNum = []
|
||||
this.typeValue = ''
|
||||
this.Craftsmen = ''
|
||||
this.batchNum = ''
|
||||
this.material = ''
|
||||
this.partName = ''
|
||||
this.tableData = [] // 清主表
|
||||
getPartnames2(this.personValue).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.partNum.push({
|
||||
label: response.data[i].零件图号,
|
||||
value: response.data[i].工艺计划流水号
|
||||
})
|
||||
}
|
||||
this.shuliang = '已编制的数量' + this.partNum.length
|
||||
})
|
||||
}
|
||||
},
|
||||
radioChange() { // radio改变 编制情况 获取不同零件号
|
||||
if (this.radio === 2) { // 已编制
|
||||
this.isShow = true
|
||||
this.partNumValue = ''
|
||||
this.partNum = []
|
||||
this.typeValue = ''
|
||||
this.Craftsmen = ''
|
||||
this.partName = ''
|
||||
this.batchNum = ''
|
||||
this.material = ''
|
||||
this.personValue = ''
|
||||
this.tableData = [] // 清主表
|
||||
} else { // 未编制
|
||||
this.shuliang = ''
|
||||
this.isShow = false
|
||||
this.partNumValue = ''
|
||||
this.partNum = []
|
||||
this.typeValue = ''
|
||||
this.Craftsmen = ''
|
||||
this.partName = ''
|
||||
this.batchNum = ''
|
||||
this.material = ''
|
||||
this.personValue = ''
|
||||
this.tableData = [] // 清主表
|
||||
getPartnames1().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.partNum.push({
|
||||
label: response.data[i].零件图号,
|
||||
value: response.data[i].工艺计划流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
typeChange() { // 当零件号改变时,改变种类、工艺员、零件名称、投产总数量、材质,并且显示主表信息
|
||||
this.listLoading = true
|
||||
this.tableData = []
|
||||
this.num0 = ''
|
||||
if (this.radio === 1) {
|
||||
detailInfo(this.partNumValue).then(response => {
|
||||
this.typeValue = response.data[0].零件类型名称
|
||||
this.partName = response.data[0].零件名称
|
||||
this.batchNum = response.data[0].批次数量
|
||||
this.num0 = response.data[0].工艺计划流水号
|
||||
console.log(response.data[0].工艺计划流水号, 520)
|
||||
this.material = response.data[0].材料
|
||||
mainTable(this.num0).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.tableData.push({
|
||||
name: response.data[i].工艺名称,
|
||||
request: response.data[i].工艺要求,
|
||||
num1: response.data[i].工序流水号,
|
||||
Settlement: response.data[i].准结定额工时,
|
||||
singleton: response.data[i].单件定额工时,
|
||||
lingjian: response.data[i].零件图号,
|
||||
numm: response.data[i].工艺计划流水号
|
||||
})
|
||||
}
|
||||
this.listLoading = false
|
||||
})
|
||||
})
|
||||
} else {
|
||||
detailInfo(this.partNumValue).then(response => {
|
||||
this.typeValue = response.data[0].零件类型名称
|
||||
this.partName = response.data[0].零件名称
|
||||
this.batchNum = response.data[0].批次数量
|
||||
this.num0 = response.data[0].工艺计划流水号
|
||||
this.material = response.data[0].材料
|
||||
})
|
||||
mainTable1(this.partNumValue).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.tableData.push({
|
||||
name: response.data[i].工艺名称,
|
||||
request: response.data[i].工艺要求,
|
||||
num1: response.data[i].工序流水号,
|
||||
Settlement: response.data[i].准结定额工时,
|
||||
singleton: response.data[i].单件定额工时,
|
||||
budget: response.data[i].外协预算价格1,
|
||||
lingjian: response.data[i].零件图号,
|
||||
numm: response.data[i].工艺计划流水号
|
||||
})
|
||||
}
|
||||
this.listLoading = false
|
||||
})
|
||||
}
|
||||
},
|
||||
ADD() {
|
||||
this.result = 0
|
||||
for (let i = 0; i < this.tableData.length; i++) {
|
||||
TableAddLi(this.tableData[i].singleton, this.tableData[i].Settlement, this.tableData[i].lingjian, this.tableData[i].num1, this.tableData[i].numm).then(response => {
|
||||
this.result += parseInt(response.data[0].result)
|
||||
if (this.result === this.tableData.length) {
|
||||
this.$message.success('保存成功')
|
||||
} else if (response.data[0].result === '0') {
|
||||
this.$message.error('第' + (i + 1) + '行保存失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
ADD1() {
|
||||
this.result = 0
|
||||
if (this.personValue === '') {
|
||||
this.$message.error('请选择人员')
|
||||
} else {
|
||||
for (let i = 0; i < this.tableData.length; i++) {
|
||||
TableAddLi(this.tableData[i].singleton, this.tableData[i].Settlement, this.tableData[i].lingjian, this.tableData[i].num1, this.tableData[i].numm).then(response => {
|
||||
this.result += parseInt(response.data[0].result)
|
||||
if (this.result === this.tableData.length) {
|
||||
TableAddLi1(this.partNumValue, this.personValue).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('保存成功')
|
||||
this.radioChange()
|
||||
} else {
|
||||
this.$message.error('保存失败')
|
||||
}
|
||||
})
|
||||
} else if (response.data[0].result === '0') {
|
||||
this.$message.error('保存失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.doing-row4{
|
||||
background: #f0f9eb;
|
||||
}
|
||||
.el-card{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
</style>
|
||||
390
src/views/ManufacturingCenter/RepairTimeEntry/index.vue
Normal file
390
src/views/ManufacturingCenter/RepairTimeEntry/index.vue
Normal file
@@ -0,0 +1,390 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<el-card>
|
||||
|
||||
<span>人员名称:</span>
|
||||
<el-input v-model="personnelNumber" placeholder="请选择人员名称" class="input-with-select" readonly clearable size="small" style="width:200px;margin:10px;">
|
||||
<el-button slot="append" icon="el-icon-search" size="small" @click="dialogTableVisible"/>
|
||||
</el-input>
|
||||
<el-button type="success" class="el-icon-search" size="small" @click="pageCurrent=1;pageSize=10;searchTable()">查询</el-button>
|
||||
<el-button type="primary" class="el-icon-circle-plus-outline" size="small" @click="editType1('form');param = 0">新增</el-button>
|
||||
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<el-table v-loading="loading0" :data="tableData" height="650" style="width: 100%;" border>
|
||||
<el-table-column
|
||||
label="序号"
|
||||
type="index"
|
||||
align="center"
|
||||
width="50"/>
|
||||
<el-table-column label="工艺名称" align="center" width="280px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工艺名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="修补工时" align="center" width="110px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.修补工时 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="年" align="center" width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.年 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="月" align="center" width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.月 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="人员" align="center" width="140px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.姓名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作时间" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.操作时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="150px" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
class="el-icon-edit"
|
||||
@click="handleChange1(scope.$index, scope.row, 'form');param = 1">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block">
|
||||
<el-pagination
|
||||
v-if="!loading0"
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-dialog :title="title1" :visible.sync="dialogFormVisible" center>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="110px" class="demo-ruleForm" style="width: 48%;margin: auto">
|
||||
<el-form-item label="工艺" prop="TechnologyValue">
|
||||
<el-select v-model="form.TechnologyValue" filterable size="small">
|
||||
<el-option
|
||||
v-for="item in Technology"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="年" prop="yearNumberValue">
|
||||
<el-select v-model="form.yearNumberValue" size="small">
|
||||
<el-option
|
||||
v-for="item in yearNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="月" prop="monthNumberValue">
|
||||
<el-select v-model="form.monthNumberValue" size="small">
|
||||
<el-option
|
||||
v-for="item in monthNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="修补工时" prop="timeNumber">
|
||||
<el-input v-model="form.timeNumber" placeholder="修补工时" clearable size="small" style="width: 200px"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="14"/>
|
||||
<el-form-item >
|
||||
<el-button size="small" @click="callOff('form')">取消</el-button>
|
||||
<el-button size="small" type="primary" @click="submit('form')">确 定</el-button>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :visible.sync="dialogFormVisible1" title="人员信息" center width="750px">
|
||||
<div style="height: 500px">
|
||||
<div style="float: left;margin-top: 10px;margin-left: 20px;overflow-y: scroll;height: 400px">
|
||||
<el-tree
|
||||
:data="data2"
|
||||
node-key="id"
|
||||
style="width: 150px;float: left"
|
||||
height="400"
|
||||
accordion
|
||||
@node-click="handleNodeClick"
|
||||
/>
|
||||
</div>
|
||||
<el-table :data="List1" highlight-current-row height="400" style="width: 400px;float: left;margin-left: 30px" @row-click="handleCurrentChange2">
|
||||
<el-table-column label="考勤编号" align="center" >
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.考勤编号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="姓名" align="center" >
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.姓名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="性别" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.性别 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工作岗位" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.岗位名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-button style="margin-left: 260px" @click="dialogFormVisible1 = false">取消</el-button>
|
||||
<el-button type="primary" style="margin-top: 20px" @click="getName">确认</el-button>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getTable8, getTree, fn, dialogtablevisible, searchTechnology, searchperson, searchtable, edittype, handlechange } from '@/api/ManufacturingCenter/RepairTimeEntry'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
codes2: '',
|
||||
Number2: '',
|
||||
codes: '',
|
||||
Number1: '',
|
||||
Name: '',
|
||||
ssks: '',
|
||||
List1: [],
|
||||
data2: [],
|
||||
dialogFormVisible1: false,
|
||||
a: '', // 初始化赋值中间变量
|
||||
liushuihao: '', // 编辑流水号
|
||||
renyuanbianhao: '', // 编辑人员编号
|
||||
personnelNumber: '', // 人员编号
|
||||
form: {
|
||||
TechnologyValue: '',
|
||||
yearNumberValue: '',
|
||||
monthNumberValue: '',
|
||||
timeNumber: ''
|
||||
},
|
||||
Technology: [], // 工艺
|
||||
yearNumber: [], // 年
|
||||
monthNumber: [], // 月
|
||||
loading0: false,
|
||||
count1: 0, // 清表单验证计数器
|
||||
count2: 0, // 清表单验证计数器
|
||||
tableData: [], // 表格数据
|
||||
pageSize: 10,
|
||||
pageCurrent: 1,
|
||||
total: 0,
|
||||
dialogFormVisible: false,
|
||||
title1: '',
|
||||
rules: {
|
||||
TechnologyValue: [{ required: true, message: '请选择工艺', trigger: 'change' }],
|
||||
timeNumber: [{ required: true, message: '请输入修补工时', trigger: 'blur' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
this.fetchData3()
|
||||
this.searchTable()
|
||||
},
|
||||
methods: {
|
||||
handleCurrentChange2(row) { // 获取当前行人员信息
|
||||
this.ssks = row.节点名称
|
||||
this.Number1 = row.人员编号
|
||||
this.codes = row.序号
|
||||
this.Name = row.姓名
|
||||
},
|
||||
getName() { // 提交人员
|
||||
this.dialogFormVisible1 = false
|
||||
this.personnelNumber = this.Name
|
||||
this.codes2 = this.codes
|
||||
this.Number2 = this.Number1
|
||||
},
|
||||
handleNodeClick(data) { // 树节点点击
|
||||
this.ssks = data.label
|
||||
getTable8(data.id).then(response => {
|
||||
this.List1 = response.data
|
||||
})
|
||||
},
|
||||
fetchData3() {
|
||||
getTree().then(response => { // 获取人员信息树
|
||||
const data = response.data
|
||||
this.data2 = fn(data, 0)
|
||||
})
|
||||
},
|
||||
dialogTableVisible() {
|
||||
this.dialogFormVisible1 = true
|
||||
dialogtablevisible()
|
||||
},
|
||||
// 初始化工艺
|
||||
fetchData() {
|
||||
var time = new Date()
|
||||
this.form.TechnologyValue = ''
|
||||
this.Technology = []
|
||||
searchTechnology().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.Technology.push({
|
||||
label: response.data[i].工艺名称,
|
||||
value: response.data[i].工艺编号
|
||||
})
|
||||
}
|
||||
})
|
||||
for (let i = time.getFullYear() - 2; i <= time.getFullYear() + 2; i++) {
|
||||
if (i === time.getFullYear()) {
|
||||
this.a = i
|
||||
}
|
||||
this.yearNumber.push({
|
||||
label: i,
|
||||
value: i
|
||||
})
|
||||
}
|
||||
for (let i = 0; i < 12; i++) {
|
||||
this.monthNumber.push({
|
||||
label: i + 1,
|
||||
value: i + 1
|
||||
})
|
||||
}
|
||||
this.form.yearNumberValue = this.a
|
||||
this.form.monthNumberValue = 1
|
||||
},
|
||||
// 查询
|
||||
searchTable() {
|
||||
this.tableData = []
|
||||
this.loading0 = true
|
||||
if (this.personnelNumber !== '' && this.personnelNumber !== null) {
|
||||
searchtable(1, this.Number2, this.pageCurrent, this.pageSize).then(response => {
|
||||
this.tableData = response.data.rows
|
||||
this.total = response.data.total
|
||||
this.loading0 = false
|
||||
})
|
||||
} else {
|
||||
searchtable(0, this.Number2, this.pageCurrent, this.pageSize).then(response => {
|
||||
this.tableData = response.data.rows
|
||||
this.total = response.data.total
|
||||
this.loading0 = false
|
||||
})
|
||||
}
|
||||
},
|
||||
// 增加打开
|
||||
editType1(formName) {
|
||||
if (this.personnelNumber === '' || this.personnelNumber === null) {
|
||||
this.$message.error('请输入人员编号')
|
||||
} else {
|
||||
this.count1 = this.count1 + 1
|
||||
if (this.count1 !== 1) {
|
||||
this.$refs[formName].resetFields()
|
||||
}
|
||||
this.title1 = '增加'
|
||||
this.form.TechnologyValue = ''
|
||||
this.form.timeNumber = ''
|
||||
this.dialogFormVisible = true
|
||||
}
|
||||
},
|
||||
// 增加确定
|
||||
editType() {
|
||||
searchperson(this.codes2).then(response => {
|
||||
if (response.data.length !== 0) {
|
||||
edittype(response.data[0].人员编号, this.form.TechnologyValue, this.form.yearNumberValue, this.form.monthNumberValue, this.form.timeNumber).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('增加成功')
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = 10
|
||||
this.searchTable()
|
||||
this.dialogFormVisible = false
|
||||
} else {
|
||||
this.$message.error('增加失败')
|
||||
this.dialogFormVisible = false
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error('人员编号无效')
|
||||
this.dialogFormVisible = false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 编辑打开
|
||||
handleChange1(index, row, formName) {
|
||||
this.count2 = this.count2 + 1
|
||||
if (this.count2 !== 1) {
|
||||
this.$refs[formName].resetFields()
|
||||
}
|
||||
this.renyuanbianhao = row.人员编号
|
||||
this.liushuihao = row.员工月修补工时流水号
|
||||
this.form.TechnologyValue = parseInt(row.工艺编号)
|
||||
this.form.yearNumberValue = row.年
|
||||
this.form.monthNumberValue = row.月
|
||||
this.form.timeNumber = row.修补工时
|
||||
this.dialogFormVisible = true
|
||||
this.title1 = '编辑'
|
||||
},
|
||||
// 编辑确定
|
||||
handleChange() {
|
||||
handlechange(this.liushuihao, this.renyuanbianhao, this.form.TechnologyValue, this.form.yearNumberValue, this.form.monthNumberValue, this.form.timeNumber).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('修改成功')
|
||||
this.searchTable()
|
||||
} else {
|
||||
this.$message.error('修改失败')
|
||||
}
|
||||
})
|
||||
this.dialogFormVisible = false
|
||||
},
|
||||
// 提交添加或者修改
|
||||
submit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.param === 0) {
|
||||
this.editType()
|
||||
} else {
|
||||
this.handleChange()
|
||||
}
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 重置表单
|
||||
callOff(formName) {
|
||||
this.dialogFormVisible = false
|
||||
this.$refs[formName].resetFields()
|
||||
},
|
||||
// 分页
|
||||
handleSizeChange(val) {
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = val
|
||||
this.searchTable()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.searchTable()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-card{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
</style>
|
||||
528
src/views/ManufacturingCenter/SparePartsForScrap/index.vue
Normal file
528
src/views/ManufacturingCenter/SparePartsForScrap/index.vue
Normal file
@@ -0,0 +1,528 @@
|
||||
<!--零件报废补投-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<el-card>
|
||||
<div>
|
||||
<!--项目名称-->
|
||||
<span>项目名称:</span>
|
||||
<el-select v-model="ProjectNameValue" placeholder="请选择项目名称" style="width:200px" clearable size="small" @change="fetchMachineDrawingData" @clear="MachineDrawingValue = '';MachineDrawing = [];Team = [];TeamValue = ''">
|
||||
<el-option
|
||||
v-for="item in ProjectName"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<!--机床号-->
|
||||
<span style="margin-left: 15px">机床号:</span>
|
||||
<el-select v-model="MachineDrawingValue" placeholder="请选择机床图号" style="width:200px" clearable size="small" @change="fetchTeamDrawingData" @clear="Team = [];TeamValue = ''">
|
||||
<el-option
|
||||
v-for="item in MachineDrawing"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<!--组号-->
|
||||
<span style="margin-left: 15px">组号:</span>
|
||||
<el-select v-model="TeamValue" placeholder="请选择组号" style="width:200px" clearable size="small">
|
||||
<el-option
|
||||
v-for="item in Team"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span style="margin-left: 15px">零件图号:</span>
|
||||
<el-input v-model="PartDrawing" placeholder="请输入零件图号" size="small" style="width: 200px" clearable/>
|
||||
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 20px" @click="currentPage1=1; fetchTableData()">查询</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
element-loading-text="拼命加载中"
|
||||
element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(226,223,223,1)"
|
||||
height="250"
|
||||
highlight-current-row
|
||||
border
|
||||
stripe
|
||||
style="width: 100%; text-align: center"
|
||||
@current-change="fetchTableData2">
|
||||
<el-table-column
|
||||
prop="province1"
|
||||
label="零件号"
|
||||
>
|
||||
<template slot-scope="scope">{{ scope.row.零件图号 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="province2"
|
||||
label="零件名称"
|
||||
>
|
||||
<template slot-scope="scope">{{ scope.row.零件名称 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="province4"
|
||||
label="批次数量"
|
||||
>
|
||||
<template slot-scope="scope">{{ scope.row.批次数量 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="province5"
|
||||
label="开始时间"
|
||||
>
|
||||
<template slot-scope="scope">{{ scope.row.机加工开始时间 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="province6"
|
||||
label="结束时间"
|
||||
>
|
||||
<template slot-scope="scope">{{ scope.row.机加工结束时间 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="province7"
|
||||
label="批次零件状态"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.批次零件状态 === '2'">停产</div>
|
||||
<div v-else >正常生产</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
label="操作"
|
||||
width="100px"
|
||||
>
|
||||
<template slot-scope="scope" >
|
||||
<el-button type="primary" size="small" @click="handleEdit(scope.row)">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:current-page="currentPage1"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="pageSize1"
|
||||
:total="total1"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange1"
|
||||
@current-change="handleCurrentChange1"/>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<el-table
|
||||
v-loading="loading2"
|
||||
:data="tableData2"
|
||||
element-loading-text="拼命加载中"
|
||||
element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(226,223,223,1)"
|
||||
height="250"
|
||||
highlight-current-row
|
||||
border
|
||||
stripe
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
width="80px"
|
||||
prop="province1"
|
||||
label="工序顺序"
|
||||
>
|
||||
<template slot-scope="scope">{{ scope.row.工序顺序 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
width="200px"
|
||||
prop="province2"
|
||||
label="工艺名称"
|
||||
>
|
||||
<template slot-scope="scope">{{ scope.row.工艺名称 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="province4"
|
||||
label="工艺要求"
|
||||
>
|
||||
<template slot-scope="scope">{{ scope.row.工艺要求 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
width="80px"
|
||||
prop="province5"
|
||||
label="单件定额工时"
|
||||
>
|
||||
<template slot-scope="scope">{{ scope.row.单件定额工时 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
width="80px"
|
||||
prop="province6"
|
||||
label="准结定额工时"
|
||||
>
|
||||
<template slot-scope="scope">{{ scope.row.准结定额工时 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
width="100px"
|
||||
prop="province7"
|
||||
label="工艺是否完成"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.工序状态 === '4'"><div style="width: 12px;height: 12px;border-radius: 50%;background-color: rgb(103, 194, 58);display: inline-block;margin:0px 5px 0 0"/>完成</div>
|
||||
<div v-else ><div style="width: 12px;height: 12px;border-radius: 50%;background-color: red;display: inline-block;margin:0px 5px 0 0"/>未完成</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:current-page="currentPage2"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="pageSize2"
|
||||
:total="total2"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange2"
|
||||
@current-change="handleCurrentChange2"/>
|
||||
</div>
|
||||
</el-card>
|
||||
<!--编辑对话框-->
|
||||
<div style="text-align: left">
|
||||
<el-dialog :visible.sync="dialogeditVisible" title="编辑" style="width: 800px;margin: auto" center >
|
||||
<el-form ref="form" :model="form" label-position="left">
|
||||
<el-form-item label="零件号" label-width="100px" style="width: 299px ; display: inline-block; text-align: left" size="small">
|
||||
<el-input v-model="form.input1" :disabled="true" auto-complete="off" style="margin-left: 20px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="批次零件状态" label-width="123px" style="margin-bottom: 18px; display: inline-block" prop="input2">
|
||||
<el-radio-group v-model="radio" fill="#B2DFEE" boolean @change="remark()">
|
||||
<el-radio-button label="正常生产"/>
|
||||
<el-radio-button label="停止生产"/>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="开始时间" label-width="120px" style="margin-bottom: 18px; display: inline-block">
|
||||
<el-date-picker
|
||||
v-model="input3"
|
||||
value-format="yyyy-MM-dd"
|
||||
size="small"
|
||||
type="date"
|
||||
placeholder="选择日期"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="结束时间" label-width="120px" style="margin-bottom: 18px; display: inline-block">
|
||||
<el-date-picker
|
||||
v-model="input4"
|
||||
value-format="yyyy-MM-dd"
|
||||
size="small"
|
||||
type="date"
|
||||
placeholder="选择日期"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div style="margin-right: 60px;margin-top: 10px">
|
||||
<el-button style="margin-left: 35%" @click="callOff('form')">取消</el-button>
|
||||
<el-button type="primary" @click="submit('form')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
<el-dialog :visible.sync="dialogeditVisible1" title="停产记录" style="width: 800px;margin: auto" center>
|
||||
<el-form ref="form2" :model="form2" label-position="left">
|
||||
<el-form-item label="停产原因" label-width="100px" style="width: 299px ; display: inline-block; text-align: left" size="small">
|
||||
<el-input v-model="form2.reason" auto-complete="off"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="停产时间" label-width="100px" style="width: 299px ; display: inline-block; text-align: left" size="small">
|
||||
<el-date-picker
|
||||
v-model="form2.time"
|
||||
value-format="yyyy-MM-dd"
|
||||
size="small"
|
||||
type="date"
|
||||
placeholder="选择日期"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div style="margin-left: 140px;margin-top: 10px">
|
||||
<el-button type="primary" @click="submitRemark()">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-card>
|
||||
<div>停产后,将重新补投两种零件,一种是接着加工(执行原来的加工计划),另一种是从第一序重新加工(重新制定零件的加工计划),补投的零件号后加B</div>
|
||||
<div style="margin-top: 20px; display: block">
|
||||
<span>补投接着加工零件数量</span>
|
||||
<el-input v-model="inputA" auto-complete="off" style="width: 200px" size="small"/>
|
||||
<span>开始工序</span>
|
||||
<el-input v-model="inputB" :disabled="true" auto-complete="off" style="width: 200px" size="small"/>
|
||||
<el-button :disabled="disabled" type="success" size="small" @click="editA">补投接着生产零件</el-button>
|
||||
</div>
|
||||
<div style="margin-left: 800px; display: block">>>>><el-button type="success" size="small" style="margin-left: 40px" @click="goToCapacityBalance()">制定计划</el-button></div>
|
||||
<div style="margin-top: 20px; display: block">
|
||||
<span>补投重新加工零件数量</span>
|
||||
<el-input v-model="inputC" auto-complete="off" style="width: 200px" size="small" />
|
||||
<span>开始工序</span>
|
||||
<el-input v-model="inputD" :disabled="true" auto-complete="off" style="width: 200px" size="small"/>
|
||||
<el-button :disabled="disabledB" type="success" size="small" @click="editB">补投重新生产零件</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<el-table
|
||||
:data="tableData4"
|
||||
height="250"
|
||||
highlight-current-row
|
||||
border
|
||||
stripe
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
prop="province1"
|
||||
label="零件号"
|
||||
>
|
||||
<template slot-scope="scope">{{ scope.row.零件图号 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="province2"
|
||||
label="零件名称"
|
||||
>
|
||||
<template slot-scope="scope">{{ scope.row.零件名称 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="province4"
|
||||
label="重投数量"
|
||||
>
|
||||
<template slot-scope="scope">{{ scope.row.批次数量 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="province5"
|
||||
label="开始工序"
|
||||
>
|
||||
<template slot-scope="scope">{{ scope.row.开始工序 }}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ProjectNameSelect, MachineDrawingSelect, TeamSelect, TableDataSelect, editTime, editStop, TableDta2Select, editA, TableData3Select, editchar } from '@/api/ManufacturingCenter/SparePartsForScrap'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
remark1: '',
|
||||
remark2: '',
|
||||
disabledB: false,
|
||||
tableData4: [],
|
||||
judge: '',
|
||||
ProjectNameValue: '', // 项目名称
|
||||
ProjectName: [], // 项目名称下拉框
|
||||
MachineDrawingValue: '', // 机床号
|
||||
MachineDrawing: [], // 机床图号下拉框
|
||||
TeamValue: '', // 组号
|
||||
Team: [], // 组号下拉框
|
||||
currentPage1: 1,
|
||||
pageSize1: 10,
|
||||
total1: null,
|
||||
currentPage2: 1,
|
||||
pageSize2: 10,
|
||||
total2: null,
|
||||
tableData: [], // 主表格数据
|
||||
tableData2: [], // 次表格数据
|
||||
loading: '', // 主表格加载
|
||||
loading2: '', // 次表格加载
|
||||
ProjectCode_check: '', // 项目流水号_check
|
||||
MachineCode_check: '', // 机床流水号_check
|
||||
TeamCode_check: '', // 组件流水号_check
|
||||
ComponentPartsBasicCattleTaxNumber_check: 0, // 组件零件基本件流水号_check
|
||||
ComponentPartsBasicCattleTaxNumber: '', // 组件零件基本件流水号
|
||||
CutCode_check: 0, // 工艺计划流水号_check
|
||||
CutCode: '', // 工艺计划流水号
|
||||
CutCodeBefore_check: 0, // 工艺计划流水号_补投前_check
|
||||
CutCodeBefore: '', // 工艺计划流水号_补投前
|
||||
Assess_check: 1, // 考核状态_check
|
||||
Assess: 6, // 考核状态
|
||||
PartDrawing_check: '', // 零件图号_check
|
||||
PartDrawing: '', // 零件图号
|
||||
dialogeditVisible: false, // 编辑对话框可见性
|
||||
dialogeditVisible1: false, // 编辑对话框可见性
|
||||
code: '', // 工艺计划流水号
|
||||
temp: '', // 是否停产中间值
|
||||
disabled: false,
|
||||
form: {
|
||||
input1: '',
|
||||
input2: ''
|
||||
},
|
||||
form2: {
|
||||
reason: '',
|
||||
time: ''
|
||||
},
|
||||
radio: '',
|
||||
input3: '', // 开始时间
|
||||
input4: '', // 结束时间
|
||||
inputA: 1,
|
||||
inputB: '',
|
||||
inputC: 1,
|
||||
inputD: 1
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.fetchProjectNameData()
|
||||
},
|
||||
methods: {
|
||||
// 项目名称查询
|
||||
fetchProjectNameData() {
|
||||
this.getSelect(ProjectNameSelect, ['项目名称', '项目流水号'], 'ProjectName', this.Assess)
|
||||
},
|
||||
// 机床图号查询
|
||||
fetchMachineDrawingData() {
|
||||
this.Team = []
|
||||
this.TeamValue = ''
|
||||
this.getSelect(MachineDrawingSelect, ['机床图号', '机床流水号'], 'MachineDrawing', this.ProjectNameValue)
|
||||
},
|
||||
// 组号查询
|
||||
fetchTeamDrawingData() {
|
||||
this.getSelect(TeamSelect, ['组号', '组件流水号'], 'Team', this.MachineDrawingValue)
|
||||
},
|
||||
fetchTableData() {
|
||||
this.loading = true
|
||||
this.ProjectNameValue ? this.ProjectCode_check = 1 : this.ProjectCode_check = 0
|
||||
this.MachineDrawingValue ? this.MachineCode_check = 1 : this.MachineCode_check = 0
|
||||
this.TeamValue ? this.TeamCode_check = 1 : this.TeamCode_check = 0
|
||||
this.PartDrawing ? this.PartDrawing_check = 1 : this.PartDrawing_check = 0
|
||||
this.getTable(TableDataSelect, [this.ProjectCode_check, this.ProjectNameValue, this.MachineCode_check, this.MachineDrawingValue, this.TeamCode_check, this.TeamValue, this.ComponentPartsBasicCattleTaxNumber_check, this.ComponentPartsBasicCattleTaxNumber, this.CutCode_check, this.CutCode, this.CutCodeBefore_check, this.CutCodeBefore, this.Assess_check, this.Assess, this.PartDrawing_check, this.PartDrawing, this.currentPage1, this.pageSize1], ['tableData', 'total1', 'loading'])
|
||||
},
|
||||
fetchTableData2(row) {
|
||||
if (row) {
|
||||
this.disabled = false
|
||||
this.judge = row.批次零件状态
|
||||
this.CutCodeBefore = row.工艺计划流水号
|
||||
TableDta2Select(row.工艺计划流水号, this.currentPage2, this.pageSize2).then(response => {
|
||||
this.tableData2 = response.data.rows
|
||||
this.total2 = response.data.total
|
||||
for (let i = 0; i < response.data.rows.length; i++) {
|
||||
if (response.data.rows[i].工序状态 === '4') {
|
||||
this.inputB = this.inputB + 1
|
||||
}
|
||||
if (response.data.rows[i].工序状态 !== '4') {
|
||||
this.inputB = response.data.rows[i].工序顺序
|
||||
break
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
handleSizeChange1(val) {
|
||||
this.currentPage1 = 1
|
||||
this.pageSize1 = val
|
||||
this.fetchTableData()
|
||||
},
|
||||
handleCurrentChange1(val) {
|
||||
this.currentPage1 = val
|
||||
this.fetchTableData()
|
||||
},
|
||||
handleSizeChange2(val) {
|
||||
this.pageSize2 = val
|
||||
TableDta2Select(this.CutCodeBefore, this.currentPage2, this.pageSize2).then(response => {
|
||||
this.tableData2 = response.data.rows
|
||||
this.total2 = response.data.total
|
||||
})
|
||||
this.currentPage2 = 1
|
||||
this.pageSize2 = 10
|
||||
},
|
||||
handleCurrentChange2(val) {
|
||||
this.currentPage2 = val
|
||||
TableDta2Select(this.CutCodeBefore, this.currentPage2, this.pageSize2).then(response => {
|
||||
this.tableData2 = response.data.rows
|
||||
this.total2 = response.data.total
|
||||
})
|
||||
this.currentPage2 = 1
|
||||
this.pageSize2 = 10
|
||||
},
|
||||
handleEdit(row) {
|
||||
this.remark1 = ''
|
||||
this.remark2 = ''
|
||||
this.form2.reason = ''
|
||||
this.form2.time = ''
|
||||
this.dialogeditVisible = true
|
||||
this.form.input1 = row.零件图号
|
||||
if (row.批次零件状态 === '2') {
|
||||
this.radio = '停止生产'
|
||||
} else if (row.批次零件状态 === '1') {
|
||||
this.radio = '正常生产'
|
||||
}
|
||||
this.input3 = row.机加工开始时间
|
||||
this.input4 = row.机加工结束时间
|
||||
this.code = row.工艺计划流水号
|
||||
},
|
||||
async chaEdit() {
|
||||
this.radio === '正常生产' ? this.temp = '1' : this.temp = '2'
|
||||
const Time = await editTime(this.code, this.input3, this.input4)
|
||||
const Char = await editchar(this.remark1, this.remark2, this.code)
|
||||
const Stop = await editStop(this.code, this.temp)
|
||||
if (Time.data[0].result === '1' && Char.data[0].result === '1' && Stop.data[0].result === '1') {
|
||||
this.dialogeditVisible = false
|
||||
this.$message.success('信息更新成功')
|
||||
this.fetchTableData()
|
||||
} else {
|
||||
this.$message.error('信息更新失败')
|
||||
}
|
||||
},
|
||||
// 提交添加或者修改
|
||||
submit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
this.chaEdit()
|
||||
}
|
||||
})
|
||||
},
|
||||
// 重置表单
|
||||
callOff(formName) {
|
||||
this.form = {}
|
||||
this.dialogeditVisible = false
|
||||
this.$refs[formName].resetFields()
|
||||
},
|
||||
editA() {
|
||||
if (this.judge === '2') {
|
||||
editA(this.CutCodeBefore, this.inputA, this.inputB).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('补投成功')
|
||||
this.disabled = true
|
||||
TableData3Select(0, this.ProjectNameValue, 0, this.MachineDrawingValue, 0, this.TeamValue, 0, this.ComponentPartsBasicCattleTaxNumber, 0, this.CutCode, 1, this.CutCodeBefore).then(response => {
|
||||
this.tableData4 = response.data
|
||||
})
|
||||
} else {
|
||||
this.$message.error('补投失败')
|
||||
}
|
||||
})
|
||||
} else { this.$message.warning('请选择停产零件') }
|
||||
},
|
||||
editB() {
|
||||
if (this.judge === '2') {
|
||||
editA(this.CutCodeBefore, this.inputC, this.inputD).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('补投成功')
|
||||
this.disabledB = true
|
||||
TableData3Select(0, this.ProjectNameValue, 0, this.MachineDrawingValue, 0, this.TeamValue, 0, this.ComponentPartsBasicCattleTaxNumber, 0, this.CutCode, 1, this.CutCodeBefore).then(response => {
|
||||
this.tableData4 = response.data
|
||||
})
|
||||
} else {
|
||||
this.$message.error('补投失败')
|
||||
}
|
||||
})
|
||||
} else { alert('请选择停产零件') }
|
||||
},
|
||||
goToCapacityBalance() {
|
||||
this.$router.push({ path: '/ProductionCapacityBalance/index' })
|
||||
},
|
||||
remark() {
|
||||
if (this.radio === '停止生产') {
|
||||
this.form2.reason = ''
|
||||
this.form2.time = ''
|
||||
this.dialogeditVisible1 = true
|
||||
}
|
||||
},
|
||||
submitRemark() {
|
||||
this.remark1 = this.form2.reason
|
||||
this.remark2 = this.form2.time
|
||||
this.dialogeditVisible1 = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-card{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.el-date-editor{
|
||||
width:200px;
|
||||
}
|
||||
</style>
|
||||
512
src/views/ManufacturingCenter/StatusQuery/index.vue
Normal file
512
src/views/ManufacturingCenter/StatusQuery/index.vue
Normal file
@@ -0,0 +1,512 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<el-card>
|
||||
<span>项目名称:</span>
|
||||
<el-select
|
||||
v-model="entryNameValue"
|
||||
:remote-method="remoteMethod"
|
||||
placeholder="项目名称"
|
||||
style="width:200px"
|
||||
size="small"
|
||||
clearable
|
||||
filterable
|
||||
remote
|
||||
@change="empty">
|
||||
<el-option
|
||||
v-for="item in entryName"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span>机床号:</span>
|
||||
<el-input v-model="machineToolNumber" placeholder="机床号" size="small" clearable style="width:200px" @dblclick.native="SearchMachine" @change="empty1"/>
|
||||
<span>组号:</span>
|
||||
<el-input v-model="groupNumber" placeholder="组号" size="small" clearable style="width:200px" @dblclick.native="searchGroupList"/>
|
||||
<span>零件号:</span>
|
||||
<el-input v-model="partNumber" placeholder="零件号" size="small" clearable style="width:200px"/>
|
||||
<br>
|
||||
<span>零件状态:</span>
|
||||
<el-select v-model="partStateValue" placeholder="零件状态" size="small" clearable style="width:200px">
|
||||
<el-option
|
||||
v-for="item in partState"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span>零件类型:</span>
|
||||
<el-select v-model="partTypeValue" placeholder="零件类型" size="small" clearable style="margin-top: 15px;width: 200px">
|
||||
<el-option
|
||||
v-for="item in partType"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<el-button type="success" icon="el-icon-search" size="small" style="margin: 15px 0 0 10px" @click="pageCurrent=1;pageSize=10;total=0;searchData()">查询</el-button>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<el-table
|
||||
v-loading="loading0"
|
||||
:data="tableData"
|
||||
style="width: 100%;max-height: 600px"
|
||||
height="600"
|
||||
size="mini"
|
||||
highlight-current-row
|
||||
border>
|
||||
<el-table-column align="center" label="序号" type="index" width="60px"/>
|
||||
<el-table-column align="center" label="机床图号" width="170px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机床图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="组号" width="140px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.组号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="零件图号" width="200px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="零件名称" width="180px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="数量" width="60px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.投产总数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="投产时间" width="130px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.传递时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="零件状态" width="750px">
|
||||
<template slot-scope="scope">
|
||||
<el-steps :active="scope.row.考核状态" finish-status="success" simple>
|
||||
<el-step title="投产" />
|
||||
<el-step title="工艺" />
|
||||
<el-step title="定额" />
|
||||
<el-step title="平衡" />
|
||||
<el-step title="完成" />
|
||||
<el-step title="入库" />
|
||||
<el-step title="出库" />
|
||||
</el-steps>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
@click="handleEdit(scope.row)">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[10, 20, 30, 40, 50]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-dialog :title="title" :visible.sync="dialogFormVisible4" center style="min-height: 300px" width="800px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="110px" class="demo-ruleForm">
|
||||
<el-form-item label="零件状态" prop="零件状态" style="margin-left: 200px">
|
||||
<el-select v-model="form.零件状态" placeholder="零件状态" size="small" clearable>
|
||||
<el-option
|
||||
v-for="item in partState"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="cancel('form')">取消</el-button>
|
||||
<el-button type="primary" @click="submitEdit('form')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :visible.sync="dialogFormVisible2" title="选择机床" center style="min-height: 300px">
|
||||
<el-table
|
||||
:data="tableData6"
|
||||
style="width:100%;max-height: 300px;display: inline-block"
|
||||
height="300"
|
||||
highlight-current-row
|
||||
border
|
||||
@row-click="selectMachine">
|
||||
<el-table-column align="center" label="机床图号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机床图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="机床名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机床名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="机床开始时间">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机床开始时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="机床结束时间">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机床结束时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工位属性">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位属性 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="机床主管">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机床主管 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:current-page="pageCurrent1"
|
||||
:page-sizes="[10, 20, 30, 40, 50]"
|
||||
:page-size="pageSize1"
|
||||
:total="total1"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange1"
|
||||
@current-change="handleCurrentChange1"/>
|
||||
</div>
|
||||
<el-button type="primary" style="margin-left: 350px;margin-top: 20px" @click="submitName">提交</el-button>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :visible.sync="dialogFormVisible3" title="选择组号" center style="min-height: 300px">
|
||||
<el-table
|
||||
:data="tableData7"
|
||||
style="width:100%;max-height: 300px;display: inline-block"
|
||||
height="300"
|
||||
highlight-current-row
|
||||
border
|
||||
@row-click="selectGroup">
|
||||
<el-table-column align="center" label="机床图号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机床图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="机床名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机床名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="组号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.组号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="组件名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.组件名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="组件介绍">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.组件介绍 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:current-page="pageCurrent2"
|
||||
:page-sizes="[10, 20, 30, 40, 50]"
|
||||
:page-size="pageSize2"
|
||||
:total="total2"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange3"
|
||||
@current-change="handleCurrentChange3"/>
|
||||
</div>
|
||||
<el-button type="primary" style="margin-left: 350px;margin-top: 20px" @click="submitGroup">提交</el-button>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { initProject, intPartState, searchTable, searchmachine, searchgroup, editData } from '@/api/ManufacturingCenter/StatusQuery'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading0: false,
|
||||
entryNameValue: '', // 项目流水号
|
||||
entryName: [], // 项目数组
|
||||
machineToolNumber: '', // 机床图号
|
||||
machineNumber: '',
|
||||
machine: null, // 机床流水号
|
||||
groupNumber: '', // 组号
|
||||
groupNumber1: '',
|
||||
groupNum: null, // 组件流水号
|
||||
partNumber: '', // 零件号
|
||||
partStateValue: null, // 零件状态
|
||||
partState: [], // 零件状态数组
|
||||
partTypeValue: null, // 零件类型
|
||||
num: null,
|
||||
pageCurrent: 1,
|
||||
pageSize: 10,
|
||||
pageCurrent1: 1,
|
||||
pageSize1: 10,
|
||||
pageCurrent2: 1,
|
||||
pageSize2: 10,
|
||||
tableData7: [],
|
||||
tableData6: [],
|
||||
tableData: [],
|
||||
state: null,
|
||||
total: null,
|
||||
total1: null,
|
||||
total2: null,
|
||||
title: '',
|
||||
dialogFormVisible2: false,
|
||||
dialogFormVisible3: false,
|
||||
dialogFormVisible4: false,
|
||||
List: [],
|
||||
check: null,
|
||||
check1: null,
|
||||
check2: null,
|
||||
check3: null,
|
||||
check4: null,
|
||||
check5: null,
|
||||
partType: [{
|
||||
value: 1,
|
||||
label: '自家生产'
|
||||
}, {
|
||||
value: 2,
|
||||
label: '外协生产'
|
||||
}],
|
||||
form: {
|
||||
零件状态: null
|
||||
},
|
||||
rules: {
|
||||
零件状态: [
|
||||
{ required: true, message: '请选择零件状态', trigger: 'change' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
fetchData() {
|
||||
intPartState().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.partState.push({
|
||||
label: response.data[i].考核状态名称,
|
||||
value: response.data[i].考核状态
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
searchData() {
|
||||
if (this.entryNameValue !== null && this.entryNameValue !== '') {
|
||||
this.check = 1
|
||||
} else {
|
||||
this.check = 0
|
||||
}
|
||||
if (this.machineToolNumber !== '') {
|
||||
this.check1 = 1
|
||||
} else {
|
||||
this.check1 = 0
|
||||
}
|
||||
if (this.groupNumber !== '') {
|
||||
this.check2 = 1
|
||||
} else {
|
||||
this.check2 = 0
|
||||
}
|
||||
if (this.partNumber !== '') {
|
||||
this.check3 = 1
|
||||
} else {
|
||||
this.check3 = 0
|
||||
}
|
||||
if (this.partStateValue !== null && this.partStateValue !== '') {
|
||||
this.check4 = 1
|
||||
} else {
|
||||
this.check4 = 0
|
||||
}
|
||||
if (this.partTypeValue !== null && this.partTypeValue !== '') {
|
||||
this.check5 = 1
|
||||
} else {
|
||||
this.check5 = 0
|
||||
}
|
||||
this.loading0 = true
|
||||
searchTable(this.check, this.entryNameValue, this.check1, this.machine, this.check2, this.groupNum, this.check3, this.partNumber, this.check4, this.partStateValue, this.check5, this.partTypeValue, this.pageSize, this.pageCurrent).then(response => {
|
||||
console.log(response.data)
|
||||
for (let i = 0; i < response.data.rows.length; i++) {
|
||||
response.data.rows[i].考核状态 = parseInt(response.data.rows[i].考核状态) - 2
|
||||
if (response.data.rows[i].传递时间 !== undefined || response.data.rows[i].hasOwnProperty('传递时间')) {
|
||||
response.data.rows[i].传递时间 = response.data.rows[i].传递时间.split(' ', 2)[0]
|
||||
}
|
||||
}
|
||||
this.loading0 = false
|
||||
this.tableData = response.data.rows
|
||||
this.total = parseInt(response.data.total)
|
||||
})
|
||||
},
|
||||
getList() { // 初始化项目名称
|
||||
this.list = []
|
||||
initProject().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.list.push({
|
||||
label: response.data[i].项目名称,
|
||||
value: response.data[i].项目流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
remoteMethod(query) {
|
||||
if (query !== '') {
|
||||
setTimeout(() => {
|
||||
this.entryName = this.list.filter(item => {
|
||||
return item.label.toLowerCase()
|
||||
.indexOf(query.toLowerCase()) > -1
|
||||
})
|
||||
}, 1000)
|
||||
} else {
|
||||
this.entryName = []
|
||||
}
|
||||
},
|
||||
empty() {
|
||||
this.machineToolNumber = ''
|
||||
this.groupNumber = ''
|
||||
},
|
||||
SearchMachine() { // 查询机床
|
||||
if (this.entryNameValue !== null && this.entryNameValue !== '') {
|
||||
this.dialogFormVisible2 = true
|
||||
this.check6 = 1
|
||||
searchmachine(this.entryNameValue, this.check6, this.pageCurrent1, this.pageSize1).then(response => {
|
||||
for (let i = 0; i < response.data.result.length; i++) {
|
||||
if (response.data.result[i].机床开始时间 !== '') {
|
||||
response.data.result[i].机床开始时间 = response.data.result[i].机床开始时间.substr(0, 10)
|
||||
}
|
||||
if (response.data.result[i].机床结束时间 !== '') {
|
||||
response.data.result[i].机床结束时间 = response.data.result[i].机床结束时间.substr(0, 10)
|
||||
}
|
||||
}
|
||||
this.tableData6 = response.data.result
|
||||
this.total1 = parseInt(response.data.output[0].ItemCount)
|
||||
})
|
||||
} else {
|
||||
this.$message.warning('请先选择项目')
|
||||
}
|
||||
},
|
||||
selectMachine(row) { // 选择机床号
|
||||
this.machine = row.机床流水号
|
||||
this.machineNumber = row.机床图号
|
||||
},
|
||||
submitName() { // 提交机床号
|
||||
this.machineToolNumber = this.machineNumber
|
||||
this.dialogFormVisible2 = false
|
||||
},
|
||||
empty1() {
|
||||
this.groupNumber = ''
|
||||
},
|
||||
searchGroupList() { // 查询组号
|
||||
if (this.machineToolNumber !== '') {
|
||||
this.dialogFormVisible3 = true
|
||||
searchgroup(this.machine, this.pageCurrent2, this.pageSize2).then(response => {
|
||||
this.tableData7 = response.data.result
|
||||
this.total2 = parseInt(response.data.output[0].ItemCount)
|
||||
})
|
||||
} else {
|
||||
this.$message.warning('请先选择机床')
|
||||
}
|
||||
},
|
||||
selectGroup(row) { // 选择组号
|
||||
this.groupNumber1 = row.组号
|
||||
this.groupNum = row.组件流水号
|
||||
},
|
||||
submitGroup() { // 提交组号
|
||||
this.groupNumber = this.groupNumber1
|
||||
this.dialogFormVisible3 = false
|
||||
},
|
||||
handleEdit(row) {
|
||||
if (this.$refs['form'] !== undefined) {
|
||||
this.$refs['form'].resetFields()
|
||||
}
|
||||
this.form = {}
|
||||
this.title = '编辑'
|
||||
this.dialogFormVisible4 = true
|
||||
this.num = row.工艺计划流水号
|
||||
},
|
||||
submitEdit(formName) { // 提交编辑
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
editData(this.num, this.form.零件状态).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('编辑成功')
|
||||
this.dialogFormVisible4 = false
|
||||
this.pageCurrent = 1
|
||||
this.searchData()
|
||||
} else { this.$message.error('编辑失败') }
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
cancel(formName) { // 取消
|
||||
this.form = {}
|
||||
this.dialogFormVisible4 = false
|
||||
this.$refs[formName].resetFields()
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.pageSize = val
|
||||
this.searchData()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.searchData()
|
||||
},
|
||||
handleSizeChange1(val) {
|
||||
this.pageCurrent1 = 1
|
||||
this.pageSize1 = val
|
||||
this.SearchMachine()
|
||||
},
|
||||
handleCurrentChange1(val) {
|
||||
this.pageCurrent1 = val
|
||||
this.SearchMachine()
|
||||
},
|
||||
handleSizeChange3(val) {
|
||||
this.pageCurrent2 = 1
|
||||
this.pageSize2 = val
|
||||
this.searchGroupList()
|
||||
},
|
||||
handleCurrentChange3(val) {
|
||||
this.pageCurrent2 = val
|
||||
this.searchGroupList()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-card{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.el-date-editor{
|
||||
width:150px
|
||||
}
|
||||
span{
|
||||
margin: 10px 0 10px 10px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,305 @@
|
||||
<!--典型工艺维护-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<div style="margin-top: -10px;">
|
||||
<el-row>
|
||||
<span>零件分类:</span>
|
||||
<el-select v-model="partsCategoriesValue" size="small" filterable clearable placeholder="零件分类" @change="getPartsName">
|
||||
<el-option
|
||||
v-for="item in partsCategories"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
|
||||
<span>零件名称:</span>
|
||||
<el-select v-model="partsNameValue" size="small" filterable clearable placeholder="零件名称" @change="getTableData" >
|
||||
<el-option
|
||||
v-for="item in partsName"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
|
||||
<span>典型工艺号:</span>
|
||||
<el-input v-model="typicalNumValue" auto-complete="off" style="width: 200px" size="small" />
|
||||
<el-button size="small" type="primary" icon="el-icon-search" style="margin: 10px 0 0 10px" @click="getTableData">查询</el-button>
|
||||
<el-button size="small" type="info" icon="el-icon-circle-plus-outline" style="margin: 10px 0 0 10px" @click="addTableData">增加</el-button>
|
||||
<el-button size="small" type="success" icon="el-icon-cjn-09" style="margin: 10px 0 0 10px" @click="editConfirm">保存</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<el-table v-loading="loading" :data="tableData" border style="width: 100%;max-height: 550px;" size="mini" height="550px">
|
||||
<el-table-column prop="num" label="序号" width="50" align="center" type="index"/>
|
||||
<el-table-column prop="name" label="工艺名称" width="230" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input
|
||||
v-model="scope.row.工艺名称"
|
||||
size="mini"
|
||||
style="width:200px"
|
||||
placeholder="工艺名称"
|
||||
@dblclick.native="tableSearch(scope.$index)"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="hard" label="难度等级" width="110" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.工艺难度等级" size="mini" placeholder="请选择" @change="difficultyLevel(scope.row)">
|
||||
<el-option v-for="item in hard" :key="item.value" :label="item.label" :value="item.value">
|
||||
<span style="color: #8492a6; font-size: 13px">{{ item.value }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="request" label="工艺要求" align="center" min-width="350">
|
||||
<template slot-scope="scope">
|
||||
<el-input
|
||||
v-model="scope.row.工艺要求"
|
||||
:rows="1"
|
||||
size="mini"
|
||||
placeholder="工艺要求"
|
||||
type="textarea"
|
||||
@dblclick.native="tableSearch(scope.$index)"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="单件" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.单件定额工时" style="width:50px" placeholder="单件定额工时"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="准结" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.准结定额工时" style="width:50px" placeholder="准结定额工时"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="300" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<el-button
|
||||
size="mini"
|
||||
icon="el-icon-arrow-up"
|
||||
type="primary"
|
||||
@click="upMove(scope.row)"/>
|
||||
<el-button
|
||||
size="mini"
|
||||
icon="el-icon-arrow-down"
|
||||
type="primary"
|
||||
@click="downMove(scope.row)"/>
|
||||
<el-button
|
||||
size="mini"
|
||||
icon="el-icon-circle-plus-outline"
|
||||
type="primary"
|
||||
@click="insertRow(scope.row)"/>
|
||||
<el-button
|
||||
size="mini"
|
||||
icon="el-icon-delete"
|
||||
type="danger"
|
||||
@click="delRow(scope.row)"/>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<el-dialog :visible.sync="dialogFormVisible" title="工艺名称、工艺要求选择" center width="400px">
|
||||
<el-form ref="form" :model="form" label-position="left" label-width="125px" class="demo-ruleForm">
|
||||
<el-form-item label="工艺名称分类">
|
||||
<el-select v-model="form.processNameClassValue" placeholder="分类" size="small" @change="classificationChange()">
|
||||
<el-option
|
||||
v-for="item in processNameClass"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="工艺名称">
|
||||
<el-select v-model="form.processNameValue" placeholder="名称" size="small" @change="nameChange()">
|
||||
<el-option
|
||||
v-for="item in processName"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="工艺要求">
|
||||
<el-select v-model="form.processRequestValue" placeholder="要求" size="small">
|
||||
<el-option
|
||||
v-for="item in processRequest"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button size="mini" type="primary" @click="confirmSelect()">确定选择</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getPartsCategories, getPartsName, getTableData, upMove, downMove, deleRow, editConfirm, processNameSelect, processRequestSelect, processNameClick, insertRow, difficultyLevel, isAddOrEdit, addProcess } from '@/api/ManufacturingCenter/TypicalProcessMaintenance'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
partsCategories: [],
|
||||
partsCategoriesCheck: null,
|
||||
partsCategoriesValue: '',
|
||||
partsName: [],
|
||||
partsNameCheck: null,
|
||||
partsNameValue: '',
|
||||
typicalNumValue: '',
|
||||
tableData: [],
|
||||
loading: false,
|
||||
hard: [{ value: 'A' }, { value: 'B' }, { value: 'C' }],
|
||||
dialogFormVisible: false,
|
||||
form: {
|
||||
processNameClassValue: '',
|
||||
processNameValue: '',
|
||||
processRequestValue: ''
|
||||
},
|
||||
processNameClass: [],
|
||||
processName: [],
|
||||
processRequest: [],
|
||||
index: null
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
fetchData() {
|
||||
this.getSelect(getPartsCategories, ['典型工艺名称分类', '典型工艺名称分类流水号'], 'partsCategories')
|
||||
},
|
||||
getPartsName() {
|
||||
this.typicalNumValue = ''
|
||||
this.partsName = []
|
||||
this.partsNameValue = ''
|
||||
getPartsName(this.partsCategoriesValue).then(res => {
|
||||
const data = res.data
|
||||
data.length > 0 ? this.partsNameValue = data[0].典型工艺流水号 : this.partsNameValue = ''
|
||||
this.typicalNumValue = data[0].典型工艺号
|
||||
data.map(item => {
|
||||
this.partsName.push({
|
||||
label: item.典型工艺名称,
|
||||
value: item.典型工艺流水号
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
getTableData() {
|
||||
this.partsCategoriesValue ? this.partsCategoriesCheck = 1 : this.partsCategoriesCheck = 0
|
||||
this.partsNameValue ? this.partsNameCheck = 1 : this.partsNameCheck = 0
|
||||
this.loading = true
|
||||
getTableData(this.partsCategoriesCheck, this.partsCategoriesValue, this.partsNameCheck, this.partsNameValue).then(res => {
|
||||
this.loading = false
|
||||
this.tableData = res.data
|
||||
})
|
||||
},
|
||||
upMove(row) {
|
||||
upMove(row.典型工艺流水号, row.典型工艺工序流水号).then(res => {
|
||||
if (res.data[0].result === '1') {
|
||||
this.getTableData()
|
||||
}
|
||||
})
|
||||
},
|
||||
downMove(row) {
|
||||
downMove(row.典型工艺流水号, row.典型工艺工序流水号).then(res => {
|
||||
if (res.data[0].result === '1') {
|
||||
this.getTableData()
|
||||
}
|
||||
})
|
||||
},
|
||||
insertRow(row) {
|
||||
insertRow(row.典型工艺流水号, row.典型工艺工序流水号).then(res => {
|
||||
if (res.data[0].result === '1') {
|
||||
this.getTableData()
|
||||
}
|
||||
})
|
||||
},
|
||||
delRow(row) {
|
||||
deleRow(row.典型工艺流水号, row.典型工艺工序流水号).then(res => {
|
||||
if (res.data[0].result === '1') {
|
||||
this.getTableData()
|
||||
}
|
||||
})
|
||||
},
|
||||
editConfirm() {
|
||||
let index = 0
|
||||
this.tableData.map(row => {
|
||||
editConfirm(row.典型工艺流水号, row.典型工艺工序流水号, row.工艺序号, row.工艺编号, row.工艺要求, row.单件定额工时, row.准结定额工时, row.备注).then(res => {
|
||||
if (res.data[0].result === '1') {
|
||||
index++
|
||||
} else {
|
||||
this.$message.error('零件保存失败')
|
||||
}
|
||||
if (index === this.tableData.length) {
|
||||
this.$message.success('保存修改成功')
|
||||
this.getTableData()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
tableSearch(index) {
|
||||
this.index = index
|
||||
this.dialogFormVisible = true
|
||||
this.processNameClass = []
|
||||
this.processName = []
|
||||
this.form.processNameClassValue = ''
|
||||
this.form.processNameValue = ''
|
||||
this.form.processRequestValue = ''
|
||||
this.getSelect(processNameClick, ['工艺分类名称', '工艺分类流水号'], 'processNameClass')
|
||||
},
|
||||
classificationChange() {
|
||||
this.processName = []
|
||||
this.processRequest = []
|
||||
this.form.processNameValue = ''
|
||||
this.form.processRequestValue = ''
|
||||
this.getSelect(processNameSelect, ['工艺名称', '工艺编号'], 'processName', this.form.processNameClassValue)
|
||||
},
|
||||
nameChange() {
|
||||
this.form.processRequestValue = ''
|
||||
this.processRequest = []
|
||||
this.getSelect(processRequestSelect, ['工艺要求'], 'processRequest', this.form.processNameValue)
|
||||
},
|
||||
confirmSelect() {
|
||||
this.dialogFormVisible = false
|
||||
for (let i = 0, len = this.processName.length; i < len; i++) {
|
||||
if (this.processName[i].value === this.form.processNameValue) {
|
||||
this.tableData[this.index].工艺名称 = this.processName[i].label
|
||||
break
|
||||
}
|
||||
}
|
||||
this.tableData[this.index].工艺编号 = this.form.processNameValue
|
||||
this.tableData[this.index].工艺要求 = this.form.processRequestValue
|
||||
},
|
||||
difficultyLevel(row) {
|
||||
difficultyLevel(row.工艺难度等级, row.典型工艺工序流水号)
|
||||
},
|
||||
async addTableData() {
|
||||
if (this.partsNameValue) {
|
||||
const result = await isAddOrEdit(this.partsNameValue)
|
||||
if (result.data.length === 0) {
|
||||
for (let i = 1; i < 21; i++) {
|
||||
await addProcess(this.partsNameValue, i, 0)
|
||||
}
|
||||
this.getTableData()
|
||||
} else {
|
||||
this.$message.warning(`改工艺已存在!请修改工艺`)
|
||||
}
|
||||
} else {
|
||||
this.$message.warning('请选择零件名称')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
span{
|
||||
margin: 20px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,344 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<span>设备名称:</span>
|
||||
<el-input v-model="equipmentName" placeholder="设备名称" size="small" clearable style="width:200px;margin-left: 10px"/>
|
||||
<el-button type="success" size="small" icon="el-icon-search" style="margin-left:30px" @click="pageCurrent = 1;fetchData()">查询</el-button>
|
||||
<el-button type="primary" size="small" icon="el-icon-circle-plus-outline" style="margin-left:10px" @click="handleAdd()">增加</el-button>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<el-table :data="List" highlight-current-row border>
|
||||
<el-table-column label="设备名称" align="center" >
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.设备名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="设备编号" align="center" >
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.设备编号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="设备型号" align="center" >
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.设备型号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="设备性能指标" align="center" >
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.设备性能指标 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="设备加工能力" align="center" >
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.设备加工能力工时 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="设备加工工艺" align="center" >
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工艺属性 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="班次类型" align="center" >
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.班次类型 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="设备工时系数" align="center" >
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.设备工时系数 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="整改工时系数" align="center" >
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.整改工时比例 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="预留工时系数" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.设备预留工时系数 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="200px" fixed="right" >
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" icon="el-icon-edit" style="margin-left:10px" @click="handleEdit(scope.row)">编辑</el-button>
|
||||
<el-button type="danger" size="mini" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-dialog :title="title" :visible.sync="dialogFormVisible" center style="min-height: 300px" width="800px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="120px" class="demo-ruleForm">
|
||||
<el-row>
|
||||
<el-col :span = "12">
|
||||
<el-form-item label="设备名称" prop="设备名称" >
|
||||
<el-input v-model="form.设备名称" placeholder="设备名称" size="small" style="width:200px" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span = "12">
|
||||
<el-form-item label="设备编号" prop="设备编号" >
|
||||
<el-input v-model="form.设备编号" placeholder="设备编号" size="small" style="width:200px" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span = "12">
|
||||
<el-form-item label="设备型号" prop="设备型号" >
|
||||
<el-input v-model="form.设备型号" placeholder="设备型号" size="small" style="width:200px" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span = "12">
|
||||
<el-form-item label="设备性能指标" prop="设备性能指标" >
|
||||
<el-input v-model="form.设备性能指标" placeholder="设备性能指标" size="small" style="width:200px" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span = "12">
|
||||
<el-form-item label="设备加工能力" prop="设备加工能力" >
|
||||
<el-input v-model="form.设备加工能力" placeholder="设备加工能力" size="small" style="width:200px" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span = "12">
|
||||
<el-form-item label="设备加工工艺" prop="设备加工工艺" >
|
||||
<el-select v-model="form.设备加工工艺" placeholder="设备加工工艺" size="small" style="width:200px" clearable >
|
||||
<el-option
|
||||
v-for="item in processingName"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span = "12">
|
||||
<el-form-item label="班次类型" prop="班次类型" >
|
||||
<el-select v-model="form.班次类型" placeholder="班次类型" size="small" style="width:200px" clearable >
|
||||
<el-option
|
||||
v-for="item in typeOfShift"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span = "12">
|
||||
<el-form-item label="设备工时系数" prop="设备工时系数" >
|
||||
<el-input v-model="form.设备工时系数" placeholder="设备工时系数" size="small" style="width:200px" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span = "12">
|
||||
<el-form-item label="整改工时系数" prop="整改工时系数" >
|
||||
<el-input v-model="form.整改工时系数" placeholder="整改工时系数" size="small" style="width:200px" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span = "12">
|
||||
<el-form-item label="预留工时系数" prop="预留工时系数" >
|
||||
<el-input v-model="form.预留工时系数" placeholder="预留工时系数" size="small" style="width:200px" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="callOff('form')">取消</el-button>
|
||||
<el-button type="primary" @click="submit('form')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getData, initProcessing, addTable, editTable, deleteTable } from '@/api/ManufacturingCenter/WorkshopEquipmentManagement'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
equipmentName: '', // 设备名称
|
||||
List: [],
|
||||
check: 0,
|
||||
pageCurrent: 1,
|
||||
pageSize: 10,
|
||||
total: null,
|
||||
title: '',
|
||||
dialogFormVisible: false,
|
||||
processingName: [],
|
||||
processing1: '', // 工艺名称简称
|
||||
equipmentSerialNumber: '', // 设备流水号
|
||||
typeOfShift: [
|
||||
{ value: '0', label: 0 },
|
||||
{ value: '1', label: 1 },
|
||||
{ value: '2', label: 2 },
|
||||
{ value: '3', label: 3 },
|
||||
{ value: '4', label: 4 }],
|
||||
form: {
|
||||
设备名称: '',
|
||||
设备编号: '',
|
||||
设备型号: '',
|
||||
设备性能指标: '',
|
||||
设备加工能力: '',
|
||||
设备加工工艺: '',
|
||||
班次类型: '',
|
||||
设备工时系数: '',
|
||||
整改工时系数: '',
|
||||
预留工时系数: ''
|
||||
},
|
||||
rules: {
|
||||
设备名称: [{ required: true, message: '请选择设备名称', change: 'blur' }],
|
||||
设备编号: [{ required: true, message: '请选择设备编号', change: 'blur' }],
|
||||
设备型号: [{ required: true, message: '请选择设备型号', change: 'blur' }],
|
||||
设备加工能力: [{ required: true, message: '请选择设备加工能力', change: 'blur' }],
|
||||
设备加工工艺: [{ required: true, message: '请选择设备加工工艺', trigger: 'blur' }],
|
||||
班次类型: [{ required: true, message: '请选择班次类型', trigger: 'blur' }],
|
||||
设备工时系数: [{ required: true, message: '请选择设备工时系数', change: 'blur' }],
|
||||
整改工时系数: [{ required: true, message: '请选择整改工时系数', change: 'blur' }],
|
||||
预留工时系数: [{ required: true, message: '请选择预留工时系数', change: 'blur' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initialization()
|
||||
},
|
||||
methods: {
|
||||
fetchData() {
|
||||
if (this.equipmentName !== '') {
|
||||
this.check = 1
|
||||
} else {
|
||||
this.check = 0
|
||||
}
|
||||
getData(this.check, this.equipmentName, this.pageCurrent, this.pageSize).then(response => {
|
||||
this.List = response.data.rows
|
||||
this.total = response.data.total
|
||||
})
|
||||
},
|
||||
initialization() {
|
||||
initProcessing().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.processingName.push({
|
||||
label: response.data[i].工艺名称,
|
||||
value: response.data[i].工艺编号,
|
||||
processing: response.data[i].工艺名称简称
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleAdd() {
|
||||
if (this.$refs['form'] !== undefined) {
|
||||
this.$refs['form'].resetFields()
|
||||
}
|
||||
this.dialogFormVisible = true
|
||||
this.title = '增加'
|
||||
this.form = {}
|
||||
},
|
||||
handleEdit(row) {
|
||||
if (this.$refs['form'] !== undefined) {
|
||||
this.$refs['form'].resetFields()
|
||||
}
|
||||
this.title = '编辑'
|
||||
this.dialogFormVisible = true
|
||||
this.form.设备名称 = row.设备名称
|
||||
this.form.设备编号 = row.设备编号
|
||||
this.form.设备型号 = row.设备型号
|
||||
this.form.设备性能指标 = row.设备性能指标
|
||||
this.form.设备加工能力 = row.设备加工能力工时
|
||||
this.form.班次类型 = row.班次类型
|
||||
this.form.设备工时系数 = row.设备工时系数
|
||||
this.form.整改工时系数 = row.整改工时比例
|
||||
this.form.预留工时系数 = row.设备预留工时系数
|
||||
this.equipmentSerialNumber = row.设备流水号
|
||||
},
|
||||
submit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.title === '增加') {
|
||||
this.submitAdd()
|
||||
this.title = ''
|
||||
} else if (this.title === '编辑') {
|
||||
this.submitEdit()
|
||||
this.title = ''
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
submitAdd() {
|
||||
for (let i = 0; i < this.processingName.length; i++) {
|
||||
if (this.form.设备加工工艺 === this.processingName[i].value) {
|
||||
this.processing1 = this.processingName[i].processing
|
||||
}
|
||||
}
|
||||
addTable(this.form.设备名称, this.form.设备型号, this.form.设备性能指标, this.form.设备加工能力, this.form.设备工时系数, this.processing1, this.form.设备加工工艺, this.form.班次类型, this.form.整改工时系数, this.form.设备编号, this.form.预留工时系数).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: '信息添加成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.dialogFormVisible = false
|
||||
this.fetchData()
|
||||
} else {
|
||||
this.$message.error('信息添加失败')
|
||||
}
|
||||
})
|
||||
},
|
||||
submitEdit() {
|
||||
editTable(this.equipmentSerialNumber, this.form.设备名称, this.form.设备型号, this.form.设备性能指标, this.form.设备加工能力, this.form.设备工时系数, this.form.班次类型, this.form.设备加工工艺, this.form.整改工时系数, this.form.设备编号, this.form.预留工时系数).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: '信息编辑成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.dialogFormVisible = false
|
||||
this.fetchData()
|
||||
} else {
|
||||
this.$message.error('信息编辑失败')
|
||||
}
|
||||
})
|
||||
},
|
||||
callOff(formName) {
|
||||
this.dialogFormVisible = false
|
||||
this.$refs[formName].resetFields()
|
||||
},
|
||||
handleDelete(row) {
|
||||
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteTable(row.设备流水号).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('删除成功')
|
||||
this.fetchData()
|
||||
} else { this.$message.error('删除失败') }
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.pageSize = val
|
||||
this.pageCurrent = 1
|
||||
this.fetchData()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.fetchData()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
586
src/views/MarketingCenter/BidBond/index.vue
Normal file
586
src/views/MarketingCenter/BidBond/index.vue
Normal file
@@ -0,0 +1,586 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--顶栏结构-->
|
||||
<el-card>
|
||||
<el-radio v-model="radio" label="1">未收回</el-radio>
|
||||
<el-radio v-model="radio" label="2">已收回</el-radio>
|
||||
<span style="margin-left: 20px">保金类型:</span>
|
||||
<el-select v-model="TypeOfGoldDepositValue" clearable filterable placeholder="请选择" size="small" style="margin-left: 10px;width: 130px">
|
||||
<el-option
|
||||
v-for="item in TypeOfGoldDeposit"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">投标人:</span>
|
||||
<el-input v-model="Bidder" clearable size="small" style="width:100px" placeholder="请选择" readonly @dblclick.native="dialogFormVisiblePeople = true;flag2 = 1" @clear="clear()"/>
|
||||
<span style="margin-left: 10px">招标企业:</span>
|
||||
<el-input v-model="TenderingEnterprise" clearable size="small" style="width:180px" placeholder="请输入招标企业"/>
|
||||
<span style="margin-left: 10px">开始日期:</span>
|
||||
<el-date-picker
|
||||
v-model="startTime"
|
||||
style="width: 200px;"
|
||||
value-format="yyyy-MM-dd"
|
||||
size="small"
|
||||
type="date"
|
||||
placeholder="请选择开始日期"/>
|
||||
<span style="margin-left: 10px">结束日期:</span>
|
||||
<el-date-picker
|
||||
v-model="endTime"
|
||||
style="width: 200px;"
|
||||
value-format="yyyy-MM-dd"
|
||||
size="small"
|
||||
type="date"
|
||||
placeholder="请选择结束日期"/>
|
||||
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="pageSize = 10;PageCurrent = 1;fetchTableData1()">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" style="margin-left: 10px;margin-right: 15px" @click="addBidBond();flag1 = 2">增加</el-button>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<span>预警颜色说明:</span>
|
||||
<el-tag type="info">未到时间</el-tag>
|
||||
<el-tag type="warning">即将拖期</el-tag>
|
||||
<el-tag type="danger">已拖期</el-tag>
|
||||
<el-tag type="success">已收回</el-tag>
|
||||
<el-tag style="background-color: lightgrey;color: #666666">履约金</el-tag>
|
||||
</el-card>
|
||||
|
||||
<!--投标保证金表格-->
|
||||
<el-card>
|
||||
<el-table
|
||||
v-loading="tableData1Loading"
|
||||
:row-style="tableRowClassName"
|
||||
:data="tableData1"
|
||||
style="width: 100%"
|
||||
height="600"
|
||||
border>
|
||||
<el-table-column align="center" label="招标企业" width="300">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.招标企业 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="联系人" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.联系人 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="联系电话" width="120">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.联系电话 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="保证金金额" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.保证金金额 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="投标人" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.投标人 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="保金类型" width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.保证金类型 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="投标日期" width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.投标日期 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="计划收回日期" width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.预计收回日期 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="实际收回日期" width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.实际收回日期 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="状态" width="120">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.状态 === '0'">未到预警时间</div>
|
||||
<div v-else-if="scope.row.状态 === '1'">即将拖期</div>
|
||||
<div v-else-if="scope.row.状态 === '2'">已拖期</div>
|
||||
<div v-else >已收回</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="备注">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.备注 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="400">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
:disabled="scope.row.是否禁用"
|
||||
size="mini"
|
||||
type="success"
|
||||
icon="el-icon-edit"
|
||||
@click.stop="TakeBack(scope.row);flag1 = 1">收回</el-button>
|
||||
<el-button
|
||||
:disabled="disabled"
|
||||
size="mini"
|
||||
type="info"
|
||||
icon="el-icon-edit"
|
||||
@click.stop="ComplianceGold(scope.row)">履约</el-button>
|
||||
<el-button
|
||||
:disabled="disabled"
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
@click.stop="editBidBond(scope.row);flag1 = 3">编辑</el-button>
|
||||
<el-button
|
||||
:disabled="disabled"
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@click.stop="delBidBond(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:current-page="PageCurrent"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="PageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-dialog :visible.sync="dialogFormVisiblePeople" title="人员信息" center width="750px">
|
||||
<div style="height: 420px">
|
||||
<div style="float: left;margin-top: 10px;margin-left: 20px;overflow-y: scroll;height: 400px">
|
||||
<el-tree
|
||||
:data="dataPeople"
|
||||
node-key="id"
|
||||
style="width: 150px;float: left"
|
||||
height="400"
|
||||
accordion
|
||||
@node-click="handleNodeClick"
|
||||
/>
|
||||
</div>
|
||||
<el-table :data="ListPeople" highlight-current-row height="400" style="width: 400px;float: left;margin-left: 30px" @row-click="handleChange">
|
||||
<el-table-column label="考勤编号" align="center" >
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.考勤编号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="姓名" align="center" >
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.姓名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="性别" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.性别 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工作岗位" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.岗位名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-button style="margin-left: 260px" @click="offName">取消</el-button>
|
||||
<el-button type="primary" style="margin-top: 20px" @click="getName">确认</el-button>
|
||||
</el-dialog>
|
||||
|
||||
<!--收回投标保证金-->
|
||||
<el-dialog :visible.sync="dialogFormVisible1" title="收回" center style="min-height: 300px" width="20%">
|
||||
<el-form ref="form1" :model="form1" :rules="rules1" label-position="left" label-width="110px" class="demo-ruleForm">
|
||||
<el-form-item label="实际收回日期" prop="收回日期">
|
||||
<el-date-picker
|
||||
v-model="form1.收回日期"
|
||||
style="width: 200px;"
|
||||
value-format="yyyy-MM-dd"
|
||||
size="small"
|
||||
type="date"
|
||||
placeholder="收回日期"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="callOff('form1')">取消</el-button>
|
||||
<el-button type="primary" @click="submit('form1')">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!--投标保证金对话框-->
|
||||
<el-dialog :title="title" :visible.sync="dialogFormVisible2" center style="min-height: 300px" width="40%">
|
||||
<el-form ref="form2" :model="form2" :rules="rules2" label-position="left" label-width="120px" class="demo-ruleForm">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="招标企业" prop="招标企业">
|
||||
<el-input v-model="form2.招标企业" size="small" placeholder="请输入招标企业" style="width: 200px;"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系人" prop="联系人">
|
||||
<el-input v-model="form2.联系人" size="small" placeholder="请输入联系人" style="width: 200px;"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系电话" prop="联系电话">
|
||||
<el-input v-model="form2.联系电话" size="small" placeholder="请输入联系电话" style="width: 200px;"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="保证金金额" prop="保证金金额">
|
||||
<el-input v-model="form2.保证金金额" size="small" placeholder="请输入保证金金额" style="width: 200px;"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="保证金类型" prop="保证金类型">
|
||||
<el-select v-model="form2.保证金类型" clearable filterable placeholder="请选择保证金类型" size="small" style="width: 200px;">
|
||||
<el-option
|
||||
v-for="item in TypeOfGoldDeposit1"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="投标人" prop="投标人">
|
||||
<el-input v-model="form2.投标人" size="small" placeholder="请输入投标人" style="width: 200px;" readonly @dblclick.native="dialogFormVisiblePeople = true;flag2 = 2" @clear="clear()"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="投标日期" prop="投标日期">
|
||||
<el-date-picker
|
||||
v-model="form2.投标日期"
|
||||
style="width: 200px;"
|
||||
value-format="yyyy-MM-dd"
|
||||
size="small"
|
||||
type="date"
|
||||
placeholder="投标日期"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="计划收回日期" prop="计划收回日期">
|
||||
<el-date-picker
|
||||
v-model="form2.计划收回日期"
|
||||
style="width: 200px;"
|
||||
value-format="yyyy-MM-dd"
|
||||
size="small"
|
||||
type="date"
|
||||
placeholder="收回日期"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="提前X天提醒我" prop="提前X天提醒我">
|
||||
<el-input v-model="form2.提前X天提醒我" size="small" placeholder="提前X天提醒我" style="width: 200px;"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注" prop="备注">
|
||||
<el-input v-model="form2.备注" size="small" placeholder="请输入备注" style="width: 200px;"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="callOff('form2')">取消</el-button>
|
||||
<el-button type="primary" @click="submit('form2')">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { initType, selectBidBond, getTree, tree, getTablePeople, TakeBack, ComplianceGold, addBidBond, editBidBond, delBidBond } from '@/api/MarketingCenter/BidBond'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
disabled: false,
|
||||
BidBondCode: '',
|
||||
MoneyTypeCode: '',
|
||||
TypeOfGoldDeposit1: [],
|
||||
flag2: '',
|
||||
title: '',
|
||||
dialogFormVisible2: false,
|
||||
code: '',
|
||||
flag1: '',
|
||||
startTime: '',
|
||||
startTime_check: '',
|
||||
endTime: '',
|
||||
endTime_check: '',
|
||||
tableData1Loading: false,
|
||||
TypeOfGoldDepositValue: '', // 保证金类型
|
||||
TypeOfGoldDepositValue_check: '',
|
||||
TypeOfGoldDeposit: [], // 保证金类型数组
|
||||
Bidder: '', // 投标人,
|
||||
Bidder_check: '',
|
||||
TenderingEnterprise: '', // 招标企业
|
||||
TenderingEnterprise_check: '',
|
||||
time: [], // 时间区间
|
||||
radio: '1',
|
||||
tableData1: [],
|
||||
PageSize: 10,
|
||||
PageCurrent: 1,
|
||||
total: null,
|
||||
dataPeople: [],
|
||||
dialogFormVisiblePeople: false,
|
||||
ListPeople: [],
|
||||
peopleid: '',
|
||||
peoplename: '',
|
||||
dialogFormVisible1: false,
|
||||
form1: {
|
||||
收回日期: ''
|
||||
},
|
||||
form2: {
|
||||
招标企业: '',
|
||||
联系人: '',
|
||||
联系电话: '',
|
||||
保证金金额: '',
|
||||
保证金类型: '',
|
||||
投标人: '',
|
||||
投标日期: '',
|
||||
计划收回日期: '',
|
||||
提前X天提醒我: '',
|
||||
备注: ''
|
||||
},
|
||||
rules1: { // 表单验证规则
|
||||
收回日期: [{ required: true, message: '请输入收回日期', trigger: 'change' }]
|
||||
},
|
||||
rules2: { // 表单验证规则
|
||||
招标企业: [{ required: true, message: '请输入招标企业', trigger: 'blur' }],
|
||||
联系人: [{ required: true, message: '请输入联系人', trigger: 'blur' }],
|
||||
联系电话: [{ required: true, message: '请输入联系电话', trigger: 'blur' }],
|
||||
保证金金额: [{ required: true, message: '请输入保证金金额', trigger: 'blur' }],
|
||||
保证金类型: [{ required: true, message: '请输入保证金类型', trigger: 'change' }],
|
||||
投标人: [{ required: true, message: '请输入投标人', trigger: 'change' }],
|
||||
投标日期: [{ required: true, message: '请选择收回日期', trigger: 'change' }],
|
||||
计划收回日期: [{ required: true, message: '请选择计划收回日期', trigger: 'change' }],
|
||||
提前X天提醒我: [{ required: true, message: '提前X天提醒我', trigger: 'blur' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.init()
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.getSelect(initType, ['保证金类型', '保证金类型流水号'], 'TypeOfGoldDeposit')
|
||||
this.getSelect(initType, ['保证金类型', '保证金类型流水号'], 'TypeOfGoldDeposit1')
|
||||
getTree().then(response => { // 获取人员信息树
|
||||
const data = response.data
|
||||
this.dataPeople = tree(data, 0)
|
||||
})
|
||||
},
|
||||
fetchTableData1() {
|
||||
if (this.TypeOfGoldDepositValue === '' || this.TypeOfGoldDepositValue == null) {
|
||||
this.TypeOfGoldDepositValue_check = 0
|
||||
} else {
|
||||
this.TypeOfGoldDepositValue_check = 1
|
||||
}
|
||||
if (this.Bidder === '' || this.Bidder == null) {
|
||||
this.Bidder_check = 0
|
||||
} else {
|
||||
this.Bidder_check = 1
|
||||
}
|
||||
if (this.TenderingEnterprise === '' || this.TenderingEnterprise == null) {
|
||||
this.TenderingEnterprise_check = 0
|
||||
} else {
|
||||
this.TenderingEnterprise_check = 1
|
||||
}
|
||||
if (this.startTime === '' || this.startTime == null) {
|
||||
this.startTime_check = 0
|
||||
} else {
|
||||
this.startTime_check = 1
|
||||
}
|
||||
if (this.endTime === '' || this.endTime == null) {
|
||||
this.endTime_check = 0
|
||||
} else {
|
||||
this.endTime_check = 1
|
||||
}
|
||||
if (this.radio === '1') {
|
||||
this.disabled = false
|
||||
} else {
|
||||
this.disabled = true
|
||||
}
|
||||
this.tableData1Loading = true
|
||||
selectBidBond(1, this.radio, this.TypeOfGoldDepositValue_check, this.TypeOfGoldDepositValue, this.Bidder_check, this.peopleid, this.TenderingEnterprise_check, this.TenderingEnterprise, this.startTime_check, this.startTime, this.endTime_check, this.endTime, this.PageCurrent, this.PageSize).then(response => {
|
||||
this.tableData1Loading = false
|
||||
const data = response.data.rows
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
data[i].履约金 === '1' ? data[i].是否禁用 = true : data[i].是否禁用 = false
|
||||
}
|
||||
if (this.radio === '2') {
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
data[i].是否禁用 = true
|
||||
}
|
||||
}
|
||||
this.tableData1 = data
|
||||
this.total = response.data.total
|
||||
})
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.PageCurrent = 1
|
||||
this.PageSize = val
|
||||
this.fetchTableData1()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.PageCurrent = val
|
||||
this.fetchTableData1()
|
||||
},
|
||||
tableRowClassName({ row }) {
|
||||
if (parseInt(row.是否收回) === 2) {
|
||||
return 'background: #66cc33'
|
||||
} else {
|
||||
if (parseInt(row.履约金) === 1) {
|
||||
return 'background: lightgrey'
|
||||
}
|
||||
if (parseInt(row.状态) === 1) {
|
||||
return 'background: #ffff66'
|
||||
} else if (parseInt(row.状态) === 2) {
|
||||
return 'background: #ff6666'
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
},
|
||||
handleNodeClick(data) { // 树节点点击
|
||||
this.getData(getTablePeople, 'ListPeople', data.id)
|
||||
},
|
||||
handleChange(row) {
|
||||
this.peopleid = row.人员编号
|
||||
this.peoplename = row.姓名
|
||||
},
|
||||
getName() {
|
||||
this.dialogFormVisiblePeople = false
|
||||
if (this.flag2 === 1) {
|
||||
this.Bidder = this.peoplename
|
||||
} else {
|
||||
this.form2.投标人 = this.peoplename
|
||||
}
|
||||
},
|
||||
offName() {
|
||||
this.dialogFormVisiblePeople = false
|
||||
this.peopleid = ''
|
||||
this.peoplename = ''
|
||||
},
|
||||
TakeBack(row) {
|
||||
this.addForm('form1')
|
||||
this.dialogFormVisible1 = true
|
||||
this.code = row.招标保证金流水号
|
||||
},
|
||||
submitTakeBack() {
|
||||
TakeBack(this.code, this.form1.收回日期).then(response => {
|
||||
this.dialogFormVisible1 = false
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('信息更新成功')
|
||||
this.fetchTableData1()
|
||||
} else {
|
||||
this.$message.error('信息更新失败')
|
||||
}
|
||||
})
|
||||
},
|
||||
submit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.flag1 === 1) {
|
||||
this.submitTakeBack()
|
||||
this.flag1 = null
|
||||
} else if (this.flag1 === 2) {
|
||||
this.addTableData1()
|
||||
this.flag1 = null
|
||||
} else if (this.flag1 === 3) {
|
||||
this.editTableData1()
|
||||
this.flag1 = null
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
callOff() {
|
||||
this.dialogFormVisible1 = false
|
||||
},
|
||||
ComplianceGold(row) {
|
||||
this.$confirm('此操作会将此投标保证金转为履约保证金, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
ComplianceGold(row.招标保证金流水号).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.fetchTableData1()
|
||||
this.$message.success('删除成功')
|
||||
} else {
|
||||
this.$message.error('删除失败')
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
addBidBond() {
|
||||
this.addForm('form2')
|
||||
this.title = '增加'
|
||||
this.dialogFormVisible2 = true
|
||||
},
|
||||
addTableData1() {
|
||||
addBidBond(this.form2.招标企业, this.form2.联系人, this.form2.联系电话, this.form2.保证金金额, this.peopleid, this.form2.保证金类型, this.form2.投标日期, this.form2.计划收回日期, this.form2.备注, this.form2.提前X天提醒我).then(response => {
|
||||
this.dialogFormVisible2 = false
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('添加成功')
|
||||
this.title = ''
|
||||
this.fetchTableData1()
|
||||
} else {
|
||||
this.$message.error('添加失败')
|
||||
}
|
||||
})
|
||||
},
|
||||
editBidBond(row) {
|
||||
this.title = '编辑'
|
||||
this.dialogFormVisible2 = true
|
||||
this.form2.招标企业 = row.招标企业
|
||||
this.form2.联系人 = row.联系人
|
||||
this.form2.联系电话 = row.联系电话
|
||||
this.form2.保证金金额 = row.保证金金额
|
||||
this.form2.投标人 = row.投标人
|
||||
this.peopleid = row.人员流水号
|
||||
this.form2.保证金类型 = parseInt(row.保证金类型流水号)
|
||||
// this.MoneyTypeCode = row.保证金类型流水号
|
||||
this.form2.投标日期 = row.投标日期
|
||||
this.form2.计划收回日期 = row.预计收回日期
|
||||
this.form2.备注 = row.备注
|
||||
this.form2.提前X天提醒我 = row.提前x天提醒
|
||||
this.BidBondCode = row.招标保证金流水号
|
||||
},
|
||||
editTableData1() {
|
||||
editBidBond(this.form2.招标企业, this.form2.联系人, this.form2.联系电话, this.form2.保证金金额, this.peopleid, this.form2.保证金类型, this.form2.投标日期, this.form2.计划收回日期, this.form2.备注, this.form2.提前X天提醒我, this.BidBondCode).then(response => {
|
||||
this.dialogFormVisible2 = false
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('添加成功')
|
||||
this.title = ''
|
||||
this.fetchTableData1()
|
||||
} else {
|
||||
this.$message.error('添加失败')
|
||||
}
|
||||
})
|
||||
},
|
||||
delBidBond(row) {
|
||||
function a() {
|
||||
this.fetchTableData1()
|
||||
this.dialogFormVisible2 = false
|
||||
}
|
||||
this.deleteRow(delBidBond, row.招标保证金流水号, a)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
573
src/views/MarketingCenter/CRM/index.vue
Normal file
573
src/views/MarketingCenter/CRM/index.vue
Normal file
@@ -0,0 +1,573 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<span>客户名称:</span>
|
||||
<el-select v-model="CustomerNameValue" filterable placeholder="请输入客户名称" style="margin-right: 10px" size="small" clearable>
|
||||
<el-option
|
||||
v-for="item in CustomerName"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<!--<el-input v-model="CustomerName" placeholder="请输入客户名称" size="small"></el-input>-->
|
||||
<!--<span class="move">销售经理:</span>-->
|
||||
<!--<el-input clearable v-model="MarketingManagerValue" @dblclick.native="dialogFormVisiblePeople = true" size="small" style="width:200px" placeholder="请选择营销经理" clearable></el-input>-->
|
||||
<!--<span class="move">信誉等级:</span>-->
|
||||
<!--<el-select v-model="CreditRatingValue" placeholder="请选择信誉等级" size="small">-->
|
||||
<!--<el-option-->
|
||||
<!--v-for="item in CreditRating"-->
|
||||
<!--:key="item.value"-->
|
||||
<!--:label="item.label"-->
|
||||
<!--:value="item.value">-->
|
||||
<!--</el-option>-->
|
||||
<!--</el-select>-->
|
||||
<el-button type="success" icon="el-icon-search" class="move" size="small" @click="selectCustomerOfName">查询</el-button>
|
||||
</el-card>
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
<el-card>
|
||||
<el-table
|
||||
v-loading="loading1"
|
||||
ref="multipleTable"
|
||||
:data="tableData1"
|
||||
stripe
|
||||
tooltip-effect="dark"
|
||||
style="width: 100%"
|
||||
height="730"
|
||||
highlight-current-row
|
||||
border>
|
||||
<el-table-column align="center" label="序号" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-radio :label="scope.row.省份流水号" v-model="radio" @change.native="getCurrentRow(scope.row.省份流水号, scope.row.省份)"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="地区">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.省份 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-card>
|
||||
<el-button type="text" icon="el-icon-circle-plus-outline" size="mini" @click="addMarketingManager();flag = 1">添加销售经理</el-button>
|
||||
<span style="float: right">销售经理</span>
|
||||
<el-table v-loading="loading3" :data="tableData3" height="192" style="width: 100%;margin-top: 10px" border highlight-current-row>
|
||||
<el-table-column label="责权省份" align="center" width="80">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.省份 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="姓名" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.姓名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="性别" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.性别 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="联系电话" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.联系电话 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="生日" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.出生日期 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="200px" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
class="el-icon-edit"
|
||||
@click="handleEditMarketingManager(scope.row);flag = 2">编辑</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
class="el-icon-delete"
|
||||
@click="handleDeleteMarketingManager(scope.$index, scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<el-button type="text" icon="el-icon-circle-plus-outline" size="mini" @click = "addCustomer();flag1 = 1">新增客户</el-button>
|
||||
<span style="float: right">客户信息</span>
|
||||
<el-table v-loading="loading2" :data="tableData2" height="400" style="width: 100%;margin-top: 10px" border highlight-current-row>
|
||||
<el-table-column label="省份" align="center" width="80px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.省份 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="客户名称" align="center" width="280">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.客户名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="联系人" align="center" width="100spx">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.联系人 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="联系电话" align="center" width="192px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.电话 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="传真" align="center" width="140px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.传真 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="联系地址" align="center" width="200px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.地址 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="电子邮箱" align="center" width="200px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.电子邮箱 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="税号" align="center" width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.税号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="银行账号" align="center" width="200px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.银行账号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="信誉等级" align="center" width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.价值评估 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.备注 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="200px" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
class="el-icon-edit"
|
||||
@click="handleEdit(scope.row);flag1 = 2">编辑</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
class="el-icon-delete"
|
||||
@click="handleDelete(scope.$index, scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block">
|
||||
<el-pagination
|
||||
v-if="!loading2"
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!--选择人员-->
|
||||
<el-dialog :visible.sync="dialogFormVisiblePeople" title="人员信息" center width="750px">
|
||||
<div style="height: 420px">
|
||||
<div style="float: left;margin-top: 10px;margin-left: 20px;overflow-y: scroll;height: 400px">
|
||||
<el-tree
|
||||
:data="dataPeople"
|
||||
node-key="id"
|
||||
style="width: 150px;float: left"
|
||||
height="400"
|
||||
accordion
|
||||
@node-click="handleNodeClick"
|
||||
/>
|
||||
</div>
|
||||
<el-table :data="ListPeople" highlight-current-row height="400" style="width: 400px;float: left;margin-left: 30px" @row-click="handleChange">
|
||||
<el-table-column label="考勤编号" align="center" >
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.考勤编号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="姓名" align="center" >
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.姓名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="性别" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.性别 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工作岗位" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.岗位名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-button style="margin-left: 260px" @click="offName">取消</el-button>
|
||||
<el-button type="primary" style="margin-top: 20px" @click="getName">确认</el-button>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :title="title1" :visible.sync="dialogFormVisible1" center width="400px">
|
||||
<el-form ref="form1" :model="form1" :rules="rules1" label-position="left" label-width="110px" class="demo-ruleForm" style="margin: auto">
|
||||
<el-form-item label="营销经理" prop="营销经理">
|
||||
<el-input v-model="form1.营销经理" clearable size="small" style="width:200px" placeholder="请选择营销经理" @dblclick.native="dialogFormVisiblePeople = true"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="callOff1()">取消</el-button>
|
||||
<el-button type="primary" @click="submit1('form1')">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :title="title2" :visible.sync="dialogFormVisible2" center width="700px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form ref="form2" :model="form2" :rules="rules2" label-position="left" label-width="90px" class="demo-ruleForm" style="margin: auto">
|
||||
<el-form-item label="省份:" prop="省份">
|
||||
<el-input v-model="form2.省份" :disabled="true" clearable size="small" style="width:200px" placeholder="请选择省份"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form ref="form2" :model="form2" :rules="rules2" label-position="left" label-width="90px" class="demo-ruleForm" style="margin: auto">
|
||||
<el-form-item label="客户名称:" prop="客户名称">
|
||||
<el-input v-model="form2.客户名称" clearable size="small" style="width:200px" placeholder="请输入客户名称"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form ref="form2" :model="form2" :rules="rules2" label-position="left" label-width="90px" class="demo-ruleForm" style="margin: auto">
|
||||
<el-form-item label="联系人:" prop="联系人">
|
||||
<el-input v-model="form2.联系人" clearable size="small" style="width:200px" placeholder="请输入联系人"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form ref="form2" :model="form2" :rules="rules2" label-position="left" label-width="90px" class="demo-ruleForm" style="margin: auto">
|
||||
<el-form-item label="联系电话:" prop="联系电话">
|
||||
<el-input v-model="form2.联系电话" clearable size="small" style="width:200px" placeholder="请输入联系电话"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form ref="form2" :model="form2" :rules="rules2" label-position="left" label-width="90px" class="demo-ruleForm" style="margin: auto">
|
||||
<el-form-item label="传真:" prop="传真">
|
||||
<el-input v-model="form2.传真" clearable size="small" style="width:200px" placeholder="请输入传真"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form ref="form2" :model="form2" :rules="rules2" label-position="left" label-width="90px" class="demo-ruleForm" style="margin: auto">
|
||||
<el-form-item label="联系地址:" prop="联系地址">
|
||||
<el-input v-model="form2.联系地址" clearable size="small" style="width:200px" placeholder="请输入联系地址"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form ref="form2" :model="form2" :rules="rules2" label-position="left" label-width="90px" class="demo-ruleForm" style="margin: auto">
|
||||
<el-form-item label="电子邮箱:" prop="电子邮箱">
|
||||
<el-input v-model="form2.电子邮箱" clearable size="small" style="width:200px" placeholder="请输入电子邮箱"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form ref="form2" :model="form2" :rules="rules2" label-position="left" label-width="90px" class="demo-ruleForm" style="margin: auto">
|
||||
<el-form-item label="税号:" prop="税号">
|
||||
<el-input v-model="form2.税号" clearable size="small" style="width:200px" placeholder="请输入税号"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form ref="form2" :model="form2" :rules="rules2" label-position="left" label-width="90px" class="demo-ruleForm" style="margin: auto">
|
||||
<el-form-item label="银行账号:" prop="银行账号">
|
||||
<el-input v-model="form2.银行账号" clearable size="small" style="width:200px" placeholder="请输入银行账号"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form ref="form2" :model="form2" :rules="rules2" label-position="left" label-width="90px" class="demo-ruleForm" style="margin: auto">
|
||||
<el-form-item label="信用等级:" prop="信用等级">
|
||||
<el-select v-model="form2.信用等级" placeholder="请选择信誉等级" size="small">
|
||||
<el-option
|
||||
v-for="item in CreditRating"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form ref="form2" :model="form2" :rules="rules2" label-position="left" label-width="90px" class="demo-ruleForm" style="margin: auto">
|
||||
<el-form-item label="备注:" prop="备注">
|
||||
<el-input v-model="form2.备注" clearable size="small" style="width:530px" placeholder="请输入备注"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="callOff2()">取消</el-button>
|
||||
<el-button type="primary" @click="submit2('form2')">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { searchValue, selectAdress, selectCustomer, getTree, tree, getTablePeople, selectMarketingManager, selectCustomerOfName, initCustomer, deleteCustomer, deleteMarketingManager, addMarketingManager, editMarketingManager, addCustomer, selectAdressOfID, editCustomer } from '@/api/MarketingCenter/CRM'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
a: '', // 营销经理地区流水号
|
||||
b: '', // 省份
|
||||
c: '', // 客户流水号
|
||||
flag: null,
|
||||
flag1: null,
|
||||
title1: '', // 营销经理对话框
|
||||
title2: '', // 客户对话框
|
||||
dialogFormVisible1: false, // 营销经理对话框可见性
|
||||
dialogFormVisible2: false, // 客户对话框可见性
|
||||
CustomerNameValue: '',
|
||||
CustomerName: [], // 客户名称
|
||||
// CreditRatingValue: '', // 信誉等级
|
||||
CreditRating: [], // 信誉等级数组
|
||||
tableData1: [], // 地区表
|
||||
loading1: false, // 地区的加载动画
|
||||
loading2: false, // 客户的加载动画
|
||||
radio: null, // 地区选择框
|
||||
tableData2: [], // 客户表
|
||||
pageCurrent: 1,
|
||||
pageSize: 10,
|
||||
total: null,
|
||||
AdressID: null, // 地区流水号
|
||||
MarketingManagerValue: '', // 营销经理
|
||||
dialogFormVisiblePeople: false,
|
||||
dataPeople: [],
|
||||
ListPeople: [],
|
||||
peoplename: '',
|
||||
peopleid: '',
|
||||
tableData3: [],
|
||||
loading3: false,
|
||||
form1: {
|
||||
营销经理: '' // 营销经理
|
||||
},
|
||||
form2: {
|
||||
省份: '',
|
||||
客户名称: '',
|
||||
联系人: '',
|
||||
联系电话: '',
|
||||
传真: '',
|
||||
联系地址: '',
|
||||
电子邮箱: '',
|
||||
税号: '',
|
||||
银行账号: '',
|
||||
信用等级: 1,
|
||||
备注: ''
|
||||
},
|
||||
rules1: { // 表单验证规则
|
||||
营销经理: [{ required: true, message: '请选择营销经理', trigger: 'change' }]
|
||||
},
|
||||
rules2: { // 表单验证规则
|
||||
省份: [{ required: true, message: '请选择省份' }],
|
||||
客户名称: [{ required: true, message: '请输入客户名称' }],
|
||||
联系人: [{ required: true, message: '请输入联系人' }],
|
||||
信用等级: [{ required: true, message: '请选择信用等级' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.init()
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.loading1 = true
|
||||
selectAdress().then(response => {
|
||||
this.tableData1 = response.data
|
||||
this.loading1 = false
|
||||
})
|
||||
this.getSelect(searchValue, ['价值评估', '价值评估流水号'], 'CreditRating')
|
||||
getTree().then(response => { // 获取人员信息树
|
||||
const data = response.data
|
||||
this.dataPeople = tree(data, 0)
|
||||
})
|
||||
this.getSelect(initCustomer, ['客户名称', '客户流水号'], 'CustomerName')
|
||||
},
|
||||
getCurrentRow(row) {
|
||||
this.CustomerNameValue = ''
|
||||
this.AdressID = row
|
||||
this.getTable(selectCustomer, [this.AdressID, this.pageCurrent, this.pageSize], ['tableData2', 'total', 'loading2'])
|
||||
this.loading3 = true
|
||||
selectMarketingManager(this.AdressID).then(response => {
|
||||
this.loading3 = false
|
||||
this.tableData3 = response.data
|
||||
})
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = val
|
||||
this.getTable(selectCustomer, [this.AdressID, this.pageCurrent, this.pageSize], ['tableData2', 'total', 'loading2'])
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.getTable(selectCustomer, [this.AdressID, this.pageCurrent, this.pageSize], ['tableData2', 'total', 'loading2'])
|
||||
},
|
||||
handleNodeClick(data) { // 树节点点击
|
||||
this.getData(getTablePeople, 'ListPeople', data.id)
|
||||
},
|
||||
offName() {
|
||||
this.dialogFormVisiblePeople = false
|
||||
this.peopleid = ''
|
||||
this.peoplename = ''
|
||||
},
|
||||
getName() {
|
||||
this.dialogFormVisiblePeople = false
|
||||
this.form1.营销经理 = this.peoplename
|
||||
},
|
||||
handleChange(row) {
|
||||
this.peopleid = row.人员编号
|
||||
this.peoplename = row.姓名
|
||||
},
|
||||
selectCustomerOfName() {
|
||||
selectCustomerOfName(this.CustomerNameValue, this.pageCurrent, this.pageSize).then(response => {
|
||||
this.radio = parseInt(response.data.rows[0].客户名称省份流水号)
|
||||
this.AdressID = parseInt(response.data.rows[0].客户名称省份流水号)
|
||||
this.tableData2 = response.data.rows
|
||||
return this.AdressID
|
||||
}).then(data => {
|
||||
this.loading3 = false
|
||||
selectMarketingManager(data).then(response => {
|
||||
this.loading3 = false
|
||||
this.tableData3 = response.data
|
||||
})
|
||||
})
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
function a() {
|
||||
if (this.CustomerNameValue === '') {
|
||||
this.getTable(selectCustomer, [this.AdressID, this.pageCurrent, this.pageSize], ['tableData2', 'total', 'loading2'])
|
||||
}
|
||||
if (this.CustomerNameValue !== '') {
|
||||
selectCustomerOfName(row.客户流水号, this.pageCurrent, this.pageSize).then(response => {
|
||||
this.tableData2 = response.data.rows
|
||||
})
|
||||
}
|
||||
}
|
||||
this.deleteRow(deleteCustomer, row.客户流水号, a)
|
||||
},
|
||||
handleDeleteMarketingManager(index, row) {
|
||||
function a() {
|
||||
selectMarketingManager(this.AdressID).then(response => {
|
||||
this.loading3 = false
|
||||
this.tableData3 = response.data
|
||||
})
|
||||
}
|
||||
this.deleteRow(deleteMarketingManager, row.营销经理地区流水号, a)
|
||||
},
|
||||
addMarketingManager() {
|
||||
if (this.AdressID === '' || this.AdressID === null) {
|
||||
this.$message.warning('请选择一个省份')
|
||||
} else {
|
||||
this.dialogFormVisible1 = true
|
||||
this.title1 = '增加'
|
||||
this.addForm('form1')
|
||||
}
|
||||
},
|
||||
callOff1() {
|
||||
this.dialogFormVisible1 = false
|
||||
},
|
||||
submit1() {
|
||||
function a() {
|
||||
this.dialogFormVisible1 = false
|
||||
this.loading3 = true
|
||||
selectMarketingManager(this.AdressID).then(response => {
|
||||
this.loading3 = false
|
||||
this.tableData3 = response.data
|
||||
})
|
||||
}
|
||||
if (this.flag === 1) {
|
||||
this.addTable(addMarketingManager, [this.peopleid, this.AdressID], 'form1', a)
|
||||
} else {
|
||||
this.editTable(editMarketingManager, [this.peopleid, this.a], 'form1', a)
|
||||
}
|
||||
},
|
||||
handleEditMarketingManager(row) {
|
||||
this.dialogFormVisible1 = true
|
||||
this.title1 = '编辑'
|
||||
this.form1.营销经理 = row.姓名
|
||||
this.peopleid = row.营销经理流水号
|
||||
this.a = row.营销经理地区流水号
|
||||
},
|
||||
addCustomer() {
|
||||
if (this.AdressID === '' || this.AdressID === null) {
|
||||
this.$message.warning('请选择一个省份')
|
||||
} else {
|
||||
this.dialogFormVisible2 = true
|
||||
this.title2 = '增加'
|
||||
this.addForm('form2')
|
||||
}
|
||||
selectAdressOfID(this.AdressID).then(response => {
|
||||
this.form2.省份 = response.data[0].省份
|
||||
})
|
||||
},
|
||||
callOff2() {
|
||||
this.dialogFormVisible2 = false
|
||||
},
|
||||
handleEdit(row) {
|
||||
this.dialogFormVisible2 = true
|
||||
this.title2 = '编辑'
|
||||
this.form2.省份 = row.省份
|
||||
this.form2.客户名称 = row.客户名称
|
||||
this.form2.联系电话 = row.电话
|
||||
this.form2.传真 = row.传真
|
||||
this.form2.联系地址 = row.地址
|
||||
this.form2.联系人 = row.联系人
|
||||
this.form2.电子邮箱 = row.电子邮箱
|
||||
this.form2.银行账号 = row.银行账号
|
||||
this.form2.税号 = row.税号
|
||||
this.form2.信用等级 = parseInt(row.价值评估流水号)
|
||||
this.form2.备注 = row.备注
|
||||
this.c = row.客户流水号
|
||||
},
|
||||
submit2() {
|
||||
function a() {
|
||||
this.dialogFormVisible2 = false
|
||||
this.getTable(selectCustomer, [this.AdressID, this.pageCurrent, this.pageSize], ['tableData2', 'total', 'loading2'])
|
||||
}
|
||||
if (this.flag1 === 1) {
|
||||
this.addTable(addCustomer, [this.AdressID, this.form2.客户名称, this.form2.联系电话, this.form2.传真, this.form2.联系地址, this.form2.联系人, this.form2.电子邮箱, this.form2.银行账号, this.form2.税号, this.form2.信用等级, this.form2.备注], 'form2', a)
|
||||
} else {
|
||||
this.editTable(editCustomer, [this.AdressID, this.form2.客户名称, this.form2.联系电话, this.form2.传真, this.form2.联系地址, this.form2.联系人, this.form2.电子邮箱, this.form2.银行账号, this.form2.税号, this.form2.信用等级, this.form2.备注, this.c], 'form2', a)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-input{
|
||||
width: 200px;
|
||||
}
|
||||
.el-select{
|
||||
width: 200px;
|
||||
}
|
||||
.move{
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
</style>
|
||||
1462
src/views/MarketingCenter/ContractCapitalManagement/index.vue
Normal file
1462
src/views/MarketingCenter/ContractCapitalManagement/index.vue
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,821 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<span>项目名称</span>
|
||||
<el-select v-model="entryNameValue" clearable filterable placeholder="项目名称" style="margin-right: 10px" size="small">
|
||||
<el-option
|
||||
v-for="item in entryName"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">销售经理</span>
|
||||
<el-input v-model="MarketingManagerValue" clearable size="small" style="width:200px" placeholder="请选择营销经理" readonly @dblclick.native="openName();param = 1" @clear="clear()"/>
|
||||
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="pageSize = 10;PageCurrent = 1;fetchTableData1()">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" style="margin-left: 10px" @click="ADD()">增加</el-button>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
:data="tableData1"
|
||||
:row-key="getRowKeys"
|
||||
:expand-row-keys="expands"
|
||||
style="width: 100%"
|
||||
height="600"
|
||||
border
|
||||
@row-click="fetchExecutionProgressdata"
|
||||
@expand-change="selectMachine">
|
||||
<el-table-column type="expand">
|
||||
<template slot-scope="scope">
|
||||
<el-table :data="tableData2" border style="width: 600px; text-align: center">
|
||||
<el-table-column label="设备型号" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机床图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="设备名称" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机床名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" width="250px" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="warning"
|
||||
icon="el-icon-edit"
|
||||
@click="editMachine(scope.row);flag = 2">编辑</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@click="deleteMachine(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="合同编号" width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.合同编号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="项目名称" width="200">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.项目名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="付款方式" width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.付款方式 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="图纸会签节点" width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.图纸会签节点 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="设备预验收节点" width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.设备预验收节点 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="发货节点" width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.发货节点 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="安装调试节点" width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.安装调试节点 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="销售经理" width="80">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.营销经理 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="客户名称" width="260">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.客户名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="联系人" width="80">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.联系人 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="联系电话" width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.电话 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="合同信息备注" width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.合同信息备注 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="300">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="warning"
|
||||
icon="el-icon-plus"
|
||||
@click.stop="addMachine(scope.row);flag = 1">机床</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
@click.stop="handleEdit(scope.row)">编辑</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@click.stop="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:current-page="PageCurrent"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="PageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card v-show="ExecutionProgressShow">
|
||||
<h4>合同进度</h4>
|
||||
<el-steps :active="ExecutionProgress" finish-status="success" process-status="process " style="margin-left: 10px">
|
||||
<el-step title="签订合同" icon="el-icon-edit-outline"/>
|
||||
<el-step title="图纸会签" icon="el-icon-picture-outline"/>
|
||||
<el-step title="加工制造" icon="el-icon-setting"/>
|
||||
<el-step title="预备验收" icon="el-icon-view"/>
|
||||
<el-step title="设备发货" icon="el-icon-sold-out"/>
|
||||
<el-step title="安装调试" icon="el-icon-time"/>
|
||||
<el-step title="项目验收" icon="el-icon-circle-check-outline"/>
|
||||
</el-steps>
|
||||
</el-card>
|
||||
<el-card v-show="uploader" style="min-height: 145px;">
|
||||
<h4>纪要文件</h4>
|
||||
<div style="float: right;">
|
||||
<el-upload
|
||||
:action="action"
|
||||
:on-success="uploadSuccess"
|
||||
:on-error="uploadFailure"
|
||||
:show-file-list="showFileList"
|
||||
:file-list="fileList"
|
||||
class="upload-demo"
|
||||
multiple>
|
||||
<el-button size="small" type="primary">点击上传</el-button>
|
||||
</el-upload>
|
||||
</div>
|
||||
<div v-for="file in hadFile" :key="file.id">
|
||||
<div class="wrapper">
|
||||
<div class="content">
|
||||
<div class="action">
|
||||
<a class="delete" @click="deleteFileData(file.id)">删除</a>
|
||||
</div>
|
||||
<div v-if="file.suffix==='pdf'" class="icon"><svg-icon icon-class="pdf" /></div>
|
||||
<div v-else-if="file.suffix==='docx'||file.suffix === 'doc'" class="icon"><svg-icon icon-class="doc" /></div>
|
||||
<div v-else-if="file.suffix==='xlsx' || file.suffix === 'xls'" class="icon"><svg-icon icon-class="excel" /></div>
|
||||
<div v-else-if="file.suffix==='pptx' || file.suffix === 'ppt'" class="icon"><svg-icon icon-class="ppt" /></div>
|
||||
<div v-else-if="file.suffix==='jpg' || file.suffix === 'jpeg'|| file.suffix === 'png'" class="icon"><svg-icon icon-class="pic" /></div>
|
||||
<div v-else class="icon"><svg-icon icon-class="file" /></div>
|
||||
<a :href="file.url"><div class="info">{{ file.name }}</div></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
<!--新增合同信息对话框-->
|
||||
<el-dialog :title="title" :visible.sync="dialogFormVisible1" center style="min-height: 300px" width="800px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="140px" class="demo-ruleForm">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目名称" prop="EntryName">
|
||||
<el-input v-model="form.EntryName" size="small" placeholder="请输入项目名称" style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="已完成进度" prop="executionProgressID">
|
||||
<el-select v-model="form.executionProgressID" :disabled="infoDisable" placeholder="请输入目前执行进度" clearable size="small" style="width: 200px">
|
||||
<el-option
|
||||
v-for="item in executionProgress"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="销售经理" prop="MarketingManagerValue">
|
||||
<el-input v-model="form.MarketingManagerValue" clearable size="small" style="width:200px" placeholder="请选择营销经理" readonly @dblclick.native="openName()" @clear="clear()"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="图纸会签节点" prop="drawingJointSignNode">
|
||||
<el-date-picker
|
||||
v-model="form.drawingJointSignNode"
|
||||
value-format="yyyy-MM-dd"
|
||||
size="small"
|
||||
type="date"
|
||||
placeholder="请选择图纸会签节点"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="设备预验节点" prop="EquipmentPreAcceptanceNode">
|
||||
<el-date-picker
|
||||
v-model="form.EquipmentPreAcceptanceNode"
|
||||
value-format="yyyy-MM-dd"
|
||||
size="small"
|
||||
type="date"
|
||||
placeholder="请选择设备预验收节点"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="发货节点" prop="ConsignmentNode">
|
||||
<el-date-picker
|
||||
v-model="form.ConsignmentNode"
|
||||
value-format="yyyy-MM-dd"
|
||||
size="small"
|
||||
type="date"
|
||||
placeholder="请选择发货节点"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="安装调试节点" prop="installDebugNode">
|
||||
<el-date-picker
|
||||
v-model="form.installDebugNode"
|
||||
value-format="yyyy-MM-dd"
|
||||
size="small"
|
||||
type="date"
|
||||
placeholder="请选择安装调试节点"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="客户名称" prop="customerName">
|
||||
<el-input v-model="form.customerName" size="small" placeholder="请输入客户名称" style="width:200px" readonly @dblclick.native="CustomerChange()"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="付款方式" prop="付款方式">
|
||||
<el-select v-model="form.付款方式" :disabled="disabled" placeholder="请选择付款方式" clearable size="small" style="width: 200px">
|
||||
<el-option
|
||||
v-for="item in money"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
v-model="form.remark"
|
||||
style="width: 200px"
|
||||
type="textarea"
|
||||
autosize
|
||||
placeholder="请输入项目介绍"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="callOff('form')">取消</el-button>
|
||||
<el-button type="primary" @click="submit('form')">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--新增机床对话框-->
|
||||
<el-dialog :title="title1" :visible.sync="dialogFormVisible2" center style="min-height: 300px" width="25%">
|
||||
<el-form ref="form1" :model="form1" :rules="rules1" label-width="140px">
|
||||
<el-form-item label="设备型号" prop="设备型号">
|
||||
<el-input v-model="form1.设备型号" size="small" placeholder="请输入设备型号" style="width:200px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="设备名称">
|
||||
<el-input v-model="form1.设备名称" size="small" placeholder="请输入设备名称" style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="callOff2('form1')">取消</el-button>
|
||||
<el-button type="primary" @click="submitMachine('form1')">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!--营销经理选择-->
|
||||
<el-dialog :visible.sync="dialogFormVisiblePeople" title="营销经理" center width="30%">
|
||||
<span>责权省份</span>
|
||||
<el-select v-model="ProvinceValue" clearable filterable placeholder="请选择省份" style="margin-right: 10px" size="small" @change="changeProvince">
|
||||
<el-option
|
||||
v-for="item in Province"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<div style="margin-top: 15px">
|
||||
<el-table :data="tableData3" border style="width: 100%; text-align: center;" highlight-current-row @row-click="handleChange">
|
||||
<el-table-column label="销售经理" align="center" >
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.姓名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="性别" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.性别 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="offName">取消</el-button>
|
||||
<el-button type="primary" @click="getName">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!--客户选择-->
|
||||
<el-dialog :visible.sync="dialogCustomerFormVisible" title="客户选择" center width="600px">
|
||||
<el-input v-model="Customer" clearable size="small" style="width:200px" placeholder="请输入客户名称"/>
|
||||
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="pageSize1 = 10;PageCurrent1 = 1;fetchCustomerData()">查询</el-button>
|
||||
<el-table v-loading="loading1" :data="CustomerData" highlight-current-row height="300" show-overflow-tooltip style="height: 330px; margin-top: 20px" @row-click="handleCustomerChange">
|
||||
<el-table-column label="省份" align="center" width="80">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.省份 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="客户名称" align="center" >
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.客户名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="联系人" align="center" width="80">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.联系人 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="联系电话" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.电话 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
:current-page="PageCurrent1"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="10"
|
||||
:total="total1"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange1"
|
||||
@current-change="handleCurrentChange1"/>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="offCustomerChange">取消</el-button>
|
||||
<el-button type="primary" @click="getCustomerCode">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { initProject, searchTable1, fetchExecutionProgress, delList, addList, executionProgressID, editchar, getTree, tree, getTablePeople, fetchCustomerData, getFileData, deleteFileData, selectMachine, selectProvince, SelectMarketingManager, submitMachine, editMachine, delMachine, money } from '@/api/MarketingCenter/ContractInformationManagement'
|
||||
import { upload, download } from '@/utils/request'
|
||||
export default {
|
||||
|
||||
data() {
|
||||
return {
|
||||
a: 1,
|
||||
b: 1,
|
||||
c: 1,
|
||||
money: [],
|
||||
expands: [],
|
||||
flag: '',
|
||||
title1: '',
|
||||
dialogFormVisible2: false,
|
||||
ProvinceValue: '',
|
||||
Province: [],
|
||||
CustomerCode: '',
|
||||
loading1: false,
|
||||
CustomerData: [],
|
||||
Customer: '',
|
||||
id1: '',
|
||||
action: '',
|
||||
peoplename: '',
|
||||
peopleid: '',
|
||||
dataPeople: [],
|
||||
ListPeople: [],
|
||||
fileList: [],
|
||||
hadFile: [],
|
||||
disabled: false,
|
||||
projectNum: null,
|
||||
dialogFormVisiblePeople: false,
|
||||
dialogFormVisiblePeople1: false,
|
||||
dialogCustomerFormVisible: false,
|
||||
listLoading: false,
|
||||
showFileList: true,
|
||||
entryNameValue: '', // 项目名称下拉框
|
||||
entryName: [], // 项目名称下拉框数据
|
||||
list1: [], // 项目名称临时存储
|
||||
MarketingManagerValue: '', // 营销经理下拉框
|
||||
MarketingManager: [], // 营销经理下拉框数据
|
||||
list2: [], // 营销经理临时存储
|
||||
tableData1: [], // 合同信息表
|
||||
tableData2: [], // 机床信息表
|
||||
tableData3: [], // 营销经理表
|
||||
PageCurrent: 1,
|
||||
PageSize: 10,
|
||||
total: null,
|
||||
PageCurrent1: 1,
|
||||
PageSize1: 10,
|
||||
total1: null,
|
||||
infoDisable: true,
|
||||
hetongID: '',
|
||||
ExecutionProgress: null, // 执行进度
|
||||
ExecutionProgressShow: false, // 执行进度可见性
|
||||
uploader: false, // 上传可见性
|
||||
dialogFormVisible1: false, // 新增对话框可见性
|
||||
form: {
|
||||
MarketingManagerValue: '',
|
||||
EntryName: '', // 项目名称
|
||||
drawingJointSignNode: '', // 图纸会签节点
|
||||
EquipmentPreAcceptanceNode: '', // 设备预验收节点
|
||||
ConsignmentNode: '', // 发货节点
|
||||
installDebugNode: '', // 安装调试节点
|
||||
executionProgressID: 1, // 执行进度ID
|
||||
customerName: '', // 客户名称
|
||||
remark: '',
|
||||
付款方式: 1
|
||||
},
|
||||
form1: {
|
||||
设备型号: '',
|
||||
设备名称: ''
|
||||
},
|
||||
title: '',
|
||||
param: 0,
|
||||
executionProgress: [], // 执行进度下拉框数据
|
||||
executionProgressID1: '', // 中间变量存储执行进度ID
|
||||
ProjectTypeIDV: [],
|
||||
temp: '', // 增加或修改的标志位
|
||||
rules: { // 表单验证规则
|
||||
EntryName: [{ required: true, message: '请输入项目名称', trigger: 'blur' }],
|
||||
MarketingManagerValue: [{ required: true, message: '请选择营销经理', trigger: 'change' }],
|
||||
executionProgressID: [{ required: true, message: '请选择已完成进度', trigger: 'change' }],
|
||||
付款方式: [{ required: true, message: '请选择付款方式', trigger: 'change' }]
|
||||
},
|
||||
rules1: { // 表单验证规则
|
||||
设备型号: [{ required: true, message: '请输入设备型号', trigger: 'blur' }],
|
||||
设备名称: [{ required: true, message: '请输入设备名称', trigger: 'blur' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
this.fetchTableData1()
|
||||
this.fetchCustomerData()
|
||||
},
|
||||
methods: {
|
||||
fetchData() {
|
||||
getTree().then(response => { // 获取人员信息树
|
||||
const data = response.data
|
||||
this.dataPeople = tree(data, 0)
|
||||
})
|
||||
this.getSelect(initProject, ['项目名称', '项目流水号'], 'entryName')
|
||||
this.getSelect(executionProgressID, ['执行进度名', '执行进度ID'], 'executionProgress')
|
||||
this.getSelect(selectProvince, ['省份', '省份流水号'], 'Province')
|
||||
this.getSelect(money, ['付款方式', '付款方式代码'], 'money')
|
||||
},
|
||||
openName() {
|
||||
this.dialogFormVisiblePeople = true
|
||||
},
|
||||
getRowKeys(row) {
|
||||
return row.项目流水号
|
||||
},
|
||||
handleNodeClick(data) { // 树节点点击
|
||||
getTablePeople(data.id).then(response => {
|
||||
this.ListPeople = response.data
|
||||
})
|
||||
},
|
||||
handleChange(row) {
|
||||
this.peopleid = row.营销经理流水号
|
||||
this.peoplename = row.姓名
|
||||
},
|
||||
getName() {
|
||||
if (this.param === 1) {
|
||||
this.dialogFormVisiblePeople = false
|
||||
this.MarketingManagerValue = this.peoplename
|
||||
this.param = 0
|
||||
} else {
|
||||
this.dialogFormVisiblePeople = false
|
||||
this.id1 = this.peopleid
|
||||
this.form.MarketingManagerValue = this.peoplename
|
||||
}
|
||||
},
|
||||
offName() {
|
||||
this.dialogFormVisiblePeople = false
|
||||
this.dialogFormVisiblePeople1 = false
|
||||
this.peopleid = ''
|
||||
this.peoplename = ''
|
||||
},
|
||||
fetchTableData1() {
|
||||
this.ExecutionProgressShow = false
|
||||
this.uploader = false
|
||||
this.ExecutionProgress = null
|
||||
this.listLoading = true
|
||||
this.getTable(searchTable1, [this.PageCurrent, this.PageSize, this.entryNameValue, this.peopleid], ['tableData1', 'total', 'listLoading'])
|
||||
},
|
||||
fetchExecutionProgressdata(row) {
|
||||
this.projectNum = row.项目流水号
|
||||
this.ExecutionProgressShow = true
|
||||
this.uploader = true
|
||||
this.action = `${upload}?&ProjectNum=${this.projectNum}`
|
||||
this.getFileData(this.projectNum)
|
||||
fetchExecutionProgress(row.项目流水号).then(response => {
|
||||
this.ExecutionProgress = response.data[0].执行进度流水号
|
||||
})
|
||||
},
|
||||
selectMachine(row) {
|
||||
if (this.a === 1) {
|
||||
this.expands.push(row.项目流水号)
|
||||
this.b = row.项目流水号
|
||||
this.a = 0
|
||||
} else {
|
||||
if (this.b === row.项目流水号) {
|
||||
this.expands = []
|
||||
this.a = 1
|
||||
} else {
|
||||
this.expands = []
|
||||
this.expands.push(row.项目流水号)
|
||||
this.a = 0
|
||||
this.b = row.项目流水号
|
||||
}
|
||||
}
|
||||
this.projectNum = row.项目流水号
|
||||
this.ExecutionProgressShow = true
|
||||
this.uploader = true
|
||||
this.action = `${upload}?&ProjectNum=${this.projectNum}`
|
||||
this.getFileData(this.projectNum)
|
||||
fetchExecutionProgress(row.项目流水号).then(response => {
|
||||
this.ExecutionProgress = response.data[0].执行进度流水号
|
||||
})
|
||||
selectMachine(row.项目流水号).then(response => {
|
||||
this.tableData2 = response.data
|
||||
})
|
||||
},
|
||||
handleDelete(row) {
|
||||
this.deleteRow(delList, row.项目流水号, function() { this.fetchTableData1() })
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.PageCurrent = 1
|
||||
this.PageSize = val
|
||||
this.fetchTableData1()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.PageCurrent = val
|
||||
this.fetchTableData1()
|
||||
},
|
||||
handleSizeChange1(val) {
|
||||
this.PageCurrent1 = 1
|
||||
this.PageSize1 = val
|
||||
this.fetchCustomerData()
|
||||
},
|
||||
handleCurrentChange1(val) {
|
||||
this.PageCurrent1 = val
|
||||
this.fetchCustomerData()
|
||||
},
|
||||
ADD() {
|
||||
this.addForm('form')
|
||||
this.dialogFormVisible1 = true
|
||||
this.temp = 1
|
||||
this.title = '增加'
|
||||
this.disabled = false
|
||||
},
|
||||
addTableData1() {
|
||||
addList(this.form.EntryName, this.form.drawingJointSignNode, this.form.EquipmentPreAcceptanceNode, this.form.ConsignmentNode, this.form.installDebugNode, this.id1, this.form.executionProgressID, this.CustomerCode, this.form.remark, this.form.付款方式).then(response => {
|
||||
this.dialogFormVisible1 = false
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('添加成功')
|
||||
this.peopleid = ''
|
||||
this.title = ''
|
||||
this.getTable(searchTable1, [this.PageCurrent, this.PageSize, '', ''], ['tableData1', 'total', 'listLoading'])
|
||||
} else {
|
||||
this.$message.error('添加失败')
|
||||
}
|
||||
})
|
||||
},
|
||||
// 重置表单
|
||||
callOff() {
|
||||
this.dialogFormVisible1 = false
|
||||
this.dialogFormVisible2 = false
|
||||
},
|
||||
|
||||
// 提交添加或者修改
|
||||
submit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.temp === 1) {
|
||||
this.addTableData1()
|
||||
this.temp = null
|
||||
} else if (this.temp === 2) {
|
||||
this.chaEdit()
|
||||
this.temp = null
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
handleEdit(row) {
|
||||
this.title = '编辑'
|
||||
this.dialogFormVisible1 = true
|
||||
this.form.contractNumber = row.合同编号
|
||||
this.form.EntryName = row.项目名称
|
||||
this.form.drawingJointSignNode = row.图纸会签节点
|
||||
this.form.EquipmentPreAcceptanceNode = row.设备预验收节点
|
||||
this.form.ConsignmentNode = row.发货节点
|
||||
this.form.installDebugNode = row.安装调试节点
|
||||
this.form.MarketingManagerValue = row.营销经理
|
||||
this.form.executionProgressID = parseInt(row.执行进度流水号)
|
||||
this.form.customerName = row.客户名称
|
||||
this.hetongID = row.项目流水号
|
||||
this.form.remark = row.合同信息备注
|
||||
this.CustomerCode = row.客户流水号
|
||||
this.form.付款方式 = parseInt(row.付款方式代码)
|
||||
this.disabled = true
|
||||
this.temp = 2
|
||||
this.infoDisable = false
|
||||
},
|
||||
chaEdit() {
|
||||
editchar(this.form.EntryName, this.form.drawingJointSignNode, this.form.EquipmentPreAcceptanceNode, this.form.ConsignmentNode, this.form.installDebugNode, this.id1, this.form.executionProgressID, this.CustomerCode, this.form.remark, this.hetongID, this.form.付款方式).then(response => {
|
||||
this.dialogFormVisible1 = false
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('信息更新成功')
|
||||
this.peopleid = ''
|
||||
this.fetchTableData1()
|
||||
} else {
|
||||
this.$message.error('信息更新失败')
|
||||
}
|
||||
})
|
||||
this.getTable(searchTable1, [this.PageCurrent, this.PageSize, '', ''], ['tableData1', 'total', 'listLoading'])
|
||||
this.ExecutionProgressShow = true
|
||||
this.uploader = true
|
||||
this.action = `${upload}?&ProjectNum=${this.hetongID}`
|
||||
fetchExecutionProgress(this.hetongID).then(response => {
|
||||
this.ExecutionProgress = response.data[0].执行进度流水号
|
||||
})
|
||||
},
|
||||
clear() {
|
||||
this.peopleid = ''
|
||||
this.tableData3 = []
|
||||
this.ProvinceValue = ''
|
||||
},
|
||||
CustomerChange() {
|
||||
this.dialogCustomerFormVisible = true
|
||||
},
|
||||
offCustomerChange() {
|
||||
this.dialogCustomerFormVisible = false
|
||||
},
|
||||
fetchCustomerData() {
|
||||
this.loading1 = true
|
||||
this.getTable(fetchCustomerData, [this.PageCurrent1, this.PageSize1, this.Customer], ['CustomerData', 'total1', 'loading1'])
|
||||
},
|
||||
handleCustomerChange(row) {
|
||||
this.CustomerCode = row.客户流水号
|
||||
this.form.customerName = row.客户名称
|
||||
},
|
||||
getCustomerCode() {
|
||||
this.dialogCustomerFormVisible = false
|
||||
},
|
||||
async submitUpload() {
|
||||
await this.$refs.upload.submit()
|
||||
},
|
||||
uploadSuccess(res, file, fileList) {
|
||||
if (res[0].result === '1') {
|
||||
const index = fileList.indexOf(file)
|
||||
fileList.splice(index, 1)
|
||||
} else {
|
||||
this.$message.error(`${file.name}文件上传失败,请检查上传文件是否正确!`)
|
||||
}
|
||||
if (fileList.length === 0) {
|
||||
this.$message.success('文件上传成功')
|
||||
this.getFileData(this.projectNum)
|
||||
}
|
||||
},
|
||||
uploadFailure(a, file, fileList) {
|
||||
fileList.map(file => {
|
||||
this.$message.error(`${file.name}文件上传失败,请检查上传文件是否正确!`)
|
||||
})
|
||||
},
|
||||
getFileData(row) {
|
||||
this.hadFile = []
|
||||
getFileData(row).then(res => {
|
||||
if (res.data.length > 0) {
|
||||
res.data.map(item => {
|
||||
this.hadFile.push({
|
||||
url: `${download}?id=${item.文件标识}.${item.文件后缀}&name=${item.文件名称}.${item.文件后缀}`,
|
||||
name: `${item.文件名称}.${item.文件后缀}`,
|
||||
suffix: item.文件后缀,
|
||||
id: item.文件标识
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
deleteFileData(id) {
|
||||
this.deleteRow(deleteFileData, id, function() { this.getFileData(this.projectNum) })
|
||||
},
|
||||
changeProvince() {
|
||||
SelectMarketingManager(this.ProvinceValue).then(response => {
|
||||
this.tableData3 = response.data
|
||||
})
|
||||
},
|
||||
addMachine(row) {
|
||||
this.projectNum = row.项目流水号
|
||||
this.dialogFormVisible2 = true
|
||||
this.title1 = '新增'
|
||||
this.addForm('form1')
|
||||
},
|
||||
editMachine(row) {
|
||||
this.dialogFormVisible2 = true
|
||||
this.title1 = '编辑'
|
||||
this.c = row.机床流水号
|
||||
this.form1.设备型号 = row.机床图号
|
||||
this.form1.设备名称 = row.机床名称
|
||||
},
|
||||
callOff2() {
|
||||
this.dialogFormVisible2 = false
|
||||
},
|
||||
submitMachine() {
|
||||
function a() {
|
||||
selectMachine(this.projectNum).then(response => {
|
||||
this.tableData2 = response.data
|
||||
})
|
||||
this.dialogFormVisible2 = false
|
||||
}
|
||||
if (this.flag === 1) {
|
||||
this.addTable(submitMachine, [this.projectNum, this.form1.设备型号, this.form1.设备名称], 'form1', a)
|
||||
} else {
|
||||
this.editTable(editMachine, [this.c, this.form1.设备型号, this.form1.设备名称], 'form1', a)
|
||||
}
|
||||
},
|
||||
deleteMachine(row) {
|
||||
function a() {
|
||||
selectMachine(this.projectNum).then(response => {
|
||||
this.tableData2 = response.data
|
||||
})
|
||||
}
|
||||
this.deleteRow(delMachine, row.机床流水号, a)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-card {
|
||||
margin-top: 15px;
|
||||
}
|
||||
.el-date-editor{
|
||||
width:200px;
|
||||
}
|
||||
|
||||
.wrapper{
|
||||
width: 260px;
|
||||
height: 50px;
|
||||
overflow: hidden;
|
||||
border: 1px solid #b8c7d9;
|
||||
float: left;
|
||||
margin: 10px;
|
||||
}
|
||||
.content{
|
||||
position: relative;
|
||||
padding: 8px 8px 0 8px;
|
||||
}
|
||||
.action{
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
right: 8px;
|
||||
}
|
||||
.delete{
|
||||
padding: 0 5px;
|
||||
border-radius: 3px;
|
||||
color: #0f84b0;
|
||||
font-size: 12px;
|
||||
}
|
||||
.delete:hover{
|
||||
background: -webkit-linear-gradient(top,#0ba9e3,#0099d3);
|
||||
color: #fff;
|
||||
}
|
||||
a{
|
||||
text-decoration: none;
|
||||
}
|
||||
.icon{
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
display: inline-block;
|
||||
margin-right: 7px;
|
||||
margin-top: 2px;
|
||||
font-size: 26px;
|
||||
}
|
||||
.info{
|
||||
position: absolute;
|
||||
left: 44px;
|
||||
line-height: 30px;
|
||||
display: inline-block;
|
||||
color: #999;
|
||||
}
|
||||
</style>
|
||||
668
src/views/MarketingCenter/SafetyMargin/index.vue
Normal file
668
src/views/MarketingCenter/SafetyMargin/index.vue
Normal file
@@ -0,0 +1,668 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--顶栏结构-->
|
||||
<el-card>
|
||||
<el-radio v-model="radio" label="1">未收回</el-radio>
|
||||
<el-radio v-model="radio" label="2">已收回</el-radio>
|
||||
<span style="margin-left: 20px">项目名称:</span>
|
||||
<el-select v-model="entryNameValue" clearable filterable placeholder="项目名称:" size="small" style="margin-left: 10px">
|
||||
<el-option
|
||||
v-for="item in entryName"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="pageSize = 10;PageCurrent = 1;fetchTableData1()">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" style="margin-left: 10px;margin-right: 15px" @click="addSafetyMargin();flag1 = 1">增加</el-button>
|
||||
<span>预警颜色说明:</span>
|
||||
<el-tag type="info">未到时间</el-tag>
|
||||
<el-tag type="warning">即将拖期</el-tag>
|
||||
<el-tag type="danger">已拖期</el-tag>
|
||||
<el-tag type="success">已收回</el-tag>
|
||||
</el-card>
|
||||
|
||||
<!--安全保证金表格-->
|
||||
<el-card>
|
||||
<el-table
|
||||
v-loading="tableData1Loading"
|
||||
:row-style="tableRowClassName"
|
||||
:data="tableData1"
|
||||
style="width: 100%"
|
||||
height="400"
|
||||
border
|
||||
@row-click="fetchTableData2">
|
||||
<el-table-column align="center" label="项目名称" width="300">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.项目名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="交付日期" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.交付日期 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="保证金金额" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.保证金金额 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="扣款金额" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.扣款金额 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="AmountReceivable" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.应收回金额 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="计划收回日期" width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.预计收回日期 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="实际收回日期" width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.实际收回日期 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="状态" width="120">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.状态 === '0'">未到预警时间</div>
|
||||
<div v-else-if="scope.row.状态 === '1'">即将拖期</div>
|
||||
<div v-else-if="scope.row.状态 === '2'">已拖期</div>
|
||||
<div v-else >已收回</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="备注">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.备注 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="400">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
:disabled="disabled"
|
||||
size="mini"
|
||||
type="success"
|
||||
icon="el-icon-edit"
|
||||
@click.stop="TakeBack(scope.row);flag1 = 5">收回</el-button>
|
||||
<el-button
|
||||
:disabled="disabled"
|
||||
size="mini"
|
||||
type="info"
|
||||
icon="el-icon-edit"
|
||||
@click.stop="Withdrawing(scope.row);flag1 = 3">扣款</el-button>
|
||||
<el-button
|
||||
:disabled="disabled"
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
@click.stop="editSafetyMargin(scope.row);flag1 = 2">编辑</el-button>
|
||||
<el-button
|
||||
:disabled="disabled"
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@click.stop="delSafetyMargin(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:current-page="PageCurrent"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="PageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!--扣款记录表格-->
|
||||
<el-card>
|
||||
<span style="float: right">扣款记录</span>
|
||||
<el-table
|
||||
v-loading="tableData2Loading"
|
||||
:data="tableData2"
|
||||
style="width: 100%;margin-top: 15px"
|
||||
height="230"
|
||||
border>
|
||||
<el-table-column align="center" label="扣款金额">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.扣款金额 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="被扣款人">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.被扣款人 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="扣款原因">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.扣款原因 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="扣款日期">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.扣款日期 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
:disabled="disabled"
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
@click.stop="editWithdrawing(scope.row);flag1 = 4">编辑</el-button>
|
||||
<el-button
|
||||
:disabled="disabled"
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@click.stop="delWithdrawing(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:current-page="PageCurrent2"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="PageSize2"
|
||||
:total="total2"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange2"
|
||||
@current-change="handleCurrentChange2"/>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!--新增编辑保证金信息对话框-->
|
||||
<el-dialog :title="title" :visible.sync="dialogFormVisible1" center style="min-height: 300px" width="800px">
|
||||
<el-form ref="form" :model="form" :rules="rules1" label-position="left" label-width="120px" class="demo-ruleForm">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目名称" prop="项目名称">
|
||||
<el-select v-model="form.项目名称" clearable filterable placeholder="请选择项目:" size="small">
|
||||
<el-option
|
||||
v-for="item in entryName1"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="保证金金额" prop="保证金金额">
|
||||
<el-input v-model="form.保证金金额" size="small" placeholder="请输入保证金金额" style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="交付日期" prop="交付日期">
|
||||
<el-date-picker
|
||||
v-model="form.交付日期"
|
||||
style="width: 200px;"
|
||||
value-format="yyyy-MM-dd"
|
||||
size="small"
|
||||
type="date"
|
||||
placeholder="请选择交付日期"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="计划收回日期" prop="预计收回日期">
|
||||
<el-date-picker
|
||||
v-model="form.预计收回日期"
|
||||
style="width: 200px;"
|
||||
value-format="yyyy-MM-dd"
|
||||
size="small"
|
||||
type="date"
|
||||
placeholder="请选择计划收回日期"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="提前X天提醒我" prop="提前X天提醒我">
|
||||
<el-input v-model="form.提前X天提醒我" size="small" placeholder="提前X天提醒我" style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注" prop="备注">
|
||||
<el-input v-model="form.备注" size="small" placeholder="请输入备注" style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="callOff('form')">取消</el-button>
|
||||
<el-button type="primary" @click="submit1('form')">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!--扣款记录增加-->
|
||||
<el-dialog :title="title2" :visible.sync="dialogFormVisible2" center style="min-height: 300px" width="800px">
|
||||
<el-form ref="form2" :model="form2" :rules="rules2" label-position="left" label-width="120px" class="demo-ruleForm">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目名称" prop="项目名称">
|
||||
<el-input v-model="projectName" size="small" placeholder="请输入项目名称" style="width:200px" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="被扣款人" prop="被扣款人">
|
||||
<el-input v-model="form2.被扣款人" size="small" placeholder="请输入被扣款人" style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="剩余金额" prop="剩余金额">
|
||||
<el-input v-model="SurplusAmount" size="small" placeholder="请输入剩余金额" style="width:200px" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="扣款金额" prop="扣款金额">
|
||||
<el-input-number v-model="form2.扣款金额" :min="0" :max="maxMoney" :precision="2" :step="1" size="small" style="width: 200px" placeholder="请输入本次付款金额"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="扣款日期" prop="扣款日期">
|
||||
<el-date-picker
|
||||
v-model="form2.扣款日期"
|
||||
style="width: 200px;"
|
||||
value-format="yyyy-MM-dd"
|
||||
size="small"
|
||||
type="date"
|
||||
placeholder="扣款日期"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="扣款原因" prop="扣款原因">
|
||||
<el-input v-model="form2.扣款原因" size="small" placeholder="扣款原因" style="width: 200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="callOff('form2')">取消</el-button>
|
||||
<el-button type="primary" @click="submit1('form2')">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!--扣款记录编辑-->
|
||||
<el-dialog :visible.sync="dialogFormVisible3" title="编辑" center style="min-height: 300px" width="800px">
|
||||
<el-form ref="form3" :model="form3" :rules="rules3" label-position="left" label-width="120px" class="demo-ruleForm">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目名称" prop="项目名称">
|
||||
<el-input v-model="projectName" size="small" placeholder="请输入项目名称" style="width:200px" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="被扣款人" prop="被扣款人">
|
||||
<el-input v-model="form3.被扣款人" size="small" placeholder="请输入被扣款人" style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="扣款日期" prop="扣款日期">
|
||||
<el-date-picker
|
||||
v-model="form3.扣款日期"
|
||||
style="width: 200px;"
|
||||
value-format="yyyy-MM-dd"
|
||||
size="small"
|
||||
type="date"
|
||||
placeholder="扣款日期"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="扣款金额" prop="扣款金额">
|
||||
<el-input-number v-model="form3.扣款金额" :min="0" :max="maxMoney1" :precision="2" :step="1" size="small" style="width: 200px" placeholder="请输入本次付款金额"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="23">
|
||||
<el-form-item label="扣款原因" prop="扣款原因">
|
||||
<el-input v-model="form3.扣款原因" size="small" placeholder="扣款原因" style="width: 580px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="callOff('form3')">取消</el-button>
|
||||
<el-button type="primary" @click="submit1('form3')">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!--收回安全保证金-->
|
||||
<el-dialog :visible.sync="dialogFormVisible4" title="收回" center style="min-height: 300px" width="20%">
|
||||
<el-form ref="form4" :model="form4" :rules="rules4" label-position="left" label-width="120px" class="demo-ruleForm">
|
||||
<el-form-item label="项目名称" prop="项目名称">
|
||||
<el-input v-model="projectName" size="small" placeholder="请输入项目名称" style="width:200px" disabled/>
|
||||
</el-form-item>
|
||||
<el-form-item label="剩余金额" prop="剩余金额">
|
||||
<el-input v-model="form4.剩余金额" size="small" placeholder="请输入项目名称" style="width:200px" disabled/>
|
||||
</el-form-item>
|
||||
<el-form-item label="收回日期" prop="收回日期">
|
||||
<el-date-picker
|
||||
v-model="form4.收回日期"
|
||||
style="width: 200px;"
|
||||
value-format="yyyy-MM-dd"
|
||||
size="small"
|
||||
type="date"
|
||||
placeholder="收回日期"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="callOff('form4')">取消</el-button>
|
||||
<el-button type="primary" @click="submit1('form4')">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { initProject, searchTable1, searchTable2, addSafetyMargin, editSafetyMargin, delSafetyMargin, Withdrawing, delWithdrawing, edtWithdrawing, TakeBack } from '@/api/MarketingCenter/SafetyMargin'
|
||||
export default {
|
||||
data() {
|
||||
const validateValue = (rule, value, callback) => {
|
||||
if (value === 0) {
|
||||
callback(new Error('金额不能为0或大于剩余保证金金额'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
return {
|
||||
disabled: false,
|
||||
AmountReceivable: '应收回金额',
|
||||
WithdrawingCode: '',
|
||||
SurplusAmount: '',
|
||||
maxMoney: null,
|
||||
maxMoney1: null,
|
||||
code: '', // 安全保证金流水号
|
||||
projectCode: '',
|
||||
projectName: '',
|
||||
flag1: null,
|
||||
entryName: '', // 项目名称
|
||||
entryNameValue: [], // 项目名称数组
|
||||
tableData1: [], // 安全保证金信息表数组
|
||||
tableData2: [], // 安全保证金信息表数组
|
||||
tableData1Loading: false, // 安全保证金信息表加载动画
|
||||
tableData2Loading: false, // 安全保证金信息表加载动画
|
||||
PageCurrent: 1,
|
||||
PageSize: 10,
|
||||
total: null,
|
||||
PageCurrent2: 1,
|
||||
PageSize2: 10,
|
||||
total2: null,
|
||||
radio: '1',
|
||||
title: '',
|
||||
title2: '',
|
||||
entryName1: [],
|
||||
dialogFormVisible1: false,
|
||||
dialogFormVisible2: false,
|
||||
dialogFormVisible3: false,
|
||||
dialogFormVisible4: false,
|
||||
form: {
|
||||
备注: '',
|
||||
项目名称: '',
|
||||
保证金金额: '',
|
||||
交付日期: '',
|
||||
预计收回日期: '',
|
||||
提前X天提醒我: ''
|
||||
},
|
||||
form2: {
|
||||
扣款金额: '',
|
||||
被扣款人: '',
|
||||
扣款日期: '',
|
||||
扣款原因: ''
|
||||
},
|
||||
form3: {
|
||||
扣款金额: '',
|
||||
被扣款人: '',
|
||||
扣款日期: '',
|
||||
扣款原因: ''
|
||||
},
|
||||
form4: {
|
||||
收回日期: '',
|
||||
剩余金额: ''
|
||||
},
|
||||
rules1: { // 表单验证规则
|
||||
项目名称: [{ required: true, message: '请选择项目', trigger: 'change' }],
|
||||
保证金金额: [{ required: true, message: '请输入保证金金额', trigger: 'blur' }],
|
||||
交付日期: [{ required: true, message: '请选择交付日期', trigger: 'change' }],
|
||||
预计收回日期: [{ required: true, message: '请选择预计收回日期', trigger: 'change' }],
|
||||
提前X天提醒我: [{ required: true, message: '提前X天提醒我', trigger: 'blur' }]
|
||||
},
|
||||
rules2: { // 表单验证规则
|
||||
扣款金额: [
|
||||
{ required: true, message: '请输入本次付款金额', trigger: 'blur' },
|
||||
{ required: true, trigger: 'blur', validator: validateValue }],
|
||||
被扣款人: [{ required: true, message: '请输入被扣款人', trigger: 'blur' }],
|
||||
扣款日期: [{ required: true, message: '请选择扣款日期', trigger: 'change' }]
|
||||
},
|
||||
rules3: { // 表单验证规则
|
||||
扣款金额: [
|
||||
{ required: true, message: '请输入本次付款金额', trigger: 'blur' },
|
||||
{ required: true, trigger: 'blur', validator: validateValue }],
|
||||
被扣款人: [{ required: true, message: '请输入被扣款人', trigger: 'blur' }],
|
||||
扣款日期: [{ required: true, message: '请选择扣款日期', trigger: 'change' }]
|
||||
},
|
||||
rules4: { // 表单验证规则
|
||||
收回日期: [{ required: true, message: '请选择收回日期', trigger: 'change' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.init()
|
||||
},
|
||||
methods: {
|
||||
change(data) {
|
||||
return data + 1
|
||||
},
|
||||
init() {
|
||||
this.getSelect(initProject, ['项目名称', '项目流水号'], 'entryName')
|
||||
this.getSelect(initProject, ['项目名称', '项目流水号'], 'entryName1')
|
||||
},
|
||||
fetchTableData1() {
|
||||
if (this.radio === '1') {
|
||||
this.disabled = false
|
||||
this.AmountReceivable = '应收回金额'
|
||||
this.getTable(searchTable1, [this.PageCurrent, this.PageSize, this.entryNameValue, this.radio], ['tableData1', 'total', 'tableData1Loading'])
|
||||
} else {
|
||||
this.disabled = true
|
||||
this.AmountReceivable = '实收回金额'
|
||||
this.getTable(searchTable1, [this.PageCurrent, this.PageSize, this.entryNameValue, this.radio], ['tableData1', 'total', 'tableData1Loading'])
|
||||
}
|
||||
},
|
||||
fetchTableData2(row) {
|
||||
this.code = row.安全保证金流水号
|
||||
this.SurplusAmount = row.应收回金额
|
||||
this.projectName = row.项目名称
|
||||
this.getTable(searchTable2, [this.PageCurrent2, this.PageSize2, this.code], ['tableData2', 'total2', 'tableData2Loading'])
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.PageCurrent = 1
|
||||
this.PageSize = val
|
||||
this.fetchTableData1()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.PageCurrent = val
|
||||
this.fetchTableData1()
|
||||
},
|
||||
handleSizeChange2(val) {
|
||||
this.PageCurrent2 = 1
|
||||
this.PageSize2 = val
|
||||
this.fetchTableData2()
|
||||
},
|
||||
handleCurrentChange2(val) {
|
||||
this.PageCurrent2 = val
|
||||
this.fetchTableData2()
|
||||
},
|
||||
tableRowClassName({ row }) {
|
||||
if (parseInt(row.是否收回) === 2) {
|
||||
return 'background: #66cc33'
|
||||
} else {
|
||||
if (parseInt(row.状态) === 1) {
|
||||
return 'background: #ffff66'
|
||||
} else if (parseInt(row.状态) === 2) {
|
||||
return 'background: #ff6666'
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
},
|
||||
addSafetyMargin() {
|
||||
this.title = '增加'
|
||||
this.dialogFormVisible1 = true
|
||||
this.addForm('form')
|
||||
},
|
||||
editSafetyMargin(row) {
|
||||
this.title = '编辑'
|
||||
this.dialogFormVisible1 = true
|
||||
this.form.项目名称 = parseInt(row.项目流水号)
|
||||
this.form.保证金金额 = row.保证金金额
|
||||
this.form.交付日期 = row.交付日期
|
||||
this.form.预计收回日期 = row.预计收回日期
|
||||
this.form.提前X天提醒我 = row.提前x天提醒
|
||||
this.form.备注 = row.备注
|
||||
this.code = row.安全保证金流水号
|
||||
// this.projectCode = parseInt(row.项目流水号)
|
||||
},
|
||||
addTableData1() {
|
||||
addSafetyMargin(this.form.项目名称, this.form.保证金金额, this.form.交付日期, this.form.提前X天提醒我, this.form.预计收回日期, this.form.备注).then(response => {
|
||||
this.dialogFormVisible1 = false
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('添加成功')
|
||||
this.title = ''
|
||||
this.fetchTableData1()
|
||||
} else {
|
||||
this.$message.error('添加失败')
|
||||
}
|
||||
})
|
||||
},
|
||||
editTableData1() {
|
||||
editSafetyMargin(this.form.项目名称, this.form.保证金金额, this.form.交付日期, this.form.提前X天提醒我, this.form.预计收回日期, this.form.备注, this.code).then(response => {
|
||||
this.dialogFormVisible1 = false
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('信息更新成功')
|
||||
this.fetchTableData1()
|
||||
this.code = ''
|
||||
this.projectCode = ''
|
||||
} else {
|
||||
this.$message.error('信息更新失败')
|
||||
}
|
||||
})
|
||||
},
|
||||
// 提交保证金信息添加或者修改
|
||||
submit1(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.flag1 === 1) {
|
||||
this.addTableData1()
|
||||
this.flag1 = null
|
||||
} else if (this.flag1 === 2) {
|
||||
this.editTableData1()
|
||||
this.flag1 = null
|
||||
} else if (this.flag1 === 3) {
|
||||
this.addTableData2()
|
||||
this.flag1 = null
|
||||
} else if (this.flag1 === 4) {
|
||||
this.edtTableData2()
|
||||
this.flag1 = null
|
||||
} else if (this.flag1 === 5) {
|
||||
this.submitTakeBack()
|
||||
this.flag1 = null
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
callOff() {
|
||||
this.dialogFormVisible1 = false
|
||||
this.dialogFormVisible2 = false
|
||||
},
|
||||
delSafetyMargin(row) {
|
||||
this.deleteRow(delSafetyMargin, row.安全保证金流水号, function() { this.fetchTableData1() })
|
||||
},
|
||||
delWithdrawing(row) {
|
||||
function a() {
|
||||
this.getTable(searchTable2, [this.PageCurrent2, this.PageSize2, this.code], ['tableData2', 'total2', 'tableData2Loading'])
|
||||
this.getTable(searchTable1, [this.PageCurrent, this.PageSize, this.entryNameValue, this.radio], ['tableData1', 'total', 'tableData1Loading'])
|
||||
this.dialogFormVisible2 = false
|
||||
}
|
||||
this.deleteRow(delWithdrawing, row.扣款流水号, a)
|
||||
},
|
||||
Withdrawing(row) {
|
||||
this.title2 = '扣款'
|
||||
this.dialogFormVisible2 = true
|
||||
this.code = row.安全保证金流水号
|
||||
this.projectName = row.项目名称
|
||||
this.maxMoney = row.保证金金额
|
||||
this.SurplusAmount = row.应收回金额
|
||||
this.addForm('form2')
|
||||
},
|
||||
addTableData2() {
|
||||
Withdrawing(this.code, this.form2.扣款金额, this.form2.被扣款人, this.form2.扣款原因, this.form2.扣款日期).then(response => {
|
||||
this.dialogFormVisible2 = false
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('扣款成功')
|
||||
this.title = ''
|
||||
this.getTable(searchTable1, [this.PageCurrent, this.PageSize, this.entryNameValue, this.radio], ['tableData1', 'total', 'tableData1Loading'])
|
||||
this.getTable(searchTable2, [this.PageCurrent2, this.PageSize2, this.code], ['tableData2', 'total2', 'tableData2Loading'])
|
||||
} else {
|
||||
this.$message.error('扣款失败')
|
||||
}
|
||||
})
|
||||
},
|
||||
editWithdrawing(row) {
|
||||
this.dialogFormVisible3 = true
|
||||
this.maxMoney1 = parseFloat(this.SurplusAmount) + parseFloat(row.扣款金额)
|
||||
this.form3.扣款金额 = row.扣款金额
|
||||
this.form3.被扣款人 = row.被扣款人
|
||||
this.form3.扣款原因 = row.扣款原因
|
||||
this.form3.扣款日期 = row.扣款日期
|
||||
this.WithdrawingCode = row.扣款流水号
|
||||
console.log(row.扣款流水号)
|
||||
},
|
||||
edtTableData2() {
|
||||
edtWithdrawing(this.WithdrawingCode, this.form3.扣款金额, this.form3.被扣款人, this.form3.扣款原因, this.form3.扣款日期).then(response => {
|
||||
this.dialogFormVisible3 = false
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('信息更新成功')
|
||||
this.getTable(searchTable1, [this.PageCurrent, this.PageSize, this.entryNameValue, this.radio], ['tableData1', 'total', 'tableData1Loading'])
|
||||
this.getTable(searchTable2, [this.PageCurrent2, this.PageSize2, this.code], ['tableData2', 'total2', 'tableData2Loading'])
|
||||
} else {
|
||||
this.$message.error('信息更新失败')
|
||||
}
|
||||
})
|
||||
},
|
||||
TakeBack(row) {
|
||||
this.code = row.安全保证金流水号
|
||||
this.projectName = row.项目名称
|
||||
this.form4.剩余金额 = parseFloat(row.应收回金额)
|
||||
this.dialogFormVisible4 = true
|
||||
},
|
||||
submitTakeBack() {
|
||||
TakeBack(this.code, this.form4.收回日期).then(response => {
|
||||
this.dialogFormVisible4 = false
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('信息更新成功')
|
||||
this.getTable(searchTable1, [this.PageCurrent, this.PageSize, this.entryNameValue, this.radio], ['tableData1', 'total', 'tableData1Loading'])
|
||||
} else {
|
||||
this.$message.error('信息更新失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-date-picker{
|
||||
width:50px
|
||||
}
|
||||
|
||||
</style>
|
||||
338
src/views/Outsourcing/InterBudgetaryBudgets/index.vue
Normal file
338
src/views/Outsourcing/InterBudgetaryBudgets/index.vue
Normal file
@@ -0,0 +1,338 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<el-card>
|
||||
<el-row>
|
||||
<el-radio-group v-model="radio" style="margin: 10px;" @change="radioChange">
|
||||
<el-radio :label="1">未编制</el-radio>
|
||||
<el-radio :label="2">已编制</el-radio>
|
||||
</el-radio-group>
|
||||
|
||||
<span>零件图号:</span>
|
||||
<el-input v-model="partName" placeholder="零件图号" size="small" clearable style="width:200px"/>
|
||||
|
||||
<span>开始时间:</span>
|
||||
<el-date-picker
|
||||
v-model="date01"
|
||||
format="yyyy-MM-dd"
|
||||
value-format="yyyy-MM-dd"
|
||||
type="date"
|
||||
size="small"
|
||||
placeholder="选择开始日期"/>
|
||||
|
||||
<span>结束时间:</span>
|
||||
<el-date-picker
|
||||
v-model="date02"
|
||||
format="yyyy-MM-dd"
|
||||
value-format="yyyy-MM-dd"
|
||||
type="date"
|
||||
size="small"
|
||||
placeholder="选择结束日期"/>
|
||||
|
||||
<el-button size="small" icon="el-icon-search" type="success" style="margin-left: 10px" @click="pageSize2=10; pageCurrent2=1;searchPartNum()">查询</el-button>
|
||||
</el-row>
|
||||
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<el-table v-loading="loading2" :data="tableData2" height="370" style="width: 100%;" border element-loading-text="拼命加载中" @row-click="searchTable">
|
||||
<el-table-column
|
||||
label=" "
|
||||
type="index"
|
||||
align="center"
|
||||
width="50"/>
|
||||
<el-table-column label="零件图号" align="center" width="230px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件名称" align="center" width="230px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="材料" align="center" width="220px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.材料 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="种类" align="center" width="180px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件类型名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="投产数量" align="center" width="180px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.批次数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="规格" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.原材料规格 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="面积" width="110" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.面积 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="重量" width="110" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.重量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="材料费" width="110" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.材料费 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="150px" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
class="el-icon-edit"
|
||||
@click="edit(scope.$index, scope.row, 'form')">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block">
|
||||
<el-pagination
|
||||
v-if="!loading2"
|
||||
:current-page="pageCurrent2"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="pageSize2"
|
||||
:total="total2"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange2"
|
||||
@current-change="handleCurrentChange2"/>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<el-table v-loading="loading0" :data="tableData" :summary-method="getSummaries" border style="width: 100%;max-height: 390px;" height="340px" stripe show-summary>
|
||||
<el-table-column label="序号" width="80" align="center" type="index"/>
|
||||
<el-table-column label="工艺名称" width="200" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].工艺名称" size="mini" placeholder="工艺名称" readonly/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工艺要求" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].工艺要求" size="mini" readonly type="textarea"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单件" width="110" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].单件定额工时_系数" size="mini" readonly/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="准结" width="110" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].准结定额工时" size="mini" readonly/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="外协预算价格" width="110" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].外协预算价格_系数" size="mini" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-button size="small" type="primary" style="float:right;margin: 10px" @click="saveRowPrice">保存</el-button>
|
||||
</el-card>
|
||||
|
||||
<el-dialog :visible.sync="dialogFormVisible" title="编辑" center style="min-height: 300px" width="800px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="110px" class="demo-ruleForm">
|
||||
|
||||
<el-form-item label="面积" prop="面积" style="margin-left: 200px">
|
||||
<el-input v-model="form.面积" placeholder="面积" size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="重量" prop="重量" style="margin-left: 200px">
|
||||
<el-input v-model="form.重量" placeholder="重量" size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="材料费" prop="材料费" style="margin-left: 200px">
|
||||
<el-input v-model="form.材料费" placeholder="材料费" size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="callOff('form')">取消</el-button>
|
||||
<el-button type="primary" @click="submit('form')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { searchPartNum1, searchPartNum2, searchTable, saveWeightArea, saveMaterialPrice, saveRowPrice } from '@/api/Outsourcing/InterBudgetaryBudgets'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
lingjianhao: '',
|
||||
dialogFormVisible: false,
|
||||
form: {
|
||||
面积: '',
|
||||
重量: '',
|
||||
材料费: ''
|
||||
},
|
||||
rules: {
|
||||
},
|
||||
cailiaofei: '',
|
||||
result: [],
|
||||
result2: [],
|
||||
radio: 1,
|
||||
partName: '', // 零件名称
|
||||
date01: '', // 开始时间
|
||||
date02: '', // 结束时间
|
||||
loading0: false,
|
||||
tableData: [],
|
||||
loading2: false,
|
||||
tableData2: [], // 表格数据
|
||||
total2: null, // 总条数
|
||||
pageSize2: 10, // 每页显示条数
|
||||
pageCurrent2: 1 // 后台获取页
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
radioChange() {
|
||||
this.tableData2 = []
|
||||
},
|
||||
// 查零件号
|
||||
searchPartNum() {
|
||||
if (this.partName === null) {
|
||||
this.partName = ''
|
||||
}
|
||||
if (this.date01 === '') {
|
||||
this.date01 = null
|
||||
}
|
||||
if (this.date02 === '') {
|
||||
this.date02 = null
|
||||
}
|
||||
this.loading2 = true
|
||||
this.tableData2 = []
|
||||
this.tableData = []
|
||||
if (this.radio === 1) {
|
||||
searchPartNum1(this.partName, this.date01, this.date02, this.pageCurrent2, this.pageSize2).then(response => {
|
||||
this.tableData2 = response.data.rows
|
||||
this.total2 = response.data.total
|
||||
}).then(() => {
|
||||
this.loading2 = false
|
||||
})
|
||||
} else {
|
||||
searchPartNum2(this.partName, this.date01, this.date02, this.pageCurrent2, this.pageSize2).then(response => {
|
||||
this.tableData2 = response.data.rows
|
||||
this.total2 = response.data.total
|
||||
}).then(() => {
|
||||
this.loading2 = false
|
||||
})
|
||||
}
|
||||
},
|
||||
// 合计
|
||||
getSummaries(param) {
|
||||
const { columns, data } = param
|
||||
const sums = ['', '', '', '', '', 0]
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 1) {
|
||||
sums[1] = '统计总价:'
|
||||
return
|
||||
} else if (index === 5) {
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
sums[5] += parseFloat(data[i].外协预算价格_系数)
|
||||
}
|
||||
sums[5] = parseInt(sums[5] * 100) / 100
|
||||
}
|
||||
})
|
||||
return sums
|
||||
},
|
||||
searchTable(row) {
|
||||
this.loading0 = true
|
||||
this.tableData = []
|
||||
searchTable(row.工艺计划流水号, 1).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
if (response.data[i].外协预算价格_系数 !== 0) {
|
||||
response.data[i].外协预算价格_系数 = response.data[i].外协预算价格_系数.toFixed(2)
|
||||
}
|
||||
}
|
||||
this.cailiaofei = row.材料费
|
||||
this.tableData = response.data
|
||||
this.loading0 = false
|
||||
})
|
||||
},
|
||||
// 打开编辑
|
||||
edit(index, row) {
|
||||
if (this.$refs['form'] !== undefined) {
|
||||
this.$refs['form'].resetFields()
|
||||
}
|
||||
this.form.面积 = row.面积
|
||||
this.form.重量 = row.重量
|
||||
this.form.材料费 = row.材料费
|
||||
this.lingjianhao = row.工艺计划流水号
|
||||
this.dialogFormVisible = true
|
||||
},
|
||||
// 编辑确定
|
||||
submit(formName) {
|
||||
this.WithdrawingEdit()
|
||||
this.dialogFormVisible = false
|
||||
},
|
||||
// 编辑
|
||||
WithdrawingEdit() {
|
||||
if ((this.form.重量 === '' || this.form.重量 === null) && (this.form.面积 === '' || this.form.面积 === null)) {
|
||||
this.form.重量 = null
|
||||
this.form.面积 = null
|
||||
}
|
||||
saveWeightArea(this.lingjianhao, this.form.重量, this.form.面积).then(response => {
|
||||
this.WithdrawingEdit2()
|
||||
})
|
||||
},
|
||||
WithdrawingEdit2() {
|
||||
if (this.form.材料费 === '' || this.form.材料费 === null) {
|
||||
this.form.材料费 = 0
|
||||
}
|
||||
saveMaterialPrice(this.lingjianhao, this.form.材料费).then(response => {
|
||||
this.$message.success('保存成功')
|
||||
this.searchPartNum()
|
||||
})
|
||||
},
|
||||
// 关闭扣款编辑
|
||||
callOff(formName) {
|
||||
this.dialogFormVisible = false
|
||||
this.$refs[formName].resetFields()
|
||||
},
|
||||
// 保存行价格
|
||||
saveRowPrice() {
|
||||
if (this.tableData.length === 0) {
|
||||
this.$message.error('请选择零件')
|
||||
} else {
|
||||
for (let i = 0; i < this.tableData.length; i++) {
|
||||
saveRowPrice(this.tableData[i].工序流水号, parseFloat(this.tableData[i].外协预算价格_系数), this.tableData[i].工艺计划流水号, this.cailiaofei).then(response => {
|
||||
})
|
||||
}
|
||||
this.$message.success('保存成功')
|
||||
this.searchPartNum()
|
||||
}
|
||||
},
|
||||
handleSizeChange2(val) {
|
||||
this.pageCurrent2 = 1
|
||||
this.pageSize2 = val
|
||||
this.searchPartNum()
|
||||
},
|
||||
handleCurrentChange2(val) {
|
||||
this.pageCurrent2 = val
|
||||
this.searchPartNum()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
span{
|
||||
margin: 10px 0 10px 10px;
|
||||
}
|
||||
.el-date-editor{
|
||||
width:150px
|
||||
}
|
||||
.el-card{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
</style>
|
||||
461
src/views/Outsourcing/OutFactoryMaintenance/index.vue
Normal file
461
src/views/Outsourcing/OutFactoryMaintenance/index.vue
Normal file
@@ -0,0 +1,461 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<el-card>
|
||||
<span>厂家名称:</span>
|
||||
<el-input v-model="ManufacturerName" clearable size="small" style="width:200px;margin:10px;"/>
|
||||
<span>电话:</span>
|
||||
<el-input v-model="phNumber" size="small" clearable style="width:200px;margin:10px;"/>
|
||||
<el-button type="success" class="el-icon-search" size="small" @click="pageCurrent=1;pageSize=10;searchTable()">查询</el-button>
|
||||
<el-button type="primary" class="el-icon-circle-plus-outline" size="small" @click="editType1('form');param = 0">新增</el-button>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<el-table v-loading="loading0" :data="tableData" height="650" style="width: 100%;" border>
|
||||
<el-table-column
|
||||
label=" "
|
||||
align="center"
|
||||
type="index"
|
||||
width="50"/>
|
||||
<el-table-column label="外协厂家名称" align="center" width="280px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.外协厂家名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="外协厂家简称" align="center" width="110px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.外协厂家简称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="地址" align="center" width="280px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.地址 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="联系人" align="center" width="120px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.联系人 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="电话" align="center" width="140px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.电话 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="传真" align="center" width="120px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.传真 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="设备情况" align="center" width="230px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.设备情况 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!--<el-table-column label="类别" align="center" width="110px">-->
|
||||
<!--<template slot-scope="scope">-->
|
||||
<!--{{scope.row.类别}}-->
|
||||
<!--</template>-->
|
||||
<!--</el-table-column>-->
|
||||
<!--<el-table-column label="关注" align="center">-->
|
||||
<!--<template slot-scope="scope">-->
|
||||
<!--{{scope.row.关注}}-->
|
||||
<!--</template>-->
|
||||
<!--</el-table-column>-->
|
||||
<el-table-column label="备注" align="center" width="150px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.备注 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!--<el-table-column label="序号" align="center">-->
|
||||
<!--<template slot-scope="scope">-->
|
||||
<!--{{scope.row.序号}}-->
|
||||
<!--</template>-->
|
||||
<!--</el-table-column>-->
|
||||
<el-table-column label="操作" align="center" width="200px" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
class="el-icon-edit"
|
||||
@click="handleChange1(scope.$index, scope.row, 'form');param = 1">编辑</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
class="el-icon-delete"
|
||||
@click="handleDelete(scope.$index, scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block">
|
||||
<el-pagination
|
||||
v-if="!loading0"
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-dialog :title="title1" :visible.sync="dialogFormVisible" center style="min-height: 300px" width="700px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="90px" class="demo-ruleForm">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="厂家名称" prop="ManufacturerName" >
|
||||
<el-input v-model="form.ManufacturerName" placeholder="厂家名称" clearable size="small"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="厂家简称" prop="ManufacturerAbbreviation">
|
||||
<el-input v-model="form.ManufacturerAbbreviation" placeholder="厂家简称" clearable size="small" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="地址" prop="address">
|
||||
<el-input v-model="form.address" placeholder="地址" clearable size="small" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系人" prop="roleName">
|
||||
<el-input v-model="form.roleName" placeholder="联系人" clearable size="small"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="电话" prop="phNumber">
|
||||
<el-input v-model="form.phNumber" placeholder="电话" clearable size="small"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="传真" prop="Fax">
|
||||
<el-input v-model="form.Fax" placeholder="传真" clearable size="small"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!--<el-row>-->
|
||||
<!--<el-col :span="12">-->
|
||||
<!--<el-form-item label="类别" prop="category">-->
|
||||
<!--<el-input v-model="form.category" placeholder="类别" clearable size="small"></el-input>-->
|
||||
<!--</el-form-item>-->
|
||||
<!--</el-col>-->
|
||||
<!--<el-col :span="12">-->
|
||||
<!--<el-form-item label="关注" prop="attention">-->
|
||||
<!--<el-input v-model="form.attention" placeholder="关注" clearable size="small" ></el-input>-->
|
||||
<!--</el-form-item>-->
|
||||
<!--</el-col>-->
|
||||
<!--</el-row>-->
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="设备情况" prop="EquipmentCondition">
|
||||
<el-input v-model="form.EquipmentCondition" placeholder="设备情况" clearable size="small"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注" prop="Remarks">
|
||||
<el-input v-model="form.Remarks" placeholder="备注" clearable size="small" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!--<el-row>-->
|
||||
<!--<el-col :span="12">-->
|
||||
<!--<el-form-item label="厂家序号" prop="ManufacturerNumber">-->
|
||||
<!--<el-input v-model="form.ManufacturerNumber" placeholder="厂家序号" clearable size="small"></el-input>-->
|
||||
<!--</el-form-item>-->
|
||||
<!--</el-col>-->
|
||||
<!--<el-col :span="12">-->
|
||||
<!--</el-col>-->
|
||||
<!--</el-row>-->
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="callOff('form')">取消</el-button>
|
||||
<el-button type="primary" @click="submit('form')" >确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { searchtable, edittype, handlechange, handledelete } from '@/api/Outsourcing/OutFactoryMaintenance'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading0: false,
|
||||
count1: 0,
|
||||
count2: 0, // 清表单验证计数器
|
||||
ManufacturerNumber: '', // 厂家序号
|
||||
num1: '',
|
||||
ManufacturerName: '', // 厂家名称
|
||||
num2: '',
|
||||
address: '', // 地址
|
||||
num3: '',
|
||||
roleName: '', // 联系人
|
||||
num4: '',
|
||||
phNumber: '', // 电话
|
||||
num5: '',
|
||||
Fax: '', // 传真
|
||||
num6: '',
|
||||
Remarks: '', // 备注
|
||||
num7: '',
|
||||
category: '', // 类别
|
||||
num8: '',
|
||||
EquipmentCondition: '', // 设备情况
|
||||
num9: '',
|
||||
ManufacturerAbbreviation: '', // 厂家简称
|
||||
num10: '',
|
||||
attention: '', // 关注
|
||||
num11: '',
|
||||
tableData: [], // 表格数据
|
||||
pageSize: 10,
|
||||
pageCurrent: 1,
|
||||
total: 0,
|
||||
CoManufacturerFlowNumber: '', // 外协厂家流水号
|
||||
CoManufacturerFlowNumber1: '',
|
||||
dialogFormVisible: false,
|
||||
title1: '',
|
||||
form: {
|
||||
ManufacturerNumber: '', // 厂家序号
|
||||
ManufacturerName: '', // 厂家名称
|
||||
address: '', // 地址
|
||||
roleName: '', // 联系人
|
||||
phNumber: '', // 电话
|
||||
Fax: '', // 传真
|
||||
Remarks: '', // 备注
|
||||
category: '', // 类别
|
||||
EquipmentCondition: '', // 设备情况
|
||||
ManufacturerAbbreviation: '', // 厂家简称
|
||||
attention: '' // 关注
|
||||
},
|
||||
rules: {
|
||||
ManufacturerName: [{ required: true, message: '请输入厂家名称', trigger: 'blur' }],
|
||||
ManufacturerAbbreviation: [{ required: true, message: '请输入厂家简称', trigger: 'blur' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.searchTable()
|
||||
},
|
||||
methods: {
|
||||
// 查询
|
||||
searchTable() {
|
||||
this.loading0 = true
|
||||
if (this.ManufacturerNumber !== '' && this.ManufacturerNumber !== null) {
|
||||
this.num1 = 1
|
||||
} else {
|
||||
this.num1 = 0
|
||||
this.ManufacturerNumber = ''
|
||||
}
|
||||
if (this.ManufacturerName !== '' && this.ManufacturerName !== null) {
|
||||
this.num2 = 1
|
||||
} else {
|
||||
this.num2 = 0
|
||||
this.ManufacturerName = ''
|
||||
}
|
||||
if (this.ManufacturerAbbreviation !== '' && this.ManufacturerAbbreviation !== null) {
|
||||
this.num10 = 1
|
||||
} else {
|
||||
this.num10 = 0
|
||||
this.ManufacturerAbbreviation = ''
|
||||
}
|
||||
if (this.address !== '' && this.address !== null) {
|
||||
this.num3 = 1
|
||||
} else {
|
||||
this.num3 = 0
|
||||
this.address = ''
|
||||
}
|
||||
if (this.roleName !== '' && this.roleName !== null) {
|
||||
this.num4 = 1
|
||||
} else {
|
||||
this.num4 = 0
|
||||
this.roleName = ''
|
||||
}
|
||||
if (this.phNumber !== '' && this.phNumber !== null) {
|
||||
this.num5 = 1
|
||||
} else {
|
||||
this.num5 = 0
|
||||
this.phNumber = ''
|
||||
}
|
||||
if (this.Fax !== '' && this.Fax !== null) {
|
||||
this.num6 = 1
|
||||
} else {
|
||||
this.num6 = 0
|
||||
this.Fax = ''
|
||||
}
|
||||
if (this.Remarks !== '' && this.Remarks !== null) {
|
||||
this.num7 = 1
|
||||
} else {
|
||||
this.num7 = 0
|
||||
this.Remarks = ''
|
||||
}
|
||||
if (this.category !== '' && this.category !== null) {
|
||||
this.num8 = 1
|
||||
} else {
|
||||
this.num8 = 0
|
||||
this.category = ''
|
||||
}
|
||||
if (this.attention !== '' && this.attention !== null) {
|
||||
this.num11 = 1
|
||||
} else {
|
||||
this.num11 = 0
|
||||
this.attention = ''
|
||||
}
|
||||
if (this.EquipmentCondition !== '' && this.EquipmentCondition !== null) {
|
||||
this.num9 = 1
|
||||
} else {
|
||||
this.num9 = 0
|
||||
this.EquipmentCondition = ''
|
||||
}
|
||||
searchtable(this.pageCurrent, this.pageSize, this.num1, this.ManufacturerNumber, this.num2, this.ManufacturerName, this.num10, this.ManufacturerAbbreviation, this.num3, this.address, this.num4, this.roleName, this.num5, this.phNumber, this.num6, this.Fax, this.num7, this.Remarks, this.num8, this.category, this.num11, this.attention, this.num9, this.EquipmentCondition).then(response => {
|
||||
this.tableData = response.data.rows
|
||||
this.total = response.data.total
|
||||
this.loading0 = false
|
||||
})
|
||||
},
|
||||
// 点击增加
|
||||
editType1(formName) {
|
||||
this.count1 = this.count1 + 1
|
||||
if (this.count1 !== 1) {
|
||||
this.$refs[formName].resetFields()
|
||||
}
|
||||
this.title1 = '增加'
|
||||
this.form.ManufacturerName = ''
|
||||
this.form.ManufacturerNumber = ''
|
||||
this.form.address = ''
|
||||
this.form.roleName = ''
|
||||
this.form.phNumber = ''
|
||||
this.form.Fax = ''
|
||||
this.form.Remarks = ''
|
||||
this.form.category = ''
|
||||
this.form.EquipmentCondition = ''
|
||||
this.form.ManufacturerAbbreviation = ''
|
||||
this.form.attention = ''
|
||||
this.dialogFormVisible = true
|
||||
},
|
||||
// 增加确定
|
||||
editType() {
|
||||
edittype(this.form.ManufacturerNumber, this.form.ManufacturerName, this.form.ManufacturerAbbreviation, this.form.address, this.form.roleName, this.form.phNumber, this.form.Fax, this.form.Remarks, this.form.category, this.form.attention, this.form.EquipmentCondition).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: '信息增加成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = 10
|
||||
this.searchTable()
|
||||
} else {
|
||||
this.$message.error('信息增加失败')
|
||||
}
|
||||
})
|
||||
this.dialogFormVisible = false
|
||||
},
|
||||
// 编辑打开
|
||||
handleChange1(index, row, formName) {
|
||||
this.count2 = this.count2 + 1
|
||||
if (this.count2 !== 1) {
|
||||
this.$refs[formName].resetFields()
|
||||
}
|
||||
this.form.ManufacturerNumber = row.序号
|
||||
this.form.ManufacturerName = row.外协厂家名称
|
||||
this.form.address = row.地址
|
||||
this.form.roleName = row.联系人
|
||||
this.form.phNumber = row.电话
|
||||
this.form.Fax = row.传真
|
||||
this.form.Remarks = row.备注
|
||||
this.form.category = row.类别
|
||||
this.form.EquipmentCondition = row.设备情况
|
||||
this.form.ManufacturerAbbreviation = row.外协厂家简称
|
||||
this.form.attention = row.关注
|
||||
this.dialogFormVisible = true
|
||||
this.title1 = '编辑'
|
||||
this.CoManufacturerFlowNumber1 = row.外协厂家流水号
|
||||
},
|
||||
// 编辑确定
|
||||
handleChange() {
|
||||
handlechange(this.CoManufacturerFlowNumber1, this.form.ManufacturerNumber, this.form.ManufacturerName, this.form.ManufacturerAbbreviation, this.form.address, this.form.roleName, this.form.phNumber, this.form.Fax, this.form.Remarks, this.form.category, this.form.attention, this.form.EquipmentCondition).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: '信息修改成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.searchTable()
|
||||
} else {
|
||||
this.$message.error('信息修改失败')
|
||||
}
|
||||
})
|
||||
this.dialogFormVisible = false
|
||||
},
|
||||
// 提交添加或者修改
|
||||
submit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.param === 0) {
|
||||
this.editType()
|
||||
} else {
|
||||
this.handleChange()
|
||||
}
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 重置表单
|
||||
callOff(formName) {
|
||||
this.dialogFormVisible = false
|
||||
this.$refs[formName].resetFields()
|
||||
},
|
||||
// 删除
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
handledelete(row.外协厂家流水号).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: '信息删除成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.searchTable()
|
||||
} else {
|
||||
this.$message.error('信息删除失败')
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
},
|
||||
// 分页
|
||||
handleSizeChange(val) {
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = val
|
||||
this.searchTable()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.searchTable()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-card{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.el-input{
|
||||
width: 210px;
|
||||
}
|
||||
</style>
|
||||
388
src/views/Outsourcing/OutsourcingDataMaintenance/index.vue
Normal file
388
src/views/Outsourcing/OutsourcingDataMaintenance/index.vue
Normal file
@@ -0,0 +1,388 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<el-card>
|
||||
<span>工艺名称:</span>
|
||||
<el-input v-model="Code" placeholder="工艺名称" clearable size="small" style="width: 15%;top: 1px;"/>
|
||||
<span style="margin-left: 10px">工艺分类:</span>
|
||||
<el-select v-model="processClassificationValue" size="small" filterable clearable placeholder="工艺分类">
|
||||
<el-option
|
||||
v-for="item in processClassification"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<el-button type="success" class="el-icon-search" size="small" style="margin-left: 10px" @click="pageSize=10;pageList=1;getTableData()">查询</el-button>
|
||||
<el-button v-if="false" type="primary" class="el-icon-circle-plus-outline" size="small" @click="addData('form1')">新增</el-button>
|
||||
</el-card>
|
||||
|
||||
<el-card class="box-card">
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData3"
|
||||
border
|
||||
stripe
|
||||
tooltip-effect="dark"
|
||||
style="width: 100%;"
|
||||
height="650">
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="序号"
|
||||
type="index"
|
||||
width="55"/>
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="工艺名称"
|
||||
width="300">
|
||||
<template slot-scope="scope">{{ scope.row.工艺名称 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="工艺名称简称"
|
||||
width="280">
|
||||
<template slot-scope="scope">{{ scope.row.工艺名称简称 }}</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" label="工时价格(元/分)">
|
||||
<template slot-scope="scope">
|
||||
<div :class="colorCode1[scope.$index]">
|
||||
<h4>{{ scope.row.外协价格1 }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" label="重量价格(元/kg)">
|
||||
<template slot-scope="scope">
|
||||
<div :class="colorCode2[scope.$index]">
|
||||
<h4>{{ scope.row.重量价格1 }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" label="面积价格(元/m2)">
|
||||
<template slot-scope="scope">
|
||||
<div :class="colorCode3[scope.$index]">
|
||||
<h4>{{ scope.row.面积价格1 }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" width="130px" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
class="el-icon-edit"
|
||||
@click="handleEdit(scope.$index, scope.row, 'form')">编辑</el-button>
|
||||
<el-button
|
||||
v-if="false"
|
||||
size="mini"
|
||||
type="danger"
|
||||
class="el-icon-delete"
|
||||
@click="handleDelete(scope.$index, scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
v-if="!loading"
|
||||
:current-page="currentPage"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-dialog :visible.sync="dialogFormVisible1" title="外协价格计算系数维护" center width="20%">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="left" class="demo-ruleForm" label-width="100px" style="width: 90%;margin: auto">
|
||||
<el-row style="margin: 2px 0 30px 30px;">
|
||||
<el-radio-group v-model="radio">
|
||||
<el-radio :label="1">工时</el-radio>
|
||||
<el-radio :label="2">重量</el-radio>
|
||||
<el-radio :label="3">面积</el-radio>
|
||||
</el-radio-group>
|
||||
</el-row>
|
||||
|
||||
<el-form-item v-if="radio === 1" label="工时(元/分)" prop="Price">
|
||||
<el-input v-model="form.Price" size="small" placeholder="请输入工时价格"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item v-if="radio === 2" label="重量(元/kg)" prop="weightPrice">
|
||||
<el-input v-model="form.weightPrice" size="small" placeholder="请输入重量价格"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item v-if="radio === 3" label="面积(元/m2)" prop="areaPrice">
|
||||
<el-input v-model="form.areaPrice" size="small" placeholder="请输入面积价格"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="14"/>
|
||||
<el-form-item >
|
||||
<el-button size="small" @click="callOff('form')">取消</el-button>
|
||||
<el-button size="small" type="primary" @click="submit('form')">确 定</el-button>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :visible.sync="dialogFormVisible2" title="新增工艺" center width="28%">
|
||||
<el-form ref="form1" :model="form1" :rules="rules" label-position="left" label-width="110px" class="demo-ruleForm">
|
||||
<el-form-item label="工艺名称" prop="Name">
|
||||
<el-input v-model="form1.Name" size="small" />
|
||||
</el-form-item>
|
||||
<el-form-item label="工艺名称简称" prop="ShortName">
|
||||
<el-input v-model="form1.ShortName" size="small" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="callOff1('form1')">取消</el-button>
|
||||
<el-button size="small" type="primary" @click="submit1('form1')">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getType, getTable, delList, Add, editList } from '@/api/Outsourcing/OutsourcingDataMaintenance'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
colorCode1: [],
|
||||
colorCode2: [],
|
||||
colorCode3: [],
|
||||
radio: 1,
|
||||
processClassificationValue: '',
|
||||
processClassification: [],
|
||||
form: { // 添加修改表单
|
||||
Price: '', // 外协价格
|
||||
weightPrice: '', // 重量价格
|
||||
areaPrice: '' // 面积价格
|
||||
},
|
||||
count1: 0,
|
||||
count2: 0,
|
||||
form1: {
|
||||
Name: '',
|
||||
ShortName: ''
|
||||
},
|
||||
EditCode: '',
|
||||
loading: false,
|
||||
Code_Check: false,
|
||||
Code_Check1: false,
|
||||
Code: '', // 工艺计划流水号
|
||||
dialogFormVisible1: false,
|
||||
dialogFormVisible2: false, // 新增编辑弹框
|
||||
total: null, // 总条数
|
||||
pageSize: 10, // 每页显示条数
|
||||
pageList: 1, // 后台获取页
|
||||
currentPage: 1, // 显示当前页
|
||||
tableData3: [], // 表格数据
|
||||
rules: { // 表单验证规则
|
||||
Price: [{ required: true, message: '请输入工时价格', trigger: 'change' }],
|
||||
weightPrice: [{ required: true, message: '请输入重量价格', trigger: 'change' }],
|
||||
areaPrice: [{ required: true, message: '请输入面积价格', trigger: 'change' }],
|
||||
Name: [{ required: true, message: '请输入工艺名称', trigger: 'change' }],
|
||||
ShortName: [{ required: true, message: '请输入工艺名称简称', trigger: 'change' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getTableData()
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
// 初始化获取工艺分类
|
||||
fetchData() {
|
||||
this.processClassificationValue = ''
|
||||
this.processClassification = []
|
||||
getType().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.processClassification.push({
|
||||
label: response.data[i].工艺分类名称,
|
||||
value: response.data[i].工艺分类流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 按条件查询
|
||||
getTableData() {
|
||||
this.loading = true
|
||||
this.tableData3 = []
|
||||
this.colorCode1 = []
|
||||
this.colorCode2 = []
|
||||
this.colorCode3 = []
|
||||
if (this.Code === '' || this.Code === null) {
|
||||
this.Code_Check = false
|
||||
} else {
|
||||
this.Code_Check = true
|
||||
}
|
||||
if (this.processClassificationValue === '' || this.processClassificationValue === null) {
|
||||
this.Code_Check1 = false
|
||||
} else {
|
||||
this.Code_Check1 = true
|
||||
}
|
||||
getTable(this.Code_Check, this.Code, this.Code_Check1, this.processClassificationValue, this.pageList, this.pageSize).then(response => {
|
||||
this.total = parseInt(response.data.total)
|
||||
if (response.data.rows.length !== 0) {
|
||||
for (let i = 0; i < response.data.rows.length; i++) {
|
||||
if (response.data.rows[i].外协价格计算标准流水号 === '1') {
|
||||
this.colorCode1.push('mianji')
|
||||
this.colorCode2.push('')
|
||||
this.colorCode3.push('')
|
||||
} else if (response.data.rows[i].外协价格计算标准流水号 === '2') {
|
||||
this.colorCode1.push('')
|
||||
this.colorCode2.push('mianji')
|
||||
this.colorCode3.push('')
|
||||
} else {
|
||||
this.colorCode1.push('')
|
||||
this.colorCode2.push('')
|
||||
this.colorCode3.push('mianji')
|
||||
}
|
||||
}
|
||||
this.tableData3 = response.data.rows
|
||||
}
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
// 删除
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
delList(row.工艺编号).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.getTableData()
|
||||
this.$message({
|
||||
message: '已被成功删除',
|
||||
type: 'success'
|
||||
})
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
},
|
||||
// 打开添加
|
||||
addData(formName) {
|
||||
this.count1 = this.count1 + 1
|
||||
if (this.count1 !== 1) {
|
||||
this.$refs[formName].resetFields()
|
||||
}
|
||||
this.form1.Name = ''
|
||||
this.form1.ShortName = ''
|
||||
this.dialogFormVisible2 = true
|
||||
},
|
||||
// 添加
|
||||
submitAdd() {
|
||||
Add(this.form1.Name, this.form1.ShortName).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.dialogFormVisible2 = false
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '添加成功!'
|
||||
})
|
||||
this.pageList = 1
|
||||
this.pageSize = 10
|
||||
this.getTableData()
|
||||
} else {
|
||||
this.$message.error('添加失败')
|
||||
this.dialogFormVisible2 = false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 打开编辑
|
||||
handleEdit(index, row, formName) {
|
||||
this.count2 = this.count2 + 1
|
||||
if (this.count2 !== 1) {
|
||||
this.$refs[formName].resetFields()
|
||||
}
|
||||
this.radio = parseInt(row.外协价格计算标准流水号)
|
||||
this.form.Price = row.外协价格1
|
||||
this.EditCode = row.工艺编号
|
||||
this.form.weightPrice = row.重量价格1
|
||||
this.form.areaPrice = row.面积价格1
|
||||
this.dialogFormVisible1 = true
|
||||
},
|
||||
// 提交编辑
|
||||
submitEdit() {
|
||||
if (this.form.Price === '0') {
|
||||
this.form.Price = ''
|
||||
}
|
||||
if (this.form.weightPrice === '0') {
|
||||
this.form.weightPrice = ''
|
||||
}
|
||||
if (this.form.areaPrice === '0') {
|
||||
this.form.areaPrice = ''
|
||||
}
|
||||
editList(this.EditCode, this.form.Price, this.form.weightPrice, this.form.areaPrice, this.radio).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.dialogFormVisible1 = false
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '信息更新成功!'
|
||||
})
|
||||
this.getTableData()
|
||||
} else {
|
||||
this.dialogFormVisible1 = false
|
||||
this.$message.error('信息更新失败')
|
||||
}
|
||||
})
|
||||
},
|
||||
// 提交添加或者修改
|
||||
submit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
this.submitEdit()
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
submit1(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
this.submitAdd()
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 重置表单
|
||||
callOff(formName) {
|
||||
this.dialogFormVisible1 = false
|
||||
this.$refs[formName].resetFields()
|
||||
},
|
||||
callOff1(formName) {
|
||||
this.dialogFormVisible2 = false
|
||||
this.$refs[formName].resetFields()
|
||||
},
|
||||
// 分页
|
||||
handleSizeChange(val) {
|
||||
this.pageList = 1
|
||||
this.pageSize = val
|
||||
this.getTableData()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageList = val
|
||||
this.getTableData()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.el-card{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.mianji{
|
||||
background-color: #7EE3FC;
|
||||
border: 1px solid #1f2d3d;
|
||||
}
|
||||
</style>
|
||||
344
src/views/Outsourcing/OutsourcingInspectionEntry/index.vue
Normal file
344
src/views/Outsourcing/OutsourcingInspectionEntry/index.vue
Normal file
@@ -0,0 +1,344 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<el-card>
|
||||
<span>合同号:</span>
|
||||
<el-input v-model="contractNum" placeholder="合同号" size="small" clearable style="width:200px"/>
|
||||
<span>外协厂家:</span>
|
||||
<el-select v-model="outHelpValue" size="small" filterable remote clearable placeholder="外协厂家">
|
||||
<el-option
|
||||
v-for="item in outHelp"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span>零件号:</span>
|
||||
<el-input v-model="partNum" placeholder="零件号" size="small" clearable style="width:200px"/>
|
||||
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 10px;" @click="PageCurrent=1;PageSize=10;searchTable()">查询</el-button>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<el-table v-loading="loading0" :data="tableData" border style="width: 100%;" height="650" stripe>
|
||||
<el-table-column label="合同号" width="200" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.表单号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="厂家" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.外协厂家简称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件号" width="200" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件名称" width="140" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.批次数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="保存" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" icon="el-icon-cjn-09" type="primary" @click="saveRow(scope.row)">保存</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="废品" width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].废品数量" size="mini" disabled/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="1检" align="center">
|
||||
<el-table-column label="交检日期" width="160" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-date-picker
|
||||
:readonly="readonly1[scope.$index]"
|
||||
v-model="tableData[scope.$index].交检日期1"
|
||||
size="mini"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
type="date"
|
||||
placeholder="外协科长填选"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="交检数量" width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].交检数量1" :readonly="readonly1[scope.$index]" size="mini"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="检查日期" width="160" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-date-picker
|
||||
:disabled="disabled2[scope.$index]"
|
||||
:readonly="true"
|
||||
v-model="tableData[scope.$index].检查日期1"
|
||||
size="mini"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
type="date"
|
||||
placeholder="检查员填选"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合格数量" width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].合格数量1" :disabled="disabled2[scope.$index]" :readonly="true" size="mini"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="2检" align="center">
|
||||
<el-table-column label="交检日期" width="160" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-date-picker
|
||||
:disabled="disabled3[scope.$index]"
|
||||
:readonly="readonly2[scope.$index]"
|
||||
v-model="tableData[scope.$index].交检日期2"
|
||||
size="mini"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
type="date"
|
||||
placeholder="外协科长填选"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="交检数量" width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].交检数量2" :disabled="disabled3[scope.$index]" :readonly="readonly2[scope.$index]" size="mini"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="检查日期" width="160" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-date-picker
|
||||
:disabled="disabled4[scope.$index]"
|
||||
:readonly="true"
|
||||
v-model="tableData[scope.$index].检查日期2"
|
||||
size="mini"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
type="date"
|
||||
placeholder="检查员填选"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合格数量" width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].合格数量2" :disabled="disabled4[scope.$index]" :readonly="true" size="mini"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="3检" align="center">
|
||||
<el-table-column label="交检日期" width="160" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-date-picker
|
||||
:disabled="disabled5[scope.$index]"
|
||||
v-model="tableData[scope.$index].交检日期3"
|
||||
size="mini"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
type="date"
|
||||
placeholder="外协科长填选"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="交检数量" width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].交检数量3" :disabled="disabled5[scope.$index]" size="mini"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="检查日期" width="160" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-date-picker
|
||||
:disabled="disabled6[scope.$index]"
|
||||
:readonly="true"
|
||||
v-model="tableData[scope.$index].检查日期3"
|
||||
size="mini"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
type="date"
|
||||
placeholder="检查员填选"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合格数量" width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].合格数量3" :disabled="disabled6[scope.$index]" :readonly="true" size="mini"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
v-if="!loading0"
|
||||
:current-page="PageCurrent"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="PageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { initOutHelp, searchTable, saveRow } from '@/api/Outsourcing/OutsourcingInspectionEntry'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading0: false,
|
||||
contractNum: '',
|
||||
outHelpValue: '',
|
||||
outHelp: [],
|
||||
partNum: '',
|
||||
tableData: [],
|
||||
readonly1: [],
|
||||
readonly2: [],
|
||||
readonly3: [],
|
||||
disabled2: [],
|
||||
disabled3: [],
|
||||
disabled4: [],
|
||||
disabled5: [],
|
||||
disabled6: [],
|
||||
PageCurrent: 1,
|
||||
PageSize: 10,
|
||||
total: null
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
fetchData() {
|
||||
this.outHelp = []
|
||||
initOutHelp().then(response => { // 初始化外协厂家;*这里模糊查询省一个存储过程
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.outHelp.push({
|
||||
label: response.data[i].外协厂家名称,
|
||||
value: response.data[i].外协厂家流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
searchTable() {
|
||||
this.loading0 = true
|
||||
this.tableData = []
|
||||
if (this.contractNum === '') {
|
||||
this.check1 = 0
|
||||
} else { this.check1 = 1 }
|
||||
if (this.outHelpValue === '') {
|
||||
this.check2 = 0
|
||||
} else { this.check2 = 1 }
|
||||
if (this.partNum === '') {
|
||||
this.check3 = 0
|
||||
} else { this.check3 = 1 }
|
||||
searchTable(this.PageCurrent, this.PageSize, this.check2, this.outHelpValue, this.check1, this.contractNum, this.check3, this.partNum).then(response => {
|
||||
this.tableData = response.data.rows
|
||||
this.total = response.data.total
|
||||
this.judge()
|
||||
this.loading0 = false
|
||||
})
|
||||
},
|
||||
// 判断进度
|
||||
judge() {
|
||||
for (let i = 0; i < this.tableData.length; i++) {
|
||||
if (this.tableData[i].合格数量1 === null || this.tableData[i].合格数量1 === '') {
|
||||
this.readonly1[i] = false
|
||||
} else {
|
||||
this.readonly1[i] = true
|
||||
}
|
||||
if (this.tableData[i].合格数量2 === null || this.tableData[i].合格数量2 === '') {
|
||||
this.readonly2[i] = false
|
||||
} else {
|
||||
this.readonly2[i] = true
|
||||
}
|
||||
if (this.tableData[i].合格数量3 === null || this.tableData[i].合格数量3 === '') {
|
||||
this.readonly3[i] = false
|
||||
} else {
|
||||
this.readonly3[i] = true
|
||||
}
|
||||
if (this.tableData[i].交检数量1 === null || this.tableData[i].交检数量1 === '') {
|
||||
this.disabled2[i] = true
|
||||
} else {
|
||||
this.disabled2[i] = false
|
||||
}
|
||||
if (this.tableData[i].合格数量1 === null || this.tableData[i].合格数量1 === '') {
|
||||
this.disabled3[i] = true
|
||||
} else {
|
||||
this.disabled3[i] = false
|
||||
}
|
||||
if (this.tableData[i].交检数量2 === null || this.tableData[i].交检数量2 === '') {
|
||||
this.disabled4[i] = true
|
||||
} else {
|
||||
this.disabled4[i] = false
|
||||
}
|
||||
if (this.tableData[i].合格数量2 === null || this.tableData[i].合格数量2 === '') {
|
||||
this.disabled5[i] = true
|
||||
} else {
|
||||
this.disabled5[i] = false
|
||||
}
|
||||
if (this.tableData[i].交检数量3 === null || this.tableData[i].交检数量3 === '') {
|
||||
this.disabled6[i] = true
|
||||
} else {
|
||||
this.disabled6[i] = false
|
||||
}
|
||||
}
|
||||
},
|
||||
saveRow(row) {
|
||||
if (parseInt(row.交检数量1) > row.批次数量 || parseInt(row.交检数量1) + parseInt(row.交检数量2) > row.批次数量 || parseInt(row.交检数量1) + parseInt(row.交检数量2) + parseInt(row.交检数量3) > row.批次数量) {
|
||||
this.$message.error('超出零件数量范围')
|
||||
} else {
|
||||
if (row.交检日期1 === null) { row.交检日期1 = '' }
|
||||
if (row.交检数量1 === null) { row.交检数量1 = '' }
|
||||
if (row.检查日期1 === null) { row.检查日期1 = '' }
|
||||
if (row.合格数量1 === null) { row.合格数量1 = '' }
|
||||
if (row.交检日期2 === null) { row.交检日期2 = '' }
|
||||
if (row.交检数量2 === null) { row.交检数量2 = '' }
|
||||
if (row.检查日期2 === null) { row.检查日期2 = '' }
|
||||
if (row.合格数量2 === null) { row.合格数量2 = '' }
|
||||
if (row.交检日期3 === null) { row.交检日期3 = '' }
|
||||
if (row.交检数量3 === null) { row.交检数量3 = '' }
|
||||
if (row.检查日期3 === null) { row.检查日期3 = '' }
|
||||
if (row.合格数量3 === null) { row.合格数量3 = '' }
|
||||
saveRow(row.外协加工任务单明细流水号, row.交检日期1, row.交检数量1, row.检查日期1, row.合格数量1, row.交检日期2, row.交检数量2, row.检查日期2, row.合格数量2, row.交检日期3, row.交检数量3, row.检查日期3, row.合格数量3, row.废品数量).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('保存成功')
|
||||
// this.PageCurrent = 1
|
||||
// this.PageSize = 10
|
||||
// this.searchTable()
|
||||
} else { this.$message.error('保存失败') }
|
||||
})
|
||||
}
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.PageCurrent = 1
|
||||
this.PageSize = val
|
||||
this.searchTable()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.PageCurrent = val
|
||||
this.searchTable()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.doing-row4{
|
||||
background: #f0f9eb;
|
||||
}
|
||||
.el-card{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.el-date-editor{
|
||||
width:130px
|
||||
}
|
||||
span{
|
||||
margin: 10px 0 10px 10px;
|
||||
}
|
||||
</style>
|
||||
405
src/views/Outsourcing/OutsourcingInspectionEntry2/index.vue
Normal file
405
src/views/Outsourcing/OutsourcingInspectionEntry2/index.vue
Normal file
@@ -0,0 +1,405 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<el-card>
|
||||
<span>合同号:</span>
|
||||
<el-input v-model="contractNum" placeholder="合同号" size="small" clearable style="width:200px"/>
|
||||
<span>外协厂家:</span>
|
||||
<el-select v-model="outHelpValue" size="small" filterable remote clearable placeholder="外协厂家">
|
||||
<el-option
|
||||
v-for="item in outHelp"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span>零件号:</span>
|
||||
<el-input v-model="partNum" placeholder="零件号" size="small" clearable style="width:200px"/>
|
||||
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 10px;" @click="PageCurrent=1;PageSize=10;searchTable()">查询</el-button>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<el-table v-loading="loading0" :data="tableData" border style="width: 100%;" height="650" stripe>
|
||||
<el-table-column label="合同号" width="200" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.表单号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="厂家" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.外协厂家简称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件号" width="200" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件名称" width="140" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.批次数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="保存" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" icon="el-icon-cjn-09" type="primary" @click="saveRow(scope.row)">保存</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="废品" width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].废品数量" :disabled="disabled_feipin[scope.$index]" size="mini"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="1检" align="center">
|
||||
<el-table-column label="交检日期" width="160" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-date-picker
|
||||
:readonly="true"
|
||||
v-model="tableData[scope.$index].交检日期1"
|
||||
size="mini"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
type="date"
|
||||
placeholder="外协科长填选"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="交检数量" width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].交检数量1" :readonly="true" size="mini"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="检查日期" width="160" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-date-picker
|
||||
:disabled="disabled2[scope.$index]"
|
||||
v-model="tableData[scope.$index].检查日期1"
|
||||
size="mini"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
type="date"
|
||||
placeholder="检查员填选"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合格数量" width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].合格数量1" :disabled="disabled2[scope.$index]" size="mini"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="2检" align="center">
|
||||
<el-table-column label="交检日期" width="160" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-date-picker
|
||||
:disabled="disabled3[scope.$index]"
|
||||
:readonly="true"
|
||||
v-model="tableData[scope.$index].交检日期2"
|
||||
size="mini"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
type="date"
|
||||
placeholder="外协科长填选"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="交检数量" width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].交检数量2" :disabled="disabled3[scope.$index]" :readonly="true" size="mini"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="检查日期" width="160" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-date-picker
|
||||
:disabled="disabled4[scope.$index]"
|
||||
v-model="tableData[scope.$index].检查日期2"
|
||||
size="mini"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
type="date"
|
||||
placeholder="检查员填选"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合格数量" width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].合格数量2" :disabled="disabled4[scope.$index]" size="mini"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="3检" align="center">
|
||||
<el-table-column label="交检日期" width="160" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-date-picker
|
||||
:disabled="disabled5[scope.$index]"
|
||||
:readonly="true"
|
||||
v-model="tableData[scope.$index].交检日期3"
|
||||
size="mini"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
type="date"
|
||||
placeholder="外协科长填选"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="交检数量" width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].交检数量3" :disabled="disabled5[scope.$index]" :readonly="true" size="mini"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="检查日期" width="160" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-date-picker
|
||||
:disabled="disabled6[scope.$index]"
|
||||
v-model="tableData[scope.$index].检查日期3"
|
||||
size="mini"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
type="date"
|
||||
placeholder="检查员填选"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合格数量" width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].合格数量3" :disabled="disabled6[scope.$index]" size="mini"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
v-if="!loading0"
|
||||
:current-page="PageCurrent"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="PageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { initOutHelp, searchTable, saveRow } from '@/api/Outsourcing/OutsourcingInspectionEntry'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading0: false,
|
||||
contractNum: '',
|
||||
outHelpValue: '',
|
||||
outHelp: [],
|
||||
partNum: '',
|
||||
tableData: [],
|
||||
disabled_feipin: [],
|
||||
disabled2: [],
|
||||
disabled3: [],
|
||||
disabled4: [],
|
||||
disabled5: [],
|
||||
disabled6: [],
|
||||
PageCurrent: 1,
|
||||
PageSize: 10,
|
||||
total: 0
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
fetchData() {
|
||||
this.outHelp = []
|
||||
initOutHelp().then(response => { // 初始化外协厂家;*这里模糊查询省一个存储过程
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.outHelp.push({
|
||||
label: response.data[i].外协厂家名称,
|
||||
value: response.data[i].外协厂家流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
searchTable() {
|
||||
this.loading0 = true
|
||||
this.tableData = []
|
||||
if (this.contractNum === '') {
|
||||
this.check1 = 0
|
||||
} else { this.check1 = 1 }
|
||||
if (this.outHelpValue === '') {
|
||||
this.check2 = 0
|
||||
} else { this.check2 = 1 }
|
||||
if (this.partNum === '') {
|
||||
this.check3 = 0
|
||||
} else { this.check3 = 1 }
|
||||
searchTable(this.PageCurrent, this.PageSize, this.check2, this.outHelpValue, this.check1, this.contractNum, this.check3, this.partNum).then(response => {
|
||||
this.tableData = response.data.rows
|
||||
this.total = response.data.total
|
||||
this.loading0 = false
|
||||
this.judge()
|
||||
})
|
||||
},
|
||||
// 判断进度
|
||||
judge() {
|
||||
for (let i = 0; i < this.tableData.length; i++) {
|
||||
if (this.tableData[i].交检数量1 === null || this.tableData[i].交检数量1 === '') {
|
||||
this.disabled2[i] = true
|
||||
this.disabled_feipin[i] = true
|
||||
} else {
|
||||
this.disabled2[i] = false
|
||||
this.disabled_feipin[i] = false
|
||||
}
|
||||
if (this.tableData[i].合格数量1 === null || this.tableData[i].合格数量1 === '') {
|
||||
this.disabled3[i] = true
|
||||
} else {
|
||||
this.disabled3[i] = false
|
||||
}
|
||||
if (this.tableData[i].交检数量2 === null || this.tableData[i].交检数量2 === '') {
|
||||
this.disabled4[i] = true
|
||||
} else {
|
||||
this.disabled4[i] = false
|
||||
}
|
||||
if (this.tableData[i].合格数量2 === null || this.tableData[i].合格数量2 === '') {
|
||||
this.disabled5[i] = true
|
||||
} else {
|
||||
this.disabled5[i] = false
|
||||
}
|
||||
if (this.tableData[i].交检数量3 === null || this.tableData[i].交检数量3 === '') {
|
||||
this.disabled6[i] = true
|
||||
} else {
|
||||
this.disabled6[i] = false
|
||||
}
|
||||
}
|
||||
},
|
||||
// 保存
|
||||
saveRow(row) {
|
||||
// if (parseInt(row.废品数量) > row.批次数量 || parseInt(row.合格数量1) + parseInt(row.废品数量) > row.批次数量 || parseInt(row.合格数量2) + parseInt(row.废品数量) > row.批次数量 || parseInt(row.合格数量3) + parseInt(row.废品数量) > row.批次数量 || parseInt(row.合格数量1) + parseInt(row.合格数量2) + parseInt(row.废品数量) > row.批次数量 || parseInt(row.合格数量3) + parseInt(row.合格数量2) + parseInt(row.合格数量1) + parseInt(row.废品数量) > row.批次数量) {
|
||||
if (row.合格数量1 !== '' && row.合格数量2 === '' && row.合格数量3 === '') {
|
||||
if (parseInt(row.合格数量1) + parseInt(row.废品数量) > row.交检数量1) {
|
||||
this.$message.error('超出零件数量范围')
|
||||
} else {
|
||||
if (row.交检日期1 === null) { row.交检日期1 = '' }
|
||||
if (row.交检数量1 === null) { row.交检数量1 = '' }
|
||||
if (row.检查日期1 === null) { row.检查日期1 = '' }
|
||||
if (row.合格数量1 === null) { row.合格数量1 = '' }
|
||||
if (row.交检日期2 === null) { row.交检日期2 = '' }
|
||||
if (row.交检数量2 === null) { row.交检数量2 = '' }
|
||||
if (row.检查日期2 === null) { row.检查日期2 = '' }
|
||||
if (row.合格数量2 === null) { row.合格数量2 = '' }
|
||||
if (row.交检日期3 === null) { row.交检日期3 = '' }
|
||||
if (row.交检数量3 === null) { row.交检数量3 = '' }
|
||||
if (row.检查日期3 === null) { row.检查日期3 = '' }
|
||||
if (row.合格数量3 === null) { row.合格数量3 = '' }
|
||||
saveRow(row.外协加工任务单明细流水号, row.交检日期1, row.交检数量1, row.检查日期1, row.合格数量1, row.交检日期2, row.交检数量2, row.检查日期2, row.合格数量2, row.交检日期3, row.交检数量3, row.检查日期3, row.合格数量3, row.废品数量).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('保存成功')
|
||||
this.PageCurrent = 1
|
||||
this.PageSize = 10
|
||||
this.searchTable()
|
||||
} else { this.$message.error('保存失败') }
|
||||
})
|
||||
}
|
||||
} else if (row.合格数量1 !== '' && row.合格数量2 !== '' && row.合格数量3 === '') {
|
||||
if (parseInt(row.合格数量1) + parseInt(row.合格数量2) + parseInt(row.废品数量) > row.交检数量1 + row.交检数量2) {
|
||||
this.$message.error('超出零件数量范围')
|
||||
} else {
|
||||
if (row.交检日期1 === null) { row.交检日期1 = '' }
|
||||
if (row.交检数量1 === null) { row.交检数量1 = '' }
|
||||
if (row.检查日期1 === null) { row.检查日期1 = '' }
|
||||
if (row.合格数量1 === null) { row.合格数量1 = '' }
|
||||
if (row.交检日期2 === null) { row.交检日期2 = '' }
|
||||
if (row.交检数量2 === null) { row.交检数量2 = '' }
|
||||
if (row.检查日期2 === null) { row.检查日期2 = '' }
|
||||
if (row.合格数量2 === null) { row.合格数量2 = '' }
|
||||
if (row.交检日期3 === null) { row.交检日期3 = '' }
|
||||
if (row.交检数量3 === null) { row.交检数量3 = '' }
|
||||
if (row.检查日期3 === null) { row.检查日期3 = '' }
|
||||
if (row.合格数量3 === null) { row.合格数量3 = '' }
|
||||
saveRow(row.外协加工任务单明细流水号, row.交检日期1, row.交检数量1, row.检查日期1, row.合格数量1, row.交检日期2, row.交检数量2, row.检查日期2, row.合格数量2, row.交检日期3, row.交检数量3, row.检查日期3, row.合格数量3, row.废品数量).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('保存成功')
|
||||
this.PageCurrent = 1
|
||||
this.PageSize = 10
|
||||
this.searchTable()
|
||||
} else { this.$message.error('保存失败') }
|
||||
})
|
||||
}
|
||||
} else if (row.合格数量1 !== '' && row.合格数量2 !== '' && row.合格数量3 !== '') {
|
||||
if (parseInt(row.合格数量1) + parseInt(row.合格数量2) + parseInt(row.合格数量3) + parseInt(row.废品数量) > row.交检数量1 + row.交检数量2 + row.交检数量3) {
|
||||
this.$message.error('超出零件数量范围')
|
||||
} else {
|
||||
if (row.交检日期1 === null) { row.交检日期1 = '' }
|
||||
if (row.交检数量1 === null) { row.交检数量1 = '' }
|
||||
if (row.检查日期1 === null) { row.检查日期1 = '' }
|
||||
if (row.合格数量1 === null) { row.合格数量1 = '' }
|
||||
if (row.交检日期2 === null) { row.交检日期2 = '' }
|
||||
if (row.交检数量2 === null) { row.交检数量2 = '' }
|
||||
if (row.检查日期2 === null) { row.检查日期2 = '' }
|
||||
if (row.合格数量2 === null) { row.合格数量2 = '' }
|
||||
if (row.交检日期3 === null) { row.交检日期3 = '' }
|
||||
if (row.交检数量3 === null) { row.交检数量3 = '' }
|
||||
if (row.检查日期3 === null) { row.检查日期3 = '' }
|
||||
if (row.合格数量3 === null) { row.合格数量3 = '' }
|
||||
saveRow(row.外协加工任务单明细流水号, row.交检日期1, row.交检数量1, row.检查日期1, row.合格数量1, row.交检日期2, row.交检数量2, row.检查日期2, row.合格数量2, row.交检日期3, row.交检数量3, row.检查日期3, row.合格数量3, row.废品数量).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('保存成功')
|
||||
this.PageCurrent = 1
|
||||
this.PageSize = 10
|
||||
this.searchTable()
|
||||
} else { this.$message.error('保存失败') }
|
||||
})
|
||||
}
|
||||
}
|
||||
// if (parseInt(row.合格数量1) + parseInt(row.废品数量) > row.交检数量1 || parseInt(row.合格数量1) + parseInt(row.合格数量2) + parseInt(row.废品数量) > row.交检数量1 + row.交检数量2 || parseInt(row.合格数量1) + parseInt(row.合格数量2) + parseInt(row.合格数量3) + parseInt(row.废品数量) > row.交检数量1 + row.交检数量2 + row.交检数量3) {
|
||||
// this.$message.error('超出零件数量范围')
|
||||
// } else {
|
||||
// if (row.交检日期1 === null) { row.交检日期1 = '' }
|
||||
// if (row.交检数量1 === null) { row.交检数量1 = '' }
|
||||
// if (row.检查日期1 === null) { row.检查日期1 = '' }
|
||||
// if (row.合格数量1 === null) { row.合格数量1 = '' }
|
||||
// if (row.交检日期2 === null) { row.交检日期2 = '' }
|
||||
// if (row.交检数量2 === null) { row.交检数量2 = '' }
|
||||
// if (row.检查日期2 === null) { row.检查日期2 = '' }
|
||||
// if (row.合格数量2 === null) { row.合格数量2 = '' }
|
||||
// if (row.交检日期3 === null) { row.交检日期3 = '' }
|
||||
// if (row.交检数量3 === null) { row.交检数量3 = '' }
|
||||
// if (row.检查日期3 === null) { row.检查日期3 = '' }
|
||||
// if (row.合格数量3 === null) { row.合格数量3 = '' }
|
||||
// saveRow(row.外协加工任务单明细流水号, row.交检日期1, row.交检数量1, row.检查日期1, row.合格数量1, row.交检日期2, row.交检数量2, row.检查日期2, row.合格数量2, row.交检日期3, row.交检数量3, row.检查日期3, row.合格数量3, row.废品数量).then(response => {
|
||||
// if (response.data[0].result === '1') {
|
||||
// this.$message.success('保存成功')
|
||||
// this.PageCurrent = 1
|
||||
// this.PageSize = 10
|
||||
// this.searchTable()
|
||||
// } else { this.$message.error('保存失败') }
|
||||
// })
|
||||
// }
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.PageCurrent = 1
|
||||
this.PageSize = val
|
||||
this.searchTable()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.PageCurrent = val
|
||||
this.searchTable()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.doing-row4{
|
||||
background: #f0f9eb;
|
||||
}
|
||||
.el-card{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.el-date-editor{
|
||||
width:130px
|
||||
}
|
||||
span{
|
||||
margin: 10px 0 10px 10px;
|
||||
}
|
||||
</style>
|
||||
488
src/views/Outsourcing/OutsourcingPaymentPlanManagement/index.vue
Normal file
488
src/views/Outsourcing/OutsourcingPaymentPlanManagement/index.vue
Normal file
@@ -0,0 +1,488 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<el-card>
|
||||
<el-row>
|
||||
<span>表单号:</span>
|
||||
<el-input v-model="FormNumber" placeholder="表单号" clearable size="small" style="width:190px;margin:10px;"/>
|
||||
<span>任务下达时间段:</span>
|
||||
<el-date-picker
|
||||
v-model="date1"
|
||||
style="width:190px;margin:10px;"
|
||||
size="small"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
placeholder="选择日期"/>
|
||||
<span>~</span>
|
||||
<el-date-picker
|
||||
v-model="date2"
|
||||
style="width:190px;margin:10px;"
|
||||
size="small"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
placeholder="选择日期"/>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<span>厂家名:</span>
|
||||
<el-select v-model="ManufacturerNameValue" placeholder="选择外协厂家" filterable clearable size="small" style="width:190px;margin:10px;">
|
||||
<el-option
|
||||
v-for="item in ManufacturerName"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span>实际付款时间段:</span>
|
||||
<el-date-picker
|
||||
v-model="date3"
|
||||
style="width:190px;margin:10px;"
|
||||
size="small"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
placeholder="选择日期"/>
|
||||
<span>~</span>
|
||||
<el-date-picker
|
||||
v-model="date4"
|
||||
style="width:190px;margin:10px;"
|
||||
size="small"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
placeholder="选择日期"/>
|
||||
<el-button type="success" class="el-icon-search" size="small" @click="pageCurrent=1;pageSize=10;total=null;pageCurrent2=1;pageSize2=10;total2=null;searchTable()">查询</el-button>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<el-table v-loading="loading" :data="tableData" :row-class-name="tableRowClassName" height="580" style="width: 100%;" border element-loading-text="拼命加载中" @row-click="getParts">
|
||||
<el-table-column
|
||||
label=" "
|
||||
type="index"
|
||||
align="center"
|
||||
width="50"/>
|
||||
<el-table-column label="表单号" align="center" width="280px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.表单号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="外协厂家名称" align="center" width="280px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.外协厂家名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务下达日期" align="center" width="280px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.任务下达日期 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="外协员" align="center" width="120px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.外协员姓名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="加工价格" align="center">
|
||||
<el-table-column label="预算总价" align="center" width="140px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.加工价格_预算_总价 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="成交总价" align="center" width="140px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.加工价格_成交_总价 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="材料费" align="center" width="140px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.材料价格_价格_总价 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="运费" align="center" width="140px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.运费 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="其他费用" align="center" width="140px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.其他价格_总价 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="总价" align="center" width="140px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.总价 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="扣款" align="center">
|
||||
<el-table-column label="质量" align="center" width="140px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.扣款_质量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="计划" align="center" width="140px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.扣款_计划 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="其他" align="center" width="140px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.扣款_其他 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="应付金额" align="center" width="140px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.应付总额 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="付款日期" align="center" width="240px">
|
||||
<!--<template slot-scope="scope">-->
|
||||
<!--{{scope.row.实际付款时间}}-->
|
||||
<!--</template>-->
|
||||
<el-table-column label="入库" align="center" width="140px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.入库时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="计划" align="center" width="140px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计划付款时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="实际" align="center" width="140px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.实际付款时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="扣款说明" align="center" width="240px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.扣款说明 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="200px" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
:disabled="scope.row.实际付款时间!==''"
|
||||
size="mini"
|
||||
type="primary"
|
||||
class="el-icon-edit"
|
||||
@click="Withdrawing(scope.$index, scope.row, 'form')">扣款</el-button>
|
||||
<el-button
|
||||
:disabled="scope.row.实际付款时间!==''"
|
||||
size="mini"
|
||||
type="success"
|
||||
class="el-icon-check"
|
||||
@click="payment(scope.$index, scope.row)">付款</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block">
|
||||
<el-pagination
|
||||
v-if="!loading"
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card v-if="false">
|
||||
<el-table v-loading="loading2" :data="tableData2" height="370" style="width: 100%;" border element-loading-text="拼命加载中">
|
||||
<el-table-column
|
||||
label=" "
|
||||
type="index"
|
||||
align="center"
|
||||
width="50"/>
|
||||
<el-table-column label="零件图号" align="center" width="230px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件名称" align="center" width="230px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="项目名称" align="center" width="220px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.项目名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="机床图号" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机床图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="组号" align="center" width="180px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.组号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block">
|
||||
<el-pagination
|
||||
v-if="!loading2"
|
||||
:current-page="pageCurrent2"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="pageSize2"
|
||||
:total="total2"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange2"
|
||||
@current-change="handleCurrentChange2"/>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-dialog :visible.sync="dialogFormVisible2" title="扣款" center style="min-height: 300px" width="800px">
|
||||
<el-form ref="form2" :model="form2" :rules="rules" label-position="left" label-width="110px" class="demo-ruleForm">
|
||||
<el-form-item label="质量" style="margin-left: 200px">
|
||||
<el-input v-model="form2.质量" placeholder="质量" size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划" style="margin-left: 200px">
|
||||
<el-input v-model="form2.计划" placeholder="计划" size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="其他" style="margin-left: 200px">
|
||||
<el-input v-model="form2.其他" placeholder="其他" size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="扣款说明" prop="扣款说明" style="margin-left: 200px">
|
||||
<el-input v-model="form2.扣款说明" placeholder="扣款说明" size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="callOff2('form2')">取消</el-button>
|
||||
<el-button type="primary" @click="submit2('form2')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { initOutHelp, searchtable, payTime, WithdrawingEdit, getParts } from '@/api/Outsourcing/OutsourcingPaymentPlanManagement'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
实际付款时间: '',
|
||||
loading: false,
|
||||
loading2: false,
|
||||
zhongjianbianliang: '',
|
||||
dialogFormVisible2: false,
|
||||
form2: {
|
||||
质量: '',
|
||||
计划: '',
|
||||
其他: '',
|
||||
扣款说明: ''
|
||||
},
|
||||
rules: {
|
||||
扣款说明: [{ required: true, message: '请输入扣款说明', trigger: 'blur' }]
|
||||
},
|
||||
date1: '',
|
||||
date2: '',
|
||||
date3: '',
|
||||
date4: '',
|
||||
FormNumber: '',
|
||||
ManufacturerNameValue: '',
|
||||
ManufacturerName: [], // 厂家名称
|
||||
FormNumber_check: false,
|
||||
ManufacturerNameValue_check: false,
|
||||
date1_check: false,
|
||||
date3_check: false,
|
||||
tableData: [], // 表格数据
|
||||
total: null, // 总条数
|
||||
pageSize: 10, // 每页显示条数
|
||||
pageCurrent: 1, // 后台获取页
|
||||
tableData2: [], // 表格数据
|
||||
total2: null, // 总条数
|
||||
pageSize2: 10, // 每页显示条数
|
||||
pageCurrent2: 1 // 后台获取页
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
// 初始化外协厂家
|
||||
fetchData() {
|
||||
this.ManufacturerName = []
|
||||
initOutHelp().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.ManufacturerName.push({
|
||||
label: response.data[i].外协厂家名称,
|
||||
value: response.data[i].外协厂家流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询表格数据
|
||||
searchTable() {
|
||||
this.loading = true
|
||||
if (this.FormNumber === '' || this.FormNumber === null) {
|
||||
this.FormNumber_check = false
|
||||
} else {
|
||||
this.FormNumber_check = true
|
||||
}
|
||||
if (this.ManufacturerNameValue === '' || this.ManufacturerNameValue === null) {
|
||||
this.ManufacturerNameValue_check = false
|
||||
} else {
|
||||
this.ManufacturerNameValue_check = true
|
||||
}
|
||||
if (this.date1 === '' || this.date1 === null) {
|
||||
this.date1_check = false
|
||||
} else {
|
||||
this.date1_check = true
|
||||
}
|
||||
if (this.date3 === '' || this.date3 === null) {
|
||||
this.date3_check = false
|
||||
} else {
|
||||
this.date3_check = true
|
||||
}
|
||||
this.tableData = []
|
||||
this.tableData2 = []
|
||||
searchtable(this.FormNumber_check, this.FormNumber, this.ManufacturerNameValue_check, this.ManufacturerNameValue, this.date1_check, this.date1, this.date2, this.date3_check, this.date3, this.date4, this.pageCurrent, this.pageSize).then(response => {
|
||||
for (let i = 0; i < response.data.rows.length; i++) {
|
||||
response.data.rows[i].任务下达日期 = response.data.rows[i].任务下达日期.substring(0, response.data.rows[i].任务下达日期.indexOf(' '))
|
||||
response.data.rows[i].实际付款时间 = response.data.rows[i].实际付款时间.substring(0, response.data.rows[i].实际付款时间.indexOf(' '))
|
||||
}
|
||||
this.tableData = response.data.rows
|
||||
this.total = response.data.total
|
||||
}).then(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 付款
|
||||
payment(index, row) {
|
||||
this.$confirm('请仔细核对信息,确定后不可更改, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'success'
|
||||
}).then(() => {
|
||||
var time = new Date()
|
||||
var month = time.getMonth() + 1
|
||||
var day = time.getDate()
|
||||
if (month >= 1 && month <= 9) {
|
||||
month = '0' + month
|
||||
}
|
||||
if (day >= 1 && day <= 9) {
|
||||
day = '0' + day
|
||||
}
|
||||
this.实际付款时间 = time.getFullYear() + '/' + month + '/' + day
|
||||
// payment(row.外协加工任务单流水号).then(response => {
|
||||
// }).then(() => {
|
||||
payTime(row.外协加工任务单流水号, this.实际付款时间).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('付款成功')
|
||||
this.searchTable()
|
||||
} else {
|
||||
this.$message.error('付款失败')
|
||||
}
|
||||
})
|
||||
// })
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消付款'
|
||||
})
|
||||
})
|
||||
},
|
||||
// 打开扣款编辑
|
||||
Withdrawing(index, row) {
|
||||
if (this.$refs['form2'] !== undefined) {
|
||||
this.$refs['form2'].resetFields()
|
||||
}
|
||||
this.form2.质量 = row.扣款_质量
|
||||
this.form2.计划 = row.扣款_计划
|
||||
this.form2.其他 = row.扣款_其他
|
||||
this.form2.扣款说明 = row.扣款说明
|
||||
this.liushuihao = row.外协加工任务单流水号
|
||||
this.dialogFormVisible2 = true
|
||||
},
|
||||
// 扣款编辑确定
|
||||
submit2(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
this.WithdrawingEdit()
|
||||
}
|
||||
})
|
||||
},
|
||||
// 扣款编辑
|
||||
WithdrawingEdit() {
|
||||
WithdrawingEdit(this.liushuihao, this.form2.质量, this.form2.计划, this.form2.其他, this.form2.扣款说明).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('修改成功')
|
||||
this.searchTable()
|
||||
} else {
|
||||
this.$message.error('修改失败')
|
||||
}
|
||||
this.dialogFormVisible2 = false
|
||||
})
|
||||
},
|
||||
// 关闭扣款编辑
|
||||
callOff2(formName) {
|
||||
this.dialogFormVisible2 = false
|
||||
this.$refs[formName].resetFields()
|
||||
},
|
||||
// 表格颜色
|
||||
tableRowClassName({ row }) {
|
||||
if (row.实际付款时间 !== '') {
|
||||
return 'fukuan'
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
},
|
||||
// 获取表格2数据
|
||||
getParts(row) {
|
||||
this.loading2 = true
|
||||
this.tableData2 = []
|
||||
this.zhongjianbianliang = row.外协加工任务单流水号
|
||||
getParts(row.外协加工任务单流水号, this.pageCurrent2, this.pageSize2).then(response => {
|
||||
this.tableData2 = response.data.rows
|
||||
this.total2 = response.data.total
|
||||
}).then(() => {
|
||||
this.loading2 = false
|
||||
})
|
||||
},
|
||||
// 分页
|
||||
handleSizeChange(val) {
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = val
|
||||
this.searchTable()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.searchTable()
|
||||
},
|
||||
handleSizeChange2(val) {
|
||||
this.pageCurrent2 = 1
|
||||
this.pageSize2 = val
|
||||
this.tableData2 = []
|
||||
getParts(this.zhongjianbianliang, this.pageCurrent2, this.pageSize2).then(response => {
|
||||
this.tableData2 = response.data.rows
|
||||
this.total2 = response.data.total
|
||||
})
|
||||
},
|
||||
handleCurrentChange2(val) {
|
||||
this.pageCurrent2 = val
|
||||
this.tableData2 = []
|
||||
getParts(this.zhongjianbianliang, this.pageCurrent2, this.pageSize2).then(response => {
|
||||
this.tableData2 = response.data.rows
|
||||
this.total2 = response.data.total
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-card{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.el-table .fukuan {
|
||||
background: #AEF199;
|
||||
}
|
||||
</style>
|
||||
351
src/views/Outsourcing/OutsourcingPriceBudget/index.vue
Normal file
351
src/views/Outsourcing/OutsourcingPriceBudget/index.vue
Normal file
@@ -0,0 +1,351 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<el-card>
|
||||
<el-row>
|
||||
<el-radio-group v-model="radio" style="margin: 10px;" @change="radioChange">
|
||||
<el-radio :label="1">未编制</el-radio>
|
||||
<el-radio :label="2">已编制</el-radio>
|
||||
</el-radio-group>
|
||||
|
||||
<span>零件图号:</span>
|
||||
<el-input v-model="partName" placeholder="零件名称" size="small" clearable style="width:200px"/>
|
||||
|
||||
<span>开始时间:</span>
|
||||
<el-date-picker
|
||||
v-model="date01"
|
||||
format="yyyy-MM-dd"
|
||||
value-format="yyyy-MM-dd"
|
||||
type="date"
|
||||
size="small"
|
||||
placeholder="选择开始日期"/>
|
||||
|
||||
<span>结束时间:</span>
|
||||
<el-date-picker
|
||||
v-model="date02"
|
||||
format="yyyy-MM-dd"
|
||||
value-format="yyyy-MM-dd"
|
||||
type="date"
|
||||
size="small"
|
||||
placeholder="选择结束日期"/>
|
||||
|
||||
<el-button size="small" icon="el-icon-search" type="success" style="margin-left: 10px" @click="pageSize2=10; pageCurrent2=1;searchPartNum()">查询</el-button>
|
||||
</el-row>
|
||||
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<el-table v-loading="loading2" :data="tableData2" height="370" style="width: 100%;" border element-loading-text="拼命加载中" @row-click="searchTable">
|
||||
<el-table-column
|
||||
label=" "
|
||||
type="index"
|
||||
align="center"
|
||||
width="50"/>
|
||||
<el-table-column label="零件图号" align="center" width="230px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件名称" align="center" width="230px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="材料" align="center" width="220px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.材料 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="种类" align="center" width="180px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件类型名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="投产数量" align="center" width="180px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.批次数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="规格" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.原材料规格 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="面积" width="110" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.面积 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="重量" width="110" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.重量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="材料费" width="110" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.材料费 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="150px" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
class="el-icon-edit"
|
||||
@click="edit(scope.$index, scope.row, 'form')">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block">
|
||||
<el-pagination
|
||||
v-if="!loading2"
|
||||
:current-page="pageCurrent2"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="pageSize2"
|
||||
:total="total2"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange2"
|
||||
@current-change="handleCurrentChange2"/>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<el-table v-loading="loading0" :data="tableData" :summary-method="getSummaries" border style="width: 100%;max-height: 390px;" height="340px" stripe show-summary>
|
||||
<el-table-column label="序号" width="80" align="center" type="index"/>
|
||||
<el-table-column label="工艺名称" width="200" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].工艺名称" size="mini" placeholder="工艺名称" readonly/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工艺要求" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].工艺要求" size="mini" readonly type="textarea"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单件" width="110" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].单件定额工时_系数" size="mini" readonly/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="准结" width="110" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].准结定额工时" size="mini" readonly/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="外协预算价格" width="110" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].外协预算价格_系数" size="mini" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-button size="small" type="primary" style="float:right;margin: 10px" @click="saveRowPrice">保存</el-button>
|
||||
</el-card>
|
||||
|
||||
<el-dialog :visible.sync="dialogFormVisible" title="编辑" center style="min-height: 300px" width="800px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="110px" class="demo-ruleForm">
|
||||
|
||||
<el-form-item label="面积" prop="面积" style="margin-left: 200px">
|
||||
<el-input v-model="form.面积" placeholder="面积" size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="重量" prop="重量" style="margin-left: 200px">
|
||||
<el-input v-model="form.重量" placeholder="重量" size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="材料费" prop="材料费" style="margin-left: 200px">
|
||||
<el-input v-model="form.材料费" placeholder="材料费" size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="callOff('form')">取消</el-button>
|
||||
<el-button type="primary" @click="submit('form')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { searchPartNum1, searchPartNum2, searchTable, saveWeightArea, saveMaterialPrice, saveRowPrice } from '@/api/Outsourcing/OutsourcingPriceBudget'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
lingjianhao: '',
|
||||
dialogFormVisible: false,
|
||||
form: {
|
||||
面积: '',
|
||||
重量: '',
|
||||
材料费: ''
|
||||
},
|
||||
rules: {
|
||||
},
|
||||
cailiaofei: '',
|
||||
result: [],
|
||||
result2: [],
|
||||
radio: 1,
|
||||
partName: '', // 零件名称
|
||||
date01: '', // 开始时间
|
||||
date02: '', // 结束时间
|
||||
loading0: false,
|
||||
tableData: [],
|
||||
loading2: false,
|
||||
tableData2: [], // 表格数据
|
||||
total2: null, // 总条数
|
||||
pageSize2: 10, // 每页显示条数
|
||||
pageCurrent2: 1 // 后台获取页
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
radioChange() {
|
||||
this.tableData2 = []
|
||||
},
|
||||
// 查零件号
|
||||
searchPartNum() {
|
||||
if (this.partName === null) {
|
||||
this.partName = ''
|
||||
}
|
||||
if (this.date01 === '') {
|
||||
this.date01 = null
|
||||
}
|
||||
if (this.date02 === '') {
|
||||
this.date02 = null
|
||||
}
|
||||
this.loading2 = true
|
||||
this.tableData2 = []
|
||||
this.tableData = []
|
||||
if (this.radio === 1) {
|
||||
searchPartNum1(this.partName, this.date01, this.date02, this.pageCurrent2, this.pageSize2).then(response => {
|
||||
this.tableData2 = response.data.rows
|
||||
this.total2 = response.data.total
|
||||
}).then(() => {
|
||||
this.loading2 = false
|
||||
})
|
||||
} else {
|
||||
searchPartNum2(this.partName, this.date01, this.date02, this.pageCurrent2, this.pageSize2).then(response => {
|
||||
this.tableData2 = response.data.rows
|
||||
this.total2 = response.data.total
|
||||
}).then(() => {
|
||||
this.loading2 = false
|
||||
})
|
||||
}
|
||||
},
|
||||
// 合计
|
||||
getSummaries(param) {
|
||||
const { columns, data } = param
|
||||
const sums = ['', '', '', '', '', 0]
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 1) {
|
||||
sums[1] = '统计总价:'
|
||||
return
|
||||
} else if (index === 5) {
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
sums[5] += parseFloat(data[i].外协预算价格_系数)
|
||||
}
|
||||
sums[5] = parseInt(sums[5] * 100) / 100
|
||||
}
|
||||
})
|
||||
return sums
|
||||
},
|
||||
searchTable(row) {
|
||||
this.loading0 = true
|
||||
this.tableData = []
|
||||
searchTable(row.工艺计划流水号, 2).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
if (response.data[i].外协预算价格_系数 !== 0) {
|
||||
response.data[i].外协预算价格_系数 = response.data[i].外协预算价格_系数.toFixed(2)
|
||||
}
|
||||
}
|
||||
this.cailiaofei = row.材料费
|
||||
this.tableData = response.data
|
||||
this.loading0 = false
|
||||
})
|
||||
},
|
||||
// 打开编辑
|
||||
edit(index, row) {
|
||||
if (this.$refs['form'] !== undefined) {
|
||||
this.$refs['form'].resetFields()
|
||||
}
|
||||
this.form.面积 = row.面积
|
||||
this.form.重量 = row.重量
|
||||
this.form.材料费 = row.材料费
|
||||
this.lingjianhao = row.工艺计划流水号
|
||||
this.dialogFormVisible = true
|
||||
},
|
||||
// 编辑确定
|
||||
submit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
this.WithdrawingEdit()
|
||||
this.dialogFormVisible = false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 编辑
|
||||
WithdrawingEdit() {
|
||||
if ((this.form.重量 === '' || this.form.重量 === null) && (this.form.面积 === '' || this.form.面积 === null)) {
|
||||
this.form.重量 = null
|
||||
this.form.面积 = null
|
||||
saveWeightArea(this.lingjianhao, this.form.重量, this.form.面积).then(() => {
|
||||
this.WithdrawingEdit2()
|
||||
})
|
||||
} else {
|
||||
saveWeightArea(this.lingjianhao, this.form.重量, this.form.面积).then(() => {
|
||||
this.WithdrawingEdit2()
|
||||
})
|
||||
}
|
||||
},
|
||||
WithdrawingEdit2() {
|
||||
if (this.form.材料费 === '' || this.form.材料费 === null) {
|
||||
this.form.材料费 = 0
|
||||
saveMaterialPrice(this.lingjianhao, this.form.材料费).then(response => {
|
||||
this.$message.success('保存成功')
|
||||
this.searchPartNum()
|
||||
})
|
||||
} else {
|
||||
saveMaterialPrice(this.lingjianhao, this.form.材料费).then(response => {
|
||||
this.$message.success('保存成功')
|
||||
this.searchPartNum()
|
||||
})
|
||||
}
|
||||
},
|
||||
// 关闭扣款编辑
|
||||
callOff(formName) {
|
||||
this.dialogFormVisible = false
|
||||
this.$refs[formName].resetFields()
|
||||
},
|
||||
// 保存行价格
|
||||
saveRowPrice() {
|
||||
if (this.tableData.length === 0) {
|
||||
this.$message.error('请选择零件')
|
||||
} else {
|
||||
for (let i = 0; i < this.tableData.length; i++) {
|
||||
saveRowPrice(this.tableData[i].工序流水号, parseFloat(this.tableData[i].外协预算价格_系数), this.tableData[i].工艺计划流水号, this.cailiaofei).then(response => {
|
||||
})
|
||||
}
|
||||
this.$message.success('保存成功')
|
||||
this.searchPartNum()
|
||||
}
|
||||
},
|
||||
handleSizeChange2(val) {
|
||||
this.pageCurrent2 = 1
|
||||
this.pageSize2 = val
|
||||
this.searchPartNum()
|
||||
},
|
||||
handleCurrentChange2(val) {
|
||||
this.pageCurrent2 = val
|
||||
this.searchPartNum()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
span{
|
||||
margin: 10px 0 10px 10px;
|
||||
}
|
||||
.el-date-editor{
|
||||
width:150px
|
||||
}
|
||||
.el-card{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
</style>
|
||||
127
src/views/Outsourcing/OutsourcingStatus/index.vue
Normal file
127
src/views/Outsourcing/OutsourcingStatus/index.vue
Normal file
@@ -0,0 +1,127 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<el-card>
|
||||
<span>零件号:</span>
|
||||
<el-input v-model="partNum" placeholder="零件号" size="small" clearable style="width:200px"/>
|
||||
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 10px;" @click="PageCurrent=1;PageSize=10;searchTable()">查询</el-button>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<el-table v-loading="loading0" :data="tableData" border style="width: 100%;" height="650" stripe>
|
||||
<el-table-column label="机床图号" width="180px" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机床图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="组号" width="100px" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.组号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件图号" width="250px" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件名称" width="100px" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" width="100px" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.批次数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!--<el-table-column label="已入库数量" width="100px" align="center">-->
|
||||
<!--<template slot-scope="scope">-->
|
||||
<!--{{ scope.row.入库数量 }}-->
|
||||
<!--</template>-->
|
||||
<!--</el-table-column>-->
|
||||
|
||||
<el-table-column label="零件状态" align="center" >
|
||||
<template slot-scope="scope">
|
||||
<el-steps :active="active[scope.$index]" finish-status="success" simple process-status="finish">
|
||||
<el-step title="未协"/>
|
||||
<el-step title="已协"/>
|
||||
<el-step title="交检"/>
|
||||
<el-step title="入库"/>
|
||||
</el-steps>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
v-if="!loading0"
|
||||
:current-page="PageCurrent"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="10"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { searchOutHelpState } from '@/api/Outsourcing/OutsourcingStatus'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading0: false,
|
||||
partNum: '', // 零件图号
|
||||
check: '',
|
||||
tableData: [],
|
||||
active: [],
|
||||
PageCurrent: 1,
|
||||
PageSize: 10,
|
||||
total: 0
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
searchTable() {
|
||||
this.loading0 = true
|
||||
this.total = 0
|
||||
this.tableData = []
|
||||
this.active = []
|
||||
if (this.partNum !== '') {
|
||||
this.check = 1
|
||||
} else { this.check = 0 }
|
||||
searchOutHelpState(this.PageCurrent, this.PageSize, this.check, this.partNum).then(response => {
|
||||
if (response.data.rows.length !== 0) {
|
||||
this.total = response.data.total
|
||||
this.tableData = response.data.rows
|
||||
for (let i = 0; i < response.data.rows.length; i++) {
|
||||
this.active.push(parseInt(response.data.rows[i].外协零件状态) + 1)
|
||||
}
|
||||
} else {
|
||||
this.loading0 = false
|
||||
}
|
||||
}).then(() => {
|
||||
this.loading0 = false
|
||||
})
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.PageCurrent = 1
|
||||
this.PageSize = val
|
||||
this.searchTable()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.PageCurrent = val
|
||||
this.searchTable()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-card{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
span{
|
||||
margin: 10px 0 10px 10px;
|
||||
}
|
||||
</style>
|
||||
1601
src/views/Outsourcing/OutsourcingTaskExecution/index.vue
Normal file
1601
src/views/Outsourcing/OutsourcingTaskExecution/index.vue
Normal file
File diff suppressed because it is too large
Load Diff
280
src/views/Outsourcing/PreorderAssociation/index.vue
Normal file
280
src/views/Outsourcing/PreorderAssociation/index.vue
Normal file
@@ -0,0 +1,280 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card>
|
||||
<el-row>
|
||||
<span>零件图号:</span>
|
||||
<el-input v-model="partName" placeholder="零件图号" size="small" clearable style="width:200px"/>
|
||||
<el-button size="small" icon="el-icon-search" type="success" style="margin-left: 10px" @click="pageSize1=10; pageCurrent1=1;searchTable()">查询</el-button>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<el-table v-loading="loading1" :data="tableData1" highlight-current-row height="350" style="width: 100%;" border element-loading-text="拼命加载中" @row-click="searchTable2">
|
||||
<el-table-column
|
||||
label=" "
|
||||
type="index"
|
||||
align="center"
|
||||
width="50"/>
|
||||
<el-table-column label="零件图号" align="center" width="380px">
|
||||
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件图号 }}
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column label="零件名称" align="center" width="320px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="材料" align="center" width="280px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.材料 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="种类" align="center" width="280px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件类型名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="投产数量" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.批次数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block">
|
||||
<el-pagination
|
||||
v-if="!loading1"
|
||||
:current-page="pageCurrent1"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="pageSize1"
|
||||
:total="total1"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange1"
|
||||
@current-change="handleCurrentChange1"/>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<el-table v-loading="loading2" :data="tableData2" :row-class-name="tableRowClassName" height="350" style="width: 100%;" border element-loading-text="拼命加载中">
|
||||
<el-table-column
|
||||
label=" "
|
||||
type="index"
|
||||
align="center"
|
||||
width="50"/>
|
||||
|
||||
<el-table-column label="序间外协" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox v-model="checkBox[scope.$index]" @change="edit(scope.$index, scope.row)">选择</el-checkbox>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="工艺名称" align="center" width="220px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工艺名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工艺要求" align="center" width="580px">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.工艺要求" :autosize="{ minRows: 1, maxRows: 1}" size="mini" readonly type="textarea"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="机加工开始日期" align="center" width="150px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机加工开始时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="机加工结束日期" align="center" width="150px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机加工结束时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工序计划" align="center" width="150px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计划日期 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工序工时" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工序工时 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { searchTable, searchTable2, edit, edit2 } from '@/api/Outsourcing/PreorderAssociation'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
count: 0, // 计数器 (表二是否有外协工序)
|
||||
InOut: 1, // 工序间是否外协变量 1自家 2外协
|
||||
num1: '',
|
||||
checkBox: [],
|
||||
loading1: false,
|
||||
loading2: false,
|
||||
check_partName: false,
|
||||
partName: '', // 零件名称
|
||||
tableData1: [], // 表格数据
|
||||
tableData2: [],
|
||||
total1: null, // 总条数
|
||||
pageSize1: 10, // 每页显示条数
|
||||
pageCurrent1: 1
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
searchTable() {
|
||||
this.loading1 = true
|
||||
this.tableData1 = []
|
||||
this.tableData2 = []
|
||||
if (this.partName !== null && this.partName !== '') {
|
||||
this.check_partName = true
|
||||
} else {
|
||||
this.check_partName = false
|
||||
}
|
||||
searchTable(this.check_partName, this.partName, this.pageCurrent1, this.pageSize1).then(response => {
|
||||
this.tableData1 = response.data.rows
|
||||
this.total1 = response.data.total
|
||||
}).then(() => {
|
||||
this.loading1 = false
|
||||
})
|
||||
},
|
||||
searchTable2(row) {
|
||||
this.loading2 = true
|
||||
this.checkBox = []
|
||||
this.tableData2 = []
|
||||
searchTable2(row.工艺计划流水号).then(response => {
|
||||
this.num1 = row.工艺计划流水号
|
||||
if (response.data.length === 0) {
|
||||
this.loading0 = false
|
||||
} else {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
if (response.data[i].工序间是否外协 === 1) {
|
||||
this.checkBox.push(false)
|
||||
} else {
|
||||
this.checkBox.push(true)
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
response.data[i].机加工开始时间 = response.data[i].机加工开始时间.split(' ')[0]
|
||||
response.data[i].机加工结束时间 = response.data[i].机加工结束时间.split(' ')[0]
|
||||
response.data[i].计划日期 = response.data[i].计划日期.split(' ')[0]
|
||||
}
|
||||
this.tableData2 = response.data
|
||||
}
|
||||
}).then(() => {
|
||||
this.loading2 = false
|
||||
})
|
||||
},
|
||||
// 修改外协状态
|
||||
edit(index, row) {
|
||||
for (let i = 0; i < this.tableData2.length; i++) {
|
||||
if (this.checkBox[i] === false) {
|
||||
this.count = this.count + 1
|
||||
}
|
||||
}
|
||||
if (this.count === this.tableData2.length) {
|
||||
edit2(row.工序流水号, row.工艺计划流水号, 0).then(response => {
|
||||
})
|
||||
}
|
||||
if (this.checkBox[index] === true) {
|
||||
this.InOut = 2
|
||||
edit(row.工序流水号, this.InOut).then(response => {
|
||||
edit2(row.工序流水号, row.工艺计划流水号, 1).then(response => {
|
||||
this.$message.success('工序外协状态更改成功')
|
||||
})
|
||||
}).then(() => {
|
||||
this.loading2 = true
|
||||
this.checkBox = []
|
||||
this.tableData2 = []
|
||||
searchTable2(this.num1).then(response => {
|
||||
if (response.data.length === 0) {
|
||||
this.loading0 = false
|
||||
} else {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
if (response.data[i].工序间是否外协 === 1) {
|
||||
this.checkBox.push(false)
|
||||
} else {
|
||||
this.checkBox.push(true)
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
response.data[i].机加工开始时间 = response.data[i].机加工开始时间.split(' ')[0]
|
||||
response.data[i].机加工结束时间 = response.data[i].机加工结束时间.split(' ')[0]
|
||||
response.data[i].计划日期 = response.data[i].计划日期.split(' ')[0]
|
||||
}
|
||||
this.tableData2 = response.data
|
||||
}
|
||||
}).then(() => {
|
||||
this.loading2 = false
|
||||
})
|
||||
})
|
||||
} else {
|
||||
this.InOut = 1
|
||||
edit(row.工序流水号, this.InOut).then(response => {
|
||||
this.$message.success('工序外协状态更改成功')
|
||||
}).then(() => {
|
||||
this.loading2 = true
|
||||
this.checkBox = []
|
||||
this.tableData2 = []
|
||||
searchTable2(this.num1).then(response => {
|
||||
if (response.data.length === 0) {
|
||||
this.loading0 = false
|
||||
} else {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
if (response.data[i].工序间是否外协 === 1) {
|
||||
this.checkBox.push(false)
|
||||
} else {
|
||||
this.checkBox.push(true)
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
response.data[i].机加工开始时间 = response.data[i].机加工开始时间.split(' ')[0]
|
||||
response.data[i].机加工结束时间 = response.data[i].机加工结束时间.split(' ')[0]
|
||||
response.data[i].计划日期 = response.data[i].计划日期.split(' ')[0]
|
||||
}
|
||||
this.tableData2 = response.data
|
||||
}
|
||||
}).then(() => {
|
||||
this.loading2 = false
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
handleSizeChange1(val) {
|
||||
this.pageCurrent1 = 1
|
||||
this.pageSize1 = val
|
||||
this.searchTable()
|
||||
},
|
||||
handleCurrentChange1(val) {
|
||||
this.pageCurrent1 = val
|
||||
this.searchTable()
|
||||
},
|
||||
// 表格颜色
|
||||
tableRowClassName({ row }) {
|
||||
if (row.工序间是否外协 === 2) {
|
||||
return 'waixie'
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
span{
|
||||
margin: 10px 0 10px 10px;
|
||||
}
|
||||
.el-card{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.el-table .waixie {
|
||||
background: #AEF199;
|
||||
}
|
||||
</style>
|
||||
297
src/views/Outsourcing/UnqualifiedTreatment/index.vue
Normal file
297
src/views/Outsourcing/UnqualifiedTreatment/index.vue
Normal file
@@ -0,0 +1,297 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<el-card>
|
||||
<span>零件号:</span>
|
||||
<el-input v-model="partNum" placeholder="零件号" size="small" clearable style="width:200px"/>
|
||||
|
||||
<span>任务下达时间:</span>
|
||||
<el-date-picker
|
||||
v-model="timeSlot"
|
||||
size="small"
|
||||
clearable
|
||||
style="width:200px"
|
||||
type="month"
|
||||
value-format="yyyy-MM"
|
||||
placeholder="任务下达时间"/>
|
||||
|
||||
<span>合同号:</span>
|
||||
<el-input v-model="contractNum" placeholder="合同号" size="small" clearable style="width:200px"/>
|
||||
<span>外协厂家:</span>
|
||||
<el-select v-model="outHelpValue" size="small" filterable remote clearable placeholder="外协厂家">
|
||||
<el-option
|
||||
v-for="item in outHelp"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
|
||||
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 10px;" @click="PageCurrent=1;PageSize=10;searchTable()">查询</el-button>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
|
||||
<el-table v-loading="loading0" :data="tableData" border style="width: 100%;" height="650" stripe>
|
||||
|
||||
<el-table-column
|
||||
label="序号"
|
||||
type="index"
|
||||
align="center"
|
||||
width="50"/>
|
||||
<el-table-column label="零件号" width="250" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件名称" width="140" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="外协厂家" width="150" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.外协厂家简称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合同号" width="200" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.表单号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="材料" width="140" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.材料 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="项目名称" width="200" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.项目名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="批次数量" width="140" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.批次数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="废品数量" width="140" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.废品数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="不合格处理方式" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.不合格处理方式 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="130px" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
class="el-icon-edit"
|
||||
@click="handleEdit(scope.$index, scope.row, 'form')">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
v-if="!loading0"
|
||||
:current-page="PageCurrent"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="PageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-dialog :visible.sync="dialogFormVisible1" title="外协价格计算系数维护" center width="20%">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="left" class="demo-ruleForm" label-width="100px" style="width: 90%;margin: auto">
|
||||
|
||||
<el-form-item label="废品数量" prop="wasteQuantity">
|
||||
<el-input v-model="form.wasteQuantity" size="small" clearable placeholder="请输入废品数量"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="处理方式" prop="processingMethod">
|
||||
<el-input v-model="form.processingMethod" size="small" clearable placeholder="请输入处理方式"/>
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="14"/>
|
||||
<el-form-item >
|
||||
<el-button size="small" @click="callOff('form')">取消</el-button>
|
||||
<el-button size="small" type="primary" @click="submit('form')">确 定</el-button>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
|
||||
</el-dialog>
|
||||
|
||||
<dialog :visible="true"/>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { initOutHelp, searchTable, editList } from '@/api/Outsourcing/UnqualifiedTreatment'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
count2: 0,
|
||||
form: {
|
||||
wasteQuantity: '', // 废品数量
|
||||
processingMethod: '' // 处理方式
|
||||
},
|
||||
dialogFormVisible1: false,
|
||||
timeSlot: '',
|
||||
years: '',
|
||||
months: '',
|
||||
loading0: false,
|
||||
contractNum: '',
|
||||
outHelpValue: '',
|
||||
outHelp: [],
|
||||
partNum: '',
|
||||
tableData: [],
|
||||
PageCurrent: 1,
|
||||
PageSize: 10,
|
||||
total: null,
|
||||
rules: { // 表单验证规则
|
||||
wasteQuantity: [{ required: true, message: '请输入废品数量', trigger: 'blur' }],
|
||||
processingMethod: [{ required: true, message: '请输入处理方式', trigger: 'blur' }]
|
||||
},
|
||||
number: ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
fetchData() {
|
||||
this.outHelp = []
|
||||
initOutHelp().then(response => { // 初始化外协厂家;*这里模糊查询省一个存储过程
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.outHelp.push({
|
||||
label: response.data[i].外协厂家名称,
|
||||
value: response.data[i].外协厂家流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
searchTable() {
|
||||
this.loading0 = true
|
||||
this.tableData = []
|
||||
if (this.contractNum === '' || this.contractNum === null) {
|
||||
this.check1 = 0
|
||||
} else { this.check1 = 1 }
|
||||
if (this.outHelpValue === '' || this.outHelpValue === null) {
|
||||
this.check2 = 0
|
||||
} else { this.check2 = 1 }
|
||||
if (this.partNum === '' || this.partNum === null) {
|
||||
this.check3 = 0
|
||||
} else { this.check3 = 1 }
|
||||
if (this.timeSlot === '' || this.timeSlot === null) {
|
||||
this.check4 = 0
|
||||
this.check5 = 0
|
||||
} else {
|
||||
this.check4 = 1
|
||||
this.check5 = 1
|
||||
this.years = this.timeSlot.substring(0, this.timeSlot.indexOf('-'))
|
||||
this.months = this.timeSlot.substring(5, 7)
|
||||
}
|
||||
searchTable(this.PageCurrent, this.PageSize, this.check2, this.outHelpValue, this.check1, this.contractNum, this.check3, this.partNum, this.check4, this.years, this.check5, this.months).then(response => {
|
||||
if (response.data.rows === 0) {
|
||||
this.loading0 = false
|
||||
this.total = response.data.total
|
||||
} else {
|
||||
this.tableData = response.data.rows
|
||||
this.total = response.data.total
|
||||
this.loading0 = false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 打开编辑
|
||||
handleEdit(index, row, formName) {
|
||||
this.count2 = this.count2 + 1
|
||||
if (this.count2 !== 1) {
|
||||
this.$refs[formName].resetFields()
|
||||
}
|
||||
this.number = row.外协加工任务单明细流水号
|
||||
this.form.wasteQuantity = row.废品数量
|
||||
this.form.processingMethod = row.不合格处理方式
|
||||
this.dialogFormVisible1 = true
|
||||
},
|
||||
// 提交编辑
|
||||
submitEdit() {
|
||||
editList(this.number, this.form.wasteQuantity, this.form.processingMethod).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.dialogFormVisible1 = false
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '信息更新成功!'
|
||||
})
|
||||
this.searchTable()
|
||||
} else {
|
||||
this.dialogFormVisible1 = false
|
||||
this.$message.error('信息更新失败')
|
||||
}
|
||||
})
|
||||
},
|
||||
// 提交添加或者修改
|
||||
submit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
this.submitEdit()
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 重置表单
|
||||
callOff(formName) {
|
||||
this.dialogFormVisible1 = false
|
||||
this.$refs[formName].resetFields()
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.PageCurrent = 1
|
||||
this.PageSize = val
|
||||
this.searchTable()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.PageCurrent = val
|
||||
this.searchTable()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.doing-row4{
|
||||
background: #f0f9eb;
|
||||
}
|
||||
.el-card{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.el-date-editor{
|
||||
width:130px
|
||||
}
|
||||
span{
|
||||
margin: 10px 0 10px 10px;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.mark{
|
||||
position:fixed;
|
||||
left:0;
|
||||
top:0;
|
||||
opacity:.5;
|
||||
width:100%;
|
||||
height:100%;
|
||||
background:#000;
|
||||
z-index:998;
|
||||
}
|
||||
.content{
|
||||
position:absolute;
|
||||
z-index:999;
|
||||
}
|
||||
</style>
|
||||
405
src/views/ProjectManagement/assess.vue
Normal file
405
src/views/ProjectManagement/assess.vue
Normal file
@@ -0,0 +1,405 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="table">
|
||||
<div class="name">
|
||||
<span>项目名称</span>
|
||||
<el-select v-model="projectValue" placeholder="请选择项目名称" filterable>
|
||||
<el-option
|
||||
v-for="item in project"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<el-button v-if="isEdit" type="primary" class="el-icon-edit" style="margin-left: 20px;">修改</el-button>
|
||||
<el-button v-else type="primary" class="el-icon-circle-check-outline" style="margin-left: 20px;">保存</el-button>
|
||||
<table class="tg">
|
||||
<colgroup>
|
||||
<col style="width: 50px">
|
||||
<col style="width: 100px">
|
||||
<col style="width: 100px">
|
||||
<col style="width: 180px">
|
||||
<col style="width: 100px">
|
||||
<col style="width: 100px">
|
||||
<col style="width: 500px">
|
||||
<col style="width: 100px">
|
||||
<col style="width: 150px">
|
||||
<col style="width: 200px">
|
||||
<col style="width: 200px">
|
||||
</colgroup>
|
||||
<tr>
|
||||
<th>序号</th>
|
||||
<th>部门</th>
|
||||
<th>部门分配比例</th>
|
||||
<th>阶段</th>
|
||||
<th>阶段分配比例</th>
|
||||
<th>阶段应发</th>
|
||||
<th>考核条件</th>
|
||||
<th>考核系数</th>
|
||||
<th >考核部门</th>
|
||||
<th >实际完成情况</th>
|
||||
<th >应得系数</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="8">1 </td>
|
||||
<td rowspan="8">电气</td>
|
||||
<td rowspan="8">20%</td>
|
||||
<td rowspan="2">设计完成</td>
|
||||
<td rowspan="2">20%</td>
|
||||
<td rowspan="2"></td>
|
||||
<td>a)按时完成率;(1-拖期时间/计划时间)</td>
|
||||
<td>0.8</td>
|
||||
<td>销售/采购</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>b)客户满意度;(满意1、不满意0~0.5)</td>
|
||||
<td>0.2</td>
|
||||
<td>销售</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="3">装配完成(发货)</td>
|
||||
<td rowspan="3">20%</td>
|
||||
<td rowspan="3"></td>
|
||||
<td>a)按时完成率;(1-拖期时间/计划时间)</td>
|
||||
<td>0.5</td>
|
||||
<td>生产部</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>b)差错率;(基本无差错1、机构小改动0.8、大的机构变更0.5)</td>
|
||||
<td>0.3</td>
|
||||
<td>生产部</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>c)设计合理性;(设计合理1、设计不合理0.5)</td>
|
||||
<td>0.2</td>
|
||||
<td>设计部</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="2">客户调试</td>
|
||||
<td rowspan="2">40%</td>
|
||||
<td rowspan="2"></td>
|
||||
<td>a)按时完成率;(1-拖期时间/计划时间)</td>
|
||||
<td>0.2</td>
|
||||
<td>销售</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>b)客户满意度;(满意1、不满意0~0.5)</td>
|
||||
<td>0.8</td>
|
||||
<td>销售</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>终验收</td>
|
||||
<td>20%</td>
|
||||
<td></td>
|
||||
<td>a)终验收通过</td>
|
||||
<td>1</td>
|
||||
<td>销售</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="8">1 </td>
|
||||
<td rowspan="8">机械</td>
|
||||
<td rowspan="8">20%</td>
|
||||
<td rowspan="2">设计完成</td>
|
||||
<td rowspan="2">20%</td>
|
||||
<td rowspan="2"></td>
|
||||
<td>a)按时完成率;(1-拖期时间/计划时间)</td>
|
||||
<td>0.8</td>
|
||||
<td>销售/采购</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>b)客户满意度;(满意1、不满意0~0.5)</td>
|
||||
<td>0.2</td>
|
||||
<td>销售</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="3">装配完成(发货)</td>
|
||||
<td rowspan="3">20%</td>
|
||||
<td rowspan="3"></td>
|
||||
<td>a)按时完成率;(1-拖期时间/计划时间)</td>
|
||||
<td>0.5</td>
|
||||
<td>生产部</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>b)差错率;(基本无差错1、机构小改动0.8、大的机构变更0.5)</td>
|
||||
<td>0.3</td>
|
||||
<td>生产部</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>c)设计合理性;(设计合理1、设计不合理0.5)</td>
|
||||
<td>0.2</td>
|
||||
<td>设计部</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="2">客户调试</td>
|
||||
<td rowspan="2">40%</td>
|
||||
<td rowspan="2"></td>
|
||||
<td>a)按时完成率;(1-拖期时间/计划时间)</td>
|
||||
<td>0.2</td>
|
||||
<td>销售</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>b)客户满意度;(满意1、不满意0~0.5)</td>
|
||||
<td>0.8</td>
|
||||
<td>销售</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>终验收</td>
|
||||
<td>20%</td>
|
||||
<td></td>
|
||||
<td>a)终验收通过</td>
|
||||
<td>1</td>
|
||||
<td>销售</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="8">1 </td>
|
||||
<td rowspan="8">生产</td>
|
||||
<td rowspan="8">20%</td>
|
||||
<td rowspan="2">设计完成</td>
|
||||
<td rowspan="2">20%</td>
|
||||
<td rowspan="2"></td>
|
||||
<td>a)按时完成率;(1-拖期时间/计划时间)</td>
|
||||
<td>0.8</td>
|
||||
<td>销售/采购</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>b)客户满意度;(满意1、不满意0~0.5)</td>
|
||||
<td>0.2</td>
|
||||
<td>销售</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="3">装配完成(发货)</td>
|
||||
<td rowspan="3">20%</td>
|
||||
<td rowspan="3"></td>
|
||||
<td>a)按时完成率;(1-拖期时间/计划时间)</td>
|
||||
<td>0.5</td>
|
||||
<td>生产部</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>b)差错率;(基本无差错1、机构小改动0.8、大的机构变更0.5)</td>
|
||||
<td>0.3</td>
|
||||
<td>生产部</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>c)设计合理性;(设计合理1、设计不合理0.5)</td>
|
||||
<td>0.2</td>
|
||||
<td>设计部</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="2">客户调试</td>
|
||||
<td rowspan="2">40%</td>
|
||||
<td rowspan="2"></td>
|
||||
<td>a)按时完成率;(1-拖期时间/计划时间)</td>
|
||||
<td>0.2</td>
|
||||
<td>销售</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>b)客户满意度;(满意1、不满意0~0.5)</td>
|
||||
<td>0.8</td>
|
||||
<td>销售</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>终验收</td>
|
||||
<td>20%</td>
|
||||
<td></td>
|
||||
<td>a)终验收通过</td>
|
||||
<td>1</td>
|
||||
<td>销售</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="8">1 </td>
|
||||
<td rowspan="8">采购与外协</td>
|
||||
<td rowspan="8">10%</td>
|
||||
<td rowspan="2">设计完成</td>
|
||||
<td rowspan="2">20%</td>
|
||||
<td rowspan="2"></td>
|
||||
<td>a)按时完成率;(1-拖期时间/计划时间)</td>
|
||||
<td>0.8</td>
|
||||
<td>销售/采购</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>b)客户满意度;(满意1、不满意0~0.5)</td>
|
||||
<td>0.2</td>
|
||||
<td>销售</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="3">装配完成(发货)</td>
|
||||
<td rowspan="3">20%</td>
|
||||
<td rowspan="3"></td>
|
||||
<td>a)按时完成率;(1-拖期时间/计划时间)</td>
|
||||
<td>0.5</td>
|
||||
<td>生产部</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>b)差错率;(基本无差错1、机构小改动0.8、大的机构变更0.5)</td>
|
||||
<td>0.3</td>
|
||||
<td>生产部</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>c)设计合理性;(设计合理1、设计不合理0.5)</td>
|
||||
<td>0.2</td>
|
||||
<td>设计部</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="2">客户调试</td>
|
||||
<td rowspan="2">40%</td>
|
||||
<td rowspan="2"></td>
|
||||
<td>a)按时完成率;(1-拖期时间/计划时间)</td>
|
||||
<td>0.2</td>
|
||||
<td>销售</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>b)客户满意度;(满意1、不满意0~0.5)</td>
|
||||
<td>0.8</td>
|
||||
<td>销售</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>终验收</td>
|
||||
<td>20%</td>
|
||||
<td></td>
|
||||
<td>a)终验收通过</td>
|
||||
<td>1</td>
|
||||
<td>销售</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { projectSelect } from '../../api/ProjectManagement/summarize'
|
||||
export default {
|
||||
name: 'Summarize',
|
||||
data() {
|
||||
return {
|
||||
projectValue: '',
|
||||
project: [],
|
||||
isEdit: true
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
project(val) {
|
||||
if (val.length > 0) {
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
fetchData() {
|
||||
this.getSelect(projectSelect, ['项目名称', '项目流水号'], 'project')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.tg{
|
||||
border-collapse:collapse;
|
||||
border-spacing:0;
|
||||
}
|
||||
.tg td{
|
||||
font-size:16px;
|
||||
padding:12px 10px;
|
||||
border-style:solid;
|
||||
border-width:1px;
|
||||
overflow:hidden;
|
||||
word-break:normal;
|
||||
color: #606266;
|
||||
border-color:#ebeef5;
|
||||
}
|
||||
.tg th{
|
||||
font-size:14px;
|
||||
font-weight:bolder;
|
||||
padding:10px 5px;
|
||||
border-style:solid;
|
||||
border-width:1px;
|
||||
overflow:hidden;
|
||||
word-break:normal;
|
||||
color: #909399;
|
||||
border-color:#ebeef5;
|
||||
}
|
||||
.tg .title{
|
||||
font-weight: 500;
|
||||
font-size: 24px;
|
||||
color: #909399;
|
||||
}
|
||||
.table table{
|
||||
margin: 20px auto;
|
||||
}
|
||||
.main {
|
||||
font-size: 30px;
|
||||
font-weight: bolder;
|
||||
}
|
||||
.name {
|
||||
margin: 10px auto;
|
||||
}
|
||||
span {
|
||||
font-size: 22px;
|
||||
margin: 20px;
|
||||
}
|
||||
</style>
|
||||
249
src/views/ProjectManagement/change.vue
Normal file
249
src/views/ProjectManagement/change.vue
Normal file
@@ -0,0 +1,249 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="table">
|
||||
<div class="name">
|
||||
<span>项目名称</span>
|
||||
<el-select v-model="projectValue" placeholder="请选择项目名称" filterable>
|
||||
<el-option
|
||||
v-for="item in project"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<el-button v-if="isEdit" type="primary" class="el-icon-edit" style="margin-left: 20px;">修改</el-button>
|
||||
<el-button v-else type="primary" class="el-icon-circle-check-outline" style="margin-left: 20px;">保存</el-button>
|
||||
<table class="tg">
|
||||
<colgroup>
|
||||
<col style="width: 93px">
|
||||
<col style="width: 83px">
|
||||
<col style="width: 64px">
|
||||
<col style="width: 64px">
|
||||
<col style="width: 63px">
|
||||
<col style="width: 63px">
|
||||
<col style="width: 92px">
|
||||
<col style="width: 64px">
|
||||
<col style="width: 76px">
|
||||
<col style="width: 105px">
|
||||
<col style="width: 102px">
|
||||
<col style="width: 134px">
|
||||
</colgroup>
|
||||
<tr>
|
||||
<th class="tg-s268" colspan="12">一、项目基本情况</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tg-s268" colspan="2">项目名称</td>
|
||||
<td class="tg-s268" colspan="3"></td>
|
||||
<td class="tg-s268" colspan="3">项目编号</td>
|
||||
<td class="tg-0lax" colspan="4"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tg-s268" colspan="2">制作人</td>
|
||||
<td class="tg-s268" colspan="3"></td>
|
||||
<td class="tg-s268" colspan="3">审核人</td>
|
||||
<td class="tg-0lax" colspan="4"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tg-s268" colspan="2">项目经理</td>
|
||||
<td class="tg-s268" colspan="3"></td>
|
||||
<td class="tg-s268" colspan="3">制作日期</td>
|
||||
<td class="tg-0lax" colspan="4"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tg-s268" colspan="12">二、历史变更记录(按时间顺序记录项目每一次变更情况)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tg-s268">序号</td>
|
||||
<td class="tg-s268">变更时间</td>
|
||||
<td class="tg-s268" colspan="2">涉及项目任务</td>
|
||||
<td class="tg-s268" colspan="3">变更要点</td>
|
||||
<td class="tg-0lax" colspan="3">变更理由</td>
|
||||
<td class="tg-0lax">申请人</td>
|
||||
<td class="tg-0lax">部门负责人</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tg-s268"></td>
|
||||
<td class="tg-s268"></td>
|
||||
<td class="tg-s268" colspan="2"></td>
|
||||
<td class="tg-s268" colspan="3"></td>
|
||||
<td class="tg-0lax" colspan="3"></td>
|
||||
<td class="tg-0lax"></td>
|
||||
<td class="tg-0lax"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tg-s268"></td>
|
||||
<td class="tg-s268"></td>
|
||||
<td class="tg-s268" colspan="2"></td>
|
||||
<td class="tg-s268" colspan="3"></td>
|
||||
<td class="tg-0lax" colspan="3"></td>
|
||||
<td class="tg-0lax"></td>
|
||||
<td class="tg-0lax"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tg-s268"></td>
|
||||
<td class="tg-s268"></td>
|
||||
<td class="tg-s268" colspan="2"></td>
|
||||
<td class="tg-s268" colspan="3"></td>
|
||||
<td class="tg-0lax" colspan="3"></td>
|
||||
<td class="tg-0lax"></td>
|
||||
<td class="tg-0lax"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tg-s268"></td>
|
||||
<td class="tg-s268"></td>
|
||||
<td class="tg-s268" colspan="2"></td>
|
||||
<td class="tg-s268" colspan="3"></td>
|
||||
<td class="tg-0lax" colspan="3"></td>
|
||||
<td class="tg-0lax"></td>
|
||||
<td class="tg-0lax"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tg-s268" colspan="12">三、请求变更信息</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tg-s268" colspan="12">1、申请变更的内容</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tg-0lax" colspan="12"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tg-0lax" colspan="12">2、申请变更的原因</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tg-0lax" colspan="12"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tg-0lax" colspan="12">四、影响分析</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tg-0lax" colspan="3">受影响的基准计划</td>
|
||||
<td class="tg-0lax" colspan="2">1、进度计划</td>
|
||||
<td class="tg-0lax" colspan="4">2、费用计划</td>
|
||||
<td class="tg-0lax" colspan="3">3、资源计划</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tg-0lax" colspan="5">是否需要成本/进度影响分析?</td>
|
||||
<td class="tg-0lax" colspan="4">是</td>
|
||||
<td class="tg-0lax" colspan="3">否</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tg-0lax" colspan="3">对成本影响</td>
|
||||
<td class="tg-0lax" colspan="9"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tg-0lax" colspan="3">对进度影响</td>
|
||||
<td class="tg-0lax" colspan="9"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tg-0lax" colspan="3">对资源的影响</td>
|
||||
<td class="tg-0lax" colspan="9"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tg-0lax" colspan="3">变更程度分类</td>
|
||||
<td class="tg-0lax" colspan="2">高</td>
|
||||
<td class="tg-0lax" colspan="4">中</td>
|
||||
<td class="tg-0lax" colspan="3">低</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tg-0lax" colspan="3">若不进行变更有何影响</td>
|
||||
<td class="tg-0lax" colspan="9"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tg-0lax">申请人签字</td>
|
||||
<td class="tg-0lax" colspan="2"></td>
|
||||
<td class="tg-0lax" colspan="2">申请日期</td>
|
||||
<td class="tg-0lax" colspan="2">项目经理签字</td>
|
||||
<td class="tg-0lax" colspan="2"></td>
|
||||
<td class="tg-0lax">日期</td>
|
||||
<td class="tg-0lax" colspan="2"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tg-0lax" colspan="12">五、审批结果</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tg-0lax">审批意见</td>
|
||||
<td class="tg-0lax" colspan="5"></td>
|
||||
<td class="tg-0lax">审批人签字</td>
|
||||
<td class="tg-0lax" colspan="2"></td>
|
||||
<td class="tg-0lax">日期</td>
|
||||
<td class="tg-0lax" colspan="2"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { projectSelect } from '../../api/ProjectManagement/summarize'
|
||||
export default {
|
||||
name: 'Summarize',
|
||||
data() {
|
||||
return {
|
||||
projectValue: '',
|
||||
project: [],
|
||||
isEdit: true
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
project(val) {
|
||||
if (val.length > 0) {
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
fetchData() {
|
||||
this.getSelect(projectSelect, ['项目名称', '项目流水号'], 'project')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.tg{
|
||||
border-collapse:collapse;
|
||||
border-spacing:0;
|
||||
}
|
||||
.tg td{
|
||||
font-size:16px;
|
||||
padding:12px 10px;
|
||||
border-style:solid;
|
||||
border-width:1px;
|
||||
overflow:hidden;
|
||||
word-break:normal;
|
||||
color: #606266;
|
||||
border-color:#ebeef5;
|
||||
}
|
||||
.tg th{
|
||||
font-size:14px;
|
||||
font-weight:bolder;
|
||||
padding:10px 5px;
|
||||
border-style:solid;
|
||||
border-width:1px;
|
||||
overflow:hidden;
|
||||
word-break:normal;
|
||||
color: #909399;
|
||||
border-color:#ebeef5;
|
||||
}
|
||||
.tg .title{
|
||||
font-weight: 500;
|
||||
font-size: 24px;
|
||||
color: #909399;
|
||||
}
|
||||
.table table{
|
||||
margin: 20px auto;
|
||||
}
|
||||
.main {
|
||||
font-size: 30px;
|
||||
font-weight: bolder;
|
||||
}
|
||||
.name {
|
||||
margin: 10px auto;
|
||||
}
|
||||
span {
|
||||
font-size: 22px;
|
||||
margin: 20px;
|
||||
}
|
||||
</style>
|
||||
193
src/views/ProjectManagement/progress.vue
Normal file
193
src/views/ProjectManagement/progress.vue
Normal file
@@ -0,0 +1,193 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="table">
|
||||
<div class="name">
|
||||
<span>项目名称</span>
|
||||
<el-select v-model="projectValue" placeholder="请选择项目名称" filterable>
|
||||
<el-option
|
||||
v-for="item in project"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<el-button v-if="isEdit" type="primary" class="el-icon-edit" style="margin-left: 20px;">修改</el-button>
|
||||
<el-button v-else type="primary" class="el-icon-circle-check-outline" style="margin-left: 20px;">保存</el-button>
|
||||
<table class="tg">
|
||||
<colgroup>
|
||||
<col style="width: 150px">
|
||||
<col style="width: 250px">
|
||||
<col style="width: 250px">
|
||||
<col style="width: 250px">
|
||||
<col style="width: 250px">
|
||||
<col style="width: 250px">
|
||||
</colgroup>
|
||||
<tr>
|
||||
<th>项目名称</th>
|
||||
<th colspan="2">山东XX新线项目</th>
|
||||
<th>客户</th>
|
||||
<th colspan="2">xxx有限公司</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>时间</td>
|
||||
<td>2016年_月_日</td>
|
||||
<td>项目阶段</td>
|
||||
<td></td>
|
||||
<td>项目负责人</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>类别</td>
|
||||
<td>内容</td>
|
||||
<td>目标</td>
|
||||
<td>计划时间</td>
|
||||
<td>原因分析</td>
|
||||
<td>下一步措施</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="3">本周项目计划</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="3">本周出现的问题</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="3">下周计划</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { projectSelect } from '../../api/ProjectManagement/summarize'
|
||||
export default {
|
||||
name: 'Summarize',
|
||||
data() {
|
||||
return {
|
||||
projectValue: '',
|
||||
project: [],
|
||||
isEdit: true
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
project(val) {
|
||||
if (val.length > 0) {
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
fetchData() {
|
||||
this.getSelect(projectSelect, ['项目名称', '项目流水号'], 'project')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.tg{
|
||||
border-collapse:collapse;
|
||||
border-spacing:0;
|
||||
}
|
||||
.tg td{
|
||||
height: 45px;
|
||||
font-size:16px;
|
||||
padding:12px 10px;
|
||||
border-style:solid;
|
||||
border-width:1px;
|
||||
overflow:hidden;
|
||||
word-break:normal;
|
||||
color: #606266;
|
||||
border-color:#ebeef5;
|
||||
}
|
||||
.tg th{
|
||||
min-height: 400px;
|
||||
font-size:20px;
|
||||
font-weight:bolder;
|
||||
padding:10px 5px;
|
||||
border-style:solid;
|
||||
border-width:1px;
|
||||
overflow:hidden;
|
||||
word-break:normal;
|
||||
color: #909399;
|
||||
border-color:#ebeef5;
|
||||
}
|
||||
.tg .title{
|
||||
font-weight: 500;
|
||||
font-size: 24px;
|
||||
color: #909399;
|
||||
}
|
||||
.table table{
|
||||
margin: 20px
|
||||
}
|
||||
.main {
|
||||
font-size: 30px;
|
||||
font-weight: bolder;
|
||||
}
|
||||
.name {
|
||||
margin: 10px auto;
|
||||
}
|
||||
span {
|
||||
font-size: 22px;
|
||||
margin: 20px;
|
||||
}
|
||||
</style>
|
||||
327
src/views/ProjectManagement/summarize.vue
Normal file
327
src/views/ProjectManagement/summarize.vue
Normal file
@@ -0,0 +1,327 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="table">
|
||||
<div class="name">
|
||||
<span>项目名称</span>
|
||||
<el-select v-model="projectValue" placeholder="请选择项目名称" filterable>
|
||||
<el-option
|
||||
v-for="item in project"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<el-button v-if="isEdit" type="primary" class="el-icon-edit" style="margin-left: 20px;" @click="edit">修改</el-button>
|
||||
<el-button v-else type="primary" class="el-icon-circle-check-outline" style="margin-left: 20px;" @click="save">保存</el-button>
|
||||
</div>
|
||||
|
||||
<table class="tg">
|
||||
<tr>
|
||||
<td colspan="8" class="title">一、项目基本情况</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">项目名称</td>
|
||||
<td colspan="2">{{ projectName }}</td>
|
||||
<td colspan="2">项目编号</td>
|
||||
<td colspan="2">
|
||||
<el-input size="small" placeholder="请输入内容" v-model="tableData.项目编号" v-if="!isEdit">
|
||||
</el-input>
|
||||
<span v-else>{{ tableData.项目编号 }}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">制作人</td>
|
||||
<td colspan="2">
|
||||
<el-input size="small" placeholder="请输入内容" v-model="tableData.制作人" v-if="!isEdit">
|
||||
</el-input>
|
||||
<span v-else>{{ tableData.制作人 }}</span>
|
||||
</td>
|
||||
<td colspan="2">审核人</td>
|
||||
<td colspan="2">
|
||||
<el-input size="small" placeholder="请输入内容" v-model="tableData.审核人" v-if="!isEdit">
|
||||
</el-input>
|
||||
<span v-else>{{ tableData.审核人 }}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">项目经理</td>
|
||||
<td colspan="2">
|
||||
<el-input size="small" placeholder="请输入内容" v-model="tableData.项目经理" v-if="!isEdit">
|
||||
</el-input>
|
||||
<span v-else>{{ tableData.项目经理 }}</span>
|
||||
</td>
|
||||
<td colspan="2">制作品日期</td>
|
||||
<td colspan="2">
|
||||
<el-date-picker size="small" type="date" placeholder="请选择日期" v-model="tableData.制作日期" v-if="!isEdit">
|
||||
</el-date-picker>
|
||||
<span v-else>{{ tableData.制作日期 | formatTime }}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="8" class="title">二、项目完成情况总结</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="8">1、时间总结</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>开始时间</td>
|
||||
<td>
|
||||
<el-date-picker size="small" type="date" placeholder="请选择日期" v-model="tableData.开始时间" v-if="!isEdit">
|
||||
</el-date-picker>
|
||||
<span v-else>{{ tableData.开始时间 | formatTime }}</span>
|
||||
</td>
|
||||
<td colspan="2">计划完成日期</td>
|
||||
<td>
|
||||
<el-date-picker size="small" type="date" placeholder="请选择日期" v-model="tableData.计划完成日期" v-if="!isEdit">
|
||||
</el-date-picker>
|
||||
<span v-else>{{ tableData.计划完成日期 | formatTime }}</span>
|
||||
</td>
|
||||
<td colspan="2">实际完成日期</td>
|
||||
<td>
|
||||
<el-date-picker size="small" type="date" placeholder="请选择日期" v-model="tableData.实际完成日期" v-if="!isEdit">
|
||||
</el-date-picker>
|
||||
<span v-else>{{ tableData.实际完成日期 | formatTime }}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="8">时间(差异)分析</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="8">
|
||||
<el-input size="small" placeholder="请输入内容" v-model="tableData.时间分析" v-if="!isEdit">
|
||||
</el-input>
|
||||
<span v-else>{{ tableData.时间分析 }}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="8">2、成本总结</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">计划费用</td>
|
||||
<td colspan="2">
|
||||
<el-input size="small" placeholder="请输入内容" v-model="tableData.计划费用" v-if="!isEdit">
|
||||
</el-input>
|
||||
<span v-else>{{ tableData.计划费用 }}</span>
|
||||
</td>
|
||||
<td colspan="2">实际费用</td>
|
||||
<td colspan="2">
|
||||
<el-input size="small" placeholder="请输入内容" v-model="tableData.实际费用" v-if="!isEdit">
|
||||
</el-input>
|
||||
<span v-else>{{ tableData.实际费用 }}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="8">成本(差异)分析 </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="8">
|
||||
<el-input size="small" placeholder="请输入内容" v-model="tableData.成本分析" v-if="!isEdit">
|
||||
</el-input>
|
||||
<span v-else>{{ tableData.成本分析 }}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="8">3、交付结果总结</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="8">计划交付结果</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="8">
|
||||
<el-input size="small" placeholder="请输入内容" v-model="tableData.计划交付结果" v-if="!isEdit">
|
||||
</el-input>
|
||||
<span v-else>{{ tableData.计划交付结果 }}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="8">实际交付结果</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="8">
|
||||
<el-input size="small" placeholder="请输入内容" v-model="tableData.实际交付结果" v-if="!isEdit">
|
||||
</el-input>
|
||||
<span v-else>{{ tableData.实际交付结果 }}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="8">未交付结果</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="8">
|
||||
<el-input size="small" placeholder="请输入内容" v-model="tableData.未交付结果" v-if="!isEdit">
|
||||
</el-input>
|
||||
<span v-else>{{ tableData.未交付结果 }}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="8">交付结果(差异)分析</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="8">
|
||||
<el-input size="small" placeholder="请输入内容" v-model="tableData.交付结果分析" v-if="!isEdit">
|
||||
</el-input>
|
||||
<span v-else>{{ tableData.交付结果分析 }}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="8" class="title">三、项目经验、教训总结</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="8">
|
||||
<el-input class="textarea" type="textarea" size="small" placeholder="请输入内容" v-model="tableData.项目经验教训总结" v-if="!isEdit" style="min-height: 160px">
|
||||
</el-input>
|
||||
<div v-html="summary"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4">签字</td>
|
||||
<td colspan="4">日期</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">审核人</td>
|
||||
<td colspan="2">
|
||||
<el-input size="small" placeholder="请输入内容" v-model="tableData.审核人" v-if="!isEdit">
|
||||
</el-input>
|
||||
<span v-else>{{ tableData.审核人 }}</span>
|
||||
</td>
|
||||
<td colspan="4">
|
||||
<el-date-picker type="date" size="small" placeholder="请输入内容" v-model="tableData.审核人签字日期" v-if="!isEdit">
|
||||
</el-date-picker>
|
||||
<span v-else>{{ tableData.审核人签字日期 | formatTime }}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">项目经理</td>
|
||||
<td colspan="2">
|
||||
<el-input size="small" placeholder="请输入内容" v-model="tableData.项目经理" v-if="!isEdit">
|
||||
</el-input>
|
||||
<span v-else>{{ tableData.项目经理 }}</span>
|
||||
</td>
|
||||
<td colspan="4">
|
||||
<el-date-picker size="small" type="date" placeholder="请选择日期" v-model="tableData.项目经理签字日期" v-if="!isEdit">
|
||||
</el-date-picker>
|
||||
<span v-else>{{ tableData.项目经理签字日期 | formatTime }}</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { projectSelect, getTableData, editTableData } from '../../api/ProjectManagement/summarize'
|
||||
export default {
|
||||
name: 'Summarize',
|
||||
data() {
|
||||
return {
|
||||
projectValue: '',
|
||||
project: [],
|
||||
isEdit: true,
|
||||
tableData: {}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
project(val) {
|
||||
if(val.length > 0){
|
||||
this.projectValue = val[0].value
|
||||
}
|
||||
},
|
||||
projectValue(val) {
|
||||
this.getData(val)
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
projectName() {
|
||||
for (let i = 0; i < this.project.length; i++) {
|
||||
if (this.project[i].value === this.projectValue) {
|
||||
return this.project[i].label
|
||||
}
|
||||
}
|
||||
},
|
||||
summary() {
|
||||
if(this.tableData.项目经验教训总结) {
|
||||
return this.tableData.项目经验教训总结.replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' ')
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
fetchData() {
|
||||
this.getSelect(projectSelect, ['项目名称', '项目流水号'], 'project')
|
||||
},
|
||||
async getData(val) {
|
||||
this.tableData = {}
|
||||
const response = await getTableData(val)
|
||||
this.tableData = response.data[0]
|
||||
},
|
||||
edit() {
|
||||
this.isEdit = false
|
||||
this.getData(this.projectValue)
|
||||
},
|
||||
async save() {
|
||||
this.isEdit = true
|
||||
console.log(this.tableData.项目经验教训总结)
|
||||
const response = await editTableData(this.tableData.项目总结流水号, this.projectValue, this.projectName, this.tableData.项目编号, this.tableData.制作人, this.tableData.审核人, this.tableData.项目经理, this.tableData.制作日期, this.tableData.开始时间, this.tableData.计划完成日期, this.tableData.实际完成日期, this.tableData.时间分析, this.tableData.计划费用, this.tableData.实际费用, this.tableData.成本分析, this.tableData.计划交付结果, this.tableData.实际交付结果, this.tableData.未交付结果, this.tableData.交付结果分析, this.tableData.项目经验教训总结, this.tableData.项目经理签字日期, this.tableData.审核人签字日期)
|
||||
if (response.data[0].result === '0') this.$message.error(`编辑失败`)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.tg{
|
||||
border-collapse:collapse;
|
||||
border-spacing:0;
|
||||
}
|
||||
.tg td{
|
||||
width: 12%;
|
||||
font-size:16px;
|
||||
padding:12px 10px;
|
||||
border-style:solid;
|
||||
border-width:1px;
|
||||
overflow:hidden;
|
||||
word-break:normal;
|
||||
color: #606266;
|
||||
border-color:#ebeef5;
|
||||
}
|
||||
.tg th{
|
||||
font-size:14px;
|
||||
font-weight:normal;
|
||||
padding:10px 5px;
|
||||
border-style:solid;
|
||||
border-width:1px;
|
||||
overflow:hidden;
|
||||
word-break:normal;
|
||||
border-color:black;
|
||||
}
|
||||
.tg .title{
|
||||
font-weight: 500;
|
||||
font-size: 24px;
|
||||
color: #909399;
|
||||
}
|
||||
.table table{
|
||||
width: 1080px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.main {
|
||||
with:1080px;
|
||||
font-size: 30px;
|
||||
font-weight: bolder;
|
||||
}
|
||||
.name {
|
||||
width: 1080px;
|
||||
margin: 10px auto;
|
||||
}
|
||||
.name span {
|
||||
font-size: 22px;
|
||||
margin: 20px;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.textarea .el-textarea__inner{
|
||||
min-height: 150px!important;
|
||||
}
|
||||
</style>
|
||||
710
src/views/TechnologyCenter/CreatePackingList/index.vue
Normal file
710
src/views/TechnologyCenter/CreatePackingList/index.vue
Normal file
@@ -0,0 +1,710 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<span>项目名称</span>
|
||||
<el-select v-model="projectValue" placeholder="请选择项目名称" filterable size="small">
|
||||
<el-option
|
||||
v-for="item in project"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<el-button :disabled="disabled" type="success" size="small" icon="el-icon-circle-plus-outline" @click="addReceipt">增加</el-button>
|
||||
<el-button type="warning" size="small" icon="el-icon-download">导出</el-button>
|
||||
<div class="title">总装箱单</div>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="receiptData"
|
||||
highlight-current-row
|
||||
border
|
||||
style="margin-top:20px">
|
||||
<el-table-column
|
||||
label="装箱单号"
|
||||
align="center"
|
||||
min-width="150px">
|
||||
<template slot-scope="scope">{{ scope.row.装箱单号 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="发货节点"
|
||||
align="center"
|
||||
min-width="100px">
|
||||
<template slot-scope="scope">{{ scope.row.发货节点 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="名称"
|
||||
align="center"
|
||||
min-width="100px">
|
||||
<template slot-scope="scope">{{ scope.row.名称 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="收货单位"
|
||||
align="center">
|
||||
<template slot-scope="scope">{{ scope.row.收货单位 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="联系人"
|
||||
align="center">
|
||||
<template slot-scope="scope">{{ scope.row.联系人 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="联系方式"
|
||||
align="center">
|
||||
<template slot-scope="scope">{{ scope.row.联系方式 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
@click="handleEditReceipt(scope.row)">编辑</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDeleteReceipt(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<el-card style="margin-top: 10px">
|
||||
<el-button :disabled="!disabled" type="primary" size="small" icon="el-icon-search" @click="addMachine">添加主机</el-button>
|
||||
<div class="title">主机</div>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="machineTableData"
|
||||
highlight-current-row
|
||||
border
|
||||
style="margin-top:20px">
|
||||
<el-table-column type="expand">
|
||||
<template slot-scope="props">
|
||||
<el-table
|
||||
:data="props.row.groupData"
|
||||
border
|
||||
style="width: 90%">
|
||||
<el-table-column
|
||||
fixed
|
||||
align="center"
|
||||
prop="类别"
|
||||
label="类别"
|
||||
/>
|
||||
<el-table-column
|
||||
label="序号"
|
||||
type="index"
|
||||
align="center"
|
||||
width="100px"/>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="代号"
|
||||
label="代号"
|
||||
/>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="部件名称"
|
||||
label="名称"
|
||||
/>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="address"
|
||||
label="规格"
|
||||
/>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="部件数量"
|
||||
label="数量"
|
||||
/>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="备注"
|
||||
label="备注"
|
||||
/>
|
||||
</el-table>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="序号"
|
||||
type="index"
|
||||
align="center"
|
||||
width="100px"/>
|
||||
<el-table-column
|
||||
label="代号"
|
||||
align="center"
|
||||
min-width="100px">
|
||||
<template slot-scope="scope">{{ scope.row.代号 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="机床名称"
|
||||
align="center"
|
||||
min-width="100px">
|
||||
<template slot-scope="scope">{{ scope.row.机床名称 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="数量"
|
||||
align="center"
|
||||
min-width="100px">
|
||||
<template slot-scope="scope">{{ scope.row.数量 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="备注"
|
||||
align="center">
|
||||
<template slot-scope="scope">{{ scope.row.备注 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
@click="editMachine(scope.row)">编辑</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@click="deleteMachine(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<el-card style="margin-top: 10px">
|
||||
<el-button :disabled="!disabled" type="primary" size="small" icon="el-icon-search" @click="addSpare">添加备件</el-button>
|
||||
<div class="title">随机供应的备件</div>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="spareData"
|
||||
highlight-current-row
|
||||
border
|
||||
style="margin-top:20px">
|
||||
<el-table-column
|
||||
label="序号"
|
||||
type="index"
|
||||
align="center"
|
||||
min-width="150px"/>
|
||||
<el-table-column
|
||||
label="名称"
|
||||
align="center">
|
||||
<template slot-scope="scope">{{ scope.row.名称 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="规格"
|
||||
align="center"
|
||||
min-width="100px">
|
||||
<template slot-scope="scope">{{ scope.row.规格 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="数量"
|
||||
align="center"
|
||||
min-width="100px">
|
||||
<template slot-scope="scope">{{ scope.row.数量 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="单位"
|
||||
align="center">
|
||||
<template slot-scope="scope">{{ scope.row.单位 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="备注"
|
||||
align="center">
|
||||
<template slot-scope="scope">{{ scope.row.备注 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
@click="editSpare(scope.row)">编辑</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@click="deleteSpare(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<el-card style="margin-top: 10px">
|
||||
<el-button :disabled="!disabled" type="primary" size="small" icon="el-icon-search" @click="addFile">添加文件</el-button>
|
||||
<div class="title">随机技术文件</div>
|
||||
<el-table
|
||||
v-loading="fileLoading"
|
||||
:data="fileData"
|
||||
highlight-current-row
|
||||
border
|
||||
style="margin-top:20px">
|
||||
<el-table-column
|
||||
label="序号"
|
||||
align="center"
|
||||
type="index"
|
||||
min-width="150px"/>
|
||||
<el-table-column
|
||||
label="名称"
|
||||
align="center"
|
||||
min-width="200px">
|
||||
<template slot-scope="scope">{{ scope.row.名称 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="数量"
|
||||
align="center"
|
||||
min-width="100px">
|
||||
<template slot-scope="scope">{{ scope.row.数量 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="备注"
|
||||
align="center"
|
||||
min-width="500px">
|
||||
<template slot-scope="scope">{{ scope.row.备注 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-edit"
|
||||
@click="editFile(scope.row)">编辑</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@click="deleteFile(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<el-dialog :title="receiptTitle" :visible.sync="receiptVisible" center style="min-height: 200px" width="800px">
|
||||
<el-form ref="receiptForm" :rules="rules" :model="receiptForm" label-position="left" label-width="110px" class="demo-ruleForm">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="装箱单号" prop="装箱单号">
|
||||
<el-input v-model="receiptForm.装箱单号" size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="名称" prop="名称">
|
||||
<el-input v-model="receiptForm.名称" size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="发货节点" prop="发货节点">
|
||||
<el-date-picker
|
||||
v-model="receiptForm.发货节点"
|
||||
value-format="yyyy-MM-dd"
|
||||
size="small"
|
||||
type="date"
|
||||
placeholder="请选择发货节点"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="收货单位" prop="收货单位">
|
||||
<el-input v-model="receiptForm.收货单位" size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系人" prop="联系人">
|
||||
<el-input v-model="receiptForm.联系人" size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系方式" prop="联系方式">
|
||||
<el-input v-model="receiptForm.联系方式" size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
<el-button v-if="receiptTitle === '新增总装箱单'" type="primary" @click="submitAddReceipt">确定</el-button>
|
||||
<el-button v-else-if="receiptTitle === '编辑总装箱单'" type="primary" @click="submitEditReceipt">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :visible.sync="machineVisible" :title="machineTitle" center style="min-height: 200px" width="400px">
|
||||
<el-form ref="machineForm" :rules="rules" :model="machineForm" label-position="left" label-width="110px" class="demo-ruleForm">
|
||||
<el-row>
|
||||
<el-col v-if="machineTitle==='添加主机'" :span="24">
|
||||
<el-form-item label="机床号" prop="装箱单号">
|
||||
<el-select v-model="machineValue" placeholder="请选择机床图号" filterable size="small">
|
||||
<el-option
|
||||
v-for="item in machine"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="数量" prop="数量">
|
||||
<el-input v-model="machineForm.数量" size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="名称">
|
||||
<el-input v-model="machineForm.备注" type="textarea" size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
<el-button v-if="machineTitle==='添加主机'" type="primary" @click="submitAddMachine">确定</el-button>
|
||||
<el-button v-else-if="machineTitle==='编辑主机'" type="primary" @click="submitEditMachine">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :visible.sync="fileVisible" :title="fileTitle" center style="min-height: 200px" width="400px">
|
||||
<el-form ref="machineForm" :rules="rules" :model="fileForm" label-position="left" label-width="110px" class="demo-ruleForm">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="名称" prop="名称">
|
||||
<el-input v-model="fileForm.名称" size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="数量" prop="数量">
|
||||
<el-input v-model="fileForm.数量" size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="备注">
|
||||
<el-input v-model="fileForm.备注" type="textarea" size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
<el-button v-if="fileTitle==='添加文件'" type="primary" @click="submitAddFile">确定</el-button>
|
||||
<el-button v-else-if="fileTitle==='编辑文件'" type="primary" @click="submitEditFile">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :visible.sync="spareVisible" :title="spareTitle" center style="min-height: 200px" width="400px">
|
||||
<el-form ref="machineForm" :rules="rules" :model="spareForm" label-position="left" label-width="110px" class="demo-ruleForm">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="名称" prop="名称">
|
||||
<el-input v-model="spareForm.名称" size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="规格" prop="规格">
|
||||
<el-input v-model="spareForm.规格" size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="数量" prop="数量">
|
||||
<el-input v-model="spareForm.数量" size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="单位" prop="单位">
|
||||
<el-input v-model="spareForm.单位" size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="备注">
|
||||
<el-input v-model="spareForm.备注" type="textarea" size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
<el-button v-if="spareTitle==='添加备件'" type="primary" @click="submitAddSpare">确定</el-button>
|
||||
<el-button v-else-if="spareTitle==='编辑备件'" type="primary" @click="submitEditSpare">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { projectSelect, getReciptData, insertReciptData, updateReciptData, deleteReciptData, getMachineData, getGroupData, machineSelect, addMachineData, updateMachineData, deleteMachineData, getFileData, addFileData, editFileData, deleteFileData, getSpareData, addSpareData, editSpareData, deleteSpareData } from '@/api/TechnologyCenter/CreatePackingList'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
project: [],
|
||||
projectValue: '',
|
||||
machine: [],
|
||||
machineValue: '',
|
||||
receiptData: [],
|
||||
loading: false,
|
||||
fileData: [],
|
||||
fileLoading: false,
|
||||
receiptTitle: '',
|
||||
receiptVisible: false,
|
||||
machineTitle: '',
|
||||
machineVisible: false,
|
||||
spareVisible: false,
|
||||
spareTitle: '',
|
||||
spareForm: {
|
||||
序号: '',
|
||||
名称: '',
|
||||
规格: '',
|
||||
单位: '',
|
||||
备注: '',
|
||||
数量: ''
|
||||
},
|
||||
spareData: [],
|
||||
receiptForm: {
|
||||
装箱单号: '',
|
||||
发货节点: '',
|
||||
名称: '',
|
||||
收货单位: '',
|
||||
联系人: '',
|
||||
联系方式: ''
|
||||
},
|
||||
machineForm: {
|
||||
序号: '',
|
||||
机床号: '',
|
||||
备注: '',
|
||||
数量: ''
|
||||
},
|
||||
rules: {
|
||||
},
|
||||
machineTableData: [],
|
||||
receiptName: '',
|
||||
receiptNum: 0, // 装箱单号,全局要使用
|
||||
fileVisible: false,
|
||||
fileTitle: '',
|
||||
fileForm: {
|
||||
序号: '',
|
||||
名称: '',
|
||||
数量: '',
|
||||
备注: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
disabled() {
|
||||
return this.receiptData.length > 0
|
||||
},
|
||||
projectName() {
|
||||
for (let i = 0; i < this.project.length; i++) {
|
||||
if (this.project[i].value === this.projectValue) {
|
||||
return this.project[i].label
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
project(val) {
|
||||
if (val.length > 0) {
|
||||
this.projectValue = val[0].value
|
||||
}
|
||||
},
|
||||
projectValue(val) {
|
||||
if (val) {
|
||||
this.getMachineSelect(val)
|
||||
}
|
||||
this.getReceipt()
|
||||
},
|
||||
receiptNum(val) {
|
||||
if (val !== 0) {
|
||||
this.getMachineData()
|
||||
this.getFileData()
|
||||
this.getSpareData()
|
||||
}
|
||||
},
|
||||
machine(val) {
|
||||
if (val.length > 0) {
|
||||
this.machineValue = val[0].value
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
fetchData() {
|
||||
this.getSelect(projectSelect, ['项目名称', '项目流水号'], 'project')
|
||||
},
|
||||
getMachineSelect(val) {
|
||||
this.getSelect(machineSelect, ['机床图号', '机床流水号'], 'machine', val)
|
||||
},
|
||||
async getReceipt() {
|
||||
this.receiptData = []
|
||||
this.machineTableData = []
|
||||
const response = await getReciptData(this.projectValue)
|
||||
const data = response.data
|
||||
if (data.length > 0) {
|
||||
this.receiptNum = data[0].装箱单编号
|
||||
this.receiptName = data[0].装箱单号
|
||||
this.receiptData = data
|
||||
} else {
|
||||
this.receiptNum = 0
|
||||
this.receiptName = ''
|
||||
}
|
||||
},
|
||||
addReceipt() {
|
||||
this.addForm('receiptForm')
|
||||
this.receiptVisible = true
|
||||
this.receiptTitle = `新增总装箱单`
|
||||
},
|
||||
submitAddReceipt() {
|
||||
this.addTable(insertReciptData, [this.receiptForm.装箱单号, this.receiptForm.发货节点, this.receiptForm.名称, this.receiptForm.收货单位, this.receiptForm.联系方式, this.receiptForm.联系人, this.projectValue], 'receiptForm', function() {
|
||||
this.receiptVisible = false
|
||||
this.getReceipt()
|
||||
})
|
||||
},
|
||||
handleEditReceipt(row) {
|
||||
this.editForm(row, 'receiptForm', function() {
|
||||
this.receiptVisible = true
|
||||
this.receiptTitle = `编辑总装箱单`
|
||||
})
|
||||
},
|
||||
submitEditReceipt() {
|
||||
this.editTable(updateReciptData, [this.receiptForm.装箱单号, this.receiptForm.发货节点, this.receiptForm.名称, this.receiptForm.收货单位, this.receiptForm.联系方式, this.receiptForm.联系人, this.receiptNum], 'receiptForm', function() {
|
||||
this.receiptVisible = false
|
||||
this.getReceipt()
|
||||
})
|
||||
},
|
||||
handleDeleteReceipt(row) {
|
||||
this.deleteRow(deleteReciptData, row.装箱单编号, function() {
|
||||
this.receiptNum = 0
|
||||
this.receiptName = ''
|
||||
this.getReceipt()
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
this.receiptVisible = false
|
||||
this.machineVisible = false
|
||||
},
|
||||
async getMachineData() {
|
||||
const response = await getMachineData(this.receiptNum)
|
||||
const data = response.data
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
const resp = await getGroupData(this.projectName, data[i].代号)
|
||||
const groupData = resp.data.map(item => {
|
||||
item.类别 = '机床所属部件'
|
||||
item.代号 = data[i].代号 + '-' + item.组号.split('-')[0]
|
||||
return item
|
||||
})
|
||||
this.machineTableData.push({
|
||||
序号: data[i].序号,
|
||||
代号: data[i].代号,
|
||||
机床名称: data[i].名称,
|
||||
数量: data[i].数量,
|
||||
备注: data[i].备注,
|
||||
groupData: groupData
|
||||
})
|
||||
}
|
||||
},
|
||||
addMachine() {
|
||||
this.addForm('machineForm', function() {
|
||||
this.machineTitle = `添加主机`
|
||||
this.machineVisible = true
|
||||
})
|
||||
},
|
||||
async submitAddMachine() {
|
||||
const response = await addMachineData(this.projectName, this.machineValue, this.machineForm.备注, this.machineForm.数量, this.receiptNum)
|
||||
if (response.data[0].result === '1') {
|
||||
this.machineVisible = false
|
||||
this.getMachineData()
|
||||
}
|
||||
},
|
||||
editMachine(row) {
|
||||
this.editForm(row, 'machineForm', function() {
|
||||
this.machineTitle = `编辑主机`
|
||||
this.machineVisible = true
|
||||
})
|
||||
},
|
||||
async submitEditMachine() {
|
||||
const response = await updateMachineData(this.machineForm.序号, this.machineForm.数量, this.machineForm.备注)
|
||||
if (response.data[0].result === '1') {
|
||||
this.machineVisible = false
|
||||
this.getMachineData()
|
||||
}
|
||||
},
|
||||
deleteMachine(row) {
|
||||
this.deleteRow(deleteMachineData, row.序号, function() {
|
||||
this.getMachineData()
|
||||
})
|
||||
},
|
||||
async getFileData() {
|
||||
const response = await getFileData(this.receiptNum)
|
||||
this.fileData = response.data
|
||||
console.log(this.fileData)
|
||||
},
|
||||
addFile() {
|
||||
this.addForm('machineForm', function() {
|
||||
this.fileTitle = `添加文件`
|
||||
this.fileVisible = true
|
||||
})
|
||||
},
|
||||
async submitAddFile() {
|
||||
const response = await addFileData(this.fileForm.名称, this.fileForm.数量, this.fileForm.备注, this.receiptNum)
|
||||
if (response.data[0].result === '1') {
|
||||
this.fileVisible = false
|
||||
this.getFileData()
|
||||
}
|
||||
},
|
||||
editFile(row) {
|
||||
this.editForm(row, 'fileForm', function() {
|
||||
this.fileTitle = `编辑文件`
|
||||
this.fileVisible = true
|
||||
})
|
||||
},
|
||||
async submitEditFile() {
|
||||
const response = await editFileData(this.fileForm.名称, this.fileForm.数量, this.fileForm.备注, this.fileForm.序号)
|
||||
if (response.data[0].result === '1') {
|
||||
this.fileVisible = false
|
||||
this.getFileData()
|
||||
}
|
||||
},
|
||||
deleteFile(row) {
|
||||
this.deleteRow(deleteFileData, row.序号, function() {
|
||||
this.getFileData()
|
||||
})
|
||||
},
|
||||
async getSpareData() {
|
||||
const response = await getSpareData(this.receiptNum)
|
||||
this.spareData = response.data
|
||||
},
|
||||
addSpare() {
|
||||
this.addForm('spareForm', function() {
|
||||
this.spareTitle = `添加备件`
|
||||
this.spareVisible = true
|
||||
})
|
||||
},
|
||||
async submitAddSpare() {
|
||||
const response = await addSpareData(this.spareForm.名称, this.spareForm.规格, this.spareForm.单位, this.spareForm.数量, this.spareForm.备注, this.receiptNum)
|
||||
if (response.data[0].result === '1') {
|
||||
this.spareVisible = false
|
||||
this.getSpareData()
|
||||
}
|
||||
},
|
||||
editSpare(row) {
|
||||
this.editForm(row, 'spareForm', function() {
|
||||
this.spareTitle = `编辑备件`
|
||||
this.spareVisible = true
|
||||
})
|
||||
},
|
||||
async submitEditSpare() {
|
||||
const response = await editSpareData(this.spareForm.名称, this.spareForm.规格, this.spareForm.单位, this.spareForm.数量, this.spareForm.备注, this.fileForm.序号)
|
||||
if (response.data[0].result === '1') {
|
||||
this.spareVisible = false
|
||||
this.getSpareData()
|
||||
}
|
||||
},
|
||||
deleteSpare(row) {
|
||||
this.deleteRow(deleteSpareData, row.序号, function() {
|
||||
this.getSpareData()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
span{
|
||||
margin: 20px;
|
||||
}
|
||||
.title{
|
||||
float: right;
|
||||
font-size: 20px;
|
||||
padding: 10px;
|
||||
font-weight: bolder;
|
||||
}
|
||||
</style>
|
||||
103
src/views/TechnologyCenter/ImportParts/UploadExcel/index.vue
Normal file
103
src/views/TechnologyCenter/ImportParts/UploadExcel/index.vue
Normal file
@@ -0,0 +1,103 @@
|
||||
<template>
|
||||
<div style="display: inline-block;width: 100%;height: 100%;margin: 10px 20px 40px 10px">
|
||||
<input id="excel-upload-input" ref="excel-upload-input" type="file" multiple="multiple" accept=".xlsx, .xls" class="c-hide" @change="handkeFileChange">
|
||||
<div id="drop" @drop="handleDrop" @dragover="handleDragover" @dragenter="handleDragover">
|
||||
将Excel文件拖到这或
|
||||
<el-button style="margin-left:16px;" size="small" icon="el-icon-search" type="success" @click="handleUpload">浏览</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import XLSX from 'xlsx'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
excelData: {
|
||||
itemFile: [],
|
||||
worksheet: []
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
generateDate({ itemFile, worksheet }) {
|
||||
this.excelData.itemFile.push(itemFile)
|
||||
this.excelData.worksheet.push(worksheet)
|
||||
},
|
||||
handleDrop(e) {
|
||||
this.excelData.itemFile = []
|
||||
this.excelData.worksheet = [] // 每次拖拽都清空一次
|
||||
e.stopPropagation()
|
||||
e.preventDefault()
|
||||
const files = e.dataTransfer.files
|
||||
for (let i = 0; i < files.length; i++) { // 支持多个文件
|
||||
const itemFile = files[i]
|
||||
this.readerData(itemFile)
|
||||
}
|
||||
this.$emit('on-selected-file', this.excelData)
|
||||
e.stopPropagation()
|
||||
e.preventDefault()
|
||||
},
|
||||
handleDragover(e) {
|
||||
e.stopPropagation()
|
||||
e.preventDefault()
|
||||
e.dataTransfer.dropEffect = 'copy'
|
||||
},
|
||||
handleUpload() {
|
||||
this.excelData.itemFile = []
|
||||
this.excelData.worksheet = [] // 每次点击“浏览”都清空一次
|
||||
document.getElementById('excel-upload-input').click()
|
||||
},
|
||||
handkeFileChange(e) {
|
||||
const files = e.target.files
|
||||
for (let i = 0; i < files.length; i++) { // 支持多个文件
|
||||
const itemFile = files[i]
|
||||
if (!itemFile) return
|
||||
this.readerData(itemFile)
|
||||
}
|
||||
this.$emit('on-selected-file', this.excelData)
|
||||
this.$refs['excel-upload-input'].value = null // fix can't select the same excel
|
||||
},
|
||||
readerData(itemFile) {
|
||||
const reader = new FileReader()
|
||||
reader.onload = e => {
|
||||
const data = e.target.result
|
||||
const fixedData = this.fixdata(data)
|
||||
const workbook = XLSX.read(btoa(fixedData), { type: 'base64' })
|
||||
const firstSheetName = workbook.SheetNames[0] // cjnsheetname
|
||||
const worksheet = workbook.Sheets[firstSheetName] // 默认firstsheet
|
||||
this.generateDate({ itemFile, worksheet })
|
||||
}
|
||||
reader.readAsArrayBuffer(itemFile)
|
||||
},
|
||||
fixdata(data) {
|
||||
let o = ''
|
||||
let l = 0
|
||||
const w = 10240
|
||||
for (; l < data.byteLength / w; ++l) o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w, l * w + w)))
|
||||
o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w)))
|
||||
return o
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#excel-upload-input{
|
||||
display: none;
|
||||
z-index: -9999;
|
||||
}
|
||||
#drop{
|
||||
border: 2px dashed #bbb;
|
||||
width: 600px;
|
||||
line-height: 160px;
|
||||
margin: 0;
|
||||
font-size: 24px;
|
||||
border-radius: 5px;
|
||||
text-align: center;
|
||||
color: #bbb;
|
||||
position: relative;
|
||||
}
|
||||
</style>
|
||||
230
src/views/TechnologyCenter/ImportParts/index.vue
Normal file
230
src/views/TechnologyCenter/ImportParts/index.vue
Normal file
@@ -0,0 +1,230 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card v-loading="loading">
|
||||
<div style="width: 620px;margin: 0 auto">
|
||||
<div style="overflow: hidden">
|
||||
<div style="margin-bottom: 10px;">
|
||||
<span>项目:</span>
|
||||
<el-select v-model="projectValue" filterable size="small" placeholder="项目名称">
|
||||
<el-option
|
||||
v-for="item in project"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</div>
|
||||
<upload-excel-component @on-selected-file="selected"/>
|
||||
</div>
|
||||
<div>
|
||||
<el-tooltip content="删除全部" placement="top">
|
||||
<span v-show="worksheet.length > 1" style="cursor: pointer;float: right;margin: 5px" @click="removeAll"><i class="el-icon-close"/></span>
|
||||
</el-tooltip>
|
||||
<el-upload :on-remove="handleRemove" :file-list="itemFile" action=""/>
|
||||
</div>
|
||||
<div v-if="worksheet.length !== 0" style="float: right;margin: 20px 0">
|
||||
<el-button icon="el-icon-upload2" type="primary" size="small" @click="basicPartsToSQL">导入到数据库</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
<specification-data ref="specificationData" :groups-names="groupsNames" :machine-names="machineNames" :project-name="projectName" @machineChange="machineChange"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/* eslint-disable */
|
||||
import UploadExcelComponent from './UploadExcel/index.vue'
|
||||
import specificationData from './specificationData'
|
||||
import { initProject, isExit, importBasics, importPurcharse, searchMachine, searchGroupNum } from '../../../api/TechnologyCenter/ImportParts'
|
||||
|
||||
export default {
|
||||
name: 'UploadExcel',
|
||||
components: { UploadExcelComponent, specificationData },
|
||||
data() {
|
||||
return {
|
||||
project: [],
|
||||
projectValue: '',
|
||||
worksheet: [],
|
||||
itemFile: [],
|
||||
loading: false,
|
||||
groupsNames: [],
|
||||
machineNames: [],
|
||||
err: 0
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
projectName() {
|
||||
for (let i = 0; i < this.project.length; i++) {
|
||||
if (this.project[i].value === this.projectValue) {
|
||||
return this.project[i].label
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
projectValue(val) {
|
||||
if (val) {
|
||||
this.groupsNames = []
|
||||
this.machineNames = []
|
||||
this.projectChange(this.projectName)
|
||||
}
|
||||
},
|
||||
project(val) {
|
||||
if (val.length > 0) {
|
||||
this.projectValue = val[0].value
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
fetchData() {
|
||||
this.getSelect(initProject, ['项目名称', '项目流水号'], 'project')
|
||||
},
|
||||
// 根据项目获取机床
|
||||
projectChange(val) {
|
||||
this.machineNames = []
|
||||
if (val) {
|
||||
this.getSelect(searchMachine, ['机床'], 'machineNames', val)
|
||||
}
|
||||
},
|
||||
// 根据机床获取分组
|
||||
machineChange(val) {
|
||||
this.groupsNames = []
|
||||
if (val) {
|
||||
searchGroupNum(this.projectName, val).then(response => {
|
||||
const res = response.data
|
||||
res.forEach(item => {
|
||||
this.groupsNames.push({
|
||||
value: item.组号
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
selected(data) { // 选择需要导入的文件
|
||||
this.worksheet = data.worksheet // 获取每个多选文件的表格坐标及值
|
||||
this.itemFile = data.itemFile
|
||||
},
|
||||
handleRemove(file) { // 移除文件
|
||||
for (let i = 0; i < this.itemFile.length; i++) {
|
||||
if (this.itemFile[i].name === file.name) {
|
||||
this.worksheet.splice(i, 1)
|
||||
this.itemFile.splice(i, 1)
|
||||
}
|
||||
}
|
||||
},
|
||||
removeAll() {
|
||||
this.worksheet = []
|
||||
this.itemFile = []
|
||||
},
|
||||
async basicPartsToSQL() {
|
||||
try {
|
||||
this.loading = true
|
||||
this.err = 0
|
||||
for (let j = this.worksheet.length - 1; j >= 0; j--) {
|
||||
let establishment,
|
||||
proofread,
|
||||
review,
|
||||
date,
|
||||
machineName,
|
||||
machineNum,
|
||||
componentName,
|
||||
componentNum,
|
||||
groupNum,
|
||||
contractNum,
|
||||
pageNum,
|
||||
totalNum,
|
||||
drawingNum,
|
||||
name,
|
||||
type,
|
||||
material,
|
||||
spareNum,
|
||||
useNum,
|
||||
manufacturer,
|
||||
remarks,
|
||||
classificationCode
|
||||
// const response = await isExit(this.projectValue, this.worksheet[j].F2.v)
|
||||
// const res = response.data
|
||||
// if (res[j].Column1 !== 0) {
|
||||
// this.$notify.error(`${this.worksheet[j].F2.v}机床不存在,请确认文件是否正确`)
|
||||
// } else {
|
||||
this.worksheet[j].G1 ? establishment = this.worksheet[j].G1.v : establishment = ''
|
||||
this.worksheet[j].I1 ? proofread = this.worksheet[j].I1.v : proofread = ''
|
||||
this.worksheet[j].L1 ? review = this.worksheet[j].L1.v : review = ''
|
||||
this.worksheet[j].P1 ? date = this.worksheet[j].P1.v : date = ''
|
||||
this.worksheet[j].Q1 ? pageNum = parseInt(this.worksheet[j].Q1.v.replace(/[^0-9]/ig, '')) : pageNum = ''
|
||||
this.worksheet[j].C2 ? machineName = this.worksheet[j].C2.v : machineName = ''
|
||||
this.worksheet[j].F2 ? machineNum = this.worksheet[j].F2.v : machineNum = ''
|
||||
this.worksheet[j].J2 ? componentName = this.worksheet[j].J2.v : componentName = ''
|
||||
this.worksheet[j].P2 ? componentNum = this.worksheet[j].P2.v : componentNum = ''
|
||||
this.worksheet[j].Q2 ? totalNum = parseInt(this.worksheet[j].Q2.v.replace(/[^0-9]/ig, '')) : totalNum = ''
|
||||
this.worksheet[j].R2 ? contractNum = this.worksheet[j].R2.v : contractNum = ''
|
||||
this.worksheet[j].M2 ? groupNum = this.worksheet[j].M2.v : groupNum = ''
|
||||
const len = parseInt(this.worksheet[j]['!ref'].split(':')[1].substring(1)) - 3
|
||||
for (let i = 0; i < len; i++) {
|
||||
const attr = i + 4
|
||||
drawingNum = this.worksheet[j][`B${attr}`] ? this.worksheet[j][`B${attr}`].v : ''
|
||||
name = this.worksheet[j][`D${attr}`] ? this.worksheet[j][`D${attr}`].v : ''
|
||||
type = this.worksheet[j][`F${attr}`] ? this.worksheet[j][`F${attr}`].v : ''
|
||||
material = this.worksheet[j][`J${attr}`] ? this.worksheet[j][`J${attr}`].v : ''
|
||||
spareNum = this.worksheet[j][`L${attr}`] ? this.worksheet[j][`L${attr}`].v : ''
|
||||
useNum = this.worksheet[j][`M${attr}`] ? this.worksheet[j][`M${attr}`].v : ''
|
||||
manufacturer = this.worksheet[j][`O${attr}`] ? this.worksheet[j][`O${attr}`].v : ''
|
||||
remarks = this.worksheet[j][`Q${attr}`] ? this.worksheet[j][`Q${attr}`].v : ''
|
||||
classificationCode = this.worksheet[j][`R${attr}`] ? this.worksheet[j][`R${attr}`].v : ''
|
||||
if (!drawingNum && !name && !type && !material && !spareNum && !useNum && !manufacturer && !remarks && !classificationCode) { // 当图号、名称、规格、材料、备件数量、装机数量、制造商、备注、分类码都为空时,循环终止,防止向数据库中插入多余且无用的数据
|
||||
break
|
||||
} else {
|
||||
if (machineNum && groupNum) {
|
||||
await this.insertToSQL(establishment, proofread, review, date, machineName, machineNum, componentName, componentNum, groupNum, contractNum, pageNum, totalNum, drawingNum, name, type, material, spareNum, useNum, manufacturer, remarks, classificationCode)
|
||||
} else {
|
||||
this.loading = false
|
||||
this.$notify.error(`请确认导入文件是否正确`)
|
||||
return
|
||||
}
|
||||
}
|
||||
// }
|
||||
}
|
||||
this.itemFile.splice(j, 1)
|
||||
this.worksheet.splice(j, 1)
|
||||
}
|
||||
this.loading = false
|
||||
this.err === 0 ? this.$message.success(`导入完成`) : this.$message.error(`导入失败零件个数为${this.err},请检查文件是否正确`)
|
||||
this.projectChange(this.projectName) // 调用查询机床方法,通过watch属性检测变化会自动得到下面表格的值。
|
||||
} catch (e) {
|
||||
this.err++
|
||||
this.$notify.error(`导入数据错误,请检查导入文件是否正确`)
|
||||
console.log(`导入数据错误${e}`)
|
||||
}
|
||||
},
|
||||
async insertToSQL(establishment, proofread, review, date, machineName, machineNum, componentName, componentNum, groupNum, contractNum, pageNum, totalNum, drawingNum, name, type, material, spareNum, useNum, manufacturer, remarks, classificationCode) {
|
||||
try {
|
||||
if (groupNum.indexOf('MX') > -1) {
|
||||
const response = await importBasics(establishment, proofread, review, date, this.projectName, machineNum, machineName, componentName, componentNum, groupNum, contractNum, totalNum, pageNum, drawingNum, name, type, material, spareNum, useNum, manufacturer, remarks, classificationCode)
|
||||
const res = response.data
|
||||
if (res[0].result === '0') {
|
||||
this.$notify.error(`${drawingNum}导入失败`)
|
||||
}
|
||||
} else {
|
||||
const response = await importPurcharse(establishment, proofread, review, date, this.projectName, machineNum, machineName, componentName, componentNum, groupNum, contractNum, totalNum, pageNum, drawingNum, name, type, material, spareNum, useNum, manufacturer, remarks, classificationCode)
|
||||
const res = response.data
|
||||
if (res[0].result === '0') {
|
||||
this.$notify.error(`${drawingNum}导入失败`)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
this.err++
|
||||
this.$message.error(`导入数据错误`)
|
||||
console.log(`导入数据错误${e}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.wrapper{
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
</style>
|
||||
546
src/views/TechnologyCenter/ImportParts/specificationData.vue
Normal file
546
src/views/TechnologyCenter/ImportParts/specificationData.vue
Normal file
@@ -0,0 +1,546 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card>
|
||||
<div style="width: 700px;margin: 0 auto">
|
||||
<span>机床名称:</span>
|
||||
<el-select v-model="machineValue" filterable clearable size="small" placeholder="机床名称" @change="getGroups">
|
||||
<el-option
|
||||
v-for="item in machineNames"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span>分组名称:</span>
|
||||
<el-select v-model="groupValue" filterable clearable size="small" placeholder="分组名称">
|
||||
<el-option
|
||||
v-for="item in groupsNames"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<el-button :disabled="disabled" type="primary" icon="el-icon-d-caret" size="small" style="margin-left: 10px" @click="transferData">传递</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
:data="tableData"
|
||||
:row-class-name="tableRowClassName"
|
||||
border>
|
||||
<el-table-column align="center" label="图号" min-width="200">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.图号或者型号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="名称" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="材料" width="200">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.材料或者规格 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="规格" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.规格 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="备件数量" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.备件数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="装机数量" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.装机数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="部件数量" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.部件数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="制造商" min-width="200">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.制造商 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="备注" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.备注 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="分类码" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.分类码 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
@click="handleEdit(scope.row)">编辑</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[10, 20, 40, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-dialog :title="title" :visible.sync="dialogFormVisible" center style="min-height: 300px" width="800px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="110px" class="demo-ruleForm">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="图号" prop="图号或者型号">
|
||||
<el-input
|
||||
v-model="form.图号或者型号"
|
||||
size="small"
|
||||
style="width: 200px;"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="名称" prop="名称">
|
||||
<el-input
|
||||
v-model="form.名称"
|
||||
size="small"
|
||||
style="width: 200px;"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item v-if="type === 1" label="材料" prop="材料">
|
||||
<el-select v-model="form.材料流水号" filterable clearable size="small" placeholder="机床名称">
|
||||
<el-option
|
||||
v-for="item in materials"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="type === 2" label="材料" prop="材料">
|
||||
<el-input v-model="form.物料名称" clearable size="small" style="width: 200px;" placeholder="物料流水号" @dblclick.native="materialShow"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="规格" prop="规格">
|
||||
<el-input
|
||||
v-model="form.规格"
|
||||
size="small"
|
||||
style="width: 200px;"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备件数量" prop="数量">
|
||||
<el-input
|
||||
v-model.number="form.备件数量"
|
||||
size="small"
|
||||
style="width: 200px;"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="装机数量" prop="数量">
|
||||
<el-input
|
||||
v-model.number="form.装机数量"
|
||||
size="small"
|
||||
style="width: 200px;"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="部件数量" prop="数量">
|
||||
<el-input
|
||||
v-model.number="form.部件数量"
|
||||
size="small"
|
||||
style="width: 200px;"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="制造商" prop="供货商">
|
||||
<el-input
|
||||
v-model.number="form.制造商"
|
||||
size="small"
|
||||
style="width: 200px;"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="分类码" prop="分类码">
|
||||
<el-input
|
||||
v-model.number="form.分类码"
|
||||
size="small"
|
||||
style="width: 200px;"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注" prop="备注">
|
||||
<el-input
|
||||
v-model.number="form.备注"
|
||||
type="textarea"
|
||||
size="small"
|
||||
style="width: 200px;"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="cancel()">取消</el-button>
|
||||
<el-button v-show="title==='编辑零件信息'" type="primary" @click="submitEdit()">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :visible.sync="dialogMaterial" title="物料选择">
|
||||
<el-input v-model="inputMaterial" placeholder="材质" size="small" style="width:200px"/>
|
||||
<el-button type="success" size="small" icon="el-icon-search" style="margin: 0 0 10px 10px" @click="searchMaterial()">查询</el-button>
|
||||
<el-table
|
||||
:data="MaterialData"
|
||||
size="mini"
|
||||
highlight-current-row
|
||||
border
|
||||
@row-click="selectMaterial">
|
||||
<el-table-column align="center" label="物料代码">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料代码 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="物料名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="物料规格">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料规格 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="物料型号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料型号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:current-page="pageCurrentMaterial"
|
||||
:page-sizes="[10, 20]"
|
||||
:page-size="pageSizeMaterial"
|
||||
:total="totalMaterial"
|
||||
small
|
||||
layout="sizes, prev, pager, next"
|
||||
@size-change="handleSizeChangeMaterial"
|
||||
@current-change="handleCurrentChangeMaterial"/>
|
||||
</div>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="dialogMaterial=false">提交</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { unSpecificationQuery, unSpecificationQueryWB, specificationQueryWB, specificationQuery, deleteBasicParts, deleteBWParts, getMaterial, getMaterialWB, searchMaterialWB, updateRow, updateRowWB, transferMX, transferWG } from '../../../api/TechnologyCenter/ImportParts'
|
||||
export default {
|
||||
name: 'SpecificationData',
|
||||
props: {
|
||||
groupsNames: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
machineNames: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
projectName: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
componentNum: '',
|
||||
groupValue: '',
|
||||
machineValue: '',
|
||||
tableData: [],
|
||||
tableDataAll: [],
|
||||
listLoading: false,
|
||||
unSpecification: [],
|
||||
pageCurrent: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
title: '',
|
||||
materials: [],
|
||||
dialogFormVisible: false,
|
||||
type: 0, // 零件类型 暂定1为基本件,2为外购件和标准件
|
||||
form: {
|
||||
id: '',
|
||||
物料物流号: null, // 当基本件时使用材料流水号,外购件和标准件时,使用物料流水号
|
||||
物料名称: '',
|
||||
材料流水号: null,
|
||||
图号或者型号: '',
|
||||
名称: '',
|
||||
材料或者规格: '',
|
||||
规格: '',
|
||||
备件数量: '',
|
||||
装机数量: '',
|
||||
部件数量: '',
|
||||
制造商: '',
|
||||
备注: '',
|
||||
分类码: ''
|
||||
},
|
||||
err: 0,
|
||||
dialogFormVisibleWB: false,
|
||||
dialogMaterial: false,
|
||||
MaterialData: [],
|
||||
inputMaterial: '',
|
||||
rules: {
|
||||
},
|
||||
rulesWB: {
|
||||
},
|
||||
pageCurrentMaterial: 1,
|
||||
pageSizeMaterial: 10,
|
||||
totalMaterial: 0,
|
||||
loadingMaterial: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
disabled() {
|
||||
if (this.tableDataAll.length === 0) {
|
||||
return true
|
||||
}
|
||||
if (this.unSpecification.data) {
|
||||
return this.unSpecification.data.length > 0
|
||||
}
|
||||
return true
|
||||
},
|
||||
materialName() {
|
||||
for (let i = 0; i < this.materials.length; i++) {
|
||||
if (this.materials[i].value === this.form.材料流水号) {
|
||||
return this.materials[i].label
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
machineNames(val) {
|
||||
this.total = 0
|
||||
this.machineValue = val.length > 0 ? val[0].value : ''
|
||||
this.getGroups()
|
||||
},
|
||||
groupsNames(val) {
|
||||
this.groupValue = val.length > 0 ? val[0].value : ''
|
||||
},
|
||||
groupValue(val) {
|
||||
val ? this.fetchData() : this.tableData = []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getSelect(getMaterial, ['材料', '材料流水号'], 'materials')
|
||||
},
|
||||
methods: {
|
||||
async fetchData() {
|
||||
try {
|
||||
this.listLoading = true
|
||||
this.total = 0
|
||||
this.tableDataAll = []
|
||||
const projectCheck = this.projectName ? 1 : 0
|
||||
const machineCheck = this.machineValue ? 1 : 0
|
||||
const groupCheck = this.groupValue ? 1 : 0
|
||||
if (this.groupValue.indexOf('MX') > -1) { // 当分组为基本件时,查询基本件规范和不规范数据,否则查询外购件或标准件规范和不规范数据
|
||||
// 分别查出规范和不规范数据,将规范数据放前面在一个总数组中
|
||||
this.type = 1
|
||||
this.unSpecification = await unSpecificationQuery(projectCheck, this.projectName, machineCheck, this.machineValue, groupCheck, this.groupValue)
|
||||
this.unSpecification.data.forEach(item => {
|
||||
this.tableDataAll.push(item)
|
||||
})
|
||||
const specification = await specificationQuery(projectCheck, this.projectName, machineCheck, this.machineValue, groupCheck, this.groupValue)
|
||||
specification.data.forEach(item => {
|
||||
this.tableDataAll.push(item)
|
||||
})
|
||||
} else {
|
||||
this.type = 2
|
||||
this.unSpecification = await unSpecificationQueryWB(projectCheck, this.projectName, machineCheck, this.machineValue, groupCheck, this.groupValue)
|
||||
this.unSpecification.data.forEach(item => {
|
||||
this.tableDataAll.push(item)
|
||||
})
|
||||
const specification = await specificationQueryWB(projectCheck, this.projectName, machineCheck, this.machineValue, groupCheck, this.groupValue)
|
||||
specification.data.forEach(item => {
|
||||
this.tableDataAll.push(item)
|
||||
})
|
||||
}
|
||||
this.total = this.tableDataAll.length
|
||||
this.pagination(this.pageCurrent, this.pageSize) // 前端分页,数据很多生成DOM节点也多,分页效果很明显。
|
||||
this.listLoading = false
|
||||
} catch (e) {
|
||||
console.log(`查询零件发生错误:${e}`)
|
||||
}
|
||||
},
|
||||
getGroups() {
|
||||
this.$emit('machineChange', this.machineValue)
|
||||
},
|
||||
pagination(pageCurrent, pageSize) {
|
||||
this.tableData = this.tableDataAll.slice((pageCurrent - 1) * pageSize, pageCurrent * pageSize)
|
||||
},
|
||||
tableRowClassName({ row }) {
|
||||
if (this.unSpecification.data.indexOf(row) > -1) {
|
||||
return 'warning-row'
|
||||
}
|
||||
return ''
|
||||
},
|
||||
handleEdit(row) {
|
||||
this.editForm(row, 'form', [this.title = '编辑零件信息', this.dialogFormVisible = true])
|
||||
if (this.type === 2) {
|
||||
this.form.物料名称 = row.材料或者规格
|
||||
this.form.物料物流号 = row.物料流水号
|
||||
}
|
||||
},
|
||||
submitEdit() {
|
||||
if (this.type === 1) {
|
||||
this.editTable(updateRow, [this.form.图号或者型号, this.form.名称, this.form.规格, this.materialName, this.form.备件数量, this.form.装机数量, this.form.制造商, this.form.备注, this.form.分类码, this.form.id, this.form.材料流水号, this.form.部件数量], 'form', function() {
|
||||
this.dialogFormVisible = false
|
||||
this.fetchData()
|
||||
})
|
||||
} else if (this.type === 2) {
|
||||
this.editTable(updateRowWB, [this.form.图号或者型号, this.form.名称, this.form.规格, this.form.物料名称, this.form.备件数量, this.form.装机数量, this.form.制造商, this.form.备注, this.form.分类码, this.form.id, this.form.物料流水号, this.form.部件数量], 'form', function() {
|
||||
this.dialogFormVisible = false
|
||||
this.fetchData()
|
||||
})
|
||||
} else {
|
||||
console.log(`编辑类型发生错误`)
|
||||
}
|
||||
},
|
||||
cancel() {
|
||||
this.dialogFormVisible = false
|
||||
},
|
||||
handleDelete(row) {
|
||||
if (this.type === 1) {
|
||||
this.deleteRow(deleteBasicParts, row.id, function() {
|
||||
this.fetchData()
|
||||
})
|
||||
} else {
|
||||
this.deleteRow(deleteBWParts, row.id, function() {
|
||||
this.fetchData()
|
||||
})
|
||||
}
|
||||
},
|
||||
materialShow() {
|
||||
this.inputMaterial = ''
|
||||
this.getMaterialWB()
|
||||
this.dialogMaterial = true
|
||||
},
|
||||
getMaterialWB() {
|
||||
this.getTable(getMaterialWB, [this.pageCurrentMaterial, this.pageSizeMaterial], ['MaterialData', 'totalMaterial', 'loadingMaterial'])
|
||||
},
|
||||
searchMaterial() {
|
||||
this.getTable(searchMaterialWB, [this.inputMaterial, this.pageCurrentMaterial, this.pageSizeMaterial], ['MaterialData', 'totalMaterial', 'loadingMaterial'])
|
||||
},
|
||||
selectMaterial(row) {
|
||||
this.dialogMaterial = false
|
||||
this.form.物料流水号 = row.物料流水号
|
||||
this.form.物料名称 = row.物料名称
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = val
|
||||
this.pagination(this.pageCurrent, this.pageSize)
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.pagination(this.pageCurrent, this.pageSize)
|
||||
},
|
||||
handleSizeChangeMaterial(val) {
|
||||
this.pageCurrentMaterial = 1
|
||||
this.pageSizeMaterial = val
|
||||
this.getMaterialWB()
|
||||
},
|
||||
handleCurrentChangeMaterial(val) {
|
||||
this.pageCurrentMaterial = val
|
||||
this.getMaterialWB()
|
||||
},
|
||||
async transferData() {
|
||||
try {
|
||||
if (this.groupValue) {
|
||||
this.listLoading = true
|
||||
if (this.groupValue.indexOf('MX') > -1) {
|
||||
for (let i = 0; i < this.tableDataAll.length; i++) {
|
||||
const data = this.tableDataAll[i]
|
||||
const total = parseInt(data.备件数量) + parseInt(data.装机数量) * parseInt(data.部件数量)
|
||||
const resp = await transferMX(data.图号或者型号, data.名称, total, data.备注, data.标记, data.设计者编号, data.组件流水号, data.材料流水号, data.数据类型, data.是否传递, data.序号, data.id)
|
||||
if (resp.data[0].result === '0') {
|
||||
this.err++
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (let i = 0; i < this.tableDataAll.length; i++) {
|
||||
let dataType
|
||||
const data = this.tableDataAll[i]
|
||||
const total = parseInt(data.备件数量) + parseInt(data.装机数量) * parseInt(data.部件数量)
|
||||
if (this.groupValue.indexOf('WG') > -1) {
|
||||
dataType = 1
|
||||
} else {
|
||||
dataType = 2
|
||||
}
|
||||
const resp = await transferWG(data.组件流水号, data.物料流水号, total, data.备注, data.标记, data.设计者编号, data.是否传递, dataType, data.序号, data.id)
|
||||
if (resp.data[0].result === '0') {
|
||||
this.err++
|
||||
this.$notify.error(`传递零件失败`)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.err === 0) { // 传递成功后,清除该分组。当所有组都传递完成后,该项目下的机床和分组消失
|
||||
const index = this.groupsNames.indexOf(this.groupValue)
|
||||
this.groupsNames.splice(index, 1)
|
||||
if (this.groupsNames.length === 0) {
|
||||
const groupIndex = this.machineNames.indexOf(this.machineValue)
|
||||
this.machineNames.splice(groupIndex, 1)
|
||||
}
|
||||
this.$message.success(`传递成功`)
|
||||
this.tableDataAll = []
|
||||
this.tableData = []
|
||||
} else {
|
||||
this.$message.error(`${this.err}个零件传递失败`)
|
||||
}
|
||||
this.listLoading = false
|
||||
} else {
|
||||
this.$message.warning(`请选择分组传递`)
|
||||
}
|
||||
} catch (e) {
|
||||
this.$message.error(`传递发生错误`)
|
||||
console.log(`${e}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.el-table .warning-row {
|
||||
background: oldlace;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped>
|
||||
span{
|
||||
margin: 10px;
|
||||
}
|
||||
</style>
|
||||
166
src/views/TechnologyCenter/ImportParts/uploadFile.js
Normal file
166
src/views/TechnologyCenter/ImportParts/uploadFile.js
Normal file
@@ -0,0 +1,166 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 初始化 项目名称
|
||||
export function initProject() {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '1',
|
||||
name: 'PDM_项目名称_查询数据_按时间排序'
|
||||
}
|
||||
})
|
||||
}
|
||||
// 导入Excel
|
||||
export function upload(project, machine, group, designer) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '2',
|
||||
name: '组件明细表_基本件_导入数据',
|
||||
param: '项目=' + project + '&机床=' + machine + '&组号=' + group + '&设计者=' + designer
|
||||
}
|
||||
})
|
||||
}
|
||||
// 导入Excel1
|
||||
export function upload1(designer, time, project, machine, group, num1, num2, name, size, num3, supplier, remark, mark) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '2',
|
||||
name: '组件明细表_基本件_导入数据1',
|
||||
param: '设计者=' + designer + '&保存时间=' + time + '&项目=' + project + '&机床=' + machine + '&组号=' + group + '&序号=' + num1 + '&图号或者型号=' + num2 + '=string&名称=' + name + '&材料或者规格=' + size + '&数量=' + num3 + '&供货商=' + supplier + '&备注=' + remark + '&标记=' + mark
|
||||
}
|
||||
})
|
||||
}
|
||||
// 查询零件(查重)
|
||||
export function searchPart(project, machine, group) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '1',
|
||||
name: '导入数据_查询',
|
||||
param: '项目=' + project + '&机床=' + machine + '&组号=' + group
|
||||
}
|
||||
})
|
||||
}
|
||||
// 导入Excel外购件
|
||||
export function outBuyUpload(project, machine, group, designer) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '2',
|
||||
name: '组件明细表_外购件_导入数据',
|
||||
param: '项目=' + project + '&机床=' + machine + '&组号=' + group + '&设计者=' + designer
|
||||
}
|
||||
})
|
||||
}
|
||||
// 导入Excel1外购件
|
||||
export function outBuyUpload1(designer, time, project, machine, group, num1, num2, name, size, num3, supplier, remark, mark) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '2',
|
||||
name: '组件明细表_外购件_导入数据1',
|
||||
param: '设计者=' + designer + '&保存时间=' + time + '&项目=' + project + '&机床=' + machine + '&组号=' + group + '&序号=' + num1 + '&图号或者型号=' + num2 + '&名称=' + name + '&材料或者规格=' + size + '&数量=' + num3 + '&供货商=' + supplier + '&备注=' + remark + '&标记=' + mark
|
||||
}
|
||||
})
|
||||
}
|
||||
// 查询零件(查重)外购件
|
||||
export function outBuySearchPart(project, machine, group) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '1',
|
||||
name: '导入数据_外购件_查询',
|
||||
param: '项目=' + project + '&机床=' + machine + '&组号=' + group
|
||||
}
|
||||
})
|
||||
}
|
||||
// 查询零件 基本件
|
||||
export function searchBasePartDetail(project, machine, group) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '1',
|
||||
name: 'PDM_零件明细表_基本件_数据导入保存_查询数据_综合_全部',
|
||||
param: '项目=' + project + '&机床=' + machine + '&组号=' + group
|
||||
}
|
||||
})
|
||||
}
|
||||
// 查询零件 基本件
|
||||
export function searchOutPartDetail(project, machine, group) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '1',
|
||||
name: 'PDM_零件明细表_外购件和标准件_数据导入保存_综合_全部',
|
||||
param: '项目=' + project + '&机床=' + machine + '&组号=' + group
|
||||
}
|
||||
})
|
||||
}
|
||||
// 删除 基本件
|
||||
export function deleteTable1(id) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '2',
|
||||
name: 'PDM_零件明细表_基本件_数据导入保存_删除数据',
|
||||
param: 'id=' + id
|
||||
}
|
||||
})
|
||||
}
|
||||
// 删除 外购件
|
||||
export function deleteTable2(id) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '2',
|
||||
name: 'PDM_零件明细表_外购件和标准件_数据导入保存_删除数据',
|
||||
param: 'id=' + id
|
||||
}
|
||||
})
|
||||
}
|
||||
// 初始化规范 备注
|
||||
export function initStandard1() {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '1',
|
||||
name: 'PDM_零件明细表_基本件_数据导入保存_查询数据_规范表_备注'
|
||||
}
|
||||
})
|
||||
}
|
||||
// 初始化规范 材料或者规格
|
||||
export function initStandard2() {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '1',
|
||||
name: 'PDM_零件明细表_基本件_数据导入保存_查询数据_规范表_材料或者规格'
|
||||
}
|
||||
})
|
||||
}
|
||||
// 初始化规范 物料流水号
|
||||
export function initStandard3() {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '1',
|
||||
name: 'PDM_零件明细表_基本件_数据导入保存_查询数据_规范表_物料流水号'
|
||||
}
|
||||
})
|
||||
}
|
||||
325
src/views/TechnologyCenter/QueryParts/index.vue
Normal file
325
src/views/TechnologyCenter/QueryParts/index.vue
Normal file
@@ -0,0 +1,325 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<span>项目名称</span>
|
||||
<el-select v-model="projectValue" placeholder="请选择项目名称" filterable size="small">
|
||||
<el-option
|
||||
v-for="item in project"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
|
||||
<span>机床图号</span>
|
||||
<el-select v-model="machineValue" placeholder="请选择机床图号" filterable size="small">
|
||||
<el-option
|
||||
v-for="item in machine"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
|
||||
<span>组号</span>
|
||||
<el-select v-model="groupValue" placeholder="请选择组号" filterable size="small">
|
||||
<el-option
|
||||
v-for="item in group"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
|
||||
<el-button icon="el-icon-search" type="success" size="small" @click="getTableData">查询</el-button>
|
||||
</el-card>
|
||||
<el-card v-if="groupName && groupName.indexOf('MX') > -1">
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
highlight-current-row
|
||||
border
|
||||
style="width: 100%;max-height: 520px"
|
||||
height="520">
|
||||
<el-table-column
|
||||
label="机床图号"
|
||||
align="center"
|
||||
min-width="150px">
|
||||
<template slot-scope="scope">{{ scope.row.机床图号 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="零件图号"
|
||||
align="center"
|
||||
min-width="200px">
|
||||
<template slot-scope="scope">{{ scope.row.零件图号 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="零件名称"
|
||||
align="center"
|
||||
min-width="100px">
|
||||
<template slot-scope="scope">{{ scope.row.零件名称 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="组号"
|
||||
align="center"
|
||||
min-width="100px">
|
||||
<template slot-scope="scope">{{ scope.row.组号 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="需求数量"
|
||||
align="center">
|
||||
<template slot-scope="scope">{{ scope.row.零件数量 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="材料"
|
||||
align="center">
|
||||
<template slot-scope="scope">{{ scope.row.材料 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="备注"
|
||||
align="center">
|
||||
<template slot-scope="scope">{{ scope.row.零件备注 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="零件类型"
|
||||
align="center">
|
||||
<template slot-scope="scope">{{ scope.row.零件类型名称 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChanges"
|
||||
@current-change="handleCurrentChanges"/>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card v-else>
|
||||
<el-table
|
||||
v-loading="loadingWB"
|
||||
:data="tableDataWB"
|
||||
style="width: 100%;min-height: 600px;"
|
||||
height="600"
|
||||
highlight-current-row
|
||||
border>
|
||||
<el-table-column align="center" label="物料名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="物料规格">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料规格 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="物料型号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料型号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="零件数量">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="零件类型">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.标准件类型 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="供货商">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.供货商 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="备注" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.备注 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="标记" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.标记 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px">
|
||||
<el-pagination
|
||||
:current-page="pageCurrentWB"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="pageSizeWB"
|
||||
:total="totalWB"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChangeWB"
|
||||
@current-change="handleCurrentChangeWB"/>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { projectSelect, machineSelect, groupSelect, basicPartsData, deleteBasicParts, purchasePartsData, deletePurchaseData } from '@/api/TechnologyCenter/QueryParts'
|
||||
export default {
|
||||
name: 'Index',
|
||||
data() {
|
||||
return {
|
||||
projectValue: '',
|
||||
project: [],
|
||||
machineValue: '',
|
||||
machine: [],
|
||||
groupValue: '',
|
||||
group: [],
|
||||
loading: false,
|
||||
loadingWB: false,
|
||||
total: 0,
|
||||
tableData: [],
|
||||
tableDataWB: [],
|
||||
pageCurrent: 1,
|
||||
pageSize: 10,
|
||||
pageCurrentWB: 1,
|
||||
pageSizeWB: 10,
|
||||
totalWB: 0
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
groupName() {
|
||||
for (let i = 0; i < this.group.length; i++) {
|
||||
if (this.group[i].value === this.groupValue) {
|
||||
return this.group[i].label
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
project(val) {
|
||||
if (val.length > 0) {
|
||||
this.projectValue = val[1].value
|
||||
}
|
||||
},
|
||||
projectValue(val) {
|
||||
this.machineValue = ''
|
||||
this.machine = []
|
||||
this.groupValue = ''
|
||||
this.group = []
|
||||
if (val) {
|
||||
this.getMachineSelect(val)
|
||||
}
|
||||
},
|
||||
machine(val) {
|
||||
if (val.length > 0) {
|
||||
this.machineValue = val[0].value
|
||||
}
|
||||
},
|
||||
machineValue(val) {
|
||||
this.groupValue = ''
|
||||
this.group = []
|
||||
if (val) {
|
||||
this.getGroupSelect(val)
|
||||
}
|
||||
},
|
||||
group(val) {
|
||||
if (val.length > 0) {
|
||||
this.groupValue = val[0].value
|
||||
}
|
||||
},
|
||||
groupValue(val) {
|
||||
if (val) {
|
||||
this.getTableData()
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
fetchData() {
|
||||
this.getSelect(projectSelect, ['项目名称', '项目流水号'], 'project')
|
||||
},
|
||||
getMachineSelect(val) {
|
||||
this.getSelect(machineSelect, ['机床图号', '机床流水号'], 'machine', val)
|
||||
},
|
||||
getGroupSelect(val) {
|
||||
this.getSelect(groupSelect, ['组号', '组件流水号'], 'group', val)
|
||||
},
|
||||
getTableData() {
|
||||
if (this.groupName.indexOf('MX') > -1) {
|
||||
const project_check = this.projectValue ? 1 : 0
|
||||
const machine_check = this.machineValue ? 1 : 0
|
||||
const group_check = this.groupValue ? 1 : 0
|
||||
this.loading = true
|
||||
basicPartsData(project_check, this.projectValue, machine_check, this.machineValue, group_check, this.groupValue, this.pageSize, this.pageCurrent).then(response => {
|
||||
this.loading = false
|
||||
const res = response.data
|
||||
this.tableData = res.rows
|
||||
this.total = res.total
|
||||
})
|
||||
} else {
|
||||
const type = this.groupName.indexOf('WG') ? 1 : 2
|
||||
this.loadingWB = true
|
||||
purchasePartsData(this.groupValue, type, this.pageCurrentWB, this.pageSizeWB).then(response => {
|
||||
this.loadingWB = false
|
||||
const data = response.data
|
||||
this.totalWB = data.total
|
||||
this.tableDataWB = data.rows.map(item => {
|
||||
item.标准件类型 = item.标准件类型 === '1' ? '外购件' : '标准件'
|
||||
return item
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
handleDelete(row) {
|
||||
if (row.基本件流水号) {
|
||||
this.deleteRow(deleteBasicParts, row.基本件流水号, function() {
|
||||
this.getTableData()
|
||||
})
|
||||
} else {
|
||||
this.deleteRow(deletePurchaseData, row.标准件和外购件流水号, function() {
|
||||
this.getTableData()
|
||||
})
|
||||
}
|
||||
},
|
||||
handleSizeChanges(val) {
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = val
|
||||
this.getTableData()
|
||||
},
|
||||
handleCurrentChanges(val) {
|
||||
this.pageCurrent = val
|
||||
this.getTableData()
|
||||
},
|
||||
handleSizeChangeWB(val) {
|
||||
this.pageCurrentWB = 1
|
||||
this.pageSizeWB = val
|
||||
this.getTableData()
|
||||
},
|
||||
handleCurrentChangeWB(val) {
|
||||
this.pageCurrentWB = val
|
||||
this.getTableData()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
span{
|
||||
margin: 20px;
|
||||
}
|
||||
</style>
|
||||
32
src/views/dashboard/index.vue
Normal file
32
src/views/dashboard/index.vue
Normal file
@@ -0,0 +1,32 @@
|
||||
<template>
|
||||
<div class="dashboard-container">
|
||||
<div class="dashboard-text">name:{{ name }}</div>
|
||||
<div class="dashboard-text">roles:<span v-for="role in roles" :key="role">{{ role }}</span></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'Dashboard',
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'name',
|
||||
'roles'
|
||||
])
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
.dashboard {
|
||||
&-container {
|
||||
margin: 30px;
|
||||
}
|
||||
&-text {
|
||||
font-size: 30px;
|
||||
line-height: 46px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
71
src/views/layout/Layout.vue
Normal file
71
src/views/layout/Layout.vue
Normal file
@@ -0,0 +1,71 @@
|
||||
<template>
|
||||
<div :class="classObj" class="app-wrapper">
|
||||
<div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside"/>
|
||||
<sidebar class="sidebar-container"/>
|
||||
<div class="main-container">
|
||||
<navbar/>
|
||||
<tags-view/>
|
||||
<app-main/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { Navbar, Sidebar, AppMain, TagsView } from './components'
|
||||
import ResizeMixin from './mixin/ResizeHandler'
|
||||
|
||||
export default {
|
||||
name: 'Layout',
|
||||
components: {
|
||||
Navbar,
|
||||
Sidebar,
|
||||
AppMain,
|
||||
TagsView
|
||||
},
|
||||
mixins: [ResizeMixin],
|
||||
computed: {
|
||||
sidebar() {
|
||||
return this.$store.state.app.sidebar
|
||||
},
|
||||
device() {
|
||||
return this.$store.state.app.device
|
||||
},
|
||||
classObj() {
|
||||
return {
|
||||
hideSidebar: !this.sidebar.opened,
|
||||
openSidebar: this.sidebar.opened,
|
||||
withoutAnimation: this.sidebar.withoutAnimation,
|
||||
mobile: this.device === 'mobile'
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleClickOutside() {
|
||||
this.$store.dispatch('CloseSideBar', { withoutAnimation: false })
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
.app-wrapper {
|
||||
@include clearfix;
|
||||
position: relative;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
&.mobile.openSidebar{
|
||||
position: fixed;
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
.drawer-bg {
|
||||
background: #000;
|
||||
opacity: 0.3;
|
||||
width: 100%;
|
||||
top: 0;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
z-index: 999;
|
||||
}
|
||||
</style>
|
||||
29
src/views/layout/components/AppMain.vue
Normal file
29
src/views/layout/components/AppMain.vue
Normal file
@@ -0,0 +1,29 @@
|
||||
<template>
|
||||
<section class="app-main">
|
||||
<transition name="fade-transform" mode="out-in">
|
||||
<!-- or name="fade" -->
|
||||
<!-- <router-view :key="key"></router-view> -->
|
||||
<router-view/>
|
||||
</transition>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'AppMain',
|
||||
computed: {
|
||||
// key() {
|
||||
// return this.$route.name !== undefined ? this.$route.name + +new Date() : this.$route + +new Date()
|
||||
// }
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.app-main {
|
||||
/*50 = navbar */
|
||||
min-height: calc(100vh - 50px);
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
94
src/views/layout/components/Navbar.vue
Normal file
94
src/views/layout/components/Navbar.vue
Normal file
@@ -0,0 +1,94 @@
|
||||
<template>
|
||||
<el-menu class="navbar" mode="horizontal">
|
||||
<hamburger :toggle-click="toggleSideBar" :is-active="sidebar.opened" class="hamburger-container"/>
|
||||
<breadcrumb />
|
||||
<el-dropdown class="avatar-container" trigger="click">
|
||||
<div class="avatar-wrapper">
|
||||
<img :src="require('@/assets/img/user.jpg')" class="user-avatar">
|
||||
<i class="el-icon-caret-bottom"/>
|
||||
</div>
|
||||
<el-dropdown-menu slot="dropdown" class="user-dropdown">
|
||||
<router-link class="inlineBlock" to="/">
|
||||
<el-dropdown-item>
|
||||
主页
|
||||
</el-dropdown-item>
|
||||
</router-link>
|
||||
<el-dropdown-item divided>
|
||||
<span style="display:block;" @click="logout">登出</span>
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</el-menu>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
import Breadcrumb from '@/components/Breadcrumb'
|
||||
import Hamburger from '@/components/Hamburger'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
Breadcrumb,
|
||||
Hamburger
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'sidebar',
|
||||
'avatar'
|
||||
])
|
||||
},
|
||||
methods: {
|
||||
toggleSideBar() {
|
||||
this.$store.dispatch('ToggleSideBar')
|
||||
},
|
||||
logout() {
|
||||
this.$store.dispatch('FedLogOut').then(() => {
|
||||
location.reload() // 为了重新实例化vue-router对象 避免bug
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
.navbar {
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
border-radius: 0px !important;
|
||||
.hamburger-container {
|
||||
line-height: 58px;
|
||||
height: 50px;
|
||||
float: left;
|
||||
padding: 0 10px;
|
||||
}
|
||||
.screenfull {
|
||||
position: absolute;
|
||||
right: 90px;
|
||||
top: 16px;
|
||||
color: red;
|
||||
}
|
||||
.avatar-container {
|
||||
height: 50px;
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
right: 35px;
|
||||
.avatar-wrapper {
|
||||
cursor: pointer;
|
||||
margin-top: 5px;
|
||||
position: relative;
|
||||
.user-avatar {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
.el-icon-caret-bottom {
|
||||
position: absolute;
|
||||
right: -20px;
|
||||
top: 25px;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
29
src/views/layout/components/Sidebar/Item.vue
Normal file
29
src/views/layout/components/Sidebar/Item.vue
Normal file
@@ -0,0 +1,29 @@
|
||||
<script>
|
||||
export default {
|
||||
name: 'MenuItem',
|
||||
functional: true,
|
||||
props: {
|
||||
icon: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
render(h, context) {
|
||||
const { icon, title } = context.props
|
||||
const vnodes = []
|
||||
|
||||
if (icon) {
|
||||
vnodes.push(<svg-icon icon-class={icon}/>)
|
||||
}
|
||||
|
||||
if (title) {
|
||||
vnodes.push(<span slot='title'>{(title)}</span>)
|
||||
}
|
||||
return vnodes
|
||||
}
|
||||
}
|
||||
</script>
|
||||
104
src/views/layout/components/Sidebar/SidebarItem.vue
Normal file
104
src/views/layout/components/Sidebar/SidebarItem.vue
Normal file
@@ -0,0 +1,104 @@
|
||||
<template>
|
||||
<div v-if="!item.hidden&&item.children" class="menu-wrapper">
|
||||
|
||||
<template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow">
|
||||
<a :href="onlyOneChild.path" target="_blank" @click="clickLink(onlyOneChild.path,$event)">
|
||||
<el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
|
||||
<item v-if="onlyOneChild.meta" :icon="onlyOneChild.meta.icon||item.meta.icon" :title="onlyOneChild.meta.title" />
|
||||
</el-menu-item>
|
||||
</a>
|
||||
</template>
|
||||
|
||||
<el-submenu v-else :index="item.name||item.path">
|
||||
<template slot="title">
|
||||
<item v-if="item.meta" :icon="item.meta.icon" :title="item.meta.title" />
|
||||
</template>
|
||||
|
||||
<template v-for="child in item.children" v-if="!child.hidden">
|
||||
<sidebar-item
|
||||
v-if="child.children&&child.children.length>0"
|
||||
:is-nest="true"
|
||||
:item="child"
|
||||
:key="child.path"
|
||||
:base-path="resolvePath(child.path)"
|
||||
class="nest-menu" />
|
||||
<a v-else :href="child.path" :key="child.name" target="_blank" @click="clickLink(child.path,$event)">
|
||||
<el-menu-item :index="resolvePath(child.path)">
|
||||
<item v-if="child.meta" :icon="child.meta.icon" :title="child.meta.title" />
|
||||
</el-menu-item>
|
||||
</a>
|
||||
</template>
|
||||
</el-submenu>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import path from 'path'
|
||||
import { validateURL } from '@/utils/validate'
|
||||
import Item from './Item'
|
||||
|
||||
export default {
|
||||
name: 'SidebarItem',
|
||||
components: { Item },
|
||||
props: {
|
||||
// route object
|
||||
item: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
isNest: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
basePath: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
onlyOneChild: null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
hasOneShowingChild(children, parent) {
|
||||
const showingChildren = children.filter(item => {
|
||||
if (item.hidden) {
|
||||
return false
|
||||
} else {
|
||||
// Temp set(will be used if only has one showing child)
|
||||
this.onlyOneChild = item
|
||||
return true
|
||||
}
|
||||
})
|
||||
|
||||
// When there is only one child router, the child router is displayed by default
|
||||
if (showingChildren.length === 1) {
|
||||
return true
|
||||
}
|
||||
|
||||
// Show parent if there are no child router to display
|
||||
if (showingChildren.length === 0) {
|
||||
this.onlyOneChild = { ... parent, path: '', noShowingChildren: true }
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
},
|
||||
resolvePath(routePath) {
|
||||
return path.resolve(this.basePath, routePath)
|
||||
},
|
||||
isExternalLink(routePath) {
|
||||
return validateURL(routePath)
|
||||
},
|
||||
clickLink(routePath, e) {
|
||||
if (!this.isExternalLink(routePath)) {
|
||||
e.preventDefault()
|
||||
const path = this.resolvePath(routePath)
|
||||
this.$router.push(path)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
63
src/views/layout/components/Sidebar/index.vue
Normal file
63
src/views/layout/components/Sidebar/index.vue
Normal file
@@ -0,0 +1,63 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||
<div v-show="isShow" class="img-wrapper"><img :src="require('@/assets/img/gaojingLogo.png')"></div>
|
||||
<el-menu
|
||||
:show-timeout="200"
|
||||
:default-active="$route.path"
|
||||
:collapse="isCollapse"
|
||||
mode="vertical"
|
||||
background-color="#304156"
|
||||
text-color="#cccccc"
|
||||
active-text-color="#409EFF"
|
||||
>
|
||||
<sidebar-item v-for="route in permission_routers" :key="route.name" :item="route" :base-path="route.path"/>
|
||||
</el-menu>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
import SidebarItem from './SidebarItem'
|
||||
|
||||
export default {
|
||||
components: { SidebarItem },
|
||||
data() {
|
||||
return {
|
||||
isShow: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'sidebar',
|
||||
'permission_routers'
|
||||
]),
|
||||
routes() {
|
||||
return this.$router.options.routes
|
||||
},
|
||||
isCollapse() {
|
||||
this.showLogo()
|
||||
return !this.sidebar.opened
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
showLogo() {
|
||||
if (this.sidebar.opened === true) {
|
||||
this.isShow = true
|
||||
} else {
|
||||
this.isShow = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.img-wrapper{
|
||||
img{
|
||||
width: 84px;
|
||||
margin: 20px 60px 20px 60px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
205
src/views/layout/components/TagsView.vue
Normal file
205
src/views/layout/components/TagsView.vue
Normal file
@@ -0,0 +1,205 @@
|
||||
<template>
|
||||
<div class="tags-view-container">
|
||||
<scroll-pane ref="scrollPane" class="tags-view-wrapper">
|
||||
<router-link v-for="tag in Array.from(visitedViews)" ref="tag" :class="isActive(tag)?'active':''" :to="tag.path" :key="tag.path" class="tags-view-item" @contextmenu.prevent.native="openMenu(tag,$event)" >
|
||||
{{ tag.title }}
|
||||
<span class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)"/>
|
||||
</router-link>
|
||||
</scroll-pane>
|
||||
<ul v-show="visible" :style="{left:left+'px',top:top+'px'}" class="contextmenu">
|
||||
<li @click="closeSelectedTag(selectedTag)">关闭当前</li>
|
||||
<li @click="closeOthersTags">关闭其他</li>
|
||||
<li @click="closeAllTags">关闭全部</li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ScrollPane from '@/components/ScrollPane'
|
||||
import Cookies from 'js-cookie'
|
||||
|
||||
export default {
|
||||
components: { ScrollPane },
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
top: 0,
|
||||
left: 0,
|
||||
selectedTag: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
visitedViews() {
|
||||
return this.$store.state.tagsView.visitedViews
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
$route() {
|
||||
this.addViewTags()
|
||||
// this.moveToCurrentTag()
|
||||
},
|
||||
visible(value) {
|
||||
if (value) {
|
||||
window.addEventListener('click', this.closeMenu)
|
||||
} else {
|
||||
window.removeEventListener('click', this.closeMenu)
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.addViewTags()
|
||||
},
|
||||
methods: {
|
||||
// generateTitle, // generateTitle by vue-i18n
|
||||
generateRoute() {
|
||||
if (this.$route.name) {
|
||||
return this.$route
|
||||
}
|
||||
return false
|
||||
},
|
||||
isActive(route) {
|
||||
return route.path === this.$route.path || route.name === this.$route.name
|
||||
},
|
||||
addViewTags() {
|
||||
const route = this.generateRoute()
|
||||
if (!route) {
|
||||
return false
|
||||
}
|
||||
this.$store.dispatch('addVisitedViews', route)
|
||||
},
|
||||
moveToCurrentTag() {
|
||||
const tags = this.$refs.tag
|
||||
this.$nextTick(() => {
|
||||
for (const tag of tags) {
|
||||
if (tag.to === this.$route.path) {
|
||||
this.$refs.scrollPane.moveToTarget(tag.$el)
|
||||
break
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
closeSelectedTag(view) {
|
||||
this.$store.dispatch('delVisitedViews', view).then((views) => {
|
||||
if (this.isActive(view)) {
|
||||
const latestView = views.slice(-1)[0]
|
||||
if (latestView) {
|
||||
this.$router.push(latestView.path)
|
||||
} else {
|
||||
this.$router.push('/')
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
closeOthersTags() {
|
||||
this.$router.push(this.selectedTag.path)
|
||||
this.$store.dispatch('delOthersViews', this.selectedTag).then(() => {
|
||||
this.moveToCurrentTag()
|
||||
})
|
||||
},
|
||||
closeAllTags() {
|
||||
this.$store.dispatch('delAllViews')
|
||||
this.$router.push('/')
|
||||
},
|
||||
openMenu(tag, e) {
|
||||
const status = Cookies.get('sidebarStatus')
|
||||
this.visible = true
|
||||
this.selectedTag = tag
|
||||
this.left = e.clientX
|
||||
if (status === '0') this.left = parseInt(e.clientX) - 200
|
||||
this.top = e.clientY
|
||||
},
|
||||
closeMenu() {
|
||||
this.visible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
.tags-view-container {
|
||||
.tags-view-wrapper {
|
||||
background: #ffffff;
|
||||
height: 34px;
|
||||
border-bottom: 1px solid #d8dce5;
|
||||
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .12), 0 0 3px 0 rgba(0, 0, 0, .04);
|
||||
.tags-view-item {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
height: 26px;
|
||||
line-height: 26px;
|
||||
border: 1px solid #3d3780;
|
||||
color: #3d3780;
|
||||
background: inherit;
|
||||
padding: 0 8px;
|
||||
font-size: 12px;
|
||||
margin-left: 5px;
|
||||
margin-top: 4px;
|
||||
&:first-of-type {
|
||||
margin-left: 15px;
|
||||
}
|
||||
&.active {
|
||||
background-color: #3d3780;
|
||||
color: #ffffff;
|
||||
border-color: #ffffff;
|
||||
&::before {
|
||||
content: '';
|
||||
background: #ffffff;
|
||||
display: inline-block;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
position: relative;
|
||||
margin-right: 2px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.contextmenu {
|
||||
margin: 0;
|
||||
background: #fff;
|
||||
z-index: 2;
|
||||
position: absolute;
|
||||
list-style-type: none;
|
||||
padding: 5px 0;
|
||||
border-radius: 4px;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
color: #333;
|
||||
box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, .3);
|
||||
li {
|
||||
margin: 0;
|
||||
padding: 7px 16px;
|
||||
cursor: pointer;
|
||||
&:hover {
|
||||
background: #eee;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss">
|
||||
//reset element css of el-icon-close
|
||||
.tags-view-wrapper {
|
||||
.tags-view-item {
|
||||
.el-icon-close {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
vertical-align: 2px;
|
||||
border-radius: 50%;
|
||||
text-align: center;
|
||||
transition: all .3s cubic-bezier(.645, .045, .355, 1);
|
||||
transform-origin: 100% 50%;
|
||||
&:before {
|
||||
transform: scale(.6);
|
||||
display: inline-block;
|
||||
vertical-align: -3px;
|
||||
}
|
||||
&:hover {
|
||||
background-color: #b4bccc;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
4
src/views/layout/components/index.js
Normal file
4
src/views/layout/components/index.js
Normal file
@@ -0,0 +1,4 @@
|
||||
export { default as Navbar } from './Navbar'
|
||||
export { default as Sidebar } from './Sidebar'
|
||||
export { default as AppMain } from './AppMain'
|
||||
export { default as TagsView } from './TagsView'
|
||||
52
src/views/layout/mixin/ResizeHandler.js
Normal file
52
src/views/layout/mixin/ResizeHandler.js
Normal file
@@ -0,0 +1,52 @@
|
||||
import store from '@/store'
|
||||
|
||||
const { body } = document
|
||||
const WIDTH = 1024
|
||||
const RATIO = 3
|
||||
|
||||
export default {
|
||||
watch: {
|
||||
$route(route) {
|
||||
if (this.device === 'mobile' && this.sidebar.opened) {
|
||||
store.dispatch('CloseSideBar', { withoutAnimation: false })
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeMount() {
|
||||
window.addEventListener('resize', this.resizeHandler)
|
||||
},
|
||||
mounted() {
|
||||
const isMobile = this.isMobile()
|
||||
const isSmallDesktop = this.isSmallDesktop()
|
||||
if (isSmallDesktop) {
|
||||
store.dispatch('CloseSideBar', { withoutAnimation: false })
|
||||
}
|
||||
if (isMobile) {
|
||||
store.dispatch('ToggleDevice', 'mobile')
|
||||
store.dispatch('CloseSideBar', { withoutAnimation: true })
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
isMobile() {
|
||||
const rect = body.getBoundingClientRect()
|
||||
return rect.width - RATIO < WIDTH
|
||||
},
|
||||
isSmallDesktop() {
|
||||
const rect = body.getBoundingClientRect()
|
||||
return rect.width - RATIO < 1300
|
||||
},
|
||||
resizeHandler() {
|
||||
if (!document.hidden) {
|
||||
const isMobile = this.isMobile()
|
||||
const isSmallDesktop = this.isSmallDesktop()
|
||||
store.dispatch('ToggleDevice', isMobile ? 'mobile' : 'desktop')
|
||||
if (isSmallDesktop) {
|
||||
store.dispatch('CloseSideBar', { withoutAnimation: false })
|
||||
}
|
||||
if (isMobile) {
|
||||
store.dispatch('CloseSideBar', { withoutAnimation: true })
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
411
src/views/login/index.vue
Normal file
411
src/views/login/index.vue
Normal file
@@ -0,0 +1,411 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="login-container">
|
||||
<i class="login-img"/>
|
||||
<el-form
|
||||
ref="loginForm"
|
||||
:model="loginForm"
|
||||
:rules="loginRules"
|
||||
auto-complete="on"
|
||||
label-position="left"
|
||||
label-width="0px"
|
||||
class="card-box login-form">
|
||||
<h1 class="title">高精机电装备有限公司数字化工厂</h1>
|
||||
<div class="line"/>
|
||||
<div class="content">
|
||||
<el-form-item prop="username">
|
||||
<span class="svg-container svg-container_login">
|
||||
<svg-icon icon-class="username" />
|
||||
</span>
|
||||
<el-input v-model="loginForm.username" name="username" type="text" auto-complete="on" placeholder="请输入用户名" @input.native="changeUser" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="password">
|
||||
<span class="svg-container">
|
||||
<svg-icon icon-class="password"/>
|
||||
</span>
|
||||
<el-input
|
||||
:type="pwdType"
|
||||
v-model="loginForm.password"
|
||||
name="password"
|
||||
auto-complete="on"
|
||||
placeholder="请输入密码"
|
||||
@keyup.enter.native="handleLogin"/>
|
||||
<span class="show-pwd" @click="showPwd"><svg-icon icon-class="eye" /></span>
|
||||
</el-form-item>
|
||||
<div>
|
||||
<el-checkbox v-model="loginForm.checked" class="remeberPassword">记住账号密码</el-checkbox>
|
||||
<el-button type="text" style="margin-left: 224px" @click="handleEdit('form')">修改密码</el-button>
|
||||
</div>
|
||||
<el-button :loading="loading" class="signIn" type="primary" style="width:100%;" @click.native.prevent="handleLogin">
|
||||
登录
|
||||
</el-button>
|
||||
<div class="tips">
|
||||
<span>超级管理员</span>
|
||||
<span>账号:1001</span>
|
||||
<span>密码:1001</span>
|
||||
</div>
|
||||
<div class="tips">
|
||||
<span>采购管理员</span>
|
||||
<span>账号:6201</span>
|
||||
<span>密码:6201</span>
|
||||
</div>
|
||||
<div class="tips">
|
||||
<span>外协管理员</span>
|
||||
<span>账号:1003</span>
|
||||
<span>密码:1003</span>
|
||||
</div>
|
||||
<div class="tips">
|
||||
<span>车间计划管理员</span>
|
||||
<span>账号:2002</span>
|
||||
<span>密码:2002</span>
|
||||
</div>
|
||||
<div class="tips">
|
||||
<span>技术中心管理员</span>
|
||||
<span>账号:3001</span>
|
||||
<span>密码:3001</span>
|
||||
</div>
|
||||
<div class="tips">
|
||||
<span>库存管理员</span>
|
||||
<span>账号:3002</span>
|
||||
<span>密码:3002</span>
|
||||
</div>
|
||||
<div class="tips">
|
||||
<span>营销中心管理员</span>
|
||||
<span>账号:4001</span>
|
||||
<span>密码:4001</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<el-dialog :visible.sync="dialogFormVisible" title="修改密码" center style="min-height: 200px" width="400px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="110px">
|
||||
<el-form-item label="考勤编号" prop="Account" style="display: inline-block">
|
||||
<el-input v-model="form.Account" size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="原始密码" prop="beforPassword" style="display: inline-block">
|
||||
<el-input v-model="form.beforPassword" size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="新密码" prop="newPassword" style="display: inline-block">
|
||||
<el-input v-model="form.newPassword" size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="确认密码" prop="againPassword" style="display: inline-block">
|
||||
<el-input v-model="form.againPassword" size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="callOff()">取消</el-button>
|
||||
<el-button type="primary" size="small" @click="EditPassword('form')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { isvalidUsername } from '@/utils/validate'
|
||||
import { editPassword } from '@/api/login'
|
||||
import Cookie from 'js-cookie'
|
||||
export default {
|
||||
name: 'Login',
|
||||
data() {
|
||||
const validateValue = (rules, value, callback) => {
|
||||
if (this.form.newPassword !== this.form.againPassword) {
|
||||
callback(new Error('两次输入密码不同'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
const validateUsername = (rule, value, callback) => {
|
||||
if (!isvalidUsername(value)) {
|
||||
callback(new Error('请输入正确的用户名'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
// const validatePass = (rule, value, callback) => {
|
||||
// if (value.length < 5) {
|
||||
// callback(new Error('密码不能小于5位'))
|
||||
// } else {
|
||||
// callback()
|
||||
// }
|
||||
// }
|
||||
return {
|
||||
rules: {
|
||||
againPassword: [
|
||||
{ required: true, message: '请输入确认密码', trigger: 'blur' },
|
||||
{ required: true, trigger: 'blur', validator: validateValue }],
|
||||
Account: [{ required: true, message: '请输入考勤编号', trigger: 'blur' }],
|
||||
beforPassword: [{ required: true, message: '请输入原始密码', trigger: 'blur' }],
|
||||
newPassword: [{ required: true, message: '请输入新密码', trigger: 'blur' }]
|
||||
},
|
||||
list: [],
|
||||
form: {
|
||||
againPassword: '',
|
||||
Account: '',
|
||||
beforPassword: '',
|
||||
newPassword: ''
|
||||
},
|
||||
dialogFormVisible: false,
|
||||
loginForm: {
|
||||
username: '',
|
||||
password: '',
|
||||
checked: false
|
||||
},
|
||||
loginRules: {
|
||||
username: [{ required: true, trigger: 'blur', validator: validateUsername }]
|
||||
// password: [{ required: true, trigger: 'blur', validator: validatePass }]
|
||||
},
|
||||
loading: false,
|
||||
pwdType: 'password'
|
||||
}
|
||||
},
|
||||
// 页面加载调用获取cookie值
|
||||
mounted() {
|
||||
this.getCookie()
|
||||
},
|
||||
methods: {
|
||||
showPwd() {
|
||||
if (this.pwdType === 'password') {
|
||||
this.pwdType = ''
|
||||
} else {
|
||||
this.pwdType = 'password'
|
||||
}
|
||||
},
|
||||
changeUser() {
|
||||
this.loginForm.password = ''
|
||||
},
|
||||
handleLogin() {
|
||||
this.$refs.loginForm.validate(valid => {
|
||||
if (valid) {
|
||||
this.loading = true
|
||||
this.$store.dispatch('Login', this.loginForm).then(() => {
|
||||
this.loading = false
|
||||
this.$router.push({ path: '/' })
|
||||
}).catch(() => {
|
||||
this.loading = false
|
||||
})
|
||||
} else {
|
||||
console.log('error submit!!')
|
||||
return false
|
||||
}
|
||||
if (this.loginForm.checked === true) { // 传入账号名,密码,和保存天数3个参数
|
||||
this.setCookie(this.loginForm.username, this.loginForm.password, this.loginForm.checked)
|
||||
} else {
|
||||
this.clearCookie()
|
||||
}
|
||||
})
|
||||
},
|
||||
// 设置cookie
|
||||
setCookie(username, password, checked) {
|
||||
Cookie.set('username', username, { expires: 7 })
|
||||
Cookie.set('password', password, { expires: 7 })
|
||||
Cookie.set('checked', checked, { expires: 7 })
|
||||
},
|
||||
// 读取 cookie
|
||||
getCookie() {
|
||||
this.loginForm.username = Cookie.get('username')
|
||||
this.loginForm.password = Cookie.get('password')
|
||||
this.loginForm.checked = Boolean(Cookie.get('checked'))
|
||||
},
|
||||
// 清除cookie
|
||||
clearCookie() {
|
||||
Cookie.remove('username')
|
||||
Cookie.remove('password')
|
||||
Cookie.remove('checked')
|
||||
},
|
||||
handleEdit() {
|
||||
this.addForm('form', [this.dialogFormVisible = true])
|
||||
},
|
||||
callOff() {
|
||||
this.dialogFormVisible = false
|
||||
},
|
||||
EditPassword(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
editPassword(this.form.Account, this.form.beforPassword, this.form.newPassword, 5).then(response => {
|
||||
if (response.data.result[0].result === '1') {
|
||||
if (response.data.output[0].返回 === '1') {
|
||||
this.$message.success('修改成功')
|
||||
this.dialogFormVisible = false
|
||||
} else {
|
||||
this.$message.error('用户名或密码不正确')
|
||||
}
|
||||
} else {
|
||||
this.$message.error('编辑失败')
|
||||
this.dialogFormVisible = false
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss">
|
||||
$bg:#2d3a4b;
|
||||
$dark_gray:#889aa4;
|
||||
$light_gray:#eee;
|
||||
|
||||
.login-container {
|
||||
position: fixed;
|
||||
height: 100%;
|
||||
width:100%;
|
||||
background-color: #192045;
|
||||
input:-webkit-autofill {
|
||||
-webkit-box-shadow: 0 0 0 1000px #293444 inset !important;
|
||||
-webkit-text-fill-color: #fff !important;
|
||||
}
|
||||
.login-img{
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: url("../../../static/login.png") no-repeat;
|
||||
}
|
||||
input {
|
||||
background: transparent;
|
||||
border: 0;
|
||||
-webkit-appearance: none;
|
||||
border-radius: 0;
|
||||
padding: 12px 5px 12px 15px;
|
||||
color: $light_gray;
|
||||
height: 47px;
|
||||
}
|
||||
.el-input {
|
||||
display: inline-block;
|
||||
height: 47px;
|
||||
width: 85%;
|
||||
}
|
||||
.svg-container {
|
||||
padding: 6px 5px 6px 15px;
|
||||
color: #f3b82d;
|
||||
font-size: 20px!important;
|
||||
vertical-align: middle;
|
||||
width: 30px;
|
||||
display: inline-block;
|
||||
&_login {
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
.title {
|
||||
font-size: 22px;
|
||||
line-height: 30px;
|
||||
color: #ffffff;
|
||||
margin: 0 auto 20px auto;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-family: 微软雅黑Regular&Bold;
|
||||
}
|
||||
.content{
|
||||
width: 330px;
|
||||
margin: 60px auto 0 auto;
|
||||
}
|
||||
.line{
|
||||
width: 70%;
|
||||
margin: 0 auto 25px auto;
|
||||
background-color: #ffffff;
|
||||
height: 1px;
|
||||
}
|
||||
.login-form {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
width: 400px;
|
||||
padding: 35px 35px 15px 35px;
|
||||
margin: 120px auto;
|
||||
}
|
||||
.tips {
|
||||
font-size: 14px;
|
||||
color: #fff;
|
||||
margin-bottom: 10px;
|
||||
span {
|
||||
&:first-of-type {
|
||||
margin-right: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.el-input__inner{
|
||||
border: none!important;
|
||||
font-size: 18px!important;
|
||||
color: #29335b!important;
|
||||
}
|
||||
.el-form-item {
|
||||
border: 1px solid #f3b82d;
|
||||
background: #ffffff;
|
||||
border-radius: 5px;
|
||||
color: #454545;
|
||||
}
|
||||
/*登录button*/
|
||||
.signIn{
|
||||
width: 100%;
|
||||
border: none;
|
||||
margin-top: 20px;
|
||||
border-radius: 5px;
|
||||
font-size: 18px;
|
||||
color:#29335b;
|
||||
background: -webkit-linear-gradient(left, #f5c44f , #9fd2ab); /* Safari 5.1 - 6.0 */
|
||||
background: -o-linear-gradient(right, #f5c44f, #9fd2ab); /* Opera 11.1 - 12.0 */
|
||||
background: -moz-linear-gradient(right, #f5c44f, #9fd2ab); /* Firefox 3.6 - 15 */
|
||||
background: linear-gradient(to right, #f5c44f , #9fd2ab); /* 标准的语法(必须放在最后) */
|
||||
}
|
||||
.remeberPassword{
|
||||
color: $dark_gray;
|
||||
}
|
||||
.show-pwd {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 7px;
|
||||
font-size: 16px;
|
||||
color: $dark_gray;
|
||||
cursor: pointer;
|
||||
user-select:none;
|
||||
}
|
||||
@media (min-width: 1024px) {
|
||||
/*根据屏幕大小确定显示的位置*/
|
||||
.login-form{
|
||||
position: absolute;
|
||||
left: 40%;
|
||||
top: 0;
|
||||
width: 600px;
|
||||
}
|
||||
.title{
|
||||
font-size: 32px!important;
|
||||
line-height: 32px;
|
||||
}
|
||||
.el-form-item{
|
||||
width: 400px;
|
||||
height: 48px;
|
||||
}
|
||||
.content{
|
||||
width: 400px;
|
||||
}
|
||||
}
|
||||
@media (min-width: 1281px) {
|
||||
.login-form{
|
||||
position: absolute;
|
||||
left: 30%;
|
||||
top: 6%;
|
||||
width: 600px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.remeberPassword .el-checkbox__inner:hover{
|
||||
border: 1px solid #f3b82d;
|
||||
}
|
||||
.remeberPassword .el-checkbox__input.is-checked .el-checkbox__inner{
|
||||
background-color: #f3b82d;
|
||||
border-color: #f3b82d;
|
||||
}
|
||||
.remeberPassword .el-checkbox__input.is-checked+.el-checkbox__label{
|
||||
color: #fff;
|
||||
}
|
||||
.remeberPassword .el-checkbox__input.is-focus .el-checkbox__inner{
|
||||
border-color: #f3b82d;
|
||||
}
|
||||
.login-container input:-webkit-autofill{
|
||||
-webkit-box-shadow:0 0 0 1000px #fff inset !important;
|
||||
-webkit-text-fill-color: #29335b !important;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user