This commit is contained in:
lixin
2018-12-07 19:09:48 +08:00
13 changed files with 1117 additions and 39 deletions

View File

@@ -61,7 +61,7 @@ export function addList() {
data: { data: {
type: '2', type: '2',
name: '基础表_合同信息表_增加数据', name: '基础表_合同信息表_增加数据',
param: '项目名称=' + arguments[0] + '&图纸会签节点=' + arguments[1] + '&设备预验收节点=' + arguments[2] + '&发货节点=' + arguments[3] + '&安装调试节点=' + arguments[4] + '&人员ID=' + arguments[5] + '&执行进度ID=' + arguments[6] + '&客户流水号=' + arguments[7] + '&备注=' + arguments[8] + '&付款方式代码=' + arguments[9] + '&合同签订日期=' + arguments[10] param: '项目名称=' + arguments[0] + '&图纸会签节点=' + arguments[1] + '&设备预验收节点=' + arguments[2] + '&发货节点=' + arguments[3] + '&安装调试节点=' + arguments[4] + '&人员ID=' + arguments[5] + '&执行进度ID=' + arguments[6] + '&客户流水号=' + arguments[7] + '&备注=' + arguments[8] + '&付款方式代码=' + arguments[9] + '&合同签订日期=' + arguments[10] + '&招标保证金流水号=' + arguments[11]
} }
}) })
} }
@@ -92,7 +92,7 @@ export function editchar() {
data: { data: {
type: '2', type: '2',
name: '合同信息管理_合同信息_编辑', name: '合同信息管理_合同信息_编辑',
param: '项目名称=' + arguments[0] + '&图纸会签节点=' + arguments[1] + '&设备预验收节点=' + arguments[2] + '&发货节点=' + arguments[3] + '&安装调试节点=' + arguments[4] + '&人员ID=' + arguments[5] + '&执行进度ID=' + arguments[6] + '&客户流水号=' + arguments[7] + '&合同信息备注=' + arguments[8] + '&项目流水号=' + arguments[9] + '&付款方式代码=' + arguments[10] + '&合同签订日期=' + arguments[11] param: '项目名称=' + arguments[0] + '&图纸会签节点=' + arguments[1] + '&设备预验收节点=' + arguments[2] + '&发货节点=' + arguments[3] + '&安装调试节点=' + arguments[4] + '&人员ID=' + arguments[5] + '&执行进度ID=' + arguments[6] + '&客户流水号=' + arguments[7] + '&合同信息备注=' + arguments[8] + '&项目流水号=' + arguments[9] + '&付款方式代码=' + arguments[10] + '&合同签订日期=' + arguments[11] + '&招标保证金流水号=' + arguments[12]
} }
}) })
} }
@@ -254,3 +254,14 @@ export function changeExecutionProgressID() {
} }
}) })
} }
export function selectBidBond() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '投标保证金管理_投标保证金查询',
param: '是否收回_check=' + arguments[0] + '&是否收回=' + arguments[1] + '&保金类型_check=' + arguments[2] + '&保金类型=' + arguments[3] + '&投标人_check=' + arguments[4] + '&投标人=' + arguments[5] + '&招标企业_check=' + arguments[6] + '&招标企业=' + arguments[7] + '&开始日期_check=' + arguments[8] + '&开始日期=' + arguments[9] + '&结束日期_check=' + arguments[10] + '&结束日期=' + arguments[11]
}
})
}

View File

@@ -34,7 +34,28 @@ export function isDrawingNum(projectName, machineNum, groupNum, drawingNum) {
} }
}) })
} }
export function update(projectName, machineNum, id, type, drawingNum) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: 'PDM_零件明细表_基本件_数据导入保存_编辑整改类型',
param: `项目名称=${projectName}&机床名称=${machineNum}&id=${id}&整改类型=${type}&前图号或者型号=${drawingNum}`
}
})
}
export function searchOldParts(projectName, machineNum, drawingNum) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: 'PDM_零件明细表_整改件_数据关联查询_gj',
param: `项目名称=${projectName}&机床名称=${machineNum}&图号或者型号=${drawingNum}`
}
})
}
export function importBasics(establishment, proofread, review, date, projectName, machineNum, machineName, componentName, componentNum, groupNum, contractNum, totalNum, pageNum, drawingNum, name, type, material, spareNum, useNum, manufacturer, remarks, classificationCode) { export function importBasics(establishment, proofread, review, date, projectName, machineNum, machineName, componentName, componentNum, groupNum, contractNum, totalNum, pageNum, drawingNum, name, type, material, spareNum, useNum, manufacturer, remarks, classificationCode) {
return request({ return request({
url: '', url: '',
@@ -42,7 +63,7 @@ export function importBasics(establishment, proofread, review, date, projectName
data: { data: {
type: '2', type: '2',
name: '组件明细表_基本件_导入数据gj', name: '组件明细表_基本件_导入数据gj',
param: `编制=${establishment}&校对=${proofread}&审核=${review}&日期=${date}&项目=${projectName}&机床=${machineNum}&设备名称=${machineName}&部件名称=${componentName}&部件数量=${componentNum}&组号=${groupNum}&合同编号=${contractNum}&合计页码=${totalNum}&页码=${pageNum}&图号=${drawingNum}&名称=${name}&规格=${type}&材料=${material}&备件数量=${spareNum}&装机数量=${useNum}&制造商=${manufacturer}&备注=${remarks}&分类码=${classificationCode}` param: `编制=${establishment}&校对=${proofread}&审核=${review}&日期=${date}&项目=${projectName}&机床=${machineNum}&设备名称=${machineName}&部件名称=${componentName}&部件数量=${componentNum}&组号=${groupNum}&合同编号=${contractNum}&合计页码=${totalNum}&页码=${pageNum}&图号=${drawingNum}&名称=${name}&规格\\=${type}&材料=${material}&备件数量=${spareNum}&装机数量=${useNum}&制造商=${manufacturer}&备注\\=${remarks}&分类码=${classificationCode}`
} }
}) })
} }
@@ -54,7 +75,7 @@ export function importPurcharse(establishment, proofread, review, date, projectN
data: { data: {
type: '2', type: '2',
name: '零件明细表_外购件和标准件_导入数据gj', name: '零件明细表_外购件和标准件_导入数据gj',
param: `编制=${establishment}&校对=${proofread}&审核=${review}&日期=${date}&项目=${projectName}&机床=${machineNum}&设备名称=${machineName}&部件名称=${componentName}&部件数量=${componentNum}&组号=${groupNum}&合同编号=${contractNum}&合计页码=${totalNum}&页码=${pageNum}&图号=${drawingNum}&名称=${name}&规格=${type}&材料=${material}&备件数量=${spareNum}&装机数量=${useNum}&制造商=${manufacturer}&备注=${remarks}&分类码=${classificationCode}` param: `编制=${establishment}&校对=${proofread}&审核=${review}&日期=${date}&项目=${projectName}&机床=${machineNum}&设备名称=${machineName}&部件名称=${componentName}&部件数量=${componentNum}&组号=${groupNum}&合同编号=${contractNum}&合计页码=${totalNum}&页码=${pageNum}&图号=${drawingNum}&名称=${name}&规格\\=${type}&材料=${material}&备件数量=${spareNum}&装机数量=${useNum}&制造商=${manufacturer}&备注\\=${remarks}&分类码=${classificationCode}`
} }
}) })
} }
@@ -70,6 +91,17 @@ export function specificationQuery(projectCheck, project, machineCheck, machine,
} }
}) })
} }
export function specificationQuery1(projectCheck, project, machineCheck, machine, groupCheck, group) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: 'PDM_零件明细表_整改件_规范数据查询_gj',
param: `项目名字_check=${projectCheck}&项目名字=${project}&机床名字_check=${machineCheck}&机床名字=${machine}&组号_check=${groupCheck}&组号=${group}`
}
})
}
export function specificationQueryWB(projectCheck, project, machineCheck, machine, groupCheck, group) { export function specificationQueryWB(projectCheck, project, machineCheck, machine, groupCheck, group) {
return request({ return request({
url: '', url: '',
@@ -92,6 +124,17 @@ export function unSpecificationQuery(projectCheck, project, machineCheck, machin
} }
}) })
} }
export function unSpecificationQuery1(projectCheck, project, machineCheck, machine, groupCheck, group) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: 'PDM_零件明细表_整改件_不规范数据查询_gj',
param: `项目名字_check=${projectCheck}&项目名字=${project}&机床名字_check=${machineCheck}&机床名字=${machine}&组号_check=${groupCheck}&组号=${group}`
}
})
}
export function unSpecificationQueryWB(projectCheck, project, machineCheck, machine, groupCheck, group) { export function unSpecificationQueryWB(projectCheck, project, machineCheck, machine, groupCheck, group) {
return request({ return request({
url: '', url: '',
@@ -223,6 +266,18 @@ export function searchGroupNum(project, name) {
} }
}) })
} }
// 查询组号
export function searchGroupNum1(project, name) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: 'PDM_零件明细表_整改件_数据导入保存_组号_查询数据gj',
param: `项目=${project}&机床=${name}`
}
})
}
// 传递零件 // 传递零件
export function transferMX(num1, name, num2, remark, mark, num3, num4, num5, type, transmit, num6, id) { export function transferMX(num1, name, num2, remark, mark, num3, num4, num5, type, transmit, num6, id) {
return request({ return request({
@@ -235,7 +290,18 @@ export function transferMX(num1, name, num2, remark, mark, num3, num4, num5, typ
} }
}) })
} }
// 传递零件
export function transferMX1(num1, name, num2, remark, mark, num3, num4, num5, type, transmit, num6, id, oldId) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: 'PDM_零件明细表_整改件_大量导入',
param: '图号或者型号=' + num1 + '&零件名称=' + name + '&零件数量=' + num2 + '&零件备注=' + remark + '&标记=' + mark + '&设计者编号=' + num3 + '&组件流水号=' + num4 + '&材料流水号=' + num5 + '&数据类型=' + type + '&是否传递=' + transmit + '&序号=' + num6 + '&id=' + id + '&前id=' + oldId
}
})
}
export function transferWG(groupNum, materialNum, totalNum, remarks, mark, designNum, isTransfer, dataType, No, id) { export function transferWG(groupNum, materialNum, totalNum, remarks, mark, designNum, isTransfer, dataType, No, id) {
return request({ return request({
url: '', url: '',

View File

@@ -169,6 +169,7 @@ export default {
if (type(callback) === 'function' && type(requestData) === 'function' && type(form) === 'string') { if (type(callback) === 'function' && type(requestData) === 'function' && type(form) === 'string') {
console.log(this.$refs[form]) console.log(this.$refs[form])
this.$refs[form].validate((valid) => { this.$refs[form].validate((valid) => {
console.log(valid)
if (valid) { if (valid) {
requestData(...param).then(response => { requestData(...param).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {

View File

@@ -14,9 +14,9 @@ const service = axios.create({
// baseURL: `http://192.168.1.149:8411/submit/MESCommonBase.ashx`, // baseURL: `http://192.168.1.149:8411/submit/MESCommonBase.ashx`,
// baseURL: `http://192.168.1.149:8411/submit/MESCommonBase.ashx`, // baseURL: `http://192.168.1.149:8411/submit/MESCommonBase.ashx`,
// baseURL: `http://localhost:8411/submit/MESCommonBase.ashx`, // baseURL: `http://localhost:8411/submit/MESCommonBase.ashx`,
// baseURL: `http://localhost:8411/submit/MESCommonBase.ashx`,
baseURL: `http://localhost:8411/submit/MESCommonBase.ashx`, baseURL: `http://localhost:8411/submit/MESCommonBase.ashx`,
// baseURL: `http://192.168.1.112:8411/submit/MESCommonBase.ashx`, // baseURL: `http://localhost:8077/submit/MESCommonBase.ashx`,
// baseURL: `http://192.168.0.112:8411/submit/MESCommonBase.ashx`,
timeout: 1500000 // 请求超时时间 timeout: 1500000 // 请求超时时间
}) })

View File

@@ -804,10 +804,12 @@ export default {
} }
}, },
Production() { Production() {
this.result = 0
if (this.PartType === '基本件' && this.BasicPartsNumber.length !== 0) { if (this.PartType === '基本件' && this.BasicPartsNumber.length !== 0) {
for (let i = 0; i < this.BasicPartsNumber.length; i++) { for (let i = 0; i < this.BasicPartsNumber.length; i++) {
Production(this.groupFloatValue, this.BasicPartsNumber[i], this.projectFloatValue, this.machineFloatValue).then(response => { Production(this.groupFloatValue, this.BasicPartsNumber[i], this.projectFloatValue, this.machineFloatValue).then(response => {
if (response.data[0].result === '1') { this.result += parseInt(response.data[0].result)
if (this.result === this.BasicPartsNumber.length) {
this.$message.success('投产成功') this.$message.success('投产成功')
searchPart(this.groupFloatValue).then(response => { searchPart(this.groupFloatValue).then(response => {
this.tableData1 = response.data this.tableData1 = response.data

View File

@@ -27,7 +27,6 @@
</el-input> </el-input>
<span>零件号:</span> <span>零件号:</span>
<el-input v-model="partNumber" placeholder="零件号" size="small" clearable style="width:200px"/> <el-input v-model="partNumber" placeholder="零件号" size="small" clearable style="width:200px"/>
<br>
<span>零件状态:</span> <span>零件状态:</span>
<el-select v-model="partStateValue" placeholder="零件状态" size="small" clearable style="width:200px"> <el-select v-model="partStateValue" placeholder="零件状态" size="small" clearable style="width:200px">
<el-option <el-option
@@ -36,14 +35,14 @@
:label="item.label" :label="item.label"
:value="item.value"/> :value="item.value"/>
</el-select> </el-select>
<span>零件类型:</span> <!--<span>零件类型:</span>-->
<el-select v-model="partTypeValue" placeholder="零件类型" size="small" clearable style="margin-top: 15px;width: 200px"> <!--<el-select v-model="partTypeValue" placeholder="零件类型" size="small" clearable style="margin-top: 15px;width: 200px">-->
<el-option <!--<el-option-->
v-for="item in partType" <!--v-for="item in partType"-->
:key="item.value" <!--:key="item.value"-->
:label="item.label" <!--:label="item.label"-->
:value="item.value"/> <!--:value="item.value"/>-->
</el-select> <!--</el-select>-->
<el-button type="success" icon="el-icon-search" size="small" style="margin: 15px 0 0 10px" @click="pageCurrent=1;pageSize=10;total=0;searchData()">查询</el-button> <el-button type="success" icon="el-icon-search" size="small" style="margin: 15px 0 0 10px" @click="pageCurrent=1;pageSize=10;total=0;searchData()">查询</el-button>
</el-card> </el-card>
@@ -100,15 +99,15 @@
</el-steps> </el-steps>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="120px"> <!--<el-table-column label="操作" fixed="right" align="center" width="120px">-->
<template slot-scope="scope"> <!--<template slot-scope="scope">-->
<el-button <!--<el-button-->
size="mini" <!--size="mini"-->
type="primary" <!--type="primary"-->
icon="el-icon-edit" <!--icon="el-icon-edit"-->
@click="handleEdit(scope.row)">编辑</el-button> <!--@click="handleEdit(scope.row)">编辑</el-button>-->
</template> <!--</template>-->
</el-table-column> <!--</el-table-column>-->
</el-table> </el-table>
<div class="block" style="margin-top: 10px;"> <div class="block" style="margin-top: 10px;">
<el-pagination <el-pagination
@@ -352,7 +351,6 @@ export default {
} }
this.loading0 = true this.loading0 = true
searchTable(this.check, this.entryNameValue, this.check1, this.machine, this.check2, this.groupNum, this.check3, this.partNumber, this.check4, this.partStateValue, this.check5, this.partTypeValue, this.pageSize, this.pageCurrent).then(response => { searchTable(this.check, this.entryNameValue, this.check1, this.machine, this.check2, this.groupNum, this.check3, this.partNumber, this.check4, this.partStateValue, this.check5, this.partTypeValue, this.pageSize, this.pageCurrent).then(response => {
console.log(response.data)
for (let i = 0; i < response.data.rows.length; i++) { for (let i = 0; i < response.data.rows.length; i++) {
response.data.rows[i].考核状态 = parseInt(response.data.rows[i].考核状态) - 2 response.data.rows[i].考核状态 = parseInt(response.data.rows[i].考核状态) - 2
if (response.data.rows[i].传递时间 !== undefined || response.data.rows[i].hasOwnProperty('传递时间')) { if (response.data.rows[i].传递时间 !== undefined || response.data.rows[i].hasOwnProperty('传递时间')) {
@@ -435,7 +433,6 @@ export default {
this.dialogFormVisible3 = false this.dialogFormVisible3 = false
}, },
handleEdit(row) { handleEdit(row) {
console.log(row)
this.title = '编辑' this.title = '编辑'
this.partStateValue1 = parseInt(row.考核状态) + 2 this.partStateValue1 = parseInt(row.考核状态) + 2
this.dialogFormVisible4 = true this.dialogFormVisible4 = true

View File

@@ -37,13 +37,14 @@
:row-key="getRowKeys" :row-key="getRowKeys"
:expand-row-keys="expands" :expand-row-keys="expands"
style="width: 100%" style="width: 100%"
height="600" height="460"
border border
size="mini"
@row-click="fetchExecutionProgressdata" @row-click="fetchExecutionProgressdata"
@expand-change="selectMachine"> @expand-change="selectMachine">
<el-table-column type="expand"> <el-table-column type="expand">
<template slot-scope="scope"> <template slot-scope="scope">
<el-table :data="tableData2" border style="width: 600px; text-align: center"> <el-table :data="tableData2" border style="width: 600px; text-align: center" size="mini">
<el-table-column label="设备型号" align="center"> <el-table-column label="设备型号" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.机床图号 }} {{ scope.row.机床图号 }}
@@ -73,7 +74,23 @@
</el-table-column> </el-table-column>
<el-table-column align="center" label="合同编号" width="150"> <el-table-column align="center" label="合同编号" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.合同编号 }} <template>
<el-popover
placement="right"
title="投标保证金情况"
width="300"
trigger="hover">
<div v-show="!scope.row.招标企业" style="text-align: center">
<h4>未缴纳投标保证金</h4>
</div>
<div v-show="scope.row.招标企业">
<h4>招标企业 {{ scope.row.招标企业 }}</h4>
<h4>投标保证金金额 {{ scope.row.保证金金额 }}</h4>
<h4>是否收回 {{ parseInt(scope.row.是否收回) === 1 ? '未收回' : '已收回' }}</h4>
</div>
<el-tag slot="reference">{{ scope.row.合同编号 }}</el-tag>
</el-popover>
</template>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="项目名称" width="200"> <el-table-column align="center" label="项目名称" width="200">
@@ -234,6 +251,11 @@
<el-input v-model="form.EntryName" size="small" placeholder="请输入项目名称" style="width:200px"/> <el-input v-model="form.EntryName" size="small" placeholder="请输入项目名称" style="width:200px"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item label="投标保证金" prop="">
<el-input v-model="form.bidding" readonly clearable size="small" style="width:200px" placeholder="若缴纳保证金请选择" @dblclick.native="openBidding()" @clear="clearBidding()"/>
</el-form-item>
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="已完成进度" prop="executionProgressID"> <el-form-item label="已完成进度" prop="executionProgressID">
<el-select v-model="form.executionProgressID" :disabled="infoDisable" placeholder="请输入目前执行进度" size="small" style="width: 200px"> <el-select v-model="form.executionProgressID" :disabled="infoDisable" placeholder="请输入目前执行进度" size="small" style="width: 200px">
@@ -420,6 +442,67 @@
</div> </div>
</el-dialog> </el-dialog>
<!--投标保证金选择-->
<el-dialog :visible.sync="dialogFormVisibleBidding" title="请选择投标保证金" center width="65%">
<span>招标企业</span>
<el-input v-model="enterprise" size="small" style="width:200px" clearable/>
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="searchBidding">查询</el-button>
<div style="margin-top: 15px">
<el-table
:data="tableDataBidding"
highlight-current-row
style="width: 100%"
height="400"
border
@row-click="biddingNum">
<el-table-column align="center" label="招标企业" width="300">
<template slot-scope="scope">
{{ scope.row.招标企业 }}
</template>
</el-table-column>
<el-table-column align="center" label="联系人" width="100">
<template slot-scope="scope">
{{ scope.row.联系人 }}
</template>
</el-table-column>
<el-table-column align="center" label="联系电话" width="120">
<template slot-scope="scope">
{{ scope.row.联系电话 }}
</template>
</el-table-column>
<el-table-column align="center" label="保证金金额" width="100">
<template slot-scope="scope">
{{ scope.row.保证金金额 }}
</template>
</el-table-column>
<el-table-column align="center" label="投标人" width="100">
<template slot-scope="scope">
{{ scope.row.投标人 }}
</template>
</el-table-column>
<el-table-column align="center" label="保金类型" width="150">
<template slot-scope="scope">
{{ scope.row.保证金类型 }}
</template>
</el-table-column>
<el-table-column align="center" label="投标日期" width="150">
<template slot-scope="scope">
{{ scope.row.投标日期 }}
</template>
</el-table-column>
<el-table-column align="center" label="备注">
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
</el-table>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="offBidding">取消</el-button>
<el-button type="primary" @click="getBidding">确认</el-button>
</div>
</el-dialog>
<!--客户选择--> <!--客户选择-->
<el-dialog :visible.sync="dialogCustomerFormVisible" title="客户选择" center width="600px"> <el-dialog :visible.sync="dialogCustomerFormVisible" title="客户选择" center width="600px">
<el-input v-model="Customer" clearable size="small" style="width:200px" placeholder="请输入客户名称"/> <el-input v-model="Customer" clearable size="small" style="width:200px" placeholder="请输入客户名称"/>
@@ -464,7 +547,7 @@
<script> <script>
import elInput from 'element-ui/packages/input' import elInput from 'element-ui/packages/input'
import { changeExecutionProgressID, initProject, searchTable1, fetchExecutionProgress, delList, addList, executionProgressID, editchar, getTree, tree, getTablePeople, fetchCustomerData, getFileData, deleteFileData, selectMachine, selectProvince, SelectMarketingManager, submitMachine, editMachine, delMachine, money } from '@/api/MarketingCenter/ContractInformationManagement' import { selectBidBond, changeExecutionProgressID, initProject, searchTable1, fetchExecutionProgress, delList, addList, executionProgressID, editchar, getTree, tree, getTablePeople, fetchCustomerData, getFileData, deleteFileData, selectMachine, selectProvince, SelectMarketingManager, submitMachine, editMachine, delMachine, money } from '@/api/MarketingCenter/ContractInformationManagement'
import { upload, download } from '@/utils/request' import { upload, download } from '@/utils/request'
export default { export default {
components: { components: {
@@ -475,6 +558,10 @@ export default {
a: 1, a: 1,
b: 1, b: 1,
c: 1, c: 1,
enterpriseInput: '', // 表单承接招标企业的中间变量
biddingNumber: '',
dialogFormVisibleBidding: false,
enterprise: '', // 招标企业
startTime: '', startTime: '',
startTime_check: null, startTime_check: null,
endTime: '', endTime: '',
@@ -539,8 +626,10 @@ export default {
executionProgressID: 1, // 执行进度ID executionProgressID: 1, // 执行进度ID
customerName: '', // 客户名称 customerName: '', // 客户名称
remark: '', remark: '',
付款方式: 1 付款方式: 1,
bidding: ''
}, },
tableDataBidding: [],
executionProgressID: '', executionProgressID: '',
form1: { form1: {
设备型号: '', 设备型号: '',
@@ -691,9 +780,11 @@ export default {
this.temp = 1 this.temp = 1
this.title = '增加' this.title = '增加'
this.disabled = false this.disabled = false
this.biddingNumber = ''
this.tableDataBidding = []
}, },
addTableData1() { addTableData1() {
addList(this.form.EntryName, this.form.drawingJointSignNode, this.form.EquipmentPreAcceptanceNode, this.form.ConsignmentNode, this.form.installDebugNode, this.id1, this.form.executionProgressID, this.CustomerCode, this.form.remark, this.form.付款方式, this.form.contractSigningDate).then(response => { addList(this.form.EntryName, this.form.drawingJointSignNode, this.form.EquipmentPreAcceptanceNode, this.form.ConsignmentNode, this.form.installDebugNode, this.id1, this.form.executionProgressID, this.CustomerCode, this.form.remark, this.form.付款方式, this.form.contractSigningDate, this.biddingNumber).then(response => {
this.dialogFormVisible1 = false this.dialogFormVisible1 = false
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message.success('添加成功') this.$message.success('添加成功')
@@ -744,12 +835,14 @@ export default {
this.form.remark = row.合同信息备注 this.form.remark = row.合同信息备注
this.CustomerCode = row.客户流水号 this.CustomerCode = row.客户流水号
this.form.付款方式 = parseInt(row.付款方式代码) this.form.付款方式 = parseInt(row.付款方式代码)
this.biddingNumber = parseInt(row.招标保证金流水号)
this.form.bidding = row.招标企业
this.disabled = true this.disabled = true
this.temp = 2 this.temp = 2
this.infoDisable = false this.infoDisable = false
}, },
chaEdit() { chaEdit() {
editchar(this.form.EntryName, this.form.drawingJointSignNode, this.form.EquipmentPreAcceptanceNode, this.form.ConsignmentNode, this.form.installDebugNode, this.id1, this.form.executionProgressID, this.CustomerCode, this.form.remark, this.hetongID, this.form.付款方式, this.form.contractSigningDate).then(response => { editchar(this.form.EntryName, this.form.drawingJointSignNode, this.form.EquipmentPreAcceptanceNode, this.form.ConsignmentNode, this.form.installDebugNode, this.id1, this.form.executionProgressID, this.CustomerCode, this.form.remark, this.hetongID, this.form.付款方式, this.form.contractSigningDate, this.biddingNumber).then(response => {
this.dialogFormVisible1 = false this.dialogFormVisible1 = false
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message.success('信息更新成功') this.$message.success('信息更新成功')
@@ -884,6 +977,30 @@ export default {
this.$message.error('信息更新失败') this.$message.error('信息更新失败')
} }
}) })
},
openBidding() {
this.dialogFormVisibleBidding = true
},
searchBidding() {
selectBidBond(0, '', 0, '', 0, '', 1, this.enterprise, 0, '', 0, '').then(response => {
const data = response.data
for (let i = 0; i < data.length; i++) {
data[i].投标日期 = data[i].投标日期.substring(0, data[i].投标日期.length - 8)
}
this.tableDataBidding = data
})
},
biddingNum(row) {
this.biddingNumber = parseInt(row.招标保证金流水号)
this.enterpriseInput = row.招标企业
},
clearBidding() {
this.biddingNumber = ''
this.tableDataBidding = []
},
getBidding() {
this.form.bidding = this.enterpriseInput
this.dialogFormVisibleBidding = false
} }
} }
} }

View File

@@ -293,6 +293,7 @@
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
size="small" size="small"
type="date" type="date"
style="width:200px"
placeholder="请选择发货节点"/> placeholder="请选择发货节点"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
@@ -471,8 +472,8 @@ export default {
数量: '' 数量: ''
}, },
machineRules: { machineRules: {
机床号: [{ required: true, message: '请选择机床号', trigger: 'change' }], // 机床号: [{ required: true, message: '请选择机床号', trigger: 'change' }],
数量: [{ required: true, message: '请输入数量', trigger: 'blur' }] // 数量: [{ required: true, message: '请输入数量', trigger: 'blur' }]
}, },
rules: { rules: {
}, },

View File

@@ -0,0 +1,259 @@
<template>
<div class="app-container">
<el-card v-loading="loading">
<div style="width: 620px;margin: 0 auto">
<div style="overflow: hidden">
<div style="margin-bottom: 10px;">
<span>项目</span>
<el-select v-model="projectValue" filterable size="small" placeholder="项目名称">
<el-option
v-for="item in project"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</div>
<upload-excel-component @on-selected-file="selected"/>
</div>
<div>
<el-tooltip content="删除全部" placement="top">
<span v-show="worksheet.length > 1" style="cursor: pointer;float: right;margin: 5px" @click="removeAll"><i class="el-icon-close"/></span>
</el-tooltip>
<el-upload :on-remove="handleRemove" :file-list="itemFile" action=""/>
</div>
<div v-if="worksheet.length !== 0" style="float: right;margin: 20px 0">
<el-button :disabled="disabled" icon="el-icon-upload2" type="primary" size="small" @click="basicPartsToSQL">导入到数据库</el-button>
</div>
</div>
</el-card>
<specification-data1 ref="specificationData" :groups-names="groupsNames" :machine-names="machineNames" :project-name="projectName" @machineChange="machineChange"/>
<!--<el-upload-->
<!--class="upload-demo"-->
<!--drag-->
<!--action="http://localhost:8410/submit/uploadImg.ashx?InvoiceNum=1"-->
<!--multiple>-->
<!--<i class="el-icon-upload"/>-->
<!--<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>-->
<!--<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>-->
<!--</el-upload>-->
</div>
</template>
<script>
import UploadExcelComponent from '../ImportParts/UploadExcel/index.vue'
import specificationData1 from './specificationData1'
import { sleep } from '../../../utils/tool'
import { initProject, isExit, importBasics, importPurcharse, searchMachine, searchGroupNum1 } from '../../../api/TechnologyCenter/ImportParts'
export default {
name: 'UploadExcel',
components: { UploadExcelComponent, specificationData1 },
data() {
return {
project: [],
projectValue: '',
worksheet: [],
itemFile: [],
loading: false,
groupsNames: [],
machineNames: [],
err: 0,
disabled: false
}
},
computed: {
projectName() {
for (let i = 0; i < this.project.length; i++) {
if (this.project[i].value === this.projectValue) {
return this.project[i].label
}
}
}
},
watch: {
projectValue(val) {
if (val) {
this.groupsNames = []
this.machineNames = []
this.projectChange(this.projectName)
}
},
project(val) {
if (val.length > 0) {
this.projectValue = val[0].value
}
}
},
created() {
this.fetchData()
},
methods: {
async test() {
await sleep(10000)
console.log(1)
},
fetchData() {
this.getSelect(initProject, ['项目名称', '项目流水号'], 'project')
},
// 根据项目获取机床
projectChange(val) {
this.machineNames = []
if (val) {
this.getSelect(searchMachine, ['机床'], 'machineNames', val)
}
},
// 根据机床获取分组
machineChange(val) {
this.groupsNames = []
if (val) {
searchGroupNum1(this.projectName, val).then(response => {
const res = response.data
res.forEach(item => {
this.groupsNames.push({
value: item.组号
})
})
})
}
},
async selected(data) { // 选择需要导入的文件
this.worksheet = data.worksheet // 获取每个多选文件的表格坐标及值
this.itemFile = data.itemFile
},
handleRemove(file) { // 移除文件
for (let i = 0; i < this.itemFile.length; i++) {
if (this.itemFile[i].name === file.name) {
this.worksheet.splice(i, 1)
this.itemFile.splice(i, 1)
}
}
},
removeAll() {
this.worksheet = []
this.itemFile = []
},
async basicPartsToSQL() {
try {
this.loading = true
this.dispatch = true
this.err = 0
for (let j = this.worksheet.length - 1; j >= 0; j--) {
let establishment,
proofread,
review,
date,
machineName,
machineNum,
componentName,
componentNum,
groupNum,
contractNum,
pageNum,
totalNum,
drawingNum,
name,
type,
material,
spareNum,
useNum,
manufacturer,
remarks,
classificationCode
console.log(this.worksheet[j].M2.v.substring(0, 1))
if (this.worksheet[j].M2.v.substring(0, 1) === '9') {
console.log('哈哈哈哈哈')
const response = await isExit(this.projectValue, this.worksheet[j].F2.v)
const res = response.data
if (res[0].Column1 === 0) {
this.$notify.error(`${this.worksheet[j].F2.v}机床不存在,请确认文件是否正确`)
this.loading = false
this.disabled = false
return
} else {
this.worksheet[j].G1 ? establishment = this.worksheet[j].G1.v : establishment = ''
this.worksheet[j].I1 ? proofread = this.worksheet[j].I1.v : proofread = ''
this.worksheet[j].L1 ? review = this.worksheet[j].L1.v : review = ''
this.worksheet[j].P1 ? date = this.worksheet[j].P1.v : date = ''
this.worksheet[j].Q1 ? pageNum = parseInt(this.worksheet[j].Q1.v.replace(/[^0-9]/ig, '')) : pageNum = ''
this.worksheet[j].C2 ? machineName = this.worksheet[j].C2.v : machineName = ''
this.worksheet[j].F2 ? machineNum = this.worksheet[j].F2.v : machineNum = ''
this.worksheet[j].J2 ? componentName = this.worksheet[j].J2.v : componentName = ''
this.worksheet[j].P2 ? componentNum = this.worksheet[j].P2.v : componentNum = ''
this.worksheet[j].Q2 ? totalNum = parseInt(this.worksheet[j].Q2.v.replace(/[^0-9]/ig, '')) : totalNum = ''
this.worksheet[j].R2 ? contractNum = this.worksheet[j].R2.v : contractNum = ''
this.worksheet[j].M2 ? groupNum = this.worksheet[j].M2.v : groupNum = ''
for (let i = 0; i < 999; i++) {
const attr = i + 4
drawingNum = this.worksheet[j][`B${attr}`] ? this.worksheet[j][`B${attr}`].v : ''
name = this.worksheet[j][`D${attr}`] ? this.worksheet[j][`D${attr}`].v : ''
type = this.worksheet[j][`F${attr}`] ? this.worksheet[j][`F${attr}`].v : ''
material = this.worksheet[j][`J${attr}`] ? this.worksheet[j][`J${attr}`].v : ''
spareNum = this.worksheet[j][`L${attr}`] ? this.worksheet[j][`L${attr}`].v : ''
useNum = this.worksheet[j][`M${attr}`] ? this.worksheet[j][`M${attr}`].v : ''
manufacturer = this.worksheet[j][`O${attr}`] ? this.worksheet[j][`O${attr}`].v : ''
remarks = this.worksheet[j][`Q${attr}`] ? this.worksheet[j][`Q${attr}`].v : ''
classificationCode = this.worksheet[j][`R${attr}`] ? this.worksheet[j][`R${attr}`].v : ''
if (!drawingNum && !name && !type && !material && !spareNum && !useNum && !manufacturer && !remarks && !classificationCode) { // 当图号、名称、规格、材料、备件数量、装机数量、制造商、备注、分类码都为空时,循环终止,防止向数据库中插入多余且无用的数据
break
} else {
if (machineNum && groupNum) {
await sleep(50)
if (classificationCode) {
drawingNum += '-' + classificationCode
}
await this.insertToSQL(establishment, proofread, review, date, machineName, machineNum, componentName, componentNum, groupNum, contractNum, pageNum, totalNum, drawingNum, name, type, material, spareNum, useNum, manufacturer, remarks, classificationCode)
} else {
this.loading = false
this.disabled = false
this.$notify.error(`请确认导入文件是否正确`)
return
}
}
}
}
this.itemFile.splice(j, 1)
this.worksheet.splice(j, 1)
this.err === 0 ? this.$message.success(`导入完成`) : this.$message.error(`导入失败零件个数为${this.err},请检查文件是否正确`)
} else {
this.$message.error('只能导入整改组')
}
}
this.loading = false
this.projectChange(this.projectName) // 调用查询机床方法通过watch属性检测变化会自动得到下面表格的值。
} catch (e) {
console.log(e)
this.err++
this.$notify.error(`导入数据错误,请检查导入文件是否正确`)
console.log(`导入数据错误${e}`)
}
},
async insertToSQL(establishment, proofread, review, date, machineName, machineNum, componentName, componentNum, groupNum, contractNum, pageNum, totalNum, drawingNum, name, type, material, spareNum, useNum, manufacturer, remarks, classificationCode) {
try {
if (groupNum.indexOf('MX') > -1) {
const response = await importBasics(establishment, proofread, review, date, this.projectName, machineNum, machineName, componentName, componentNum, groupNum, contractNum, totalNum, pageNum, drawingNum, name, type, material, spareNum, useNum, manufacturer, remarks, classificationCode)
const res = response.data
if (res[0].result === '0') {
this.$notify.error(`${drawingNum}导入失败`)
}
} else {
const response = await importPurcharse(establishment, proofread, review, date, this.projectName, machineNum, machineName, componentName, componentNum, groupNum, contractNum, totalNum, pageNum, drawingNum, name, type, material, spareNum, useNum, manufacturer, remarks, classificationCode)
const res = response.data
if (res[0].result === '0') {
this.$notify.error(`${drawingNum}导入失败`)
}
}
} catch (e) {
this.err++
this.$message.error(`导入数据错误`)
console.log(`导入数据错误${e}`)
}
}
}
}
</script>
<style lang="scss" scoped>
.wrapper{
width: 100%;
margin: 0 auto;
}
</style>

View File

@@ -0,0 +1,620 @@
<template>
<div>
<el-card>
<div style="width: 700px;margin: 0 auto">
<span>机床名称</span>
<el-select v-model="machineValue" filterable clearable size="small" placeholder="机床名称" @change="getGroups">
<el-option
v-for="item in machineNames"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>分组名称</span>
<el-select v-model="groupValue" filterable clearable size="small" placeholder="分组名称">
<el-option
v-for="item in groupsNames"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button :disabled="disabled" type="primary" icon="el-icon-d-caret" size="small" style="margin-left: 10px" @click="transferData">传递</el-button>
</div>
</el-card>
<el-card>
<el-table
v-loading="listLoading"
:data="tableData"
:row-class-name="tableRowClassName"
border>
<el-table-column align="center" label="图号" min-width="150">
<template slot-scope="scope">
{{ scope.row.图号或者型号 }}
</template>
</el-table-column>
<el-table-column align="center" label="名称" min-width="100">
<template slot-scope="scope">
{{ scope.row.名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="材料" width="150">
<template slot-scope="scope">
{{ scope.row.材料或者规格 }}
</template>
</el-table-column>
<el-table-column align="center" label="规格" width="100">
<template slot-scope="scope">
{{ scope.row.规格 }}
</template>
</el-table-column>
<el-table-column align="center" label="备件数量" width="80">
<template slot-scope="scope">
{{ scope.row.备件数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="装机数量" width="80">
<template slot-scope="scope">
{{ scope.row.装机数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="部件数量" width="80">
<template slot-scope="scope">
{{ scope.row.部件数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="制造商" min-width="100">
<template slot-scope="scope">
{{ scope.row.制造商 }}
</template>
</el-table-column>
<el-table-column align="center" label="备注" width="100">
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
<el-table-column align="center" label="分类码" width="80">
<template slot-scope="scope">
{{ scope.row.分类码 }}
</template>
</el-table-column>
<el-table-column align="center" label="整改类型" width="250">
<template slot-scope="scope">
<el-radio-group v-model="scope.row.整改类型" @change="submitChangeType(scope.row)">
<el-radio :label="1" class="radio">新增</el-radio>
<el-radio :label="2" class="radio">替换</el-radio>
<el-radio :label="3" class="radio">补充加工</el-radio>
</el-radio-group>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="200">
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
icon="el-icon-edit"
@click="handleEdit(scope.row)">编辑</el-button>
<el-button
size="mini"
type="danger"
icon="el-icon-delete"
@click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 40, 100]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-card>
<el-dialog :title="title" :visible.sync="dialogFormVisible" center style="min-height: 300px" width="800px">
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="110px" class="demo-ruleForm">
<el-row>
<el-col :span="12">
<el-form-item label="图号" prop="图号或者型号">
<el-input
v-model="form.图号或者型号"
size="small"
style="width: 200px;"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="名称" prop="名称">
<el-input
v-model="form.名称"
size="small"
style="width: 200px;"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item v-if="type === 1" label="材料" prop="材料">
<el-select v-model="form.材料流水号" filterable clearable size="small" placeholder="机床名称">
<el-option
v-for="item in materials"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item v-if="type === 2" label="材料" prop="材料">
<el-input v-model="form.物料名称" clearable size="small" style="width: 200px;" placeholder="物料流水号" @dblclick.native="materialShow"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规格" prop="规格">
<el-input
v-model="form.规格"
size="small"
style="width: 200px;"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="备件数量" prop="数量">
<el-input
v-model.number="form.备件数量"
size="small"
style="width: 200px;"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="装机数量" prop="数量">
<el-input
v-model.number="form.装机数量"
size="small"
style="width: 200px;"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="部件数量" prop="数量">
<el-input
v-model.number="form.部件数量"
size="small"
style="width: 200px;"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="制造商" prop="供货商">
<el-input
v-model.number="form.制造商"
size="small"
style="width: 200px;"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="分类码" prop="分类码">
<el-input
v-model.number="form.分类码"
size="small"
style="width: 200px;"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="备注">
<el-input
v-model.number="form.备注"
type="textarea"
size="small"
style="width: 200px;"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel()">取消</el-button>
<el-button v-show="title==='编辑零件信息'" type="primary" @click="submitEdit()">确定</el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogMaterial" title="物料选择">
<el-input v-model="inputMaterial" placeholder="材质" size="small" style="width:200px"/>
<el-button type="success" size="small" icon="el-icon-search" style="margin: 0 0 10px 10px" @click="searchMaterial()">查询</el-button>
<el-table
:data="MaterialData"
size="mini"
highlight-current-row
border
@row-click="selectMaterial">
<el-table-column align="center" label="物料代码">
<template slot-scope="scope">
{{ scope.row.物料代码 }}
</template>
</el-table-column>
<el-table-column align="center" label="物料名称">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="物料规格">
<template slot-scope="scope">
{{ scope.row.物料规格 }}
</template>
</el-table-column>
<el-table-column align="center" label="物料型号">
<template slot-scope="scope">
{{ scope.row.物料型号 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrentMaterial"
:page-sizes="[10, 20]"
:page-size="pageSizeMaterial"
:total="totalMaterial"
small
layout="sizes, prev, pager, next"
@size-change="handleSizeChangeMaterial"
@current-change="handleCurrentChangeMaterial"/>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="dialogMaterial=false">提交</el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogParts" :title="title1" center width="400px">
<span>零件图号</span>
<el-input v-model="PartsValueNum" size="small" placeholder="零件图号" style="width: 200px"/>
<!--<el-select v-model="PartsValueNum" filterable size="small" placeholder="零件图号">-->
<!--<el-option-->
<!--v-for="item in PartsValue"-->
<!--:key="item.value"-->
<!--:label="item.label"-->
<!--:value="item.value"/>-->
<!--</el-select>-->
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submit">提交</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { sleep } from '../../../utils/tool'
import { unSpecificationQuery1, specificationQuery1, deleteBasicParts, deleteBWParts, getMaterial, getMaterialWB, searchMaterialWB, updateRow, updateRowWB, transferMX1, update, searchOldParts } from '../../../api/TechnologyCenter/ImportParts'
export default {
name: 'SpecificationData',
props: {
groupsNames: {
type: Array,
default: () => []
},
machineNames: {
type: Array,
default: () => []
},
projectName: {
type: String,
default: ''
}
},
data() {
return {
componentNum: '',
groupValue: '',
machineValue: '',
tableData: [],
tableDataAll: [],
listLoading: false,
unSpecification: [],
pageCurrent: 1,
pageSize: 10,
total: 0,
title: '',
materials: [],
dialogFormVisible: false,
dialogParts: false,
title1: '',
oldPartsValue: '',
Number: '',
Type: '',
PartsValue: [],
PartsValueNum: '',
type: 0, // 零件类型 暂定1为基本件2为外购件和标准件
form: {
id: '',
物料物流号: null, // 当基本件时使用材料流水号,外购件和标准件时,使用物料流水号
物料名称: '',
材料流水号: null,
图号或者型号: '',
名称: '',
材料或者规格: '',
规格: '',
备件数量: '',
装机数量: '',
部件数量: '',
制造商: '',
备注: '',
分类码: ''
},
err: 0,
dialogFormVisibleWB: false,
dialogMaterial: false,
MaterialData: [],
inputMaterial: '',
rules: {
},
rulesWB: {
},
pageCurrentMaterial: 1,
pageSizeMaterial: 10,
totalMaterial: 0,
loadingMaterial: false
}
},
computed: {
disabled() {
if (this.tableDataAll.length === 0) {
return true
}
if (this.unSpecification.data) {
return this.unSpecification.data.length > 0
}
return true
},
materialName() {
for (let i = 0; i < this.materials.length; i++) {
if (this.materials[i].value === this.form.材料流水号) {
return this.materials[i].label
}
}
}
},
watch: {
machineNames(val) {
this.total = 0
this.machineValue = val.length > 0 ? val[0].value : ''
this.getGroups()
},
groupsNames(val) {
this.groupValue = val.length > 0 ? val[0].value : ''
},
groupValue(val) {
val ? this.fetchData() : this.tableData = []
}
},
mounted() {
this.getSelect(getMaterial, ['材料', '材料流水号'], 'materials')
},
methods: {
async fetchData() {
this.pageCurrent = 1
try {
this.listLoading = true
this.total = 0
this.tableDataAll = []
const projectCheck = this.projectName ? 1 : 0
const machineCheck = this.machineValue ? 1 : 0
const groupCheck = this.groupValue ? 1 : 0
// if (this.groupValue.indexOf('MX') > -1) { // 当分组为基本件时,查询基本件规范和不规范数据,否则查询外购件或标准件规范和不规范数据
// 分别查出规范和不规范数据,将规范数据放前面在一个总数组中
this.type = 1
this.unSpecification = await unSpecificationQuery1(projectCheck, this.projectName, machineCheck, this.machineValue, groupCheck, this.groupValue)
this.unSpecification.data.forEach(item => {
this.tableDataAll.push(item)
})
const specification = await specificationQuery1(projectCheck, this.projectName, machineCheck, this.machineValue, groupCheck, this.groupValue)
specification.data.forEach(item => {
this.tableDataAll.push(item)
})
this.total = this.tableDataAll.length
this.pagination(this.pageCurrent, this.pageSize) // 前端分页数据很多生成DOM节点也多分页效果很明显。
this.listLoading = false
} catch (e) {
console.log(`查询零件发生错误:${e}`)
}
},
submitChangeType(row) {
this.Number = row.id
this.Type = row.整改类型
if (row.整改类型 === 1) {
update(this.projectName, this.machineValue, row.id, row.整改类型).then(response => {
if (response.data[0].result === '1') {
this.fetchData()
}
})
} else {
if (row.整改类型 === 2) {
this.title1 = '替换'
this.oldPartsValue = row.图号或者型号.split('-')[0] + '-' + row.图号或者型号.split('-')[1].substring(2, 7)
searchOldParts(this.projectName, this.machineValue, this.oldPartsValue).then(response => {
this.PartsValueNum = response.data[0].图号或者型号
})
} else {
this.title1 = '补充加工'
this.oldPartsValue = row.图号或者型号.split('-')[0] + '-' + row.图号或者型号.split('-')[1].substring(2, 7)
searchOldParts(this.projectName, this.machineValue, this.oldPartsValue).then(response => {
this.PartsValueNum = response.data[0].图号或者型号
})
}
this.dialogParts = true
}
},
submit() {
this.dialogParts = false
update(this.projectName, this.machineValue, this.Number, this.Type, this.PartsValueNum).then(response => {
if (response.data[0].result === '1') {
this.fetchData()
this.$message.success('关联成功')
} else {
this.$message.error('关联失败')
}
})
},
getGroups() {
this.$emit('machineChange', this.machineValue)
},
pagination(pageCurrent, pageSize) {
this.tableData = this.tableDataAll.slice((pageCurrent - 1) * pageSize, pageCurrent * pageSize)
},
tableRowClassName({ row }) {
if (this.unSpecification.data.indexOf(row) > -1) {
return 'warning-row'
}
return ''
},
handleEdit(row) {
this.editForm(row, 'form', [this.title = '编辑零件信息', this.dialogFormVisible = true])
if (this.type === 2) {
this.form.物料名称 = row.材料或者规格
this.form.物料物流号 = row.物料流水号
}
},
submitEdit() {
if (this.type === 1) {
this.editTable(updateRow, [this.form.图号或者型号, this.form.名称, this.form.规格, this.materialName, this.form.备件数量, this.form.装机数量, this.form.制造商, this.form.备注, this.form.分类码, this.form.id, this.form.材料流水号, this.form.部件数量], 'form', function() {
this.dialogFormVisible = false
this.fetchData()
})
} else if (this.type === 2) {
this.editTable(updateRowWB, [this.form.图号或者型号, this.form.名称, this.form.规格, this.form.物料名称, this.form.备件数量, this.form.装机数量, this.form.制造商, this.form.备注, this.form.分类码, this.form.id, this.form.物料流水号, this.form.部件数量], 'form', function() {
this.dialogFormVisible = false
this.fetchData()
})
} else {
console.log(`编辑类型发生错误`)
}
},
cancel() {
this.dialogFormVisible = false
},
handleDelete(row) {
if (this.type === 1) {
this.deleteRow(deleteBasicParts, row.id, function() {
this.fetchData()
})
} else {
this.deleteRow(deleteBWParts, row.id, function() {
this.fetchData()
})
}
},
materialShow() {
this.inputMaterial = ''
this.getMaterialWB()
this.dialogMaterial = true
},
getMaterialWB() {
this.getTable(getMaterialWB, [this.pageCurrentMaterial, this.pageSizeMaterial], ['MaterialData', 'totalMaterial', 'loadingMaterial'])
},
searchMaterial() {
this.getTable(searchMaterialWB, [this.inputMaterial, this.pageCurrentMaterial, this.pageSizeMaterial], ['MaterialData', 'totalMaterial', 'loadingMaterial'])
},
selectMaterial(row) {
this.dialogMaterial = false
this.form.物料流水号 = row.物料流水号
this.form.物料名称 = row.物料名称
},
handleSizeChange(val) {
this.pageCurrent = 1
this.pageSize = val
this.pagination(this.pageCurrent, this.pageSize)
},
handleCurrentChange(val) {
this.pageCurrent = val
this.pagination(this.pageCurrent, this.pageSize)
},
handleSizeChangeMaterial(val) {
this.pageCurrentMaterial = 1
this.pageSizeMaterial = val
this.getMaterialWB()
},
handleCurrentChangeMaterial(val) {
this.pageCurrentMaterial = val
this.getMaterialWB()
},
async transferData() {
try {
this.err = 0
if (this.groupValue) {
this.listLoading = true
for (let i = 0; i < this.tableDataAll.length; i++) {
const data = this.tableDataAll[i]
const total = parseInt(data.备件数量) + parseInt(data.装机数量) * parseInt(data.部件数量)
const resp = await transferMX1(data.图号或者型号, data.名称, total, data.备注, data.标记, data.设计者编号, data.组件流水号, data.材料流水号, 1, data.是否传递, data.序号, data.id, data.前id)
await sleep(10)
if (resp.data[0].result === '0') {
this.err++
}
}
// if (this.groupValue.indexOf('MX') > -1) {
// for (let i = 0; i < this.tableDataAll.length; i++) {
// const data = this.tableDataAll[i]
// const total = parseInt(data.备件数量) + parseInt(data.装机数量) * parseInt(data.部件数量)
// const resp = await transferMX(data.图号或者型号, data.名称, total, data.备注, data.标记, data.设计者编号, data.组件流水号, data.材料流水号, 1, data.是否传递, data.序号, data.id)
// await sleep(10)
// if (resp.data[0].result === '0') {
// this.err++
// }
// }
// } else {
// for (let i = 0; i < this.tableDataAll.length; i++) {
// let dataType
// const data = this.tableDataAll[i]
// const total = parseInt(data.备件数量) + parseInt(data.装机数量) * parseInt(data.部件数量)
// if (this.groupValue.indexOf('WG') > -1) {
// dataType = 2
// } else {
// dataType = 1
// }
// const resp = await transferWG(data.组件流水号, data.物料流水号, total, data.备注, data.标记, data.设计者编号, data.是否传递, dataType, data.序号, data.id)
// await sleep(10)
// if (resp.data[0].result === '0') {
// this.err++
// this.$notify.error(`传递零件失败`)
// }
// }
// }
if (this.err === 0) { // 传递成功后,清除该分组。当所有组都传递完成后,该项目下的机床和分组消失
const index = this.groupsNames.indexOf(this.groupValue)
this.groupsNames.splice(index, 1)
if (this.groupsNames.length === 0) {
const groupIndex = this.machineNames.indexOf(this.machineValue)
this.machineNames.splice(groupIndex, 1)
}
this.$message.success(`传递成功`)
this.tableDataAll = []
this.tableData = []
} else {
this.$message.error(`${this.err}个零件传递失败`)
}
this.listLoading = false
} else {
this.$message.warning(`请选择分组传递`)
}
} catch (e) {
this.$message.error(`传递发生错误`)
console.log(`${e}`)
}
}
}
}
</script>
<style>
.el-table .warning-row {
background: oldlace;
}
</style>
<style scoped>
span{
margin: 10px;
}
.radio {
margin-left: 10px;
}
</style>

View File

@@ -191,6 +191,7 @@ export default {
manufacturer = this.worksheet[j][`O${attr}`] ? this.worksheet[j][`O${attr}`].v : '' manufacturer = this.worksheet[j][`O${attr}`] ? this.worksheet[j][`O${attr}`].v : ''
remarks = this.worksheet[j][`Q${attr}`] ? this.worksheet[j][`Q${attr}`].v : '' remarks = this.worksheet[j][`Q${attr}`] ? this.worksheet[j][`Q${attr}`].v : ''
classificationCode = this.worksheet[j][`R${attr}`] ? this.worksheet[j][`R${attr}`].v : '' classificationCode = this.worksheet[j][`R${attr}`] ? this.worksheet[j][`R${attr}`].v : ''
console.log(drawingNum, name, type, material, spareNum, useNum, manufacturer, remarks, classificationCode, 2222222222)
if (!drawingNum && !name && !type && !material && !spareNum && !useNum && !manufacturer && !remarks && !classificationCode) { // 当图号、名称、规格、材料、备件数量、装机数量、制造商、备注、分类码都为空时,循环终止,防止向数据库中插入多余且无用的数据 if (!drawingNum && !name && !type && !material && !spareNum && !useNum && !manufacturer && !remarks && !classificationCode) { // 当图号、名称、规格、材料、备件数量、装机数量、制造商、备注、分类码都为空时,循环终止,防止向数据库中插入多余且无用的数据
break break
} else { } else {
@@ -216,6 +217,7 @@ export default {
this.err === 0 ? this.$message.success(`导入完成`) : this.$message.error(`导入失败零件个数为${this.err},请检查文件是否正确`) this.err === 0 ? this.$message.success(`导入完成`) : this.$message.error(`导入失败零件个数为${this.err},请检查文件是否正确`)
this.projectChange(this.projectName) // 调用查询机床方法通过watch属性检测变化会自动得到下面表格的值。 this.projectChange(this.projectName) // 调用查询机床方法通过watch属性检测变化会自动得到下面表格的值。
} catch (e) { } catch (e) {
console.log(e)
this.err++ this.err++
this.$notify.error(`导入数据错误,请检查导入文件是否正确`) this.$notify.error(`导入数据错误,请检查导入文件是否正确`)
console.log(`导入数据错误${e}`) console.log(`导入数据错误${e}`)
@@ -237,7 +239,6 @@ export default {
} }
} }
} catch (e) { } catch (e) {
alert(3)
this.err++ this.err++
this.$message.error(`导入数据错误`) this.$message.error(`导入数据错误`)
console.log(`导入数据错误${e}`) console.log(`导入数据错误${e}`)

View File

@@ -360,6 +360,7 @@ export default {
}, },
methods: { methods: {
async fetchData() { async fetchData() {
this.pageCurrent = 1
try { try {
this.listLoading = true this.listLoading = true
this.total = 0 this.total = 0

View File

@@ -88,6 +88,7 @@
size="mini" size="mini"
type="danger" type="danger"
icon="el-icon-delete" icon="el-icon-delete"
disabled
@click="handleDelete(scope.row)">删除</el-button> @click="handleDelete(scope.row)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
@@ -157,6 +158,7 @@
size="mini" size="mini"
type="danger" type="danger"
icon="el-icon-delete" icon="el-icon-delete"
disabled
@click="handleDelete(scope.row)">删除</el-button> @click="handleDelete(scope.row)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>