Initial commit: 景耀JY1.0项目
This commit is contained in:
@@ -41,7 +41,7 @@
|
||||
<el-button v-show="!checked" icon="el-icon-search" type="primary" plain size="small" style="margin-left: 10px" @click="searchTable()">查询</el-button>
|
||||
<el-button v-show="checked" icon="el-icon-search" type="primary" plain size="small" style="margin-left: 10px" @click="searchTable1()">查询</el-button>
|
||||
<el-button :disabled="tableData5.length === 0 || state === 1" icon="el-icon-document-copy" type="warning" plain size="small" style="margin-left: 10px" @click="copyData()">拷贝</el-button>
|
||||
<el-button :disabled="disabled" icon="el-icon-search" type="primary" plain size="small" style="margin-left: 50px" @click="getNum()">图纸</el-button>
|
||||
<el-button :disabled="tableData5.length === 0 || state === 1" icon="el-icon-search" type="primary" plain size="small" style="margin-left: 50px" @click="getNum()">图纸</el-button>
|
||||
<el-button v-show="!checked" type="success" plain icon="el-icon-check" size="small" style="margin-left: 10px" @click="preservation()">保存</el-button>
|
||||
<el-button v-show="checked" type="success" plain icon="el-icon-check" size="small" style="margin-left: 10px" @click="preservation1()">保存</el-button>
|
||||
<el-checkbox v-model="checked" style="margin-left: 10px" @change="checkChange">零件</el-checkbox>
|
||||
@@ -51,7 +51,15 @@
|
||||
<el-col style="margin-left: 7px;width: 158px">
|
||||
<!-- <el-card>-->
|
||||
<div style="margin-top: 10px">
|
||||
<el-table :data="tableData4" :header-cell-style="{background: '#2283D4',color: 'white'}" highlight-current-row border size="mini" style="width: 158px;margin-top: 10px" height="550" @row-click="editProcedure">
|
||||
<el-input
|
||||
v-model="processSearchName"
|
||||
placeholder="请输入工序名称"
|
||||
size="small"
|
||||
clearable
|
||||
style="width: 158px; margin-bottom: 10px"
|
||||
@input="filterProcess"
|
||||
/>
|
||||
<el-table :data="filteredTableData4" :header-cell-style="{background: '#2283D4',color: 'white'}" highlight-current-row border size="mini" style="width: 158px;margin-top: 10px" height="510" @row-click="editProcedure">
|
||||
<el-table-column :width="setColumnWidth('日期时间')" label="工序" align="center" prop="" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工艺名称 }}
|
||||
@@ -303,6 +311,8 @@ export default {
|
||||
loading: false, // 数据加载
|
||||
total: 0, // 分页总数
|
||||
tableData4: [], // 工艺列表
|
||||
filteredTableData4: [], // 过滤后的工艺列表
|
||||
processSearchName: '', // 工序搜索框内容
|
||||
tableData5: [], // 工艺内容
|
||||
tableData6: [],
|
||||
pageCurrent: 1, // 分页当前页
|
||||
@@ -326,6 +336,16 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$route': {
|
||||
handler(route) {
|
||||
if (this.$route.query.订单流水号) {
|
||||
this.contractQueryJump(this.$route.query.订单流水号, this.$route.query.工艺计划流水号, this.$route.query.零件名称)
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.searchTable()
|
||||
this.getOrderNumberType()
|
||||
@@ -333,7 +353,20 @@ export default {
|
||||
this.getProcess()
|
||||
this.getTreeData()
|
||||
},
|
||||
|
||||
methods: {
|
||||
async contractQueryJump(订单编号, 工艺计划流水号, 零件名称) {
|
||||
console.log(订单编号, 工艺计划流水号, 零件名称)
|
||||
// this.partName.push({
|
||||
// label:零件名称,
|
||||
// value:Number(工艺计划流水号)
|
||||
// })
|
||||
|
||||
this.orderNumberTypeValue = Number(订单编号)
|
||||
this.getproductName()
|
||||
// this.partNameValue = Number(工艺计划流水号)
|
||||
// this.searchTable()
|
||||
},
|
||||
searchPartsGroup() {
|
||||
this.tableData5 = []
|
||||
this.partName2 = []
|
||||
@@ -627,6 +660,8 @@ export default {
|
||||
value: response.data[i].订单流水号
|
||||
})
|
||||
}
|
||||
|
||||
console.log('流水哈', this.orderNumberTypeValue)
|
||||
})
|
||||
},
|
||||
getproductName() {
|
||||
@@ -672,8 +707,19 @@ export default {
|
||||
var Data = this.CreateData('11', '工艺名称_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
this.tableData4 = response.data
|
||||
this.filteredTableData4 = response.data
|
||||
})
|
||||
},
|
||||
// 过滤工序
|
||||
filterProcess() {
|
||||
if (this.processSearchName) {
|
||||
this.filteredTableData4 = this.tableData4.filter(item => {
|
||||
return item.工艺名称.includes(this.processSearchName)
|
||||
})
|
||||
} else {
|
||||
this.filteredTableData4 = this.tableData4
|
||||
}
|
||||
},
|
||||
searchTable() {
|
||||
if (this.partNameValue) {
|
||||
this.loading = true
|
||||
|
||||
@@ -326,7 +326,7 @@ export default {
|
||||
this.$message.success('撤回成功')
|
||||
var param1 = []
|
||||
param1[0] = ['工艺计划流水号', this.multipleSelection[0].工艺计划流水号]
|
||||
var Data1 = this.CreateData('11', '车间生产管理工艺_追溯加工_查询工序', param1)
|
||||
var Data1 = this.CreateData('11', '车间生产管理工艺_追溯加工_查询工序_单工序', param1)
|
||||
this.ExecDatabase(Data1).then(response => {
|
||||
this.tableData1 = response.data
|
||||
})
|
||||
@@ -412,7 +412,7 @@ export default {
|
||||
searchTable1(row) {
|
||||
var param = []
|
||||
param[0] = ['工艺计划流水号', row.工艺计划流水号]
|
||||
var Data = this.CreateData('11', '车间生产管理工艺_追溯加工_查询工序', param)
|
||||
var Data = this.CreateData('11', '车间生产管理工艺_追溯加工_查询工序_单工序', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
this.tableData1 = response.data
|
||||
})
|
||||
|
||||
@@ -118,6 +118,11 @@
|
||||
{{ scope.row.单价 ? Number(scope.row.单价).toFixed(2) : '' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="100px" label="最新单价" align="center" prop="历史单价">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.历史单价 ? Number(scope.row.历史单价).toFixed(2) : '' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="100px" label="金额" align="center" show-overflow-tooltip prop="金额">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.金额 ? Number(scope.row.金额).toFixed(2) : '' }}
|
||||
@@ -148,7 +153,7 @@
|
||||
{{ scope.row.订单备注 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="80px" label="操作" align="center" fixed="right">
|
||||
<el-table-column width="200px" label="操作" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
:disabled="scope.row.图纸 === null"
|
||||
@@ -157,6 +162,13 @@
|
||||
size="mini"
|
||||
@click="getNum(scope.row)">图纸
|
||||
</el-button>
|
||||
<el-button
|
||||
:disabled="scope.row.图纸 === null"
|
||||
type="text"
|
||||
icon="el-icon-search"
|
||||
size="mini"
|
||||
@click="updatePrice(scope.row)">更新单价
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -206,7 +218,8 @@
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
import request, { MESDownloadFile } from '@/utils/request'
|
||||
import request, { MESDownloadFile, MESDownloadFileNew } from '@/utils/request'
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@@ -285,8 +298,21 @@ export default {
|
||||
var Data = this.CreateData('11', '采购合同查询_图片_查询数据', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
if (response.data[i].文件内容 !== null) {
|
||||
this.urls.push('data:image/png;base64,' + response.data[i].文件内容)
|
||||
const item = response.data[i]
|
||||
// 优先使用文件路径(新方式)
|
||||
if (item.文件路径) {
|
||||
axios.get(MESDownloadFileNew, {
|
||||
params: { filePath: item.文件路径 }
|
||||
}).then(res => {
|
||||
if (res.data && res.data[0] && res.data[0].文件内容) {
|
||||
this.urls.push('data:image/png;base64,' + res.data[0].文件内容)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.error('图片加载失败:', err)
|
||||
})
|
||||
} else if (item.文件内容 !== null) {
|
||||
// 兼容旧数据
|
||||
this.urls.push('data:image/png;base64,' + item.文件内容)
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -354,6 +380,30 @@ export default {
|
||||
this.tableData1 = response.data
|
||||
})
|
||||
},
|
||||
|
||||
updatePrice(row) {
|
||||
if (!row.历史单价) {
|
||||
this.$message.error('请先查询历史单价')
|
||||
return
|
||||
}
|
||||
if (row.单价) {
|
||||
this.$message.error('已有单价')
|
||||
return
|
||||
}
|
||||
var param = []
|
||||
param[0] = ['采购合同明细流水号', row.采购合同明细流水号]
|
||||
param[1] = ['历史单价', row.历史单价]
|
||||
param[2] = ['是否耗材', row.是否耗材采购]
|
||||
var Data = this.CreateData('12', '采购管理_采购合同审核_更新单价', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('更新成功')
|
||||
this.searchTable1(row)
|
||||
} else {
|
||||
this.$message.error('更新失败')
|
||||
}
|
||||
})
|
||||
},
|
||||
getSummaries(param) {
|
||||
const { columns, data } = param
|
||||
const sums = []
|
||||
|
||||
@@ -9,256 +9,136 @@
|
||||
size="small"
|
||||
value-format="yyyy-M"
|
||||
placeholder="选择月"/>
|
||||
<el-input v-model="orderNumberTypeValue" style="width:200px;margin-left: 10px" placeholder="订单号" size="small" clearable/>
|
||||
<el-input v-model="orderNumberTypeValue" style="width:200px;margin-left: 10px" placeholder="订单编号" size="small" clearable/>
|
||||
<el-input v-model="partNameValue" style="width:150px;margin-left: 10px" placeholder="零件名称或图号" size="small" clearable/>
|
||||
<el-input v-model="procedureValue" style="width:150px;margin-left: 10px" placeholder="工序名称" size="small" clearable/>
|
||||
<el-input v-model="machine" style="width:150px;margin-left: 10px" placeholder="设备" size="small" clearable/>
|
||||
<el-button icon="el-icon-search" type="primary" plain size="small" style="margin-left: 10px" @click="pageCurrent = 1;pageSize = 20;searchTable1()">查询</el-button>
|
||||
<el-row style="float: right;width: 100px;margin-right: 300px;font-size: 12px"><el-col :span="12"><span>注释:</span></el-col><el-col :span="12"><span>计划数</span><br><span>完成数</span><br><span>操作者</span></el-col></el-row>
|
||||
<el-input v-model="productNameValue" style="width:150px;margin-left: 10px" placeholder="产品名称" size="small" clearable/>
|
||||
<el-select v-model="statusValue" style="width:100px;margin-left: 10px" placeholder="状态" size="small">
|
||||
<el-option label="派工中" value="派工中"/>
|
||||
<el-option label="生产中" value="生产中"/>
|
||||
<el-option label="已完成" value="已完成"/>
|
||||
</el-select>
|
||||
<el-button icon="el-icon-search" type="primary" plain size="small" style="margin-left: 10px" @click="searchTable1()">查询</el-button>
|
||||
</div>
|
||||
<el-table :data="tableData2" height="750px" style="width: 1680px" size="mini" highlight-current-row border @cell-dblclick="dbSelected">
|
||||
<el-table-column width="140px" align="center" label="订单号" show-overflow-tooltip fixed>
|
||||
<el-table :data="tableData2" height="750px" style="width: 2200px" size="mini" highlight-current-row border>
|
||||
<el-table-column width="50px" align="center" label="序号" show-overflow-tooltip fixed>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.$index + 1 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="90px" align="center" label="状态" show-overflow-tooltip fixed>
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.状态 === '派工中' ? 'warning' : scope.row.状态 === '生产中' ? 'success' : 'info'">
|
||||
{{ scope.row.状态 }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="140px" align="center" label="订单编号" show-overflow-tooltip fixed>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.订单号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :width="setColumnWidth('零件名称')" align="center" label="零件名称" show-overflow-tooltip fixed>
|
||||
<el-table-column width="90px" align="center" label="投产日期" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件名称 }}
|
||||
{{ scope.row.投产时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :width="setColumnWidth('图号')" align="center" label="图号" show-overflow-tooltip fixed>
|
||||
<el-table-column width="100px" align="center" label="订单交货日期" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件图号 }}
|
||||
{{ scope.row.精工期限 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="50px" align="center" label="序号" show-overflow-tooltip fixed>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工序顺序 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :width="setColumnWidth('数量')" align="center" label="工序名称" show-overflow-tooltip fixed>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工序 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="130px" align="center" label="设备" show-overflow-tooltip fixed>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.设备 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="70px" align="center" label="订单数" show-overflow-tooltip fixed>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.订单数 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="70px" align="center" label="计划数" show-overflow-tooltip fixed>
|
||||
<el-table-column width="60px" align="center" label="数量" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计划数 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="80px" align="center" label="剩余计划" show-overflow-tooltip fixed>
|
||||
<el-table-column width="120px" align="center" label="产品名称" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.剩余数 }}
|
||||
{{ scope.row.产品名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="100px" align="center" label="计划开始时间" show-overflow-tooltip fixed>
|
||||
<el-table-column width="120px" align="center" label="零件名称" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计划开始日期 }}
|
||||
{{ scope.row.零件名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="100px" align="center" label="计划完成时间" show-overflow-tooltip fixed>
|
||||
<el-table-column width="120px" align="center" label="零件图号" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计划完成日期 }}
|
||||
{{ scope.row.零件图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="65px" align="center" label="1" show-overflow-tooltip>
|
||||
<el-table-column width="120px" align="center" label="材料" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计划1 }}<br>{{ scope.row.完成1 }}<br>{{ scope.row.操作者1 }}
|
||||
{{ scope.row.材料 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="65px" align="center" label="2" show-overflow-tooltip>
|
||||
<el-table-column width="80px" align="center" label="完成率" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计划2 }}<br>{{ scope.row.完成2 }}<br>{{ scope.row.操作者2 }}
|
||||
{{ scope.row.完成率 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="65px" align="center" label="3" show-overflow-tooltip>
|
||||
<el-table-column width="100px" align="center" label="当前状态" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计划3 }}<br>{{ scope.row.完成3 }}<br>{{ scope.row.操作者3 }}
|
||||
{{ scope.row.设备 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="65px" align="center" label="4" show-overflow-tooltip>
|
||||
<el-table-column width="60px" align="center" label="OP010" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计划4 }}<br>{{ scope.row.完成4 }}<br>{{ scope.row.操作者4 }}
|
||||
{{ scope.row.OP010 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="65px" align="center" label="5" show-overflow-tooltip>
|
||||
<el-table-column width="60px" align="center" label="OP020" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计划5 }}<br>{{ scope.row.完成5 }}<br>{{ scope.row.操作者5 }}
|
||||
{{ scope.row.OP020 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="65px" align="center" label="6" show-overflow-tooltip>
|
||||
<el-table-column width="60px" align="center" label="OP030" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计划6 }}<br>{{ scope.row.完成6 }}<br>{{ scope.row.操作者6 }}
|
||||
{{ scope.row.OP030 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="65px" align="center" label="7" show-overflow-tooltip>
|
||||
<el-table-column width="60px" align="center" label="OP040" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计划7 }}<br>{{ scope.row.完成7 }}<br>{{ scope.row.操作者7 }}
|
||||
{{ scope.row.OP040 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="65px" align="center" label="8" show-overflow-tooltip>
|
||||
<el-table-column width="60px" align="center" label="OP050" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计划8 }}<br>{{ scope.row.完成8 }}<br>{{ scope.row.操作者8 }}
|
||||
{{ scope.row.OP050 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="65px" align="center" label="9" show-overflow-tooltip>
|
||||
<el-table-column width="60px" align="center" label="OP060" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计划9 }}<br>{{ scope.row.完成9 }}<br>{{ scope.row.操作者9 }}
|
||||
{{ scope.row.OP060 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="65px" align="center" label="10" show-overflow-tooltip>
|
||||
<el-table-column width="60px" align="center" label="OP070" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计划10 }}<br>{{ scope.row.完成10 }}<br>{{ scope.row.操作者10 }}
|
||||
{{ scope.row.OP070 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="65px" align="center" label="11" show-overflow-tooltip>
|
||||
<el-table-column width="60px" align="center" label="OP080" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计划11 }}<br>{{ scope.row.完成11 }}<br>{{ scope.row.操作者11 }}
|
||||
{{ scope.row.OP080 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="65px" align="center" label="12" show-overflow-tooltip>
|
||||
<el-table-column width="60px" align="center" label="OP090" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计划12 }}<br>{{ scope.row.完成12 }}<br>{{ scope.row.操作者12 }}
|
||||
{{ scope.row.OP090 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="65px" align="center" label="13" show-overflow-tooltip>
|
||||
<el-table-column width="60px" align="center" label="OP100" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计划13 }}<br>{{ scope.row.完成13 }}<br>{{ scope.row.操作者13 }}
|
||||
{{ scope.row.OP100 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="65px" align="center" label="14" show-overflow-tooltip>
|
||||
<el-table-column width="60px" align="center" label="OP110" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计划14 }}<br>{{ scope.row.完成14 }}<br>{{ scope.row.操作者14 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="65px" align="center" label="15" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计划15 }}<br>{{ scope.row.完成15 }}<br>{{ scope.row.操作者15 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="65px" align="center" label="16" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计划16 }}<br>{{ scope.row.完成16 }}<br>{{ scope.row.操作者16 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="65px" align="center" label="17" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计划17 }}<br>{{ scope.row.完成17 }}<br>{{ scope.row.操作者17 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="65px" align="center" label="18" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计划18 }}<br>{{ scope.row.完成18 }}<br>{{ scope.row.操作者18 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="65px" align="center" label="19" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计划19 }}<br>{{ scope.row.完成19 }}<br>{{ scope.row.操作者19 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="65px" align="center" label="20" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计划20 }}<br>{{ scope.row.完成20 }}<br>{{ scope.row.操作者20 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="65px" align="center" label="21" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计划21 }}<br>{{ scope.row.完成21 }}<br>{{ scope.row.操作者21 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="65px" align="center" label="22" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计划22 }}<br>{{ scope.row.完成22 }}<br>{{ scope.row.操作者22 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="65px" align="center" label="23" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计划23 }}<br>{{ scope.row.完成23 }}<br>{{ scope.row.操作者23 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="65px" align="center" label="24" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计划24 }}<br>{{ scope.row.完成24 }}<br>{{ scope.row.操作者24 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="65px" align="center" label="25" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计划25 }}<br>{{ scope.row.完成25 }}<br>{{ scope.row.操作者25 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="65px" align="center" label="26" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计划26 }}<br>{{ scope.row.完成26 }}<br>{{ scope.row.操作者26 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="65px" align="center" label="27" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计划27 }}<br>{{ scope.row.完成27 }}<br>{{ scope.row.操作者27 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="65px" align="center" label="28" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计划28 }}<br>{{ scope.row.完成28 }}<br>{{ scope.row.操作者28 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="65px" align="center" label="29" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计划29 }}<br>{{ scope.row.完成29 }}<br>{{ scope.row.操作者29 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="65px" align="center" label="30" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计划30 }}<br>{{ scope.row.完成30 }}<br>{{ scope.row.操作者30 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="65px" align="center" label="31" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计划31 }}<br>{{ scope.row.完成31 }}<br>{{ scope.row.操作者31 }}
|
||||
{{ scope.row.OP110 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[10, 20, 30, 40, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChanges"
|
||||
@current-change="handleCurrentChanges"/>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-dialog v-el-drag-dialog :visible.sync="dialog" title="修改" center width="400px">
|
||||
<el-form ref="form" :model="form" label-position="center" label-width="110px" class="demo-ruleForm">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="计划数">
|
||||
<el-input-number
|
||||
v-model="form.计划数"
|
||||
:min="0"
|
||||
:step="1"
|
||||
size="small"
|
||||
style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="callOff()">取消</el-button>
|
||||
<el-button type="primary" size="small" @click="submit()">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -268,35 +148,13 @@ import { getNowShotTime } from '@/utils/tool'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
计划数: ''
|
||||
},
|
||||
process: '', // 工艺计划流水号
|
||||
procedureValue: '',
|
||||
machine: '',
|
||||
month: [],
|
||||
monthValue: '',
|
||||
dialog: false,
|
||||
numberValue: '',
|
||||
columnName: '',
|
||||
orderNumberTypeValue: '', // 操作者
|
||||
orderNumberType: [], // 操作者数组
|
||||
productpartNameValue: '', // 产品部件名称
|
||||
productpartName: [], // 产品部件名称数组
|
||||
partNameValue: '', // 零件名称
|
||||
people: [],
|
||||
peopleValue: '',
|
||||
loading: false, // 数据加载
|
||||
total: 0, // 分页总数
|
||||
tableData2: [],
|
||||
pageCurrent: 1, // 分页当前页
|
||||
pageSize: 20, // 分页每页显示条数
|
||||
orderName: '', // 排序列名
|
||||
order: '', // 排序方式
|
||||
orderName1: '', // 排序列名
|
||||
order1: '', // 排序方式
|
||||
dateRange: '', // 派工日期
|
||||
dateTime: getNowShotTime()
|
||||
orderNumberTypeValue: '', // 订单编号
|
||||
partNameValue: '', // 零件名称或图号
|
||||
productNameValue: '', // 产品名称
|
||||
statusValue: '', // 状态
|
||||
loading: false,
|
||||
tableData2: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -312,41 +170,9 @@ export default {
|
||||
// },
|
||||
created() {
|
||||
this.getNowMonth()
|
||||
this.getPeople()
|
||||
this.searchTable1()
|
||||
},
|
||||
methods: {
|
||||
dbSelected(row, column, cell) {
|
||||
console.log(row, column, cell)
|
||||
if (column.label === '1' || column.label === '2' || column.label === '3' || column.label === '4' || column.label === '5' || column.label === '6' || column.label === '7' || column.label === '8' || column.label === '9' ||
|
||||
column.label === '10' || column.label === '11' || column.label === '12' || column.label === '13' || column.label === '14' || column.label === '15' || column.label === '16' || column.label === '17' || column.label === '18' ||
|
||||
column.label === '19' || column.label === '20' || column.label === '21' || column.label === '22' || column.label === '23' || column.label === '24' || column.label === '25' || column.label === '26' || column.label === '27' ||
|
||||
column.label === '28' || column.label === '29' || column.label === '30' || column.label === '31') {
|
||||
this.columnName = '计划' + column.label
|
||||
this.form.计划数 = row[`计划${column.label}`]
|
||||
this.numberValue = row.工艺任务明细流水号
|
||||
this.dialog = true
|
||||
}
|
||||
},
|
||||
submit() {
|
||||
var param = []
|
||||
param[0] = ['工艺任务明细流水号', this.numberValue]
|
||||
param[1] = ['列名', this.columnName]
|
||||
param[2] = ['计划数', this.form.计划数]
|
||||
var Data = this.CreateData('12', '车间生产管理_生产计划_修改数据', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('修改完成')
|
||||
this.searchTable1()
|
||||
this.dialog = false
|
||||
} else {
|
||||
this.$message.error('修改失败')
|
||||
}
|
||||
})
|
||||
},
|
||||
callOff() {
|
||||
this.dialog = false
|
||||
},
|
||||
getNowMonth() {
|
||||
const nowDate = new Date()
|
||||
const date = {
|
||||
@@ -355,103 +181,85 @@ export default {
|
||||
}
|
||||
this.monthValue = date.year + '-' + date.month
|
||||
},
|
||||
getPeople() {
|
||||
var param = []
|
||||
param[0] = ['考核部门编号', 19]
|
||||
var Data = this.CreateData('11', '人事档案管理_人员_部门与人员_查询数据_根据部门编号', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.people.push({
|
||||
label: response.data[i].姓名,
|
||||
value: response.data[i].人员编号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
searchTable1() {
|
||||
if (this.monthValue) {
|
||||
let orderNumberTypeValue_check, procedureValue_check, partNameValue_check, machine_check
|
||||
let orderNumberTypeValue_check, partNameValue_check, productNameValue_check, statusValue_check
|
||||
this.orderNumberTypeValue ? orderNumberTypeValue_check = 1 : orderNumberTypeValue_check = 0
|
||||
this.procedureValue ? procedureValue_check = 1 : procedureValue_check = 0
|
||||
this.partNameValue ? partNameValue_check = 1 : partNameValue_check = 0
|
||||
this.machine ? machine_check = 1 : machine_check = 0
|
||||
this.productNameValue ? productNameValue_check = 1 : productNameValue_check = 0
|
||||
this.statusValue ? statusValue_check = 1 : statusValue_check = 0
|
||||
var param = []
|
||||
param[0] = ['合同编号', this.orderNumberTypeValue]
|
||||
param[1] = ['合同编号_check', orderNumberTypeValue_check]
|
||||
param[2] = ['设备', this.machine]
|
||||
param[3] = ['设备_check', machine_check]
|
||||
param[4] = ['零件名称_check', partNameValue_check]
|
||||
param[5] = ['零件名称', this.partNameValue]
|
||||
param[6] = ['工序名称_check', procedureValue_check]
|
||||
param[7] = ['工序名称', this.procedureValue]
|
||||
param[2] = ['零件名称_check', partNameValue_check]
|
||||
param[3] = ['零件名称', this.partNameValue]
|
||||
param[4] = ['产品名称_check', productNameValue_check]
|
||||
param[5] = ['产品名称', this.productNameValue]
|
||||
param[6] = ['状态_check', statusValue_check]
|
||||
param[7] = ['状态', this.statusValue]
|
||||
param[8] = ['月份', this.monthValue]
|
||||
var Data = this.CreateData('11', '车间生产管理_生产计划_查询数据', param, this.pageSize, this.pageCurrent)
|
||||
var Data = this.CreateData('11', '车间生产管理_生产计划_查询数据', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
this.tableData2 = response.data.rows
|
||||
this.total = response.data.total
|
||||
console.log('接口返回完整数据:', response)
|
||||
const rows = response.data
|
||||
console.log('rows数据:', rows)
|
||||
const groupedData = this.groupByOrder(rows)
|
||||
console.log('分组后数据:', groupedData)
|
||||
this.tableData2 = groupedData
|
||||
})
|
||||
} else {
|
||||
this.$message.warning('月份不能为空')
|
||||
}
|
||||
},
|
||||
sortChange1(column) {
|
||||
if (column.prop === '零件名称') {
|
||||
this.orderName1 = 1
|
||||
} else if (column.prop === '工序') {
|
||||
this.orderName1 = 2
|
||||
} else if (column.prop === '姓名') {
|
||||
this.orderName1 = 3
|
||||
} else if (column.prop === '设备') {
|
||||
this.orderName1 = 4
|
||||
} else {
|
||||
this.orderName1 = 0
|
||||
groupByOrder(data) {
|
||||
const grouped = {}
|
||||
if (!Array.isArray(data)) {
|
||||
return []
|
||||
}
|
||||
if (column.order === 'ascending') {
|
||||
this.order1 = 1
|
||||
} else if (column.order === 'descending') { this.order1 = 2 } else {
|
||||
this.order1 = ''
|
||||
this.orderName1 = 0
|
||||
}
|
||||
this.searchTable1()
|
||||
},
|
||||
handleSizeChanges(val) {
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = val
|
||||
this.searchTable1()
|
||||
},
|
||||
handleCurrentChanges(val) {
|
||||
this.pageCurrent = val
|
||||
this.searchTable1()
|
||||
data.forEach(item => {
|
||||
if (!item) return
|
||||
const orderNo = item.订单号
|
||||
if (!grouped[orderNo]) {
|
||||
grouped[orderNo] = {
|
||||
订单号: item.订单号,
|
||||
产品名称: item.产品名称,
|
||||
零件名称: item.零件名称,
|
||||
零件图号: item.零件图号,
|
||||
订单数: item.订单数,
|
||||
计划数: item.计划数,
|
||||
剩余数: item.剩余数,
|
||||
状态: item.状态,
|
||||
完成率: item.完成率,
|
||||
投产时间: item.投产时间,
|
||||
精工期限: item.精工期限,
|
||||
设备: item.设备,
|
||||
材料: item.材料,
|
||||
OP010: '',
|
||||
OP020: '',
|
||||
OP030: '',
|
||||
OP040: '',
|
||||
OP050: '',
|
||||
OP060: '',
|
||||
OP070: '',
|
||||
OP080: '',
|
||||
OP090: '',
|
||||
OP100: '',
|
||||
OP110: ''
|
||||
}
|
||||
}
|
||||
const opIndex = parseInt(item.工序顺序)
|
||||
if (opIndex >= 1 && opIndex <= 11) {
|
||||
const opKey = `OP0${opIndex}0`
|
||||
grouped[orderNo][opKey] = item.工序
|
||||
}
|
||||
})
|
||||
return Object.values(grouped)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.el-form--label-left >>> .el-form-item__label {
|
||||
text-align: right;
|
||||
}
|
||||
>>>.el-dialog--center .el-dialog__body {
|
||||
text-align: initial;
|
||||
padding: 20px 30px 20px
|
||||
}
|
||||
>>>.el-dialog__header {
|
||||
padding: 20px 20px 0px;
|
||||
}
|
||||
>>>.el-dialog__footer {
|
||||
padding: 0px 20px 20px;
|
||||
/*text-align: right;*/
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
>>>.el-form-item {
|
||||
margin-bottom: 13px;
|
||||
}
|
||||
>>> .el-table__fixed {
|
||||
:deep(.el-table__fixed) {
|
||||
height: calc(100% - 18px) !important;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.el-table .Urgent {
|
||||
background: #ff7575 !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -87,11 +87,11 @@
|
||||
{{ scope.row.订单号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :width="setColumnWidth('姓名')" label="收货人" align="center" show-overflow-tooltip>
|
||||
<!-- <el-table-column :width="setColumnWidth('姓名')" label="收货人" align="center" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.收货人员 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="订单备注" align="center" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.订单备注 }}
|
||||
@@ -109,7 +109,11 @@
|
||||
</el-table-column>
|
||||
<el-table-column width="99px" label="完成期限" align="center" prop="精工" sortable="精工" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.精工期限 }}
|
||||
<span
|
||||
:class="{
|
||||
'emergency': scope.row.期限状态 === '紧急',
|
||||
'urgent': scope.row.期限状态 === '加急'
|
||||
}">{{ scope.row.精工期限 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="99px" label="投产日期" align="center" prop="投产日期" sortable="投产日期" show-overflow-tooltip>
|
||||
@@ -117,16 +121,21 @@
|
||||
{{ scope.row.投产日期 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="240px">
|
||||
<el-table-column label="操作" align="center" width="300px">
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip :open-delay="500" effect="dark" content="查看客户提供资料" placement="top">
|
||||
<el-button :disabled="scope.row.客户提供资料 === '0'" type="text" icon="el-icon-picture-outline" size="mini" @click="ContractPhoto(scope.row)"/>
|
||||
</el-tooltip>
|
||||
<el-tooltip :open-delay="700" effect="dark" content="PLM" placement="top">
|
||||
<el-button type="text" icon="el-icon-connection" size="mini" @click="handlePLM(scope.row)">PLM</el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip :open-delay="700" effect="dark" content="图纸" placement="top">
|
||||
<el-button :disabled="scope.row.图纸 === null" type="text" icon="el-icon-search" size="mini" @click="getNum(scope.row)">图纸</el-button>
|
||||
</el-tooltip>
|
||||
<el-button :disabled="scope.row.状态新 === '未开始'" type="text" size="mini" style="margin-right: 0px" @click="partTraceability(scope.row)">零件追溯</el-button>
|
||||
<el-button :disabled="Number(scope.row.订单类型)!==3" type="text" size="mini" style="margin-right: 0px" @click="partReturn(scope.row)">打回</el-button>
|
||||
<el-button type="text" size="mini" style="margin-right: 0px" title="工艺" @click="handleEdit(scope.row, '工艺')">工艺</el-button>
|
||||
<el-button :disabled="scope.row.状态新 !== '工艺完成' && scope.row.状态新 !== '加工中'" type="text" size="mini" style="margin-right: 0px" title="派工" @click="handleEdit(scope.row, '派工')">派工</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -339,7 +348,27 @@ export default {
|
||||
this.fetchData()
|
||||
// this.getProductionStatus()
|
||||
},
|
||||
// watch: {
|
||||
// '$route': {
|
||||
// handler(route) {
|
||||
// if (sessionStorage.getItem('skipAutoFill')) {
|
||||
// sessionStorage.removeItem('skipAutoFill')
|
||||
// return
|
||||
// }
|
||||
// this.contractQueryJump(this.$route.query.订单号)
|
||||
// },
|
||||
// immediate: true
|
||||
// }
|
||||
// },
|
||||
methods: {
|
||||
handleEdit(row, buttonType) {
|
||||
sessionStorage.setItem('skipAutoFill', 'true')
|
||||
if (buttonType === '工艺') {
|
||||
this.$router.push({ path: '/SeikoWorkshop/DevelopProcess', query: { 订单流水号: row.订单流水号 }})
|
||||
} else if (buttonType === '派工') {
|
||||
this.$router.push({ path: '/SeikoWorkshop/WorkshopAssignment', query: { 订单号: row.订单号 }})
|
||||
}
|
||||
},
|
||||
partReturn(row) {
|
||||
this.form.打回原因 = ''
|
||||
this.orderNumber = row.订单号
|
||||
@@ -465,6 +494,29 @@ export default {
|
||||
// })
|
||||
// },
|
||||
// 查看零件图
|
||||
handlePLM(row) {
|
||||
const msgId = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
|
||||
const r = Math.random() * 16 | 0
|
||||
const v = c === 'x' ? r : (r & 0x3 | 0x8)
|
||||
return v.toString(16)
|
||||
})
|
||||
request({
|
||||
url: 'http://192.168.1.27:9982/api/GetMaterialDrawingUrl',
|
||||
method: 'post',
|
||||
data: {
|
||||
msgId: msgId,
|
||||
materialCode: row.物料编码
|
||||
}
|
||||
}).then(response => {
|
||||
if (response.data.Code === '200' && response.data.Data.url) {
|
||||
window.open(response.data.Data.url, '_blank')
|
||||
} else {
|
||||
this.$message.warning('PLM未返回有效链接')
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$message.error('PLM请求发送失败')
|
||||
})
|
||||
},
|
||||
getNum(row) {
|
||||
this.dialogVisible = true
|
||||
this.getFileList(row.零件图号)
|
||||
@@ -557,6 +609,34 @@ export default {
|
||||
this.pageCurrent = val
|
||||
this.searchTable()
|
||||
}
|
||||
// async contractQueryJump(订单编号 , shouldSetValue = false) {
|
||||
// if (订单编号 && shouldSetValue) {
|
||||
// // 确保orderName1已加载
|
||||
// if (this.orderName1.length === 0) {
|
||||
// await new Promise(resolve => {
|
||||
// var param = []
|
||||
// var Data = this.CreateData('11', '生产任务查询_订单信息_列表_查询数据', param)
|
||||
// this.ExecDatabase(Data).then(response => {
|
||||
// for (let i = 0; i < response.data.length; i++) {
|
||||
// this.orderName1.push({
|
||||
// label: response.data[i].订单编号,
|
||||
// value: response.data[i].订单流水号
|
||||
// })
|
||||
// }
|
||||
// resolve()
|
||||
// })
|
||||
// })
|
||||
// }
|
||||
|
||||
// let obj = this.orderName1.find((item) => {
|
||||
// return item.label === 订单编号
|
||||
// })
|
||||
// if (obj) {
|
||||
// this.orderNameValue = obj.value
|
||||
// this.searchTable()
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -575,6 +655,14 @@ export default {
|
||||
.CompleteColor{
|
||||
background: #d8e5f6 !important;
|
||||
}
|
||||
.emergency {
|
||||
color: red !important;
|
||||
font-weight: bold;
|
||||
}
|
||||
.urgent {
|
||||
color: green !important;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
<style scoped>
|
||||
.el-form--label-left >>> .el-form-item__label {
|
||||
|
||||
@@ -174,6 +174,8 @@
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
import { MESDownloadFileNew } from '@/utils/request'
|
||||
import axios from 'axios'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -251,11 +253,22 @@ export default {
|
||||
param[0] = ['质检流水号', row.质检流水号]
|
||||
var Data = this.CreateData('11', '质检管理_图片_查询数据', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
// this.URL = readFile + response.data[0].文件标识 + '.' + response.data[0].文件后缀
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
if (response.data[i].文件内容 !== null) {
|
||||
// this.urls.push(readFile + response.data[i].文件标识 + '.' + response.data[i].文件后缀)
|
||||
this.urls.push('data:image/png;base64,' + response.data[i].文件内容)
|
||||
const item = response.data[i]
|
||||
// 优先使用文件路径(新方式)
|
||||
if (item.文件路径) {
|
||||
axios.get(MESDownloadFileNew, {
|
||||
params: { filePath: item.文件路径 }
|
||||
}).then(res => {
|
||||
if (res.data && res.data[0] && res.data[0].文件内容) {
|
||||
this.urls.push('data:image/png;base64,' + res.data[0].文件内容)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.error('图片加载失败:', err)
|
||||
})
|
||||
} else if (item.文件内容 !== null) {
|
||||
// 兼容旧数据
|
||||
this.urls.push('data:image/png;base64,' + item.文件内容)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -200,6 +200,8 @@
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
import { MESDownloadFileNew } from '@/utils/request'
|
||||
import axios from 'axios'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -280,17 +282,28 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
viewPicture(row) {
|
||||
this.dialogFormVisible = true
|
||||
this.dialogFormVisible1 = true
|
||||
this.urls = []
|
||||
var param = []
|
||||
param[0] = ['质检流水号', row.质检流水号]
|
||||
var Data = this.CreateData('11', '质检管理_图片_查询数据', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
// this.URL = readFile + response.data[0].文件标识 + '.' + response.data[0].文件后缀
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
if (response.data[i].文件内容 !== null) {
|
||||
// this.urls.push(readFile + response.data[i].文件标识 + '.' + response.data[i].文件后缀)
|
||||
this.urls.push('data:image/png;base64,' + response.data[i].文件内容)
|
||||
const item = response.data[i]
|
||||
// 优先使用文件路径(新方式)
|
||||
if (item.文件路径) {
|
||||
axios.get(MESDownloadFileNew, {
|
||||
params: { filePath: item.文件路径 }
|
||||
}).then(res => {
|
||||
if (res.data && res.data[0] && res.data[0].文件内容) {
|
||||
this.urls.push('data:image/png;base64,' + res.data[0].文件内容)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.error('图片加载失败:', err)
|
||||
})
|
||||
} else if (item.文件内容 !== null) {
|
||||
// 兼容旧数据
|
||||
this.urls.push('data:image/png;base64,' + item.文件内容)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -69,6 +69,8 @@
|
||||
</el-button>
|
||||
<el-button type="success" plain size="small" style="margin-left: 10px" @click="getNum()">查看图纸
|
||||
</el-button>
|
||||
<el-button v-if="Number(token) === 2" type="danger" plain size="small" style="margin-left: 10px" @click="openScrapDialog()">手动报废结单
|
||||
</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
@@ -81,6 +83,7 @@
|
||||
size="mini"
|
||||
style="width: 100%;margin-top: 10px"
|
||||
height="750"
|
||||
@cell-dblclick="handleEdit"
|
||||
@row-click="searchTable1">
|
||||
<el-table-column :width="setColumnWidth('序号')" label="序号" type="index" align="center"/>
|
||||
<el-table-column :width="setColumnWidth('订单号')" label="订单号" align="center">
|
||||
@@ -132,6 +135,11 @@
|
||||
{{ scope.row.订单备注 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="100px" label="技术备注" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.技术备注 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
@@ -188,7 +196,7 @@
|
||||
size="mini"
|
||||
height="370px"
|
||||
style="width: 100%;margin-top: 10px"
|
||||
@row-click="XUANCHU">
|
||||
>
|
||||
<!--<el-table-column :width="setColumnWidth('零件名称')" label="零件名称" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件名称 }}
|
||||
@@ -234,11 +242,16 @@
|
||||
{{ scope.row.设备 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :width="setColumnWidth('日期')" label="派工时间" align="center">
|
||||
<!-- <el-table-column :width="setColumnWidth('日期')" label="派工时间" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.分配时间 }}
|
||||
{{ scope.row.计划开始日期 ? scope.row.计划开始日期.split(' ')[0] : '' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :width="setColumnWidth('日期')" label="完成期限" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.Expr1 ? scope.row.Expr1.split(' ')[0] : '' }}
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="操作" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
@@ -248,6 +261,13 @@
|
||||
size="mini"
|
||||
@click="editData(scope.row)">编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
:disabled="Number(scope.row.是否加工中)===1 || Number(scope.row.完成数) > 0 || Number(scope.row.报废数量) > 0 || scope.row.姓名==='外协'"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
@click="XUANCHU(scope.row)">取消
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -386,6 +406,62 @@
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 手动报废结单弹窗 -->
|
||||
<el-dialog v-el-drag-dialog :visible.sync="scrapDialogVisible" title="手动报废结单" center width="500px">
|
||||
<el-form
|
||||
ref="scrapForm"
|
||||
:model="scrapForm"
|
||||
:rules="scrapRules"
|
||||
label-position="right"
|
||||
label-width="100px">
|
||||
<el-form-item label="零件名称">
|
||||
<span>{{ currentPartName }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="投产数">
|
||||
<span>{{ currentBatchQty }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="已完成数">
|
||||
<span>{{ currentFinishQty }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="已报废数">
|
||||
<span>{{ currentScrapQty }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="最大可报废">
|
||||
<span style="color: #E6A23C;">{{ maxScrapQty }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="报废数量" prop="报废数量">
|
||||
<el-input-number
|
||||
v-model="scrapForm.报废数量"
|
||||
:min="1"
|
||||
:max="maxScrapQty"
|
||||
:step="1"
|
||||
size="small"
|
||||
style="width: 200px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="报废原因" prop="报废原因">
|
||||
<el-select v-model="scrapForm.报废原因" placeholder="请选择报废原因" size="small" style="width: 200px">
|
||||
<el-option
|
||||
v-for="item in scrapReasonList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input
|
||||
v-model="scrapForm.备注"
|
||||
:rows="3"
|
||||
type="textarea"
|
||||
placeholder="请输入备注说明"
|
||||
maxlength="200"
|
||||
show-word-limit/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="scrapDialogVisible = false">取消</el-button>
|
||||
<el-button type="danger" size="small" @click="submitScrap()">确认报废结单</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
@@ -435,7 +511,24 @@ export default {
|
||||
pageCurrent: 1, // 分页当前页
|
||||
pageSize: 40, // 分页每页显示条数
|
||||
orderName: '', // 排序列名
|
||||
order: '' // 排序方式
|
||||
order: '', // 排序方式
|
||||
// 手动报废结单相关
|
||||
scrapDialogVisible: false,
|
||||
scrapForm: {
|
||||
报废数量: 1,
|
||||
报废原因: '',
|
||||
备注: ''
|
||||
},
|
||||
scrapRules: {
|
||||
报废数量: [{ required: true, message: '请输入报废数量', trigger: 'blur' }],
|
||||
报废原因: [{ required: true, message: '请选择报废原因', trigger: 'change' }]
|
||||
},
|
||||
scrapReasonList: [],
|
||||
currentPartName: '',
|
||||
currentBatchQty: 0,
|
||||
currentFinishQty: 0,
|
||||
currentScrapQty: 0,
|
||||
maxScrapQty: 0
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -451,16 +544,87 @@ export default {
|
||||
this.machineName = this.machine[i].name
|
||||
}
|
||||
}
|
||||
},
|
||||
'$route': {
|
||||
handler(route) {
|
||||
this.contractQueryJump(this.$route.query.订单号)
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initOrderData()
|
||||
this.getOrderName('')
|
||||
this.searchTable()
|
||||
this.getMachine()
|
||||
this.getPeople()
|
||||
this.initWebpack()
|
||||
this.getScrapReasonList()
|
||||
},
|
||||
methods: {
|
||||
async initOrderData() {
|
||||
// 先加载订单列表数据(如果为空)
|
||||
if (this.orderName1.length === 0) {
|
||||
var param = []
|
||||
var Data = this.CreateData('11', '生产任务查询_订单信息_列表_查询数据', param)
|
||||
await this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.orderName1.push({
|
||||
label: response.data[i].订单编号,
|
||||
value: response.data[i].订单流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 检查是否有路由参数需要跳转
|
||||
const 订单编号 = this.$route.query.订单号
|
||||
if (订单编号) {
|
||||
const obj = this.orderName1.find((item) => item.label === 订单编号)
|
||||
if (obj) {
|
||||
this.orderNameValue = obj.value
|
||||
await this.searchTable() // 执行查询
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// 没有路由参数或匹配失败,执行默认查询
|
||||
this.searchTable()
|
||||
},
|
||||
|
||||
async contractQueryJump(订单编号) {
|
||||
if (订单编号) {
|
||||
// 确保orderName1已加载
|
||||
if (this.orderName1.length === 0) {
|
||||
await new Promise(resolve => {
|
||||
var Data = this.CreateData('11', '生产任务查询_订单信息_列表_查询数据', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.orderName1.push({
|
||||
label: response.data[i].订单编号,
|
||||
value: response.data[i].订单流水号
|
||||
})
|
||||
}
|
||||
resolve()
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
const obj = this.orderName1.find((item) => {
|
||||
return item.label === 订单编号
|
||||
})
|
||||
if (obj) {
|
||||
this.orderNameValue = obj.value
|
||||
await this.searchTable()
|
||||
}
|
||||
}
|
||||
},
|
||||
// handleEdit(row, column) {
|
||||
// if (column.label === '订单号') {
|
||||
// console.log(1)
|
||||
// this.$router.push({ path: '/SeikoWorkshop/ProductionTaskQuery', query: { 订单号: row.订单号 }})
|
||||
// }
|
||||
// },
|
||||
|
||||
// 初始化websocket
|
||||
initWebpack() {
|
||||
this.websock = new WebSocket(wsuri)// 这里面的this都指向vue
|
||||
@@ -627,12 +791,22 @@ export default {
|
||||
var Data = this.CreateData('11', '车间生产管理工艺_零件工序_已派工查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
this.tableData1 = response.data
|
||||
})
|
||||
var param1 = []
|
||||
param1[0] = ['工艺计划流水号', row.工艺计划流水号]
|
||||
var Data1 = this.CreateData('11', '车间生产管理工艺_零件工序_派工_工序查询', param1)
|
||||
this.ExecDatabase(Data1).then(response => {
|
||||
this.tableData2 = response.data
|
||||
// 获取tableData2后,将tableData1中的计划开始日期和Expr1赋值给tableData2
|
||||
var param1 = []
|
||||
param1[0] = ['工艺计划流水号', row.工艺计划流水号]
|
||||
var Data1 = this.CreateData('11', '车间生产管理工艺_零件工序_派工_工序查询', param1)
|
||||
this.ExecDatabase(Data1).then(response => {
|
||||
this.tableData2 = response.data
|
||||
// 遍历tableData2,为每一行设置默认的计划开始日期和计划完成日期
|
||||
this.tableData2.forEach(item => {
|
||||
// 查找tableData1中对应工序的记录
|
||||
const table1Item = this.tableData1.find(t1 => t1.工序 === item.工序)
|
||||
if (table1Item) {
|
||||
item.计划开始日期 = table1Item.计划开始日期
|
||||
item.计划完成日期 = table1Item.Expr1
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
sortChange1(column) {
|
||||
@@ -782,6 +956,7 @@ export default {
|
||||
param[0] = ['工序流水号', row.工序流水号]
|
||||
param[1] = ['数量', row.数量]
|
||||
param[2] = ['工艺任务流水号', row.工艺任务流水号]
|
||||
param[3] = ['退货人', this.id]
|
||||
// 参数数量与名称要与存储过程对应
|
||||
var Data = this.CreateData('12', '车间生产管理工艺_零件工序_取消派工', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
@@ -859,6 +1034,125 @@ export default {
|
||||
handleCurrentChanges(val) {
|
||||
this.pageCurrent = val
|
||||
this.searchTable()
|
||||
},
|
||||
// 获取报废原因列表
|
||||
getScrapReasonList() {
|
||||
var Data = this.CreateData('11', '质检管理_不合格原因_查询数据', [])
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
this.scrapReasonList = []
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.scrapReasonList.push({
|
||||
label: response.data[i].不合格原因文本,
|
||||
value: response.data[i].不合格原因
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 打开手动报废结单弹窗
|
||||
openScrapDialog() {
|
||||
if (!this.processValue) {
|
||||
this.$message.warning('请先选择要操作的零件')
|
||||
return
|
||||
}
|
||||
// 获取当前工单信息
|
||||
var param = []
|
||||
param[0] = ['工艺计划流水号', this.processValue]
|
||||
var Data = this.CreateData('11', '车间派工_手动报废结单_查询信息', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data && response.data.length > 0) {
|
||||
const info = response.data[0]
|
||||
this.currentPartName = info.零件名称
|
||||
this.currentBatchQty = info.批次数量
|
||||
this.currentFinishQty = info.完成数量 || 0
|
||||
this.currentScrapQty = info.已报废数量 || 0
|
||||
this.maxScrapQty = Math.max(0, this.currentBatchQty - this.currentFinishQty - this.currentScrapQty)
|
||||
// 场景B:历史遗留工单 - 完成数已等于批次数但状态未更新
|
||||
if (this.currentFinishQty >= this.currentBatchQty && info.考核状态 < 3) {
|
||||
this.$confirm(
|
||||
'该工单完成数(' + this.currentFinishQty + ')已达到批次数(' + this.currentBatchQty + '),但状态仍为加工中。\n是否立即修复工单状态为"完成"?',
|
||||
'历史遗留工单修复',
|
||||
{
|
||||
confirmButtonText: '立即修复',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}
|
||||
).then(() => {
|
||||
this.submitScrapFix()
|
||||
}).catch(() => {})
|
||||
return
|
||||
}
|
||||
// 场景A:正常报废结单
|
||||
if (this.maxScrapQty <= 0) {
|
||||
this.$message.warning('该工单已无可报废数量')
|
||||
return
|
||||
}
|
||||
this.scrapForm = {
|
||||
报废数量: 1,
|
||||
报废原因: '',
|
||||
备注: ''
|
||||
}
|
||||
this.scrapDialogVisible = true
|
||||
} else {
|
||||
this.$message.error('获取工单信息失败')
|
||||
}
|
||||
})
|
||||
},
|
||||
// 提交手动报废结单
|
||||
submitScrap() {
|
||||
this.$refs['scrapForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm('确定要报废 ' + this.scrapForm.报废数量 + ' 件吗?报废后如满足条件将自动结单。', '确认报废', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
var param = []
|
||||
param[0] = ['工艺计划流水号', this.processValue]
|
||||
param[1] = ['报废数量', this.scrapForm.报废数量]
|
||||
param[2] = ['报废原因', this.scrapForm.报废原因]
|
||||
param[3] = ['备注', this.scrapForm.备注]
|
||||
param[4] = ['操作人编号', this.id]
|
||||
var Data = this.CreateData('11', '车间派工_手动报废结单', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data && response.data.length > 0) {
|
||||
const result = response.data[0]
|
||||
if (result.result === 1) {
|
||||
this.$message.success(result.msg)
|
||||
this.scrapDialogVisible = false
|
||||
this.searchTable()
|
||||
} else {
|
||||
this.$message.error(result.msg)
|
||||
}
|
||||
} else {
|
||||
this.$message.error('操作失败')
|
||||
}
|
||||
})
|
||||
}).catch(() => {})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 修复历史遗留工单(完成数已等于批次数但状态未更新)
|
||||
submitScrapFix() {
|
||||
var param = []
|
||||
param[0] = ['工艺计划流水号', this.processValue]
|
||||
param[1] = ['报废数量', 0]
|
||||
param[2] = ['报废原因', 0]
|
||||
param[3] = ['备注', '历史遗留工单修复']
|
||||
param[4] = ['操作人编号', this.id]
|
||||
var Data = this.CreateData('11', '车间派工_手动报废结单', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data && response.data.length > 0) {
|
||||
const result = response.data[0]
|
||||
if (result.result === 1) {
|
||||
this.$message.success(result.msg)
|
||||
this.searchTable()
|
||||
} else {
|
||||
this.$message.error(result.msg)
|
||||
}
|
||||
} else {
|
||||
this.$message.error('操作失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user