This commit is contained in:
liushuai
2019-08-22 20:14:02 +08:00
parent 6900c7a551
commit 653abcfc59
9 changed files with 567 additions and 9 deletions

View File

@@ -0,0 +1,227 @@
<template>
<div class="app-container">
<el-card>
<el-row>
<span>机床编号:</span>
<el-select v-model="machineNumberValue" filterable placeholder="机床编号" size="small" clearable @change="machineChange()">
<el-option
v-for="item in machineNumber"
:key="item.value"
:label="item.label"
:value="item.value">
<div style="float: left">{{ item.label }}</div>
<div style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</div>
</el-option>
</el-select>
<span>组号:</span>
<el-select v-model="groupNumberValue" filterable placeholder="组号" size="small" clearable>
<el-option
v-for="item in groupNumber"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>检测项:</span>
<el-select v-model="TestValue" filterable placeholder="组号" size="small" clearable>
<el-option
v-for="item in Test"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>质检情况:</span>
<el-select v-model="qualityInspectionValue" filterable placeholder="质检情况" size="small" clearable>
<el-option
v-for="item in qualityInspection"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 15px" @click="pageSize=10; pageCurrent= 1;selecttable()">查询</el-button>
<el-button type="primary" size="small" icon="el-icon-download" style="margin-left:10px" @click="exportExcel()">导出</el-button>
</el-row>
</el-card>
<el-card>
<el-table :data="tableData1" border size="mini" highlight-current-row style="width: 100%" height="600px">
<el-table-column align="center" label="检验情况" width="80px">
<template slot-scope="scope">
<el-tag v-if="parseInt(scope.row.是否合格)===0||scope.row.是否合格===''" type="primary" size="small" @click="approvalPass(scope.row)">未检验</el-tag>
<el-tag v-if="parseInt(scope.row.是否合格)===1" type="success" size="small">合格</el-tag>
<el-tag v-if="parseInt(scope.row.是否合格)===2" type="error" size="small">不合格</el-tag>
</template>
</el-table-column>
<el-table-column label="机床图号" align="center" width="120px">
<template slot-scope="scope">
{{ scope.row.机床图号 }}
</template>
</el-table-column>
<el-table-column label="机床名称" align="center" width="260px">
<template slot-scope="scope">
{{ scope.row.机床名称 }}
</template>
</el-table-column>
<el-table-column label="组号" align="center" width="120px">
<template slot-scope="scope">
{{ scope.row.组号 }}
</template>
</el-table-column>
<el-table-column label="部件名称" align="center" width="120px">
<template slot-scope="scope">
{{ scope.row.组件名称 }}
</template>
</el-table-column>
<el-table-column label="检测项" align="center" width="120px">
<template slot-scope="scope">
{{ scope.row.检测项 }}
</template>
</el-table-column>
<el-table-column label="检测项明细" align="center" width="300px">
<template slot-scope="scope">
{{ scope.row.检测项明细 }}
</template>
</el-table-column>
<el-table-column label="备注" align="center">
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-card>
</div>
</template>
<script>import { initProject, searchgroup, selecttable, searchTest, selecttable22 } from '@/api/Assembly/AssemblyQualityInspection'
// import { mapGetters } from 'vuex'
export default {
data() {
return {
machineNumberValue: '',
machineNumber: [],
groupNumberValue: '',
groupNumber: [],
TestValue: '',
Test: [],
qualityInspectionValue: '',
qualityInspection: [
{
value: 1,
label: '合格'
}, {
value: 2,
label: '不合格'
}
],
tableData1: [],
total: 0, // 总条数
pageSize: 10, // 每页显示条数
pageCurrent: 1 // 后台获取页
}
},
created() {
},
mounted() {
this.initProject()
this.fetchData()
},
methods: {
initProject() {
initProject().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.machineNumber.push({
label: response.data[i].机床图号,
name: response.data[i].项目名称,
value: response.data[i].机床流水号
})
}
})
},
fetchData() {
searchTest().then(response => {
console.log(response.data)
for (let i = 0; i < response.data.length; i++) {
this.Test.push({
label: response.data[i].检测项,
value: response.data[i].检测项流水号
})
}
})
},
formatJson(filterVal, jsonData) {
return jsonData.map(v => filterVal.map(j => {
return v[j]
}))
},
exportExcel() {
if (this.machineNumberValue !== '' && this.machineNumberValue !== null) { this.check1 = 1 } else { this.check1 = 0 }
if (this.groupNumberValue !== '' && this.groupNumberValue !== null) { this.check2 = 1 } else { this.check2 = 0 }
if (this.TestValue !== '' && this.TestValue !== null) { this.check3 = 1 } else { this.check3 = 0 }
if (this.qualityInspectionValue !== '' && this.qualityInspectionValue !== null) { this.check4 = 1 } else { this.check4 = 0 }
selecttable22(this.check1, this.machineNumberValue, this.check2, this.groupNumberValue, this.check3, this.TestValue, this.check4, this.qualityInspectionValue).then(response => {
import('@/vendor/Export2Excel').then(excel => {
const tHeader = ['是否合格', '机床图号', '机床名称', '组号', '部件名称', '检测项', '检测项明细', '备注']
const filterVal = ['是否合格', '机床图号', '机床名称', '组号', '组件名称', '检测项', '检测项明细', '备注']
const list = response.data
const data = this.formatJson(filterVal, list)
excel.export_json_to_excel({
header: tHeader,
data,
filename: '装配质检情况表',
autoWidth: true,
bookType: 'xlsx'
})
})
})
},
machineChange() {
this.groupNumberValue = ''
this.groupNumber = []
searchgroup(this.machineNumberValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.groupNumber.push({
label: response.data[i].组号,
value: response.data[i].组件流水号
})
}
})
},
selecttable() {
this.tableData1 = []
if (this.machineNumberValue !== '' && this.machineNumberValue !== null) { this.check1 = 1 } else { this.check1 = 0 }
if (this.groupNumberValue !== '' && this.groupNumberValue !== null) { this.check2 = 1 } else { this.check2 = 0 }
if (this.TestValue !== '' && this.TestValue !== null) { this.check3 = 1 } else { this.check3 = 0 }
if (this.qualityInspectionValue !== '' && this.qualityInspectionValue !== null) { this.check4 = 1 } else { this.check4 = 0 }
selecttable(this.check1, this.machineNumberValue, this.check2, this.groupNumberValue, this.check3, this.TestValue, this.check4, this.qualityInspectionValue, this.pageCurrent, this.pageSize).then(response => {
console.log(response.data.rows, 111)
this.tableData1 = response.data.rows
this.total = response.data.total
console.log(this.tableData1)
})
},
// 分页
handleSizeChange(val) {
this.pageCurrent = 1
this.pageSize = val
this.selecttable()
},
handleCurrentChange(val) {
this.pageCurrent = val
this.selecttable()
}
}
}
</script>
<style scoped>
</style>

View File

@@ -161,6 +161,66 @@
</el-card>
</div>
</el-card>
<el-card>
<div style="width: 35.8%; float: left;margin-left: 2px">
<el-card>
<el-row>
<div style="margin-left: 43%;margin-top: 20px;font-weight: bold;font-size: 24px">检测项</div>
</el-row>
<el-button size="small" type="primary" icon="el-icon-circle-plus-outline" style="margin-left: 85%;margin-top: 15px" @click="handleAdd6()">增加</el-button>
<el-table :data="tableData5" border style="width: 100%;max-height: 450px;margin-top: 10px" height="450px" highlight-current-row size="small" @row-click="searchTesting">
<el-table-column
type="index"
label="序号"
align="center"
width="50"/>
<el-table-column label="检测项" align="center">
<template slot-scope="scope">
{{ scope.row.检测项 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" fixed="right" width="200px">
<template slot-scope="scope">
<el-button
size="mini"
type="danger"
icon="el-icon-delete"
@click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
<div style="width: 63.8%; float: left;margin-left: 2px">
<el-card>
<el-row>
<div style="margin-left: 43%;margin-top: 20px;font-weight: bold;font-size: 24px">检测项明细</div>
</el-row>
<el-button size="small" type="primary" icon="el-icon-circle-plus-outline" style="margin-left: 90%;margin-top: 15px" @click="handleAdd7()">增加</el-button>
<el-table :data="tableData6" border style="width: 100%;max-height: 450px;margin-top: 10px" height="450px" highlight-current-row size="small">
<el-table-column
type="index"
label="序号"
align="center"
width="50"/>
<el-table-column label="检测项明细" align="center">
<template slot-scope="scope">
{{ scope.row.检测项明细 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" fixed="right" width="200px">
<template slot-scope="scope">
<el-button
size="mini"
type="danger"
icon="el-icon-delete"
@click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</el-card>
<el-dialog :title="title" :visible.sync="dialogFormVisible" center width="400px">
<el-form label-position="left" label-width="115px" class="demo-ruleForm">
<el-form-item v-show="title==='增加不合格原因'" label="不合格原因" prop="不合格原因">
@@ -178,6 +238,12 @@
<el-form-item v-show="title==='增加质检形位'" label="质检形位" prop="质检形位">
<el-input v-model="Position" size="small" style="width: 200px"/>
</el-form-item>
<el-form-item v-show="title==='增加检测项'" label="检测项" prop="检测项">
<el-input v-model="Test" size="small" style="width: 200px"/>
</el-form-item>
<el-form-item v-show="title==='增加检测项明细'" label="检测项明细" prop="检测项明细">
<el-input v-model="Testing" size="small" style="width: 200px"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible=false">取消</el-button>
@@ -187,8 +253,8 @@
</div>
</template>
<script>import { initReasons, initHandle, initSize, initAppearance, initPosition, addReasons, addHandle, addSize, addAppearance, addPosition, deleteReasons,
deleteHandle, deleteSize, deleteAppearance, deletePosition } from '@/api/Assembly/QualityBasicData'
<script>import { initReasons, initHandle, initSize, initAppearance, initPosition, initTest, initTesting, addReasons, addHandle, addSize, addAppearance, addPosition,
addTest, addTesting, deleteReasons, deleteHandle, deleteSize, deleteAppearance, deletePosition, deleteTest, deleteTesting } from '@/api/Assembly/QualityBasicData'
export default {
data() {
return {
@@ -197,16 +263,21 @@ export default {
tableData2: [],
tableData3: [],
tableData4: [],
tableData5: [],
tableData6: [],
Reasons: '',
ReasonsValue: '',
Handle: '',
HandleValue: '',
Size: '',
Test: '',
Testing: '',
SizeValue: '',
Appearance: '',
AppearanceValue: '',
Position: '',
PositionValue: '',
value1: '',
dialogFormVisible: false,
title: ''
}
@@ -217,6 +288,7 @@ export default {
this.searchSize()
this.searchAppearance()
this.searchPosition()
this.searchTest()
},
methods: {
searchReasons() {
@@ -244,6 +316,17 @@ export default {
this.tableData4 = response.data
})
},
searchTest() {
initTest().then(response => {
this.tableData5 = response.data
})
},
searchTesting(row) {
this.value1 = row.检测项流水号
initTesting(row.检测项流水号).then(response => {
this.tableData6 = response.data
})
},
handleAdd1() {
this.title = '增加不合格原因'
this.dialogFormVisible = true
@@ -264,6 +347,14 @@ export default {
this.title = '增加质检形位'
this.dialogFormVisible = true
},
handleAdd6() {
this.title = '增加检测项'
this.dialogFormVisible = true
},
handleAdd7() {
this.title = '增加检测项明细'
this.dialogFormVisible = true
},
submitAdd() {
if (this.title === '增加不合格原因') {
addReasons(this.Reasons).then(response => {
@@ -315,6 +406,26 @@ export default {
this.$message.error('增加失败')
}
})
} else if (this.title === '增加检测项') {
addTest(this.Test).then(response => {
if (response.data[0].result === '1') {
this.$message.success('增加成功')
this.dialogFormVisible = false
this.searchTest()
} else {
this.$message.error('增加失败')
}
})
} else if (this.title === '增加检测项明细') {
addTesting(this.value1, this.Testing).then(response => {
if (response.data[0].result === '1') {
this.$message.success('增加成功')
this.dialogFormVisible = false
initTesting(this.value1).then(response => { this.tableData6 = response.data })
} else {
this.$message.error('增加失败')
}
})
}
},
handleDelete(row) {
@@ -329,6 +440,10 @@ export default {
this.deleteRow(deleteAppearance, row.质检外观流水号, function() { this.searchAppearance() })
} else if (row.质检形位流水号) {
this.deleteRow(deletePosition, row.质检形位流水号, function() { this.searchPosition() })
} else if (row.检测项流水号 && !row.检测项明细流水号) {
this.deleteRow(deleteTest, row.检测项流水号, function() { this.searchTest() })
} else if (row.检测项流水号 && row.检测项明细流水号) {
this.deleteRow(deleteTesting, row.检测项明细流水号, function() { initTesting(this.value1).then(response => { this.tableData6 = response.data }) })
}
}
}

View File

@@ -15,7 +15,7 @@
:value="item.value"/>
</el-select>
<span style="margin-left: 10px">投标人</span>
<el-input v-model="Bidder" clearable size="small" style="width:100px" placeholder="请选择" readonly @dblclick.native="dialogFormVisiblePeople = true;flag2 = 1" @clear="clear()"/>
<el-input v-model="Bidder" clearable size="small" style="width:100px" placeholder="请选择" readonly @dblclick.native="dialogFormVisiblePeople = true;flag2 = 1;searchPer()" @clear="clear()"/>
<span style="margin-left: 10px">开始日期</span>
<el-date-picker
v-model="startTime"
@@ -184,6 +184,7 @@
<div style="float: left;margin-top: 10px;margin-left: 20px;overflow-y: scroll;height: 400px">
<el-tree
:data="dataPeople"
:default-expanded-keys="treeData"
node-key="id"
style="width: 150px;float: left"
height="400"
@@ -415,6 +416,7 @@ export default {
},
data() {
return {
treeData: [7],
entryName: [],
plannedTime: [],
disabled: false,
@@ -581,6 +583,9 @@ export default {
this.PageCurrent = val
this.fetchTableData1()
},
searchPer() {
this.getData(getTablePeople, 'ListPeople', 7)
},
handleNodeClick(data) { // 树节点点击
this.getData(getTablePeople, 'ListPeople', data.id)
},

View File

@@ -187,12 +187,23 @@
</el-card>
</el-col>
</el-row>
<el-dialog
:visible.sync="dialogVisible"
title="提示"
width="30%">
<span>该人员已经是销售经理了是否还要继续添加</span>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="addPer"> </el-button>
</span>
</el-dialog>
<!--选择人员-->
<el-dialog :visible.sync="dialogFormVisiblePeople" title="人员信息" center width="750px">
<div style="height: 420px">
<div style="float: left;margin-top: 10px;margin-left: 20px;overflow-y: scroll;height: 400px">
<el-tree
:data="dataPeople"
:default-expanded-keys="treeData"
node-key="id"
style="width: 150px;float: left"
height="400"
@@ -200,7 +211,7 @@
@node-click="handleNodeClick"
/>
</div>
<el-table :data="ListPeople" height="400" style="width: 400px;float: left;margin-left: 30px" @row-click="handleChange">
<el-table :data="ListPeople" height="400" style="width: 400px;float: left;margin-left: 30px" highlight-current-row @row-click="handleChange">
<el-table-column label="考勤编号" align="center" >
<template slot-scope="scope">
{{ scope.row.考勤编号 }}
@@ -230,7 +241,7 @@
<el-dialog :title="title1" :visible.sync="dialogFormVisible1" center width="400px">
<el-form ref="form1" :model="form1" :rules="rules1" label-position="left" label-width="110px" class="demo-ruleForm" style="margin: auto">
<el-form-item label="营销经理" prop="营销经理">
<el-input v-model="form1.营销经理" clearable size="small" style="width:200px" placeholder="请选择营销经理" readonly @dblclick.native="dialogFormVisiblePeople = true"/>
<el-input v-model="form1.营销经理" clearable size="small" style="width:200px" placeholder="请选择营销经理" readonly @dblclick.native="dialogFormVisiblePeople = true;searchPer()"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@@ -322,13 +333,15 @@
<script>
import elInput from 'element-ui/packages/input'
import { searchValue, selectAdress, selectCustomer, getTree, tree, getTablePeople, selectMarketingManager, selectCustomerOfName, initCustomer, deleteCustomer, deleteMarketingManager, addMarketingManager, editMarketingManager, addCustomer, selectAdressOfID, editCustomer } from '@/api/MarketingCenter/CRM'
import { searchValue, selectAdress, selectCustomer, getTree, tree, getTablePeople, selectMarketingManager, selectCustomerOfName, initCustomer, deleteCustomer, deleteMarketingManager, addMarketingManager, editMarketingManager, addCustomer, selectAdressOfID, editCustomer, addPer } from '@/api/MarketingCenter/CRM'
export default {
components: {
elInput
},
data() {
return {
dialogVisible: false,
treeData: [7],
a: '', // 营销经理地区流水号
b: '', // 省份
c: '', // 客户流水号
@@ -433,6 +446,9 @@ export default {
this.pageCurrent = val
this.getTable(selectCustomer, [this.AdressID, this.pageCurrent, this.pageSize], ['tableData2', 'total', 'loading2'])
},
searchPer() {
this.getData(getTablePeople, 'ListPeople', 7)
},
handleNodeClick(data) { // 树节点点击
this.getData(getTablePeople, 'ListPeople', data.id)
},
@@ -520,11 +536,58 @@ export default {
})
}
if (this.flag === 1) {
this.addTable(addMarketingManager, [this.peopleid, 1], 'form1', a)
addMarketingManager(this.peopleid, 1).then(response => {
console.log(response)
if (response.data.hasOwnProperty('output') === false) {
if (response[0].result === '0') {
this.$notify.error(`增加失败`)
}
} else {
console.log(response)
if (response.data.result[0].result === '0') {
this.$notify.error(`增加失败`)
}
if (response.data.result[0].result === '1' && response.data.output[0].导入类型 === '1') {
this.dialogFormVisible1 = false
this.$notify.success('增加成功')
this.loading3 = true
selectMarketingManager(1).then(response => {
this.loading3 = false
for (let i = 0; i < response.data.length; i++) {
response.data[i].出生日期 = (response.data[i].出生日期).split(' ')[0]
}
this.tableData3 = response.data
})
}
if (response.data.output[0].导入类型 === '2') {
this.dialogVisible = true
}
}
})
// this.addTable(addMarketingManager, [this.peopleid, 1], 'form1', a)
} else {
this.editTable(editMarketingManager, [this.peopleid, this.a], 'form1', a)
}
},
addPer() {
addPer(this.peopleid, 1).then(response => {
if (response.data[0].result === '0') {
this.$notify.error(`增加失败`)
} else {
this.dialogFormVisible1 = false
this.dialogVisible = false
this.$notify.success('增加成功')
this.loading3 = true
selectMarketingManager(1).then(response => {
this.loading3 = false
for (let i = 0; i < response.data.length; i++) {
response.data[i].出生日期 = (response.data[i].出生日期).split(' ')[0]
}
this.tableData3 = response.data
})
}
})
},
handleEditMarketingManager(row) {
this.dialogFormVisible1 = true
this.title1 = '编辑'

View File

@@ -278,7 +278,7 @@
size="mini"
type="danger"
icon="el-icon-sort"
@click="TransferPlan(scope.row)">转移计划</el-button>
@click="TransferPlan(scope.row)">收款转移</el-button>
</template>
</el-table-column>
</el-table>

View File

@@ -615,7 +615,7 @@ export default {
tableData2: [], // 机床信息表
tableData3: [], // 营销经理表
PageCurrent: 1,
PageSize: 10,
PageSize: 20,
total: null,
PageCurrent1: 1,
PageSize1: 10,
@@ -695,6 +695,7 @@ export default {
this.getSelect(money, ['付款方式', '付款方式代码'], 'money')
},
openName() {
this.searchName()
this.name = ''
this.tableData3 = []
this.dialogFormVisiblePeople = true
@@ -1151,6 +1152,7 @@ export default {
},
openBidding() {
this.dialogFormVisibleBidding = true
this.searchBidding()
},
searchBidding() {
selectBidBond(0, '', 0, '', 1, this.enterprise, 0, '', 0, '').then(response => {