This commit is contained in:
liushuai
2019-09-12 10:14:37 +08:00
parent afcda77786
commit 53a9f57fe1
11 changed files with 1571 additions and 240 deletions

View File

@@ -1,5 +1,26 @@
import request from '@/utils/request'
// 查询询价单号
export function getBillNum(num) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_创建询价单单号_查询数据'
}
})
}
export function getGongyings(num) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_创建询价单单号_查询数据'
}
})
}
// 查询全部未询价的标准件和外购件
export function getExport1(num) {
return request({
@@ -130,7 +151,7 @@ export function searchSheetDetail(num2) {
})
}
// 创建询价单
export function createInquirySheet(num1, num2, remark, id) {
export function createInquirySheet(num1, id, num2, remark) {
return request({
url: '',
method: 'post',

View File

@@ -340,6 +340,7 @@
<script>
import { getEntryNameValue, getToolNum, getNum, getTable, production, getTable1, revisionBatch, editList, dele, production2, edit } from '@/api/ManufacturingCenter/InitialProduction'
import { mapGetters } from 'vuex'
import Cookie from 'js-cookie'
export default {
data() {
@@ -436,8 +437,19 @@ export default {
'id'
])
},
watch: {
// 如果路由有变化,会再次执行该方法
'$route': {
handler(route) {
const _this = this
if (route.name === 'InitialProduction') {
_this.typeChange()
}
}
}
},
created() {
this.typeChange()
// this.typeChange()
this.getCurrentTime()
this.getNowTime()
},
@@ -508,6 +520,28 @@ export default {
})
},
typeChange() {
if (Cookie.get('machineValue') !== undefined) {
this.toolNumValue = ''
this.NumValue = ''
this.Num = []
getToolNum().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.toolNum.push({
label: response.data[i].机床图号,
value: response.data[i].机床流水号,
value2: response.data[i].项目名称
})
}
}).then(() => {
this.toolNumValue = parseInt(Cookie.get('machineValue'))
this.typeChange1()
this.NumValue = parseInt(Cookie.get('group'))
this.getTable()
Cookie.remove('machineValue')
Cookie.remove('group')
})
} else {
this.toolNumValue = ''
this.NumValue = ''
this.Num = []
getToolNum().then(response => {
@@ -519,6 +553,7 @@ export default {
})
}
})
}
},
typeChange1() {
this.NumValue = ''

View File

@@ -1,6 +1,25 @@
<template>
<div>
<el-card>
<span>机床号:</span>
<el-select v-model="Machine" filterable clearable size="small" style="margin-top:10px;width: 220px" placeholder="机床号" @change="getGroup()">
<el-option
v-for="item in Machines"
:key="item.value"
:label="item.label"
:value="item.value">
<div style="float: left">{{ item.label }}</div>
<div style="float: right; color: #8492a6; font-size: 13px">{{ item.value2 }}</div>
</el-option>
</el-select>
<span>组号:</span>
<el-select v-model="Group" size="small" clearable placeholder="组号" style="margin-top:10px;width: 180px;">
<el-option
v-for="item in Groups"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<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="pageSize=10; pageCurrent=1;searchTable()">查询</el-button>
@@ -91,11 +110,17 @@
</template>
<script>
import { searchtable, searchtable2, searchtable3, change2, change3, edit } from '@/api/ManufacturingCenter/MaterialArrivalManagement'
import { getMachines, getGroups, searchtable, searchtable2, searchtable3, change2, change3, edit } from '@/api/ManufacturingCenter/MaterialArrivalManagement'
import { mapGetters } from 'vuex'
import Cookie from 'js-cookie'
export default {
data() {
return {
Machine: '',
Machines: [],
Group: '',
Groups: [],
arrest2: [],
editTime: '',
bianliang1: [],
@@ -127,10 +152,21 @@ export default {
'userId'
])
},
created() {
this.searchTable()
this.searchTable2()
watch: {
// 如果路由有变化,会再次执行该方法
'$route': {
handler(route) {
const _this = this
if (route.name === 'MaterialArrivalManagement') {
_this.getMachine()
}
}
}
},
// created() {
// this.searchTable()
// this.searchTable2()
// },
methods: {
handleSelectionChange2(val) {
this.arrest2 = val
@@ -150,17 +186,67 @@ export default {
})
}
},
getMachine() {
if (Cookie.get('machineValue') !== undefined) {
this.Machine = ''
this.Machines = []
this.Group = ''
this.Groups = []
getMachines().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Machines.push({
label: response.data[i].机床图号,
value: response.data[i].机床流水号,
value2: response.data[i].项目名称
})
}
}).then(() => {
this.Machine = parseInt(Cookie.get('machineValue'))
this.getGroup()
this.Group = parseInt(Cookie.get('group'))
this.searchTable()
Cookie.remove('machineValue')
Cookie.remove('group')
this.searchTable2()
})
} else {
this.Machine = ''
this.Machines = []
this.Group = ''
this.Groups = []
getMachines().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Machines.push({
label: response.data[i].机床图号,
value: response.data[i].机床流水号,
value2: response.data[i].项目名称
})
}
})
this.searchTable()
}
},
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].组件流水号
})
}
})
},
// 查询表格数据
searchTable() {
this.loading = true
this.tableData = []
this.Data = []
if (this.partName !== '' && this.partName !== null) {
this.partNamecheck = true
} else {
this.partNamecheck = false
}
searchtable(this.partNamecheck, this.partName, 0, this.pageCurrent, this.pageSize).then(response => {
if (this.Machine) { this.Machinecheck = true } else { this.Machinecheck = false }
if (this.Group) { this.Groupcheck = true } else { this.Groupcheck = false }
if (this.partName) { this.partNamecheck = true } else { this.partNamecheck = false }
searchtable(this.Machinecheck, this.Machine, this.Groupcheck, this.Group, this.partNamecheck, this.partName, 0, this.pageCurrent, this.pageSize).then(response => {
if (response.data.total === 0) {
this.loading = false
} else {

View File

@@ -12,147 +12,150 @@
placeholder="请输入内容"
@clear="clearMachine"
@select="handleSelect"/>
<!--<el-button type="success" icon="el-icon-search" size="mini" style="margin-left: 15px" @click="searchColor">查询</el-button>-->
<el-tag style="margin-left: 10px; color: black" type="info">未开始</el-tag>
<el-tag style="background: orange; color: black">进行中</el-tag>
<el-tag style="background: lightgreen; color: black">已完成</el-tag>
<el-tag style="background: red; color: black">已拖期</el-tag>
</el-card>
<el-card>
<div class="main">
<div class="process">
<div :class="color[22]" class="module" style="position: relative;left: 1770px;top:220px; width: 80px;height: 48px;">
<div :class="[isActive ? color[22] : 'white']" class="module" style="position: relative;left: 1770px;top:220px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">角色装配部<br>根据营销部门发出发货请求<br>装配部进行发货</div>
<el-button :disabled="disabled" type="text" @click="searchDiv23">发货</el-button>
<el-button :disabled="disabled" type="text" style="color: black" @click="searchDiv23">发货<br>{{ `${data[0].发货百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="color[21]" class="module" style="position: relative;left: 1580px;top:220px; width: 80px;height: 48px;">
<div :class="[isActive ? color[21] : 'white']" class="module" style="position: relative;left: 1580px;top:220px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">角色质检部<br>对机床进行总装调试</div>
<el-button :disabled="disabled" type="text" @click="searchDiv22">总装调试</el-button>
<el-button :disabled="disabled" type="text" style="color: black" @click="searchDiv22">总装调试<br>{{ `${data[0].总装调试百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="color[20]" class="module" style="position: relative;left: 1390px;top:220px; width: 80px;height: 48px;">
<div :class="[isActive ? color[20] : 'white']" class="module" style="position: relative;left: 1390px;top:220px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">角色质检部<br>对机床重要部件进行检测</div>
<el-button :disabled="disabled" type="text" @click="searchDiv21">装配质检</el-button>
<el-button :disabled="disabled" type="text" style="color: black" @click="searchDiv21">装配质检<br>{{ `${data[0].装配质检百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="color[19]" class="module" style="position: relative;left: 1185px;top:105px; width: 80px;height: 48px;">
<div :class="[isActive ? color[19] : 'white']" class="module" style="position: relative;left: 1185px;top:105px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">角色电气部<br>电气部长制定装配计划<br>并记录计划执行情况</div>
<el-button :disabled="disabled" type="text" @click="searchDiv6">电气装配</el-button>
<el-button :disabled="disabled" type="text" style="color: black" @click="searchDiv6">电气装配<br>{{ `${data[0].电气装配百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="color[18]" class="module" style="position: relative;left: 1100px;top:176px; width: 80px;height: 48px;">
<div :class="[isActive ? color[18] : 'white']" class="module" style="position: relative;left: 1100px;top:176px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">角色装配部长<br>装配部长制定装配计划<br>并记录计划执行情况</div>
<el-button :disabled="disabled" type="text" @click="searchDiv5">机械装配</el-button>
<div slot="content"><br>角色装配部长<br>装配部长制定装配计划<br>并记录计划执行情况</div>
<el-button :disabled="disabled" type="text" style="color: black" @click="searchDiv5">机械装配<br>{{ `${data[0].机械装配百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="color[17]" class="module" style="position: relative;left: 1015px;top:247px; width: 80px;height: 48px;">
<div :class="[isActive ? color[17] : 'white']" class="module" style="position: relative;left: 1015px;top:247px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">角色冷作车间主任<br>冷作车间主任制定冷作计划<br>并记录计划执行情况</div>
<el-button :disabled="disabled" type="text" @click="searchDiv7">冷作</el-button>
<el-button :disabled="disabled" type="text" style="color: black" @click="searchDiv7">冷作<br>{{ `${data[0].冷作百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="color[16]" class="module" style="position: relative;left: 930px;top:319px; width: 80px;height: 48px;">
<div :class="[isActive ? color[16] : 'white']" class="module" style="position: relative;left: 930px;top:319px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">角色油漆车间主任<br>油漆车间主任制定装配计划<br>并记录计划执行情况</div>
<el-button :disabled="disabled" type="text" @click="searchDiv8">油漆</el-button>
<el-button :disabled="disabled" type="text" style="color: black" @click="searchDiv8">油漆<br>{{ `${data[0].油漆百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="color[15]" class="module" style="position: relative;left: 695px;top:220px; width: 80px;height: 48px;">
<div :class="[isActive ? color[15] : 'white']" class="module" style="position: relative;left: 695px;top:220px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">角色装配部长<br>此模块用于查询某机床是否达到装配条件<br>即采购件与自制件是否成组配套</div>
<el-button :disabled="disabled" type="text" @click="searchDiv9">成组配套</el-button>
<el-button :disabled="disabled" type="text" style="color: black" @click="searchDiv9">成组配套<br>{{ `${data[0].成组配套百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="color[14]" class="module" style="position: relative;left: 455px;top:55px; width: 80px;height: 48px;">
<div :class="[isActive ? color[14] : 'white']" class="module" style="position: relative;left: 455px;top:55px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">角色质检部<br>对自制件进行检测</div>
<el-button :disabled="disabled" type="text" @click="searchDiv12">自制质检</el-button>
<el-button :disabled="disabled" type="text" style="color: black" @click="searchDiv12">自制质检<br>{{ `${data[0].自制质检百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="color[13]" class="module" style="position: relative;left: 373px;top:283px; width: 80px;height: 48px;">
<div :class="[isActive ? color[13] : 'white']" class="module" style="position: relative;left: 373px;top:283px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">角色质检部<br>对采购件进行检测</div>
<el-button :disabled="disabled" type="text" @click="searchDiv19">采购质检</el-button>
<el-button :disabled="disabled" type="text" style="color: black" @click="searchDiv19">采购质检<br>{{ `${data[0].采购质检百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="color[12]" class="module" style="position: relative;left: 160px;top:110px; width: 80px;height: 48px;">
<div :class="[isActive ? color[12] : 'white']" class="module" style="position: relative;left: 160px;top:110px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">角色金工车间<br>接收加工任务并使用<br>MES工作站进行报工</div>
<el-button :disabled="disabled" type="text" @click="searchDiv10">车间加工</el-button>
<el-button :disabled="disabled" type="text" style="color: black" @click="searchDiv10">车间加工<br>{{ `${data[0].车间加工百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="color[11]" class="module" style="position: relative;left: -25px;top:-1px; width: 80px;height: 48px;">
<div :class="[isActive ? color[11] : 'white']" class="module" style="position: relative;left: -25px;top:-1px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">角色外协员<br>进行外协加工</div>
<el-button :disabled="disabled" type="text" @click="searchDiv18">工序外协</el-button>
<el-button :disabled="disabled" type="text" style="color: black" @click="searchDiv18">工序外协<br>{{ `${data[0].工序外协百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="color[10]" class="module" style="position: relative;left: -230px;top:54px; width: 80px;height: 48px;">
<div :class="[isActive ? color[10] : 'white']" class="module" style="position: relative;left: -230px;top:54px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">角色计划员<br>针对做完工艺定额的零件进行排查</div>
<el-button :disabled="disabled" type="text" @click="searchDiv15">能力平衡</el-button>
<el-button :disabled="disabled" type="text" style="color: black" @click="searchDiv15">能力平衡<br>{{ `${data[0].能力平衡百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="color[9]" class="module" style="position: relative;left: -415px;top:54px; width: 80px;height: 48px;">
<div :class="[isActive ? color[9] : 'white']" class="module" style="position: relative;left: -415px;top:54px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">角色工艺部<br>制定零件定额</div>
<el-button :disabled="disabled" type="text" @click="searchDiv14">定额</el-button>
<el-button :disabled="disabled" type="text" style="color: black" @click="searchDiv14">定额<br>{{ `${data[0].定额百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="color[8]" class="module" style="position: relative;left: -597px;top:54px; width: 80px;height: 48px;">
<div :class="[isActive ? color[8] : 'white']" class="module" style="position: relative;left: -597px;top:54px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">角色工艺部<br>制定零件工艺</div>
<el-button :disabled="disabled" type="text" @click="searchDiv13">工艺</el-button>
<el-button :disabled="disabled" type="text" style="color: black" @click="searchDiv13">工艺<br>{{ `${data[0].工艺百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="color[7]" class="module" style="position: relative;left: -805px;top:1px; width: 80px;height: 48px;">
<div :class="[isActive ? color[7] : 'white']" class="module" style="position: relative;left: -805px;top:1px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">角色下料员<br>对于钢板等自家备料<br>下料员需要在系统确认备料<br>并通知金工领料</div>
<el-button :disabled="disabled" type="text" @click="searchDiv11">自家备料</el-button>
<el-button :disabled="disabled" type="text" style="color: black" @click="searchDiv11">自家备料<br>{{ `${data[0].自家备料百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="color[0]" class="module" style="position: relative;left: -1350px;top:222px; width: 80px;height: 48px;">
<div :class="[isActive ? color[0] : 'white']" class="module" style="position: relative;left: -1350px;top:222px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">角色营销内勤<br>负责创建项目及机床的基础信息<br>此部分作为系统数据的源头</div>
<el-button :disabled="disabled" type="text" @click="searchDiv1">签订合同</el-button>
<el-button :disabled="disabled" type="text" style="color: black" @click="searchDiv1">签订合同<br>{{ `${data[0].签订合同百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="color[1]" class="module" style="position: relative;left: -1336px;top:222px; width: 80px;height: 48px;">
<div :class="[isActive ? color[1] : 'white']" class="module" style="position: relative;left: -1336px;top:222px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">角色技术员<br>负责导入三表(零件)<br>组件在项目启动会时提出<br>由制造总监导入</div>
<el-button :disabled="disabled" type="text" @click="searchDiv2">产品设计</el-button>
<el-button :disabled="disabled" type="text" style="color: black" @click="searchDiv2">产品设计<br>{{ `${data[0].产品设计百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="color[6]" class="module" style="position: relative;left: -1057px;top:110px; width: 80px;height: 48px;">
<div :class="[isActive ? color[6] : 'white']" class="module" style="position: relative;left: -1057px;top:110px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">角色下料员<br>外购物料到货后由下料员确认备料<br>并通知金工领料</div>
<el-button :disabled="disabled" type="text" @click="searchDiv20">外购备料</el-button>
<el-button :disabled="disabled" type="text" style="color: black" @click="searchDiv20">外购备料<br>{{ `${data[0].外购备料百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="color[2]" class="module" style="position: relative;left: -1405px;top:222px; width: 80px;height: 48px;">
<div :class="[isActive ? color[2] : 'white']" class="module" style="position: relative;left: -1405px;top:222px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">角色计划员<br>计划员负责将三表中的零件按实际情况分配为<br>自制件采购部采购件制造部采购件三类</div>
<el-button :disabled="disabled" type="text" @click="searchDiv3">零件分配</el-button>
<el-button :disabled="disabled" type="text" style="color: black" @click="searchDiv3">零件分配<br>{{ `${data[0].零件分配百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="color[3]" class="module" style="position: relative;left: -1350px;top:63px; width: 80px;height: 48px;">
<div :class="[isActive ? color[3] : 'white']" class="module" style="position: relative;left: -1350px;top:63px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">角色计划员<br>计划员分配零件后<br>在生产计划下达模块<br>可查看到自家加工的零件任务<br>计划员需要将这些零件投产</div>
<el-button :disabled="disabled" type="text" @click="searchDiv4">自制件</el-button>
<el-button :disabled="disabled" type="text" style="color: black" @click="searchDiv4">自制件<br>{{ `${data[0].自制件百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="color[5]" class="module" style="position: relative;left: -1435px;top:223px; width: 80px;height: 48px;">
<div :class="[isActive ? color[5] : 'white']" class="module" style="position: relative;left: -1435px;top:223px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">角色制造部长<br>计划员分配零件后<br>将分配到制造部的采购件进行采购</div>
<el-button :disabled="disabled" type="text" @click="searchDiv17">车间采购</el-button>
<el-button :disabled="disabled" type="text" style="color: black;line-height: 19px" @click="searchDiv17">车间采购<br>{{ `${data[0].车间采购百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="color[4]" class="module" style="position: relative;left: -548px;top:300px; width: 80px;height: 48px;">
<div :class="[isActive ? color[4] : 'white']" class="module" style="position: relative;left: -548px;top:300px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">角色采购部<br>计划员分配零件后<br>将分配到采购部的采购件进行采购</div>
<el-button :disabled="disabled" type="text" @click="searchDiv16">采购部采购</el-button>
<el-button :disabled="disabled" type="text" style="color: black" @click="searchDiv16">采购部采购<br>{{ `${data[0].采购部采购百分比}%` }}</el-button>
</el-tooltip>
</div>
</div>
@@ -218,9 +221,9 @@
{{ dataDiv1.付款方式 }}
</div>
<div style="margin-top: 17px">
<sapn>回款进度</sapn>
<span>回款进度</span>
<div style="width: 200px;display: inline-block">
<el-progress :text-inside="true" :stroke-width="15" :percentage="dataDiv1.付款百分比"/>
<el-progress :text-inside="true" :stroke-width="15" :percentage="parseInt(dataDiv1.付款百分比)"/>
</div>
</div>
</div>
@@ -242,7 +245,7 @@
{{ dataDiv1.电话 }}
</div>
<div style="margin-top: 17px">
<sapn>客户评级</sapn>
<span>客户评级</span>
<el-rate
:max="maxDiv1"
v-model="valueDiv1"
@@ -351,7 +354,8 @@
style="width: 100%;min-height: 300px;"
size="mini"
highlight-current-row
border>
border
@row-click="turnToPartAs">
<el-table-column
label="序号"
align="center"
@@ -366,7 +370,7 @@
</el-table-column>
<el-table-column align="center" label="分配进度">
<template slot-scope="scope">
<el-progress :text-inside="true" :stroke-width="15" :percentage="percent(scope.row)"/>
<el-progress :text-inside="true" :stroke-width="15" :percentage="parseInt(percent(scope.row))"/>
</template>
</el-table-column>
<el-table-column align="center" label="组号">
@@ -426,7 +430,8 @@
style="width: 100%;min-height: 300px;"
size="mini"
highlight-current-row
border>
border
@row-click="turnIniPro">
<el-table-column
label="序号"
align="center"
@@ -898,7 +903,8 @@
style="width: 100%"
size="mini"
highlight-current-row
border>
border
@row-click="turnToProStatus">
<el-table-column
label="序号"
align="center"
@@ -963,7 +969,8 @@
style="width: 100%"
size="mini"
highlight-current-row
border>
border
@row-click="turnMaterArrMan">
<el-table-column
label="序号"
align="center"
@@ -1185,7 +1192,8 @@
style="width: 100%"
size="mini"
highlight-current-row
border>
border
@row-click="turnToPCB">
<el-table-column
label="序号"
align="center"
@@ -1831,6 +1839,7 @@
import { SelectMachine, ProcessOutsourcing, ProcessProportion } from '@/api/ManufacturingCenter/ParseQuery'
import request from '@/utils/request'
import echarts from 'echarts'
import Cookie from 'js-cookie'
export default {
data() {
return {
@@ -1915,6 +1924,32 @@ export default {
项目流水号: '无数据',
付款百分比: 0
},
data: [{
签订合同百分比: 0,
产品设计百分比: 0,
零件分配百分比: 0,
自制件百分比: 0,
车间采购百分比: 0,
采购部采购百分比: 0,
自家备料百分比: 0,
外购备料百分比: 0,
工艺百分比: 0,
定额百分比: 0,
能力平衡百分比: 0,
工序外协百分比: 0,
车间加工百分比: 0,
自制质检百分比: 0,
采购质检百分比: 0,
成组配套百分比: 0,
电气装配百分比: 0,
机械装配百分比: 0,
冷作百分比: 0,
油漆百分比: 0,
装配质检百分比: 0,
总装调试百分比: 0,
发货百分比: 0
}],
isActive: false,
dataDiv2: {
组件总数: '',
整改组数: '',
@@ -1987,32 +2022,46 @@ export default {
}
}
},
created() {
this.color[0] = 'white'
this.color[1] = 'white'
this.color[2] = 'white'
this.color[3] = 'white'
this.color[4] = 'white'
this.color[5] = 'white'
this.color[6] = 'white'
this.color[7] = 'white'
this.color[8] = 'white'
this.color[9] = 'white'
this.color[10] = 'white'
this.color[11] = 'white'
this.color[12] = 'white'
this.color[13] = 'white'
this.color[14] = 'white'
this.color[15] = 'white'
this.color[16] = 'white'
this.color[17] = 'white'
this.color[18] = 'white'
this.color[19] = 'white'
this.color[20] = 'white'
this.color[21] = 'white'
this.color[22] = 'white'
},
created() {},
methods: {
// 跳转到零件分配
turnToPartAs(row) {
if (row.总未分配个数 > 0 && row.总个数 > 0) {
Cookie.set('machineValue', this.machineValue)
Cookie.set('group', row.组件流水号)
this.$router.push('/ManufacturingCenter/PartAssignment')
}
},
// 跳转到生产能力平衡
turnToPCB(row) {
if (row.完成状态 !== '已完成') {
this.$router.push('/ManufacturingCenter/ProductionCapacityBalance')
}
},
// 跳转到加工进度查询
turnToProStatus(row) {
if (!row.实际完成时间) {
Cookie.set('machineValue', this.machineValue)
Cookie.set('group', row.组件流水号)
this.$router.push('/ManufacturingCenter/ProcessingStatus')
}
},
// 跳转到生产计划下达
turnIniPro(row) {
if ((parseInt(row.自家加工件总条数) - parseInt(row.已传递条数)) > 0 && parseInt(row.自家加工件总条数) !== 0) {
Cookie.set('machineValue', this.machineValue)
Cookie.set('group', row.组件流水号)
this.$router.push('/ManufacturingCenter/InitialProduction')
}
},
// 跳转到备料完成
turnMaterArrMan(row) {
if (row.状态 !== '完成') {
Cookie.set('machineValue', this.machineValue)
Cookie.set('group', row.组件流水号)
this.$router.push('/ManufacturingCenter/MaterialArrivalManagement')
}
},
changeScroll1() {
const div1 = document.getElementById('div1')
const div2 = document.getElementById('div2')
@@ -2071,6 +2120,30 @@ export default {
this.showDiv20 = false
this.showDiv21 = false
this.showDiv22 = false
this.isActive = false
this.data[0].签订合同百分比 = 0
this.data[0].产品设计百分比 = 0
this.data[0].零件分配百分比 = 0
this.data[0].自制件百分比 = 0
this.data[0].车间采购百分比 = 0
this.data[0].采购部采购百分比 = 0
this.data[0].自家备料百分比 = 0
this.data[0].外购备料百分比 = 0
this.data[0].工艺百分比 = 0
this.data[0].定额百分比 = 0
this.data[0].能力平衡百分比 = 0
this.data[0].工序外协百分比 = 0
this.data[0].车间加工百分比 = 0
this.data[0].自制质检百分比 = 0
this.data[0].采购质检百分比 = 0
this.data[0].成组配套百分比 = 0
this.data[0].电气装配百分比 = 0
this.data[0].机械装配百分比 = 0
this.data[0].冷作百分比 = 0
this.data[0].油漆百分比 = 0
this.data[0].装配质检百分比 = 0
this.data[0].总装调试百分比 = 0
this.data[0].发货百分比 = 0
},
// 机床名称查询函数
querySearch(queryString, cb) {
@@ -2103,9 +2176,8 @@ export default {
}
},
// 选择机床名称后的赋值函数
handleSelect(item) {
async handleSelect(item) {
// 在此方法中可以把下拉框选中值中的内容赋值给其他变量使用
console.log(item)
this.machineValue = item.num
this.machineValue ? this.disabled = false : this.disabled = true
this.showDiv1 = false
@@ -2130,6 +2202,40 @@ export default {
this.showDiv19 = false
this.showDiv20 = false
this.showDiv0 = true
await request({
url: '',
method: 'post',
data: {
type: '3',
name: `select * from 综合查询_状态 where 机床流水号 = ${this.machineValue}`
}
}).then(res => {
this.isActive = true
this.data = res.data
if (res.data[0].签订合同状态 === 1) { this.color[0] = 'white' } else if (res.data[0].签订合同状态 === 2) { this.color[0] = 'yellow' } else if (res.data[0].签订合同状态 === 3) { this.color[0] = 'green' } else if (res.data[0].签订合同状态 === 4) { this.color[0] = 'red' }
if (res.data[0].产品设计状态 === 1) { this.color[1] = 'white' } else if (res.data[0].产品设计状态 === 2) { this.color[1] = 'yellow' } else if (res.data[0].产品设计状态 === 3) { this.color[1] = 'green' } else if (res.data[0].产品设计状态 === 4) { this.color[1] = 'red' }
if (res.data[0].零件分配状态 === 1) { this.color[2] = 'white' } else if (res.data[0].零件分配状态 === 2) { this.color[2] = 'yellow' } else if (res.data[0].零件分配状态 === 3) { this.color[2] = 'green' } else if (res.data[0].零件分配状态 === 4) { this.color[2] = 'red' }
if (res.data[0].自制件状态 === 1) { this.color[3] = 'white' } else if (res.data[0].自制件状态 === 2) { this.color[3] = 'yellow' } else if (res.data[0].自制件状态 === 3) { this.color[3] = 'green' } else if (res.data[0].自制件状态 === 4) { this.color[3] = 'red' }
if (res.data[0].采购部采购状态 === 1) { this.color[4] = 'white' } else if (res.data[0].采购部采购状态 === 2) { this.color[4] = 'yellow' } else if (res.data[0].采购部采购状态 === 3) { this.color[4] = 'green' } else if (res.data[0].采购部采购状态 === 4) { this.color[4] = 'red' }
if (res.data[0].车间采购状态 === 1) { this.color[5] = 'white' } else if (res.data[0].车间采购状态 === 2) { this.color[5] = 'yellow' } else if (res.data[0].车间采购状态 === 3) { this.color[5] = 'green' } else if (res.data[0].车间采购状态 === 4) { this.color[5] = 'red' }
if (res.data[0].外购备料状态 === 1) { this.color[6] = 'white' } else if (res.data[0].外购备料状态 === 2) { this.color[6] = 'yellow' } else if (res.data[0].外购备料状态 === 3) { this.color[6] = 'green' } else if (res.data[0].外购备料状态 === 4) { this.color[6] = 'red' }
if (res.data[0].自家备料状态 === 1) { this.color[7] = 'white' } else if (res.data[0].自家备料状态 === 2) { this.color[7] = 'yellow' } else if (res.data[0].自家备料状态 === 3) { this.color[7] = 'green' } else if (res.data[0].自家备料状态 === 4) { this.color[7] = 'red' }
if (res.data[0].工艺状态 === 1) { this.color[8] = 'white' } else if (res.data[0].工艺状态 === 2) { this.color[8] = 'yellow' } else if (res.data[0].工艺状态 === 3) { this.color[8] = 'green' } else if (res.data[0].工艺状态 === 4) { this.color[8] = 'red' }
if (res.data[0].定额状态 === 1) { this.color[9] = 'white' } else if (res.data[0].定额状态 === 2) { this.color[9] = 'yellow' } else if (res.data[0].定额状态 === 3) { this.color[9] = 'green' } else if (res.data[0].定额状态 === 4) { this.color[9] = 'red' }
if (res.data[0].能力平衡状态 === 1) { this.color[10] = 'white' } else if (res.data[0].能力平衡状态 === 2) { this.color[10] = 'yellow' } else if (res.data[0].能力平衡状态 === 3) { this.color[10] = 'green' } else if (res.data[0].能力平衡状态 === 4) { this.color[10] = 'red' }
if (res.data[0].工序外协状态 === 1) { this.color[11] = 'white' } else if (res.data[0].工序外协状态 === 2) { this.color[11] = 'yellow' } else if (res.data[0].工序外协状态 === 3) { this.color[11] = 'green' } else if (res.data[0].工序外协状态 === 4) { this.color[11] = 'red' }
if (res.data[0].车间加工状态 === 1) { this.color[12] = 'white' } else if (res.data[0].车间加工状态 === 2) { this.color[12] = 'yellow' } else if (res.data[0].车间加工状态 === 3) { this.color[12] = 'green' } else if (res.data[0].车间加工状态 === 4) { this.color[12] = 'red' }
if (res.data[0].采购质检状态 === 1) { this.color[13] = 'white' } else if (res.data[0].采购质检状态 === 2) { this.color[13] = 'yellow' } else if (res.data[0].采购质检状态 === 3) { this.color[13] = 'green' } else if (res.data[0].采购质检状态 === 4) { this.color[13] = 'red' }
if (res.data[0].自制质检状态 === 1) { this.color[14] = 'white' } else if (res.data[0].自制质检状态 === 2) { this.color[14] = 'yellow' } else if (res.data[0].自制质检状态 === 3) { this.color[14] = 'green' } else if (res.data[0].自制质检状态 === 4) { this.color[14] = 'red' }
if (res.data[0].成组配套状态 === 1) { this.color[15] = 'white' } else if (res.data[0].成组配套状态 === 2) { this.color[15] = 'yellow' } else if (res.data[0].成组配套状态 === 3) { this.color[15] = 'green' } else if (res.data[0].成组配套状态 === 4) { this.color[15] = 'red' }
if (res.data[0].油漆状态 === 1) { this.color[16] = 'white' } else if (res.data[0].油漆状态 === 2) { this.color[16] = 'yellow' } else if (res.data[0].油漆状态 === 3) { this.color[16] = 'green' } else if (res.data[0].油漆状态 === 4) { this.color[16] = 'red' }
if (res.data[0].冷作状态 === 1) { this.color[17] = 'white' } else if (res.data[0].冷作状态 === 2) { this.color[17] = 'yellow' } else if (res.data[0].冷作状态 === 3) { this.color[17] = 'green' } else if (res.data[0].冷作状态 === 4) { this.color[17] = 'red' }
if (res.data[0].机械装配状态 === 1) { this.color[18] = 'white' } else if (res.data[0].机械装配状态 === 2) { this.color[18] = 'yellow' } else if (res.data[0].机械装配状态 === 3) { this.color[18] = 'green' } else if (res.data[0].机械装配状态 === 4) { this.color[18] = 'red' }
if (res.data[0].电气装配状态 === 1) { this.color[19] = 'white' } else if (res.data[0].电气装配状态 === 2) { this.color[19] = 'yellow' } else if (res.data[0].电气装配状态 === 3) { this.color[19] = 'green' } else if (res.data[0].电气装配状态 === 4) { this.color[19] = 'red' }
if (res.data[0].装配质检状态 === 1) { this.color[20] = 'white' } else if (res.data[0].装配质检状态 === 2) { this.color[20] = 'yellow' } else if (res.data[0].装配质检状态 === 3) { this.color[20] = 'green' } else if (res.data[0].装配质检状态 === 4) { this.color[20] = 'red' }
if (res.data[0].总装调试状态 === 1) { this.color[21] = 'white' } else if (res.data[0].总装调试状态 === 2) { this.color[21] = 'yellow' } else if (res.data[0].总装调试状态 === 3) { this.color[21] = 'green' } else if (res.data[0].总装调试状态 === 4) { this.color[21] = 'red' }
if (res.data[0].发货状态 === 1) { this.color[22] = 'white' } else if (res.data[0].发货状态 === 2) { this.color[22] = 'yellow' } else if (res.data[0].发货状态 === 3) { this.color[22] = 'green' } else if (res.data[0].发货状态 === 4) { this.color[22] = 'red' }
})
},
// 查询签订合同div数据
async searchDiv1() {
@@ -2792,7 +2898,6 @@ export default {
order by 组号`
}
}).then(res => {
console.log(res, 8766)
this.tableDataDiv7 = res.data
this.dataDiv7.length = res.data.length
request({
@@ -3084,7 +3189,6 @@ export default {
group by a.[组号],a.组件名称`
}
}).then(res => {
console.log(res, 98765)
this.tableDataDiv9C = res.data
})
})
@@ -3228,9 +3332,8 @@ export default {
await request({
url: '',
method: 'post',
data: {
type: '3',
name: `declare @机床流水号 int = ${this.machineValue}
/* 原
declare @机床流水号 int = 89
select *,(case when 100 * 已备料条数/零件条数 = 100 then '' else '——' end) as 完成时间 from (
select case when 已备料条数 = 零件条数 then '完成' else '未完成' end as 状态
,所有.*,已备料条数
@@ -3265,7 +3368,46 @@ export default {
inner join 车间生产管理工艺_备料出库记录 on 车间生产管理工艺_零件工艺计划.工艺计划流水号 = 车间生产管理工艺_备料出库记录.工艺计划流水号
group by PDM_组件名称.组号,PDM_组件名称.组件名称,PDM_机床名称.机床流水号,PDM_机床名称.机床图号,自制备料.备料到货) as 完成
on 所有.组号 = 完成.组号 and 所有.机床流水号 = 完成.机床流水号
) as 头`
) as 头
*/
data: {
type: '3',
name: `declare @机床流水号 int = ${this.machineValue}
select *,(case when 100 * 已备料条数/零件条数 = 100 then '' else '——' end) as 完成时间 from (
select case when 已备料条数 = 零件条数 then '完成' else '未完成' end as 状态
,所有.*,已备料条数
,100*已备料条数/零件条数 as 备料进度
from (
select PDM_组件名称.组号,PDM_组件名称.组件名称,PDM_组件名称.组件流水号,PDM_机床名称.机床流水号
,COUNT(*) as 零件条数
from (SELECT [工艺计划流水号],[零件图号], [零件名称], [备料打印] , [备料到货]
from [车间生产管理工艺_零件工艺计划_传递后_视图]
WHERE 考核状态 >= 3 and 考核状态 <8 and 工艺任务分配状态 =2 and 批次零件状态=1 and 备料打印 = 1 and 机床流水号 = @机床流水号
and 工艺计划流水号 in ( select 工艺计划流水号 from 车间生产管理工艺_零件工序 where 工艺编号 = 29 )) as 自制备料
inner join 车间生产管理工艺_零件工艺计划 on 自制备料.工艺计划流水号 = 车间生产管理工艺_零件工艺计划.工艺计划流水号
inner join MRP_计划订单_组件零件清单_基本件 on 车间生产管理工艺_零件工艺计划.组件零件基本件流水号 = MRP_计划订单_组件零件清单_基本件.组件零件基本件流水号
inner join MRP_计划订单_机床组件清单 on MRP_计划订单_机床组件清单.机床组件流水号 = MRP_计划订单_组件零件清单_基本件.机床组件流水号
inner join PDM_组件名称 on PDM_组件名称.组件流水号 = MRP_计划订单_机床组件清单.组件流水号
inner join PDM_机床名称 on PDM_组件名称.机床流水号 = PDM_机床名称.机床流水号
group by PDM_组件名称.组号,PDM_组件名称.组件名称,PDM_组件名称.组件流水号,PDM_机床名称.机床流水号,PDM_机床名称.机床图号
) as 所有
left join
(select 自制备料.备料到货
,PDM_组件名称.组号,PDM_组件名称.组件名称,PDM_组件名称.组件流水号,PDM_机床名称.机床流水号
,COUNT(*) as 已备料条数
from (SELECT [工艺计划流水号],[零件图号], [零件名称], [备料打印] , [备料到货]
from [车间生产管理工艺_零件工艺计划_传递后_视图]
WHERE 考核状态 >= 3 and 考核状态 <8 and 工艺任务分配状态 =2 and 批次零件状态=1 and 备料打印 = 1 and 备料到货 = 1 and 机床流水号 = @机床流水号
and 工艺计划流水号 in ( select 工艺计划流水号 from 车间生产管理工艺_零件工序 where 工艺编号 = 29 )) as 自制备料
inner join 车间生产管理工艺_零件工艺计划 on 自制备料.工艺计划流水号 = 车间生产管理工艺_零件工艺计划.工艺计划流水号
inner join MRP_计划订单_组件零件清单_基本件 on 车间生产管理工艺_零件工艺计划.组件零件基本件流水号 = MRP_计划订单_组件零件清单_基本件.组件零件基本件流水号
inner join MRP_计划订单_机床组件清单 on MRP_计划订单_机床组件清单.机床组件流水号 = MRP_计划订单_组件零件清单_基本件.机床组件流水号
inner join PDM_组件名称 on PDM_组件名称.组件流水号 = MRP_计划订单_机床组件清单.组件流水号
inner join PDM_机床名称 on PDM_组件名称.机床流水号 = PDM_机床名称.机床流水号
inner join 车间生产管理工艺_备料出库记录 on 车间生产管理工艺_零件工艺计划.工艺计划流水号 = 车间生产管理工艺_备料出库记录.工艺计划流水号
group by PDM_组件名称.组号,PDM_组件名称.组件名称,PDM_组件名称.组件流水号,PDM_机床名称.机床流水号,PDM_机床名称.机床图号,自制备料.备料到货) as 完成
on 所有.组号 = 完成.组号 and 所有.机床流水号 = 完成.机床流水号
) as 头 order by 组号`
}
}).then(res => {
this.tableDataDiv11 = res.data
@@ -3346,7 +3488,6 @@ export default {
group by 组号, 组件名称 order by 组号`
}
}).then(res => {
console.log(res)
this.tableDataDiv12 = res.data
})
},
@@ -3472,7 +3613,6 @@ export default {
group by 机床流水号,组号,组件名称 order by 组号`
}
}).then(res => {
console.log(res, 98765)
this.tableDataDiv16C = res.data
})
})
@@ -3995,7 +4135,6 @@ export default {
order by 组号`
}
}).then(res => {
console.log(res)
this.tableDataDiv14 = res.data
for (let i = 0; i < res.data.length; i++) {
this.dataDiv14.xData.push(res.data[i].组号)
@@ -4126,7 +4265,6 @@ export default {
drop table #临时表2`
}
}).then(res => {
console.log(res)
this.tableDataDiv15 = res.data
for (let i = 0; i < res.data.length; i++) {
this.dataDiv15.xData.push(res.data[i].组号)
@@ -4195,12 +4333,8 @@ export default {
name: `select * from dbo.发货管理_发货单 where 机床流水号 = ${this.machineValue} and 是否发出 = 1`
}
}).then(res => {
console.log(res)
this.tableDataDiv23 = res.data
})
},
aaa() {
console.log(this.dataDiv10.data, 89)
}
}
}
@@ -4225,9 +4359,12 @@ export default {
.showDiv{
height: 380px;
}
.el-button{
padding-top: 5px;
}
.module{
border-radius: 6px;
border: 3px solid black;
border: 1px solid black;
/*background-color: white;*/
display: inline-block;
}

View File

@@ -557,6 +557,7 @@
<script>
import { initProject, searchgroup, searchTable, searchPart, searchPart1, searchTable1, addData, editData, deleteData, searchDetailed, searchDetailed1, purchaseRequisition, purchaseRequisition1, purchaseRequisition2, MoveOut, MoveOut1, PurchasingDepartment, Production, PartCallbackInformation, PartCallbackInformation1, submit, submit1, Delete, Delete1, editStock, editNum } from '@/api/ManufacturingCenter/PartAssignment'
import { mapGetters } from 'vuex'
import Cookie from 'js-cookie'
export default {
inject: ['reload'],
data() {
@@ -646,11 +647,45 @@ export default {
'id'
])
},
watch: {
// 如果路由有变化,会再次执行该方法
'$route': {
handler(route) {
const _this = this
if (route.name === 'PartAssignment') {
_this.fetchData()
}
}
}
},
created() {
this.fetchData()
},
methods: {
fetchData() {
if (Cookie.get('machineValue') !== undefined) {
this.machineNumber = []
initProject().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.machineNumber.push({
label: response.data[i].机床图号,
name: response.data[i].项目名称,
value: response.data[i].机床流水号
})
}
}).then(() => {
this.machineNumberValue = parseInt(Cookie.get('machineValue'))
this.machineChange()
this.groupNumberValue = parseInt(Cookie.get('group'))
this.searchTable()
Cookie.remove('machineValue')
Cookie.remove('group')
})
} else {
this.machineNumberValue = ''
this.groupNumberValue = ''
this.tableData = []
this.machineNumber = []
initProject().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.machineNumber.push({
@@ -682,6 +717,7 @@ export default {
}
this.tableData10 = response.data
})
}
},
PartCallbackInformation() {
this.dialogFormVisible1 = true

View File

@@ -311,6 +311,7 @@
</template>
<script>
import { getNames, getMachines, getGroups, getTable, getTable2, getExport } from '@/api/ManufacturingCenter/ProcessingStatus'
import Cookie from 'js-cookie'
export default {
data() {
@@ -380,10 +381,20 @@ export default {
pageCurrent: 1
}
},
created() {
this.getMachine()
this.getTableData()
watch: {
// 如果路由有变化,会再次执行该方法
'$route': {
handler(route) {
const _this = this
if (route.name === 'ProcessingStatus') {
_this.getMachine()
}
}
}
},
// created() {
// this.getMachine()
// },
methods: {
formatJson(filterVal, jsonData) {
return jsonData.map(v => filterVal.map(j => {
@@ -412,7 +423,6 @@ export default {
})
})
},
// 查询供应商名称
fetchData() {
this.projects = []
getNames().then(response => {
@@ -426,6 +436,28 @@ export default {
this.part = 1
},
getMachine() {
if (Cookie.get('machineValue') !== undefined) {
this.Machine = ''
this.Machines = []
this.Group = ''
this.Groups = []
getMachines().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Machines.push({
label: response.data[i].机床图号,
value: response.data[i].机床流水号,
value2: response.data[i].项目名称
})
}
}).then(() => {
this.Machine = parseInt(Cookie.get('machineValue'))
this.getGroup()
this.Group = parseInt(Cookie.get('group'))
this.getTableData()
Cookie.remove('machineValue')
Cookie.remove('group')
})
} else {
this.Machine = ''
this.Machines = []
this.Group = ''
@@ -439,6 +471,8 @@ export default {
})
}
})
this.getTableData()
}
},
getGroup() {
this.Group = ''

View File

@@ -0,0 +1,644 @@
<template>
<div>
<el-card>
<span>请选择机床</span>
<el-autocomplete
v-model="searchCriteria"
:fetch-suggestions="querySearch"
clearable
style="width: 200px;margin-left: 10px"
size="small"
class="inline-input"
placeholder="请输入内容"
@clear="clearMachine"
@select="handleSelect"/>
<el-tag style="margin-left: 10px; color: black" type="info">未开始</el-tag>
<el-tag style="background: orange; color: black">进行中</el-tag>
<el-tag style="background: lightgreen; color: black">已完成</el-tag>
<el-tag style="background: red; color: black">已拖期</el-tag>
<!--<el-button type="success" icon="el-icon-search" size="mini" style="margin-left: 15px" @click="searchColor">查询</el-button>-->
</el-card>
<el-card>
<div class="main">
<div class="process">
<div :class="[isActive ? color[22] : 'white']" class="module" style="position: relative;left: 1770px;top:220px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">多行信息<br>第二行信息</div>
<el-button :disabled="disabled" style="color: black;line-height:19px" type="text" @click="title='发货';update()">发货<br>{{ `${data[0].发货百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="[isActive ? color[21] : 'white']" class="module" style="position: relative;left: 1580px;top:220px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">多行信息<br>第二行信息</div>
<el-button :disabled="disabled" style="color: black;line-height:19px" type="text" @click="title='总装调试';update()">总装调试<br>{{ `${data[0].总装调试百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="[isActive ? color[20] : 'white']" class="module" style="position: relative;left: 1390px;top:220px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">多行信息<br>第二行信息</div>
<el-button :disabled="disabled" style="color: black;line-height:19px" type="text" @click="title='装配质检';update()">装配质检<br>{{ `${data[0].装配质检百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="[isActive ? color[19] : 'white']" class="module" style="position: relative;left: 1185px;top:105px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">角色电气部<br>电气部长制定装配计划<br>并记录计划执行情况</div>
<el-button :disabled="disabled" style="color: black;line-height:19px" type="text" @click="title='电气装配';update()">电气装配<br>{{ `${data[0].电气装配百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="[isActive ? color[18] : 'white']" class="module" style="position: relative;left: 1100px;top:176px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">角色装配部长<br>装配部长制定装配计划<br>并记录计划执行情况</div>
<el-button :disabled="disabled" style="color: black;line-height:19px" type="text" @click="title='机械装配';update()">机械装配<br>{{ `${data[0].机械装配百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="[isActive ? color[17] : 'white']" class="module" style="position: relative;left: 1015px;top:247px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">角色冷作车间主任<br>冷作车间主任制定冷作计划<br>并记录计划执行情况</div>
<el-button :disabled="disabled" style="color: black;line-height:19px" type="text" @click="title='冷作';update()">冷作<br>{{ `${data[0].冷作百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="[isActive ? color[16] : 'white']" class="module" style="position: relative;left: 930px;top:319px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">角色油漆车间主任<br>油漆车间主任制定装配计划<br>并记录计划执行情况</div>
<el-button :disabled="disabled" style="color: black;line-height:19px" type="text" @click="title='油漆';update()">油漆<br>{{ `${data[0].油漆百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="[isActive ? color[15] : 'white']" class="module" style="position: relative;left: 695px;top:220px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">角色装配部长<br>此模块用于查询某机床是否达到装配条件<br>即采购件与自制件是否成组配套</div>
<el-button :disabled="disabled" style="color: black;line-height:19px" type="text" @click="title='成组配套';update()">成组配套<br>{{ `${data[0].成组配套百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="[isActive ? color[14] : 'white']" class="module" style="position: relative;left: 455px;top:55px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">多行信息<br>第二行信息</div>
<el-button :disabled="disabled" style="color: black;line-height:19px" type="text" @click="title='自制质检';update()">自制质检<br>{{ `${data[0].自制质检百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="[isActive ? color[13] : 'white']" class="module" style="position: relative;left: 373px;top:283px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">多行信息<br>第二行信息</div>
<el-button :disabled="disabled" style="color: black;line-height:19px" type="text" @click="title='采购质检';update()">采购质检<br>{{ `${data[0].采购质检百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="[isActive ? color[12] : 'white']" class="module" style="position: relative;left: 160px;top:110px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">角色金工车间<br>接收加工任务并使用<br>MES工作站进行报工</div>
<el-button :disabled="disabled" style="color: black;line-height:19px" type="text" @click="title='车间加工';update()">车间加工<br>{{ `${data[0].车间加工百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="[isActive ? color[11] : 'white']" class="module" style="position: relative;left: -25px;top:-1px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">多行信息<br>第二行信息</div>
<el-button :disabled="disabled" style="color: black;line-height:19px" type="text" @click="title='工序外协';update()">工序外协<br>{{ `${data[0].工序外协百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="[isActive ? color[10] : 'white']" class="module" style="position: relative;left: -230px;top:54px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">多行信息<br>第二行信息</div>
<el-button :disabled="disabled" style="color: black;line-height:19px" type="text" @click="title='能力平衡';update()">能力平衡<br>{{ `${data[0].能力平衡百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="[isActive ? color[9] : 'white']" class="module" style="position: relative;left: -415px;top:54px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">第二行信息</div>
<el-button :disabled="disabled" style="color: black;line-height:19px" type="text" @click="title='定额';update()">定额<br>{{ `${data[0].定额百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="[isActive ? color[8] : 'white']" class="module" style="position: relative;left: -597px;top:54px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">第二行信息</div>
<el-button :disabled="disabled" style="color: black;line-height:19px" type="text" @click="title='工艺';update()">工艺<br>{{ `${data[0].工艺百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="[isActive ? color[7] : 'white']" class="module" style="position: relative;left: -805px;top:1px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">角色下料员<br>对于钢板等自家备料<br>下料员需要在系统确认备料<br>并通知金工领料</div>
<el-button :disabled="disabled" style="color: black;line-height:19px" type="text" @click="title='自家备料';update()">自家备料<br>{{ `${data[0].自家备料百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="[isActive ? color[0] : 'white']" class="module" style="position: relative;left: -1350px;top:222px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">角色营销内勤<br>负责创建项目及机床的基础信息<br>此部分作为系统数据的源头</div>
<el-button :disabled="disabled" style="color: black;line-height:19px" type="text" @click="title = '签订合同';update()">签订合同<br>{{ `${data[0].签订合同百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="[isActive ? color[1] : 'white']" class="module" style="position: relative;left: -1336px;top:222px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">角色技术员<br>负责导入三表(零件)<br>组件在项目启动会时提出<br>由制造总监导入</div>
<el-button :disabled="disabled" style="color: black;line-height:19px" type="text" @click="title = '产品设计';update()">产品设计<br>{{ `${data[0].产品设计百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="[isActive ? color[6] : 'white']" class="module" style="position: relative;left: -1057px;top:110px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">角色下料员<br>外购物料到货后由下料员确认备料<br>并通知金工领料</div>
<el-button :disabled="disabled" style="color: black;line-height:19px" type="text" @click="title='外购备料';update()">外购备料<br>{{ `${data[0].外购备料百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="[isActive ? color[2] : 'white']" class="module" style="position: relative;left: -1405px;top:222px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">角色计划员<br>计划员负责将三表中的零件按实际情况分配为<br>自制件采购部采购件制造部采购件三类</div>
<el-button :disabled="disabled" style="color: black;line-height:19px" type="text" @click="title='零件分配';update()">零件分配<br>{{ `${data[0].零件分配百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="[isActive ? color[3] : 'white']" class="module" style="position: relative;left: -1350px;top:63px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">角色计划员<br>计划员分配零件后<br>在生产计划下达模块<br>可查看到自家加工的零件任务<br>计划员需要将这些零件投产</div>
<el-button :disabled="disabled" style="color: black;line-height:19px" type="text" @click="title='自制件';update()">自制件<br>{{ `${data[0].自制件百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="[isActive ? color[5] : 'white']" class="module" style="position: relative;left: -1435px;top:223px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">多行信息<br>第二行信息</div>
<el-button :disabled="disabled" style="color: black;line-height:19px" type="text" @click="title='车间采购';update()">车间采购<br>{{ `${data[0].车间采购百分比}%` }}</el-button>
</el-tooltip>
</div>
<div :class="[isActive ? color[4] : 'white']" class="module" style="position: relative;left: -548px;top:300px; width: 80px;height: 48px;">
<el-tooltip placement="top">
<div slot="content">多行信息<br>第二行信息</div>
<el-button :disabled="disabled" style="color: black;line-height:19px" type="text" @click="title='采购部采购';update()">采购部采购<br>{{ `${data[0].采购部采购百分比}%` }}</el-button>
</el-tooltip>
</div>
</div>
</div>
</el-card>
<el-card style="height: 380px">
<el-row>
<h2>{{ title }}</h2>
</el-row>
<div style="margin: 0 auto;width: 400px">
<el-row>
<el-select v-model="value" placeholder="请选择" style="width: 200px" @change="select">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-row>
<el-row style="margin-top: 30px">
<el-input-number v-model="num" :precision="2" :step="0.1" :max="100" style="width: 200px" @blur="blur"/>
</el-row>
<el-row style="margin-top: 30px">
<el-button type="primary" style="width: 200px;padding-top: 12px" @click="save">保存</el-button>
</el-row>
</div>
</el-card>
</div>
</template>
<script>import { SelectMachine } from '@/api/ManufacturingCenter/ParseQuery'
import request from '@/utils/request'
export default {
data() {
return {
name: '',
name1: '',
num: 0,
options: [{
value: 1,
label: '未开始'
}, {
value: 2,
label: '进行中'
}, {
value: 3,
label: '已完成'
}, {
value: 4,
label: '已拖期'
}],
value: '',
title: '请点击查询',
disabled: true,
color: [],
isActive: false,
machineValue: '',
searchCriteria: '', // 机床名称 V-model
restaurants: [], // 机床名称数组
data: [{
签订合同百分比: 0,
产品设计百分比: 0,
零件分配百分比: 0,
自制件百分比: 0,
车间采购百分比: 0,
采购部采购百分比: 0,
自家备料百分比: 0,
外购备料百分比: 0,
工艺百分比: 0,
定额百分比: 0,
能力平衡百分比: 0,
工序外协百分比: 0,
车间加工百分比: 0,
自制质检百分比: 0,
采购质检百分比: 0,
成组配套百分比: 0,
电气装配百分比: 0,
机械装配百分比: 0,
冷作百分比: 0,
油漆百分比: 0,
装配质检百分比: 0,
总装调试百分比: 0,
发货百分比: 0
}] // 百分比
}
},
methods: {
select() {
if (this.value === 3) {
this.num = 100
}
},
blur() {
if (this.num === 100) {
this.value = 3
}
},
// 清空查询条件
clearMachine() {
this.num = 0
this.value = ''
this.title = '请点击查询'
this.machineValue = ''
this.isActive = false
this.disabled = true
this.data[0].签订合同百分比 = 0
this.data[0].产品设计百分比 = 0
this.data[0].零件分配百分比 = 0
this.data[0].自制件百分比 = 0
this.data[0].车间采购百分比 = 0
this.data[0].采购部采购百分比 = 0
this.data[0].自家备料百分比 = 0
this.data[0].外购备料百分比 = 0
this.data[0].工艺百分比 = 0
this.data[0].定额百分比 = 0
this.data[0].能力平衡百分比 = 0
this.data[0].工序外协百分比 = 0
this.data[0].车间加工百分比 = 0
this.data[0].自制质检百分比 = 0
this.data[0].采购质检百分比 = 0
this.data[0].成组配套百分比 = 0
this.data[0].电气装配百分比 = 0
this.data[0].机械装配百分比 = 0
this.data[0].冷作百分比 = 0
this.data[0].油漆百分比 = 0
this.data[0].装配质检百分比 = 0
this.data[0].总装调试百分比 = 0
this.data[0].发货百分比 = 0
},
// 机床名称查询函数
querySearch(queryString, cb) {
this.restaurants = []
if (this.searchCriteria !== '' && this.searchCriteria !== null) {
SelectMachine(this.searchCriteria).then(response => {
const res = response.data
res.forEach(item => {
this.restaurants.push({
value: item.货品编号,
num: item.机床流水号
})
})
return this.restaurants
}).then(data => {
var restaurants = data
var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants
return results
}).then(data => {
// 调用 callback 返回建议列表的数据
cb(data)
})
}
},
// 机床名称实时请求查询匹配函数
createFilter(queryString) {
return (restaurant) => {
return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) !== -1)
// !== -1为全字匹配 === 0为首字匹配
}
},
// 选择机床名称后的赋值函数
async handleSelect(item) {
// 在此方法中可以把下拉框选中值中的内容赋值给其他变量使用
this.machineValue = item.num
this.machineValue ? this.disabled = false : this.disabled = true
this.title = '请点击选择'
await request({
url: '',
method: 'post',
data: {
type: '3',
name: `select * from 综合查询_状态 where 机床流水号 = ${this.machineValue}`
}
}).then(res => {
this.isActive = true
this.data = res.data
if (res.data[0].签订合同状态 === 1) { this.color[0] = 'white' } else if (res.data[0].签订合同状态 === 2) { this.color[0] = 'yellow' } else if (res.data[0].签订合同状态 === 3) { this.color[0] = 'green' } else if (res.data[0].签订合同状态 === 4) { this.color[0] = 'red' }
if (res.data[0].产品设计状态 === 1) { this.color[1] = 'white' } else if (res.data[0].产品设计状态 === 2) { this.color[1] = 'yellow' } else if (res.data[0].产品设计状态 === 3) { this.color[1] = 'green' } else if (res.data[0].产品设计状态 === 4) { this.color[1] = 'red' }
if (res.data[0].零件分配状态 === 1) { this.color[2] = 'white' } else if (res.data[0].零件分配状态 === 2) { this.color[2] = 'yellow' } else if (res.data[0].零件分配状态 === 3) { this.color[2] = 'green' } else if (res.data[0].零件分配状态 === 4) { this.color[2] = 'red' }
if (res.data[0].自制件状态 === 1) { this.color[3] = 'white' } else if (res.data[0].自制件状态 === 2) { this.color[3] = 'yellow' } else if (res.data[0].自制件状态 === 3) { this.color[3] = 'green' } else if (res.data[0].自制件状态 === 4) { this.color[3] = 'red' }
if (res.data[0].采购部采购状态 === 1) { this.color[4] = 'white' } else if (res.data[0].采购部采购状态 === 2) { this.color[4] = 'yellow' } else if (res.data[0].采购部采购状态 === 3) { this.color[4] = 'green' } else if (res.data[0].采购部采购状态 === 4) { this.color[4] = 'red' }
if (res.data[0].车间采购状态 === 1) { this.color[5] = 'white' } else if (res.data[0].车间采购状态 === 2) { this.color[5] = 'yellow' } else if (res.data[0].车间采购状态 === 3) { this.color[5] = 'green' } else if (res.data[0].车间采购状态 === 4) { this.color[5] = 'red' }
if (res.data[0].外购备料状态 === 1) { this.color[6] = 'white' } else if (res.data[0].外购备料状态 === 2) { this.color[6] = 'yellow' } else if (res.data[0].外购备料状态 === 3) { this.color[6] = 'green' } else if (res.data[0].外购备料状态 === 4) { this.color[6] = 'red' }
if (res.data[0].自家备料状态 === 1) { this.color[7] = 'white' } else if (res.data[0].自家备料状态 === 2) { this.color[7] = 'yellow' } else if (res.data[0].自家备料状态 === 3) { this.color[7] = 'green' } else if (res.data[0].自家备料状态 === 4) { this.color[7] = 'red' }
if (res.data[0].工艺状态 === 1) { this.color[8] = 'white' } else if (res.data[0].工艺状态 === 2) { this.color[8] = 'yellow' } else if (res.data[0].工艺状态 === 3) { this.color[8] = 'green' } else if (res.data[0].工艺状态 === 4) { this.color[8] = 'red' }
if (res.data[0].定额状态 === 1) { this.color[9] = 'white' } else if (res.data[0].定额状态 === 2) { this.color[9] = 'yellow' } else if (res.data[0].定额状态 === 3) { this.color[9] = 'green' } else if (res.data[0].定额状态 === 4) { this.color[9] = 'red' }
if (res.data[0].能力平衡状态 === 1) { this.color[10] = 'white' } else if (res.data[0].能力平衡状态 === 2) { this.color[10] = 'yellow' } else if (res.data[0].能力平衡状态 === 3) { this.color[10] = 'green' } else if (res.data[0].能力平衡状态 === 4) { this.color[10] = 'red' }
if (res.data[0].工序外协状态 === 1) { this.color[11] = 'white' } else if (res.data[0].工序外协状态 === 2) { this.color[11] = 'yellow' } else if (res.data[0].工序外协状态 === 3) { this.color[11] = 'green' } else if (res.data[0].工序外协状态 === 4) { this.color[11] = 'red' }
if (res.data[0].车间加工状态 === 1) { this.color[12] = 'white' } else if (res.data[0].车间加工状态 === 2) { this.color[12] = 'yellow' } else if (res.data[0].车间加工状态 === 3) { this.color[12] = 'green' } else if (res.data[0].车间加工状态 === 4) { this.color[12] = 'red' }
if (res.data[0].采购质检状态 === 1) { this.color[13] = 'white' } else if (res.data[0].采购质检状态 === 2) { this.color[13] = 'yellow' } else if (res.data[0].采购质检状态 === 3) { this.color[13] = 'green' } else if (res.data[0].采购质检状态 === 4) { this.color[13] = 'red' }
if (res.data[0].自制质检状态 === 1) { this.color[14] = 'white' } else if (res.data[0].自制质检状态 === 2) { this.color[14] = 'yellow' } else if (res.data[0].自制质检状态 === 3) { this.color[14] = 'green' } else if (res.data[0].自制质检状态 === 4) { this.color[14] = 'red' }
if (res.data[0].成组配套状态 === 1) { this.color[15] = 'white' } else if (res.data[0].成组配套状态 === 2) { this.color[15] = 'yellow' } else if (res.data[0].成组配套状态 === 3) { this.color[15] = 'green' } else if (res.data[0].成组配套状态 === 4) { this.color[15] = 'red' }
if (res.data[0].油漆状态 === 1) { this.color[16] = 'white' } else if (res.data[0].油漆状态 === 2) { this.color[16] = 'yellow' } else if (res.data[0].油漆状态 === 3) { this.color[16] = 'green' } else if (res.data[0].油漆状态 === 4) { this.color[16] = 'red' }
if (res.data[0].冷作状态 === 1) { this.color[17] = 'white' } else if (res.data[0].冷作状态 === 2) { this.color[17] = 'yellow' } else if (res.data[0].冷作状态 === 3) { this.color[17] = 'green' } else if (res.data[0].冷作状态 === 4) { this.color[17] = 'red' }
if (res.data[0].机械装配状态 === 1) { this.color[18] = 'white' } else if (res.data[0].机械装配状态 === 2) { this.color[18] = 'yellow' } else if (res.data[0].机械装配状态 === 3) { this.color[18] = 'green' } else if (res.data[0].机械装配状态 === 4) { this.color[18] = 'red' }
if (res.data[0].电气装配状态 === 1) { this.color[19] = 'white' } else if (res.data[0].电气装配状态 === 2) { this.color[19] = 'yellow' } else if (res.data[0].电气装配状态 === 3) { this.color[19] = 'green' } else if (res.data[0].电气装配状态 === 4) { this.color[19] = 'red' }
if (res.data[0].装配质检状态 === 1) { this.color[20] = 'white' } else if (res.data[0].装配质检状态 === 2) { this.color[20] = 'yellow' } else if (res.data[0].装配质检状态 === 3) { this.color[20] = 'green' } else if (res.data[0].装配质检状态 === 4) { this.color[20] = 'red' }
if (res.data[0].总装调试状态 === 1) { this.color[21] = 'white' } else if (res.data[0].总装调试状态 === 2) { this.color[21] = 'yellow' } else if (res.data[0].总装调试状态 === 3) { this.color[21] = 'green' } else if (res.data[0].总装调试状态 === 4) { this.color[21] = 'red' }
if (res.data[0].发货状态 === 1) { this.color[22] = 'white' } else if (res.data[0].发货状态 === 2) { this.color[22] = 'yellow' } else if (res.data[0].发货状态 === 3) { this.color[22] = 'green' } else if (res.data[0].发货状态 === 4) { this.color[22] = 'red' }
})
},
async update() {
if (this.title === '签订合同') { this.name1 = `select 签订合同状态,签订合同百分比 from 综合查询_状态 where 机床流水号 = ${this.machineValue}` }
if (this.title === '产品设计') { this.name1 = `select 产品设计状态,产品设计百分比 from 综合查询_状态 where 机床流水号 = ${this.machineValue}` }
if (this.title === '零件分配') { this.name1 = `select 零件分配状态,零件分配百分比 from 综合查询_状态 where 机床流水号 = ${this.machineValue}` }
if (this.title === '自制件') { this.name1 = `select 自制件状态,自制件百分比 from 综合查询_状态 where 机床流水号 = ${this.machineValue}` }
if (this.title === '车间采购') { this.name1 = `select 车间采购状态,车间采购百分比 from 综合查询_状态 where 机床流水号 = ${this.machineValue}` }
if (this.title === '采购部采购') { this.name1 = `select 采购部采购状态,采购部采购百分比 from 综合查询_状态 where 机床流水号 = ${this.machineValue}` }
if (this.title === '自家备料') { this.name1 = `select 自家备料状态,自家备料百分比 from 综合查询_状态 where 机床流水号 = ${this.machineValue}` }
if (this.title === '外购备料') { this.name1 = `select 外购备料状态,外购备料百分比 from 综合查询_状态 where 机床流水号 = ${this.machineValue}` }
if (this.title === '工艺') { this.name1 = `select 工艺状态,工艺百分比 from 综合查询_状态 where 机床流水号 = ${this.machineValue}` }
if (this.title === '定额') { this.name1 = `select 定额状态,定额百分比 from 综合查询_状态 where 机床流水号 = ${this.machineValue}` }
if (this.title === '能力平衡') { this.name1 = `select 能力平衡状态,能力平衡百分比 from 综合查询_状态 where 机床流水号 = ${this.machineValue}` }
if (this.title === '工序外协') { this.name1 = `select 工序外协状态,工序外协百分比 from 综合查询_状态 where 机床流水号 = ${this.machineValue}` }
if (this.title === '车间加工') { this.name1 = `select 车间加工状态,车间加工百分比 from 综合查询_状态 where 机床流水号 = ${this.machineValue}` }
if (this.title === '自制质检') { this.name1 = `select 自制质检状态,自制质检百分比 from 综合查询_状态 where 机床流水号 = ${this.machineValue}` }
if (this.title === '采购质检') { this.name1 = `select 采购质检状态,采购质检百分比 from 综合查询_状态 where 机床流水号 = ${this.machineValue}` }
if (this.title === '成组配套') { this.name1 = `select 成组配套状态,成组配套百分比 from 综合查询_状态 where 机床流水号 = ${this.machineValue}` }
if (this.title === '电气装配') { this.name1 = `select 电气装配状态,电气装配百分比 from 综合查询_状态 where 机床流水号 = ${this.machineValue}` }
if (this.title === '机械装配') { this.name1 = `select 机械装配状态,机械装配百分比 from 综合查询_状态 where 机床流水号 = ${this.machineValue}` }
if (this.title === '冷作') { this.name1 = `select 冷作状态,冷作百分比 from 综合查询_状态 where 机床流水号 = ${this.machineValue}` }
if (this.title === '油漆') { this.name1 = `select 油漆状态,油漆百分比 from 综合查询_状态 where 机床流水号 = ${this.machineValue}` }
if (this.title === '装配质检') { this.name1 = `select 装配质检状态,装配质检百分比 from 综合查询_状态 where 机床流水号 = ${this.machineValue}` }
if (this.title === '总装调试') { this.name1 = `select 总装调试状态,总装调试百分比 from 综合查询_状态 where 机床流水号 = ${this.machineValue}` }
if (this.title === '发货') { this.name1 = `select 发货状态,发货百分比 from 综合查询_状态 where 机床流水号 = ${this.machineValue}` }
await request({
url: '',
method: 'post',
data: {
type: '3',
name: this.name1
}
}).then(res => {
switch (this.title) {
case '签订合同':
this.value = res.data[0].签订合同状态
this.num = res.data[0].签订合同百分比
break
case '产品设计':
this.value = res.data[0].产品设计状态
this.num = res.data[0].产品设计百分比
break
case '零件分配':
this.value = res.data[0].零件分配状态
this.num = res.data[0].零件分配百分比
break
case '自制件':
this.value = res.data[0].自制件状态
this.num = res.data[0].自制件百分比
break
case '车间采购':
this.value = res.data[0].车间采购状态
this.num = res.data[0].车间采购百分比
break
case '采购部采购':
this.value = res.data[0].采购部采购状态
this.num = res.data[0].采购部采购百分比
break
case '自家备料':
this.value = res.data[0].自家备料状态
this.num = res.data[0].自家备料百分比
break
case '外购备料':
this.value = res.data[0].外购备料状态
this.num = res.data[0].外购备料百分比
break
case '工艺':
this.value = res.data[0].工艺状态
this.num = res.data[0].工艺百分比
break
case '定额':
this.value = res.data[0].定额状态
this.num = res.data[0].定额百分比
break
case '能力平衡':
this.value = res.data[0].能力平衡状态
this.num = res.data[0].能力平衡百分比
break
case '工序外协':
this.value = res.data[0].工序外协状态
this.num = res.data[0].工序外协百分比
break
case '车间加工':
this.value = res.data[0].车间加工状态
this.num = res.data[0].车间加工百分比
break
case '自制质检':
this.value = res.data[0].自制质检状态
this.num = res.data[0].自制质检百分比
break
case '采购质检':
this.value = res.data[0].采购质检状态
this.num = res.data[0].采购质检百分比
break
case '成组配套':
this.value = res.data[0].成组配套状态
this.num = res.data[0].成组配套百分比
break
case '电气装配':
this.value = res.data[0].电气装配状态
this.num = res.data[0].电气装配百分比
break
case '机械装配':
this.value = res.data[0].机械装配状态
this.num = res.data[0].机械装配百分比
break
case '冷作':
this.value = res.data[0].冷作状态
this.num = res.data[0].冷作百分比
break
case '油漆':
this.value = res.data[0].油漆状态
this.num = res.data[0].油漆百分比
break
case '装配质检':
this.value = res.data[0].装配质检状态
this.num = res.data[0].装配质检百分比
break
case '总装调试':
this.value = res.data[0].总装调试状态
this.num = res.data[0].总装调试百分比
break
case '发货':
this.value = res.data[0].发货状态
this.num = res.data[0].发货百分比
break
default:
}
})
},
async save() {
if (this.title === '签订合同') { this.name = `update 综合查询_状态 set 签订合同状态 = ${this.value},签订合同百分比= ${this.num} where 机床流水号 = ${this.machineValue}` }
if (this.title === '产品设计') { this.name = `update 综合查询_状态 set 产品设计状态 = ${this.value},产品设计百分比= ${this.num} where 机床流水号 = ${this.machineValue}` }
if (this.title === '零件分配') { this.name = `update 综合查询_状态 set 零件分配状态 = ${this.value},零件分配百分比= ${this.num} where 机床流水号 = ${this.machineValue}` }
if (this.title === '自制件') { this.name = `update 综合查询_状态 set 自制件状态 = ${this.value},自制件百分比= ${this.num} where 机床流水号 = ${this.machineValue}` }
if (this.title === '车间采购') { this.name = `update 综合查询_状态 set 车间采购状态 = ${this.value},车间采购百分比= ${this.num} where 机床流水号 = ${this.machineValue}` }
if (this.title === '采购部采购') { this.name = `update 综合查询_状态 set 采购部采购状态 = ${this.value},采购部采购百分比= ${this.num} where 机床流水号 = ${this.machineValue}` }
if (this.title === '自家备料') { this.name = `update 综合查询_状态 set 自家备料状态 = ${this.value},自家备料百分比= ${this.num} where 机床流水号 = ${this.machineValue}` }
if (this.title === '外购备料') { this.name = `update 综合查询_状态 set 外购备料状态 = ${this.value},外购备料百分比= ${this.num} where 机床流水号 = ${this.machineValue}` }
if (this.title === '工艺') { this.name = `update 综合查询_状态 set 工艺状态 = ${this.value},工艺百分比= ${this.num} where 机床流水号 = ${this.machineValue}` }
if (this.title === '定额') { this.name = `update 综合查询_状态 set 定额状态 = ${this.value},定额百分比= ${this.num} where 机床流水号 = ${this.machineValue}` }
if (this.title === '能力平衡') { this.name = `update 综合查询_状态 set 能力平衡状态 = ${this.value},能力平衡百分比= ${this.num} where 机床流水号 = ${this.machineValue}` }
if (this.title === '工序外协') { this.name = `update 综合查询_状态 set 工序外协状态 = ${this.value},工序外协百分比= ${this.num} where 机床流水号 = ${this.machineValue}` }
if (this.title === '车间加工') { this.name = `update 综合查询_状态 set 车间加工状态 = ${this.value},车间加工百分比= ${this.num} where 机床流水号 = ${this.machineValue}` }
if (this.title === '自制质检') { this.name = `update 综合查询_状态 set 自制质检状态 = ${this.value},自制质检百分比= ${this.num} where 机床流水号 = ${this.machineValue}` }
if (this.title === '采购质检') { this.name = `update 综合查询_状态 set 采购质检状态 = ${this.value},采购质检百分比= ${this.num} where 机床流水号 = ${this.machineValue}` }
if (this.title === '成组配套') { this.name = `update 综合查询_状态 set 成组配套状态 = ${this.value},成组配套百分比= ${this.num} where 机床流水号 = ${this.machineValue}` }
if (this.title === '电气装配') { this.name = `update 综合查询_状态 set 电气装配状态 = ${this.value},电气装配百分比= ${this.num} where 机床流水号 = ${this.machineValue}` }
if (this.title === '机械装配') { this.name = `update 综合查询_状态 set 机械装配状态 = ${this.value},机械装配百分比= ${this.num} where 机床流水号 = ${this.machineValue}` }
if (this.title === '冷作') { this.name = `update 综合查询_状态 set 冷作状态 = ${this.value},冷作百分比= ${this.num} where 机床流水号 = ${this.machineValue}` }
if (this.title === '油漆') { this.name = `update 综合查询_状态 set 油漆状态 = ${this.value},油漆百分比= ${this.num} where 机床流水号 = ${this.machineValue}` }
if (this.title === '装配质检') { this.name = `update 综合查询_状态 set 装配质检状态 = ${this.value},装配质检百分比= ${this.num} where 机床流水号 = ${this.machineValue}` }
if (this.title === '总装调试') { this.name = `update 综合查询_状态 set 总装调试状态 = ${this.value},总装调试百分比= ${this.num} where 机床流水号 = ${this.machineValue}` }
if (this.title === '发货') { this.name = `update 综合查询_状态 set 发货状态 = ${this.value},发货百分比= ${this.num} where 机床流水号 = ${this.machineValue}` }
if (this.title !== '请点击查询') {
await request({
url: '',
method: 'post',
data: {
type: '3',
name: this.name
}
}).then(res => {
console.log(res)
if (res.data.length === 0) {
this.$message.success('保存成功')
} else {
this.$message.error('保存失败')
}
}).then(() => {
request({
url: '',
method: 'post',
data: {
type: '3',
name: `select * from 综合查询_状态 where 机床流水号 = ${this.machineValue}`
}
}).then(res => {
this.isActive = true
this.data = res.data
if (res.data[0].签订合同状态 === 1) { this.color[0] = 'white' } else if (res.data[0].签订合同状态 === 2) { this.color[0] = 'yellow' } else if (res.data[0].签订合同状态 === 3) { this.color[0] = 'green' } else if (res.data[0].签订合同状态 === 4) { this.color[0] = 'red' }
if (res.data[0].产品设计状态 === 1) { this.color[1] = 'white' } else if (res.data[0].产品设计状态 === 2) { this.color[1] = 'yellow' } else if (res.data[0].产品设计状态 === 3) { this.color[1] = 'green' } else if (res.data[0].产品设计状态 === 4) { this.color[1] = 'red' }
if (res.data[0].零件分配状态 === 1) { this.color[2] = 'white' } else if (res.data[0].零件分配状态 === 2) { this.color[2] = 'yellow' } else if (res.data[0].零件分配状态 === 3) { this.color[2] = 'green' } else if (res.data[0].零件分配状态 === 4) { this.color[2] = 'red' }
if (res.data[0].自制件状态 === 1) { this.color[3] = 'white' } else if (res.data[0].自制件状态 === 2) { this.color[3] = 'yellow' } else if (res.data[0].自制件状态 === 3) { this.color[3] = 'green' } else if (res.data[0].自制件状态 === 4) { this.color[3] = 'red' }
if (res.data[0].采购部采购状态 === 1) { this.color[4] = 'white' } else if (res.data[0].采购部采购状态 === 2) { this.color[4] = 'yellow' } else if (res.data[0].采购部采购状态 === 3) { this.color[4] = 'green' } else if (res.data[0].采购部采购状态 === 4) { this.color[4] = 'red' }
if (res.data[0].车间采购状态 === 1) { this.color[5] = 'white' } else if (res.data[0].车间采购状态 === 2) { this.color[5] = 'yellow' } else if (res.data[0].车间采购状态 === 3) { this.color[5] = 'green' } else if (res.data[0].车间采购状态 === 4) { this.color[5] = 'red' }
if (res.data[0].外购备料状态 === 1) { this.color[6] = 'white' } else if (res.data[0].外购备料状态 === 2) { this.color[6] = 'yellow' } else if (res.data[0].外购备料状态 === 3) { this.color[6] = 'green' } else if (res.data[0].外购备料状态 === 4) { this.color[6] = 'red' }
if (res.data[0].自家备料状态 === 1) { this.color[7] = 'white' } else if (res.data[0].自家备料状态 === 2) { this.color[7] = 'yellow' } else if (res.data[0].自家备料状态 === 3) { this.color[7] = 'green' } else if (res.data[0].自家备料状态 === 4) { this.color[7] = 'red' }
if (res.data[0].工艺状态 === 1) { this.color[8] = 'white' } else if (res.data[0].工艺状态 === 2) { this.color[8] = 'yellow' } else if (res.data[0].工艺状态 === 3) { this.color[8] = 'green' } else if (res.data[0].工艺状态 === 4) { this.color[8] = 'red' }
if (res.data[0].定额状态 === 1) { this.color[9] = 'white' } else if (res.data[0].定额状态 === 2) { this.color[9] = 'yellow' } else if (res.data[0].定额状态 === 3) { this.color[9] = 'green' } else if (res.data[0].定额状态 === 4) { this.color[9] = 'red' }
if (res.data[0].能力平衡状态 === 1) { this.color[10] = 'white' } else if (res.data[0].能力平衡状态 === 2) { this.color[10] = 'yellow' } else if (res.data[0].能力平衡状态 === 3) { this.color[10] = 'green' } else if (res.data[0].能力平衡状态 === 4) { this.color[10] = 'red' }
if (res.data[0].工序外协状态 === 1) { this.color[11] = 'white' } else if (res.data[0].工序外协状态 === 2) { this.color[11] = 'yellow' } else if (res.data[0].工序外协状态 === 3) { this.color[11] = 'green' } else if (res.data[0].工序外协状态 === 4) { this.color[11] = 'red' }
if (res.data[0].车间加工状态 === 1) { this.color[12] = 'white' } else if (res.data[0].车间加工状态 === 2) { this.color[12] = 'yellow' } else if (res.data[0].车间加工状态 === 3) { this.color[12] = 'green' } else if (res.data[0].车间加工状态 === 4) { this.color[12] = 'red' }
if (res.data[0].采购质检状态 === 1) { this.color[13] = 'white' } else if (res.data[0].采购质检状态 === 2) { this.color[13] = 'yellow' } else if (res.data[0].采购质检状态 === 3) { this.color[13] = 'green' } else if (res.data[0].采购质检状态 === 4) { this.color[13] = 'red' }
if (res.data[0].自制质检状态 === 1) { this.color[14] = 'white' } else if (res.data[0].自制质检状态 === 2) { this.color[14] = 'yellow' } else if (res.data[0].自制质检状态 === 3) { this.color[14] = 'green' } else if (res.data[0].自制质检状态 === 4) { this.color[14] = 'red' }
if (res.data[0].成组配套状态 === 1) { this.color[15] = 'white' } else if (res.data[0].成组配套状态 === 2) { this.color[15] = 'yellow' } else if (res.data[0].成组配套状态 === 3) { this.color[15] = 'green' } else if (res.data[0].成组配套状态 === 4) { this.color[15] = 'red' }
if (res.data[0].油漆状态 === 1) { this.color[16] = 'white' } else if (res.data[0].油漆状态 === 2) { this.color[16] = 'yellow' } else if (res.data[0].油漆状态 === 3) { this.color[16] = 'green' } else if (res.data[0].油漆状态 === 4) { this.color[16] = 'red' }
if (res.data[0].冷作状态 === 1) { this.color[17] = 'white' } else if (res.data[0].冷作状态 === 2) { this.color[17] = 'yellow' } else if (res.data[0].冷作状态 === 3) { this.color[17] = 'green' } else if (res.data[0].冷作状态 === 4) { this.color[17] = 'red' }
if (res.data[0].机械装配状态 === 1) { this.color[18] = 'white' } else if (res.data[0].机械装配状态 === 2) { this.color[18] = 'yellow' } else if (res.data[0].机械装配状态 === 3) { this.color[18] = 'green' } else if (res.data[0].机械装配状态 === 4) { this.color[18] = 'red' }
if (res.data[0].电气装配状态 === 1) { this.color[19] = 'white' } else if (res.data[0].电气装配状态 === 2) { this.color[19] = 'yellow' } else if (res.data[0].电气装配状态 === 3) { this.color[19] = 'green' } else if (res.data[0].电气装配状态 === 4) { this.color[19] = 'red' }
if (res.data[0].装配质检状态 === 1) { this.color[20] = 'white' } else if (res.data[0].装配质检状态 === 2) { this.color[20] = 'yellow' } else if (res.data[0].装配质检状态 === 3) { this.color[20] = 'green' } else if (res.data[0].装配质检状态 === 4) { this.color[20] = 'red' }
if (res.data[0].总装调试状态 === 1) { this.color[21] = 'white' } else if (res.data[0].总装调试状态 === 2) { this.color[21] = 'yellow' } else if (res.data[0].总装调试状态 === 3) { this.color[21] = 'green' } else if (res.data[0].总装调试状态 === 4) { this.color[21] = 'red' }
if (res.data[0].发货状态 === 1) { this.color[22] = 'white' } else if (res.data[0].发货状态 === 2) { this.color[22] = 'yellow' } else if (res.data[0].发货状态 === 3) { this.color[22] = 'green' } else if (res.data[0].发货状态 === 4) { this.color[22] = 'red' }
})
})
} else {
this.$message.error('请选择节点')
}
}
}
}
</script>
<style scoped>
.red{
background: red;
}
.yellow{
background: orange;
}
.green{
background: lightgreen;
}
.white{
background: white;
}
.el-card{
margin: 5px 10px 5px 10px;
}
.showDiv{
height: 380px;
}
.module{
border-radius: 6px;
border: 1px solid black;
/*background-color: white;*/
display: inline-block;
}
.module:hover{
box-shadow: 5px 5px 5px #888888;/*设置阴影,可以自定义参数*/
}
.process{
text-align: center;
margin-left: 80px;
margin-top: 20px;
width: 1858px;
height: 400px;
/*border: 1px solid red;*/
background: url('../../../assets/img/img4.png') repeat;
background-repeat:no-repeat;
background-size:100% 100%;-moz-background-size:100% 100%;
}
.main{
border: 1px solid #DCDFE6;
width:100%;
overflow-y: hidden;
overflow-x: auto;
color: #000;
font-size: 16px;
height: 440px;
}
.main p{height:300px;}
/*-------滚动条整体样式----*/
.main::-webkit-scrollbar {
width:8px;
height:8px;
}
/*滚动条里面小方块样式*/
.main::-webkit-scrollbar-thumb {
border-radius:100px;
-webkit-box-shadow:inset 0 0 5px rgba(0,0,0,0.2);
background:#DCDFE6;
}
/*滚动条里面轨道样式*/
.main::-webkit-scrollbar-track {
-webkit-box-shadow:inset 0 0 5px rgba(0,0,0,0.2);
border-radius:0;
background:white;
}
.red{
background: red;
}
.el-button{
padding-top: 5px;
}
</style>

View File

@@ -1,7 +1,7 @@
/* eslint-disable */
require('script-loader!file-saver');
// import XLSX from 'xlsx'
import XLSX from 'xlsx-style'
import XLSX from 'xlsx'
function generateArray(table) {
var out = [];
var rows = table.querySelectorAll('tr');
@@ -145,22 +145,33 @@ export function export_table_to_excel(id) {
}
export function export_json_to_excel({
headerGroup,
dataGroup,
sheetGroup,
multiHeader = [],
header,
data,
filename,
merges = [],
autoWidth = true,
bookType= 'xlsx'
} = {}) {
var wb = new Workbook()
for (let i = 0; i < dataGroup.length; i++) {
/* original data */
let data = dataGroup[i]
filename = filename || 'excel-list'
data = [...data]
data.unshift(headerGroup[i]);
var ws_name = sheetGroup[i];
var ws = sheet_from_array_of_arrays(data);
data.unshift(header);
for (let i = multiHeader.length-1; i > -1; i--) {
data.unshift(multiHeader[i])
}
var ws_name = "SheetJS";
var wb = new Workbook(),
ws = sheet_from_array_of_arrays(data);
if (merges.length > 0) {
if (!ws['!merges']) ws['!merges'] = [];
merges.forEach(item => {
ws['!merges'].push(XLSX.utils.decode_range(item))
})
}
if (autoWidth) {
/*设置worksheet每列的最大宽度*/
@@ -193,26 +204,11 @@ export function export_json_to_excel({
}
ws['!cols'] = result;
}
let R = 0;
data.map(item => {
let C = 0;
item.map(itm => {
var cell_ref = XLSX.utils.encode_cell({c:C,r:R});
var cell = {v: itm }
cell.s= {
alignment: {
horizontal: "center"
}
}
ws[cell_ref] = cell;
C++;
})
R++;
})
/* add worksheet to workbook */
wb.SheetNames.push(ws_name);
wb.Sheets[ws_name] = ws;
}
var wbout = XLSX.write(wb, {
bookType: bookType,
bookSST: false,

View File

@@ -706,11 +706,20 @@
<el-dialog :visible.sync="dialogVisible2" :title="title2" center style="min-height: 300px" width="400px">
<el-form ref="form2" :model="form2" :rules="rules2" label-position="left" label-width="90px">
<el-form-item label="询价单号" prop="inquirySheetNum">
<el-input v-model="form2.inquirySheetNum" size="small"/>
<el-input v-model="form2.inquirySheetNum" readonly size="small"/>
</el-form-item>
<el-form-item label="供应商" prop="supplierName">
<el-input v-model="form2.supplierName" size="small" readonly @focus="dialogVisible1=true;enterpriseNature = '';createDate = '';registeredCapital = '';taxNum = '';EMail = '';address = '';account = '';openingBank = '';phone = '';fax = '';goodTime = ''"/>
<el-form-item label="供应商" prop="supplierNameValue">
<el-select v-model="form2.supplierNameValue" style="width:200px" placeholder="供应商" size="small" filterable>
<el-option
v-for="item in supplierNames"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<!--<el-form-item label="供应商" prop="supplierName">-->
<!--<el-input v-model="form2.supplierName" size="small" readonly @focus="dialogVisible1=true;enterpriseNature = '';createDate = '';registeredCapital = '';taxNum = '';EMail = '';address = '';account = '';openingBank = '';phone = '';fax = '';goodTime = ''"/>-->
<!--</el-form-item>-->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible2=false">取消</el-button>
@@ -718,7 +727,7 @@
v-show="title2==='创建询价单'"
type="primary"
size="small"
@click="submitCreateInquirySheet">确定</el-button>
@click="submitCreateInquirySheet1">确定</el-button>
<el-button
v-show="title2==='编辑询价单'"
type="primary"
@@ -857,7 +866,7 @@
</template>
<script>
import { searchMaterial, searchPart, searchSupplier, searchCreateInquirySheet, searchCreateInquirySheet2, searchSheetDetail, editInquirySheet,
import { getBillNum, searchMaterial, searchPart, searchSupplier, searchCreateInquirySheet, searchCreateInquirySheet2, searchSheetDetail, editInquirySheet,
createInquirySheet, deleteInquirySheet, addInquirySheet1, addInquirySheet2, outInquirySheet, searchAllMaterial, materialChange, saveOrder,
submitUseInventory, initProject, searchMachine, searchGroup, searchBaseInfo, editBaseInfo, getExport1, getExport2, searchMerge } from '@/api/PurchasingCenter/CreateInquirySheet'
import { mapGetters } from 'vuex'
@@ -869,6 +878,7 @@ export default {
name: '', // 创建询价单
data() {
return {
supplierNames: [], // 供应商下拉框
switchValue: false, // 物料变更列显示开关
source: [
{
@@ -992,11 +1002,13 @@ export default {
inquirySheetNumValue: '', // 询价单流水号
inquirySheetNum: '',
supplierName: '',
supplierValue: ''
supplierValue: '',
supplierNameValue: ''
},
rules2: { // 表单验证规则
inquirySheetNum: [{ required: true, message: '请填写询价单号' }],
supplierName: [{ required: true, message: '请选择供应商' }]
supplierName: [{ required: true, message: '请选择供应商' }],
supplierNameValue: [{ required: true, message: '请选择供应商', trigger: 'change' }]
},
groupPartNum: [], // 组件零件流水号
groupPartBasicNum: [], // 组件零件基本件流水号
@@ -1284,6 +1296,14 @@ export default {
})
}
})
searchSupplier(0, '', 0, '', 0, '', 0, '', 0, '', 0, '', 0, '', 0, '', 0, '', 0, '', 0, '', 0, '').then(response => {
for (let i = 0; i < response.data.length; i++) {
this.supplierNames.push({
label: response.data[i].供应商名称,
value: response.data[i].供应商流水号
})
}
})
},
projectChange() {
this.machine = []
@@ -1460,15 +1480,18 @@ export default {
this.pageCurrent2 = val
this.searchTable2()
},
createInquirySheet() { // 创建空单据--询价单
createInquirySheet() { // 创建空单据--询价单9745
if (this.$refs['form2'] !== undefined) {
this.$refs['form2'].resetFields()
}
this.title2 = '创建询价单'
this.form2.inquirySheetNum = ''
getBillNum().then(response => { // 查询询价单号
this.form2.inquirySheetNum = response.data[0].单号
this.form2.supplierValue = ''
this.form2.supplierNameValue = ''
this.form2.supplierName = ''
this.dialogVisible2 = true
})
},
submitCreateInquirySheet() { // 提交创建询价单
this.$refs['form2'].validate((valid) => {
@@ -1482,7 +1505,7 @@ export default {
if (numGroup1.indexOf(this.form2.inquirySheetNum) !== -1) {
this.$message.error('该询价单号已存在')
} else {
createInquirySheet(this.form2.inquirySheetNum, this.form2.supplierValue, '', this.id).then(response => {
createInquirySheet(this.form2.inquirySheetNum, this.id, this.form2.supplierValue, '').then(response => {
if (response.data[0].result === '1') {
this.$message.success('创建成功')
this.inquirySheetNum = ''
@@ -1500,6 +1523,24 @@ export default {
}
})
},
submitCreateInquirySheet1() { // 提交创建询价单
this.$refs['form2'].validate((valid) => {
if (valid) {
createInquirySheet(this.form2.inquirySheetNum, this.id, this.form2.supplierNameValue, '').then(response => {
console.log(response.data)
if (response.data[0].result === '1') {
this.$message.success('创建成功')
this.form2.supplierNameValue = ''
this.inquirySheetNum = ''
this.supplierName = ''
this.supplierValue = ''
this.dialogVisible2 = false
this.searchTable2()
} else { this.$message.error('操作失败') }
})
}
})
},
deleteInquirySheet(row) { // 删除询价单
this.$confirm('确定删除该询价单?', '提示', {
confirmButtonText: '确定',

View File

@@ -0,0 +1,220 @@
/* eslint-disable */
require('script-loader!file-saver');
import XLSX from 'xlsx'
function generateArray(table) {
var out = [];
var rows = table.querySelectorAll('tr');
var ranges = [];
for (var R = 0; R < rows.length; ++R) {
var outRow = [];
var row = rows[R];
var columns = row.querySelectorAll('td');
for (var C = 0; C < columns.length; ++C) {
var cell = columns[C];
var colspan = cell.getAttribute('colspan');
var rowspan = cell.getAttribute('rowspan');
var cellValue = cell.innerText;
if (cellValue !== "" && cellValue == +cellValue) cellValue = +cellValue;
//Skip ranges
ranges.forEach(function (range) {
if (R >= range.s.r && R <= range.e.r && outRow.length >= range.s.c && outRow.length <= range.e.c) {
for (var i = 0; i <= range.e.c - range.s.c; ++i) outRow.push(null);
}
});
//Handle Row Span
if (rowspan || colspan) {
rowspan = rowspan || 1;
colspan = colspan || 1;
ranges.push({
s: {
r: R,
c: outRow.length
},
e: {
r: R + rowspan - 1,
c: outRow.length + colspan - 1
}
});
};
//Handle Value
outRow.push(cellValue !== "" ? cellValue : null);
//Handle Colspan
if (colspan)
for (var k = 0; k < colspan - 1; ++k) outRow.push(null);
}
out.push(outRow);
}
return [out, ranges];
};
function datenum(v, date1904) {
if (date1904) v += 1462;
var epoch = Date.parse(v);
return (epoch - new Date(Date.UTC(1899, 11, 30))) / (24 * 60 * 60 * 1000);
}
function sheet_from_array_of_arrays(data, opts) {
var ws = {};
var range = {
s: {
c: 10000000,
r: 10000000
},
e: {
c: 0,
r: 0
}
};
for (var R = 0; R != data.length; ++R) {
for (var C = 0; C != data[R].length; ++C) {
if (range.s.r > R) range.s.r = R;
if (range.s.c > C) range.s.c = C;
if (range.e.r < R) range.e.r = R;
if (range.e.c < C) range.e.c = C;
var cell = {
v: data[R][C]
};
if (cell.v == null) continue;
var cell_ref = XLSX.utils.encode_cell({
c: C,
r: R
});
if (typeof cell.v === 'number') cell.t = 'n';
else if (typeof cell.v === 'boolean') cell.t = 'b';
else if (cell.v instanceof Date) {
cell.t = 'n';
cell.z = XLSX.SSF._table[14];
cell.v = datenum(cell.v);
} else cell.t = 's';
ws[cell_ref] = cell;
}
}
if (range.s.c < 10000000) ws['!ref'] = XLSX.utils.encode_range(range);
return ws;
}
function Workbook() {
if (!(this instanceof Workbook)) return new Workbook();
this.SheetNames = [];
this.Sheets = {};
}
function s2ab(s) {
var buf = new ArrayBuffer(s.length);
var view = new Uint8Array(buf);
for (var i = 0; i != s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;
return buf;
}
export function export_table_to_excel(id) {
var theTable = document.getElementById(id);
var oo = generateArray(theTable);
var ranges = oo[1];
/* original data */
var data = oo[0];
var ws_name = "SheetJS";
var wb = new Workbook(),
ws = sheet_from_array_of_arrays(data);
/* add ranges to worksheet */
// ws['!cols'] = ['apple', 'banan'];
ws['!merges'] = ranges;
/* add worksheet to workbook */
wb.SheetNames.push(ws_name);
wb.Sheets[ws_name] = ws;
var wbout = XLSX.write(wb, {
bookType: 'xlsx',
bookSST: false,
type: 'binary'
});
saveAs(new Blob([s2ab(wbout)], {
type: "application/octet-stream"
}), "test.xlsx")
}
export function export_json_to_excel({
multiHeader = [],
header,
data,
filename,
merges = [],
autoWidth = true,
bookType= 'xlsx'
} = {}) {
/* original data */
filename = filename || 'excel-list'
data = [...data]
data.unshift(header);
for (let i = multiHeader.length-1; i > -1; i--) {
data.unshift(multiHeader[i])
}
var ws_name = "SheetJS";
var wb = new Workbook(),
ws = sheet_from_array_of_arrays(data);
if (merges.length > 0) {
if (!ws['!merges']) ws['!merges'] = [];
merges.forEach(item => {
ws['!merges'].push(XLSX.utils.decode_range(item))
})
}
if (autoWidth) {
/*设置worksheet每列的最大宽度*/
const colWidth = data.map(row => row.map(val => {
/*先判断是否为null/undefined*/
if (val == null) {
return {
'wch': 10
};
}
/*再判断是否为中文*/
else if (val.toString().charCodeAt(0) > 255) {
return {
'wch': val.toString().length * 2
};
} else {
return {
'wch': val.toString().length
};
}
}))
/*以第一行为初始值*/
let result = colWidth[0];
for (let i = 1; i < colWidth.length; i++) {
for (let j = 0; j < colWidth[i].length; j++) {
if (result[j]['wch'] < colWidth[i][j]['wch']) {
result[j]['wch'] = colWidth[i][j]['wch'];
}
}
}
ws['!cols'] = result;
}
/* add worksheet to workbook */
wb.SheetNames.push(ws_name);
wb.Sheets[ws_name] = ws;
var wbout = XLSX.write(wb, {
bookType: bookType,
bookSST: false,
type: 'binary'
});
saveAs(new Blob([s2ab(wbout)], {
type: "application/octet-stream"
}), `${filename}.${bookType}`);
}

View File

@@ -29,6 +29,7 @@
</el-select>
<el-button icon="el-icon-search" type="success" size="small" @click="pageCurrentWB = 1;pageSizeWB = 10;pageCurrent = 1;pageSize = 10;getTableData()">查询</el-button>
<el-button :loading="downloadLoading" type="success" icon="el-icon-download" size="small" style="margin-left: 15px" @click="handleDownload()">导出EXCEL</el-button>
</el-card>
<el-card>
<div v-for="(file, key) in hadFile" :key="key">
@@ -259,10 +260,13 @@
import { projectSelect, machineSelect, groupSelect, basicPartsData, deleteBasicParts, purchasePartsData, deletePurchaseData, getFileData } from '@/api/TechnologyCenter/QueryParts'
import { mapGetters } from 'vuex'
import { ServerIP } from '@/utils/request'
import request from '@/utils/request'
export default {
name: 'Index',
data() {
return {
downloadLoading: false,
projectValue: '',
project: [],
machineValue: '',
@@ -342,6 +346,83 @@ export default {
this.fetchData()
},
methods: {
async handleDownload() {
this.downloadLoading = true
await request({
url: '',
method: 'post',
data: {
type: '3',
name: `declare @项目流水号 int =${this.projectValue}
create table #临时表1
(
id int IDENTITY (1,1) not null,
物料名称 nvarchar(50),
物料规格 nvarchar(50),
物料型号 nvarchar(50),
primary key (id)
);
create table #临时表2
(
id int IDENTITY (1,1) not null,
物料名称 nvarchar(50),
物料规格 nvarchar(50),
物料型号 nvarchar(50),
总数量 int,
primary key (id)
);
insert into #临时表1 select distinct 物料名称,物料规格,物料型号 from dbo.零件查询_物料规格型号_统计查询_视图
where 项目流水号=@项目流水号
declare @id int =1
declare @id2 int
declare @物料名称 nvarchar(50)
declare @物料规格 nvarchar(50)
declare @物料型号 nvarchar(50)
declare @总数量 int
while (@id<=(select COUNT (id) from #临时表1 ))
begin
select @物料名称=物料名称,@物料规格=物料规格,@物料型号=物料型号 from #临时表1
where id=@id
insert into #临时表2 (物料名称,物料规格,物料型号) values (@物料名称,@物料规格,@物料型号)
set @id2 = @@IDENTITY
select @总数量 = COUNT(物料流水号) from 零件查询_物料规格型号_统计查询_视图
where 物料名称=@物料名称 and 物料规格=@物料规格 and 物料型号=@物料型号 and 项目流水号=@项目流水号
update #临时表2 set 总数量 = @总数量
where id=@id2
set @id = @id + 1
end
select * from #临时表2
drop table #临时表1
drop table #临时表2`
}
}).then(res => {
if (res.data.length === 0) {
this.$message.error('暂无数据')
this.downloadLoading = false
} else {
import('./Export2Excel').then(excel => {
const tHeader = ['物料名称', '物料型号', '物料规格', '总数量']
const filterVal = ['物料名称', '物料型号', '物料规格', '总数量']
const list = res.data
const data = this.formatJson(filterVal, list)
excel.export_json_to_excel({
header: tHeader,
data,
filename: 'EXCEL',
autoWidth: true,
bookType: 'xlsx'
})
this.downloadLoading = false
})
}
})
},
formatJson(filterVal, jsonData) {
return jsonData.map(v => filterVal.map(j => {
return v[j]
}))
},
// ///////////////////////////////////////////////////↑0910zdy
// 在什么情况下需要查询上传的附件调用this.getFileData()即可根据
getFileData(machineValue) {
this.hadFile = []