This commit is contained in:
chenjianan
2018-12-14 19:45:49 +08:00
28 changed files with 2740 additions and 36 deletions

View File

@@ -0,0 +1,257 @@
<template>
<div style="width: 100%;">
<el-card style="width: 400px;margin: auto;margin-top: 20px">
<div class="flex">
<div>
<calendar :events="calendar1.events" :value="calendar1.value" :begin="calendar1.begin" :end="calendar1.end" :weeks="calendar1.weeks" :months="calendar1.months" @search="search" @select="select" />
</div>
</div>
</el-card>
<el-card style="width: 400px;text-align: center;margin: auto">
<el-button type="primary" plain @click="setWork">上班</el-button>
<el-button type="success" plain @click="setRest">休息</el-button>
<el-button type="warning" plain @click="setToday">返回今天</el-button>
</el-card>
</div>
</template>
<script>
import { initClendar, changeState } from '@/api/BasicData/FactoryCalendar'
import calendar from '@/components/Calendar/calendar.vue'
export default {
components: {
calendar
},
data() {
return {
year: '', // 年
month: '', // 月
selectDate: '', // 选择的日期
time: '',
serNum: [], // 工作日流水号
serNumValue: '', // 工作日流水号值
arr: [], // 日期数组
arr1: [], // 日期数组
calendar1: {
value: [],
weeks: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'], // 周的显示
months: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], // 月的显示
events: {} // 上不上班
}
}
},
created() {
this.fetchData()
},
methods: {
select(val) { // 选择
this.selectDate = val[0] + '-' + val[1] + '-' + val[2]
},
setToday() { // 返回今天
this.fetchData()
},
fetchData() { // 日历初始化
var date = new Date()
this.year = date.getFullYear()
this.month = date.getMonth() + 1
this.day = date.getDate()
this.calendar1.value = [this.year, this.month, this.day] // 当前日期!
var events = Object() // 声明events是object对象
initClendar(this.year, this.month).then(response => {
for (let i = 0; i < response.data.length; i++) { // 这个循环是将时间1900-01-01转成1900-1-1型
var str = response.data[i].工作日期
var str1 = str.substr(0, 10)
var nian = str.substr(0, 4)
var yue = str.substr(5, 2)
var ri = str.substr(8, 2)
if (str.substr(5, 1) === '0') {
yue = yue.replace('0', '')
}
if (str.substr(8, 1) === '0') {
ri = ri.replace('0', '')
}
var x = nian + '-' + yue + '-' + ri
events[x] = response.data[i].是否工作
this.arr.push(x)
this.arr1.push(str1)
}
this.calendar1.events = events
})
},
search(year1, month1) { // !子组件的,上下月,改变年
var events = Object() // 声明events是object对象
initClendar(year1, month1).then(response => {
this.serNum = []
this.arr = []
this.arr1 = []
for (let i = 0; i < response.data.length; i++) { // 这个循环是将时间1900-01-01转成1900-1-1型
var str = response.data[i].工作日期
var str1 = str.substr(0, 10)
var nian = str.substr(0, 4)
var yue = str.substr(5, 2)
var ri = str.substr(8, 2)
if (str.substr(5, 1) === '0') {
yue = yue.replace('0', '')
}
if (str.substr(8, 1) === '0') {
ri = ri.replace('0', '')
}
var x = nian + '-' + yue + '-' + ri
this.arr.push(x)
this.arr1.push(str1)
events[x] = response.data[i].是否工作
}
this.calendar1.events = events
})
},
setWork() { // 上班
this.code = 1
for (let i = 0; i < this.arr.length; i++) {
if (this.arr[i] === this.selectDate) {
this.time = this.arr1[i]
break
}
}
changeState(this.time, this.code).then(response => {
if (response.data[0].result === '1') {
this.fetchData()
this.$message.success('更改状态成功')
} else {
this.$message.error('更改状态失败')
}
})
},
setRest() { // 休息
this.code = 0
for (let i = 0; i < this.arr.length; i++) {
if (this.arr[i] === this.selectDate) {
this.time = this.arr1[i]
break
}
}
changeState(this.time, this.code).then(response => {
if (response.data[0].result === '1') {
this.fetchData()
this.$message.success('更改状态成功')
} else {
this.$message.error('更改状态失败')
}
})
}
}
}
</script>
<style>
/*demo*/
.flex{
box-sizing: border-box;
display: -webkit-box;
-webkit-box-pack: start;
-webkit-box-align: start;
display: -webkit-flex;
-webkit-justify-content: space-between;
-webkit-align-items: top;
display: flex;
justify-content: space-between;
align-items: top;
flex-flow:row wrap
}
.flex>div{
margin:10px;
padding:20px;
width:25%;
min-width:300px;
border-radius: 2px;
position: relative;
}
.flex>div>span{
position: absolute;
left:0px;
top:0px;
padding:2px 10px;
font-size:10px;
border-radius:0 0 2px 0;
background:#ea6151;
color:#fff;
}
.flex>div>input{
box-sizing: border-box;
width:100%;
margin-top:20px;
border-radius: 2px;
border:1px solid #dedede;
padding:10px;
font-size: 16px;
background:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj48ZGVmcz48c3R5bGUgdHlwZT0idGV4dC9jc3MiPjwhW0NEQVRBWwpAZm9udC1mYWNlIHsgZm9udC1mYW1pbHk6IGlmb250OyBzcmM6IHVybCgiLy9hdC5hbGljZG4uY29tL3QvZm9udF8xNDQyMzczODk2XzQ3NTQ0NTUuZW90PyNpZWZpeCIpIGZvcm1hdCgiZW1iZWRkZWQtb3BlbnR5cGUiKSwgdXJsKCIvL2F0LmFsaWNkbi5jb20vdC9mb250XzE0NDIzNzM4OTZfNDc1NDQ1NS53b2ZmIikgZm9ybWF0KCJ3b2ZmIiksIHVybCgiLy9hdC5hbGljZG4uY29tL3QvZm9udF8xNDQyMzczODk2XzQ3NTQ0NTUudHRmIikgZm9ybWF0KCJ0cnVldHlwZSIpLCB1cmwoIi8vYXQuYWxpY2RuLmNvbS90L2ZvbnRfMTQ0MjM3Mzg5Nl80NzU0NDU1LnN2ZyNpZm9udCIpIGZvcm1hdCgic3ZnIik7IH0KCl1dPjwvc3R5bGU+PC9kZWZzPjxnIGNsYXNzPSJ0cmFuc2Zvcm0tZ3JvdXAiPjxnIHRyYW5zZm9ybT0ic2NhbGUoMC4wMTU2MjUsIDAuMDE1NjI1KSI+PHBhdGggZD0iTTcxMS4zMDYyIDI5MC42OTcyYzI0LjI4MjEgMCA0NS4zNzY1LTE5LjcwNjkgNDUuMzc2NS00NC4wMzJWNDYuNTYwMjU1OTk5OTk5OTk1YzAtMjQuMzI1MS0yMS4wOTU0LTQ0LjA1MzUtNDUuMzc2NS00NC4wNTM1LTI0LjMwMjYgMC00My45ODggMTkuNzI4NC00My45ODggNDQuMDUzNXYyMDAuMTA0OTZDNjY3LjMxODMgMjcwLjk5MDMgNjg3LjAwMzYgMjkwLjY5NzIgNzExLjMwNjIgMjkwLjY5NzJ6TTYyMy40ODA4IDExMy40MjAzSDQwMC43NjQ5Mjh2NjYuNTEzOTJoMjIyLjcxNTkwNDAwMDAwMDAyVjExMy40MjAyODh6TTg4NC4wNTMgMTEzLjQyMDNoLTgyLjc3NDAxNnY2Ni4xNDUyOGg4NS45NDAyMjRjMjUuMjc4NSAwIDQ2LjYxMTUgMjEuMzc2IDQ2LjYxMTUgNDYuNjc3djE1My45Mjc2OEg5MC40Mzg2NTYwMDAwMDAwMXYtMTUzLjkyNzY4YzAtMjUuMyAyMS4zMzMtNDYuNjc3IDQ2LjYxMTUtNDYuNjc3aDg2LjUwMzQyNFYxMTMuNDIwMjg4aC04Mi42NDI5NDRjLTY0LjA4NiAwLTExNi41MDc2IDUyLjUwODctMTE2LjUwNzYgMTE2LjcwMzJ2Njc2LjgwMTUzNTk5OTk5OTljMCA2NC4xNzQxIDUwLjQ5MTQgMTE2LjY4MDcgMTE0LjU3NzQgMTE2LjY4MDdIODg0LjA1Mjk5MmM2NC4wNjI1IDAgMTE2LjUwNjYtNTIuNTA2NiAxMTYuNTA2Ni0xMTYuNjgwN1YyMzAuMTIzNTE5OTk5OTk5OThDMTAwMC41NTk2IDE2NS45MjkgOTQ4LjExNDQgMTEzLjQyMDMgODg0LjA1MyAxMTMuNDIwM3pNOTMzLjgyOTYgOTEwLjM1MTRjMCAyNS4zLTIxLjMzMyA0Ni42NzYtNDYuNjExNSA0Ni42NzZIMTM3LjA1MDExMTk5OTk5OTk4Yy0yNS4yNzg1IDAtNDYuNjExNS0yMS4zNzYtNDYuNjExNS00Ni42NzZWNDQ2LjQ0NTU2OEg5MzMuODI5NjMyVjkxMC4zNTEzNnpNMjY3LjEwODQgNjQ2LjE4MTljMzYuODc3MyAwIDY2Ljc1MjUtMjkuOTM5NyA2Ni43NTI1LTY2Ljg4MTUgMC0zNi45MjI0LTI5Ljg3NTItNjYuODYxMS02Ni43NTI1LTY2Ljg2MTEtMzYuODU0OCAwLTY2Ljc1MjUgMjkuOTM5Ny02Ni43NTI1IDY2Ljg2MTFDMjAwLjM1NTggNjE2LjI0MjIgMjMwLjI1MjUgNjQ2LjE4MTkgMjY3LjEwODQgNjQ2LjE4MTl6TTUxMS41NDg0IDY0Ni4xODE5YzM2Ljg1NTggMCA2Ni43NTI1LTI5LjkzOTcgNjYuNzUyNS02Ni44ODE1IDAtMzYuOTIyNC0yOS44OTU3LTY2Ljg2MTEtNjYuNzUyNS02Ni44NjExLTM2Ljg3NzMgMC02Ni43NTI1IDI5LjkzOTctNjYuNzUyNSA2Ni44NjExQzQ0NC43OTU5IDYxNi4yNDIyIDQ3NC42NzExIDY0Ni4xODE5IDUxMS41NDg0IDY0Ni4xODE5ek0yNjUuOTE2NCA4OTAuNzA5YzM2Ljg3NzMgMCA2Ni43NTE1LTI5LjkzOTcgNjYuNzUxNS02Ni44NjExIDAtMzYuOTQyOC0yOS44NzQyLTY2Ljg4MjYtNjYuNzUxNS02Ni44ODI2LTM2Ljg1NTggMC02Ni43NTI1IDI5LjkzOTctNjYuNzUyNSA2Ni44ODI2QzE5OS4xNjM5IDg2MC43NjkzIDIyOS4wNTk2IDg5MC43MDkgMjY1LjkxNjQgODkwLjcwOXpNNTExLjU0ODQgODkwLjcwOWMzNi44NTU4IDAgNjYuNzUyNS0yOS45Mzk3IDY2Ljc1MjUtNjYuODYxMSAwLTM2Ljk0MjgtMjkuODk1Ny02Ni44ODI2LTY2Ljc1MjUtNjYuODgyNi0zNi44NzczIDAtNjYuNzUyNSAyOS45Mzk3LTY2Ljc1MjUgNjYuODgyNkM0NDQuNzk1OSA4NjAuNzY5MyA0NzQuNjcxMSA4OTAuNzA5IDUxMS41NDg0IDg5MC43MDl6TTc1NS42NDEzIDY0Ni4xODE5YzM2Ljg1NjggMCA2Ni43NTM1LTI5LjkzOTcgNjYuNzUzNS02Ni44ODE1IDAtMzYuOTIyNC0yOS44OTY3LTY2Ljg2MTEtNjYuNzUzNS02Ni44NjExLTM2Ljg3NzMgMC02Ni43NTI1IDI5LjkzOTctNjYuNzUyNSA2Ni44NjExQzY4OC44ODk5IDYxNi4yNDIyIDcxOC43NjQgNjQ2LjE4MTkgNzU1LjY0MTMgNjQ2LjE4MTl6TTMxMS43MDM2IDI5MC42OTcyYzI0LjI4MTEgMCA0NS4zNzY1LTE5LjcwNjkgNDUuMzc2NS00NC4wMzJWNDYuNTYwMjU1OTk5OTk5OTk1YzAtMjQuMzI1MS0yMS4wOTQ0LTQ0LjA1MzUtNDUuMzc2NS00NC4wNTM1LTI0LjMwMTYgMC00My45ODkgMTkuNzI4NC00My45ODkgNDQuMDUzNXYyMDAuMTA0OTZDMjY3LjcxNDYgMjcwLjk5MDMgMjg3LjQwMiAyOTAuNjk3MiAzMTEuNzAzNiAyOTAuNjk3MnoiIGZpbGw9IiM1ZTdhODgiPjwvcGF0aD48L2c+PC9nPjwvc3ZnPg==) no-repeat 8px 10px;
padding-left: 36px;
color:#666;
}
/*transition*/
.fade-enter-active,
.fade-leave-active {
transition: all .5s ease-in-out;
}
.fade-enter,.fade-leave-active{
opacity: 0;
transform: translateY(-10px);
}
/*下拉框*/
.calendar-dropdown{
background: #fff;
position: absolute;
left:0;
top:0;
padding:20px;
border: 1px solid #eee;
border-radius: 2px;
}
.calendar-dropdown:before {
position: absolute;
left:30px;
top: -10px;
content: "";
border:5px solid rgba(0, 0, 0, 0);
border-bottom-color: #DEDEDE;
}
.calendar-dropdown:after {
position: absolute;
left:30px;
top: -9px;
content: "";
border:5px solid rgba(0, 0, 0, 0);
border-bottom-color: #fff;
}
/*弹出框*/
.calendar-dialog{
position: absolute;
left:0;
top:0;
right:0;
bottom:0;
}
.calendar-dialog-mask{
background:rgba(255,255,255,.5);
width:100%;
height:100%;
}
.calendar-dialog-body{
background: #fff;
position: absolute;
left:50%;
top:50%;
transform: translate(-50%,-50%);
padding:20px;
border: 1px solid #eee;
border-radius: 2px;
}
</style>

View File

@@ -0,0 +1,301 @@
<template>
<div class="app-container">
<table style="width: 100%">
<el-card>
<span style="margin-left: 15px">班次类型:</span>
<el-select v-model="roleName" placeholder="班次类型" clearable size="small" style="width:200px">
<el-option
v-for="item in roleNames"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 15px" @click="pageCurrent1=1;searchTable()">查询</el-button>
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" @click="handelAdd">增加</el-button>
</el-card>
<el-card>
<el-table :data="tableData" highlight-current-row>
<el-table-column label="开始工作时间">
<template slot-scope="scope">
{{ scope.row.开始工作时间 }}
</template>
</el-table-column>
<el-table-column disabled label="结束工作时间" >
<template slot-scope="scope">
{{ scope.row.结束工作时间 }}
</template>
</el-table-column>
<el-table-column label="班次类型">
<template slot-scope="scope">
{{ scope.row.班次类型 }}
</template>
</el-table-column>
<el-table-column label="班次代码">
<template slot-scope="scope">
{{ scope.row.班次代码 }}
</template>
</el-table-column>
<el-table-column label="是否夜班">
<template slot-scope="scope">
{{ scope.row.是否夜班 }}
</template>
</el-table-column>
<el-table-column label="是否工作">
<template slot-scope="scope">
{{ scope.row.是否工作 }}
</template>
</el-table-column>
<el-table-column label="是否工作">
<template slot-scope="scope">
{{ scope.row.是否工作 }}
</template>
</el-table-column>
<el-table-column label="日工作能力">
<template slot-scope="scope">
{{ scope.row.日工作能力 }}
</template>
</el-table-column>
<el-table-column label="是否可以安排高难度件">
<template slot-scope="scope">
{{ scope.row.是否可以安排高难度件 }}
</template>
</el-table-column>
<el-table-column label="备注">
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
icon="el-icon-edit"
@click="submitEdit(scope.$index, 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="pageCurrent1"
:page-sizes="[10, 20, 30, 40, 50]"
:page-size="10"
:total="total1"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
</el-card>
</table>
<el-dialog :visible.sync="dialogFormVisible1" title="增加" center style="min-height: 270px" width="800px">
<el-form ref="form1" :model="form1" :rules="rules" label-position="left" label-width="110px" class="demo-ruleForm">
<el-row>
<el-col :span="12">
<el-form-item label="员工姓名" prop="staffName">
<el-input v-model="form1.staffName" placeholder="请双击选择" size="small" clearable style="width:200px" @dblclick.native="dialogTableVisible()"/>
</el-form-item>
<el-form-item label="角色名称" prop="roleName">
<el-select v-model="form1.roleName" placeholder="角色名称" size="small" clearable style="width:200px">
<el-option
v-for="item in roleNames"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="考勤编号" >
<el-input
v-model="cjscgy"
disabled
size="small"
style="width:200px"/>
</el-form-item>
<el-form-item label="所属部门" >
<el-input v-model="ssks" size="small" style="width:200px"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="callOFF"> </el-button>
<el-button type="primary" @click="submitAdd1()"> </el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogFormVisible2" title="编辑" center style="min-height: 270px" width="800px">
<el-form ref="form2" :model="form2" :rules="rules1" label-position="left" label-width="110px" class="demo-ruleForm">
<el-row>
<el-col :span="12">
<el-form-item label="员工姓名" >
<el-input v-model="form2.staffName" disabled size="small" clearable style="width:200px"/>
</el-form-item>
<el-form-item label="角色名称" prop="roleName">
<el-select v-model="form2.roleName" placeholder="角色名称" clearable size="small" style="width:200px">
<el-option
v-for="item in roleNames"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="考勤编号" >
<el-input
v-model="cjscgy"
disabled
size="small"
style="width:200px"/>
</el-form-item>
<el-form-item disabled="true" label="所属部门" >
<el-input v-model="ssks" disabled size="small" style="width:200px"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="callOFF">取消</el-button>
<el-button type="primary" @click="submitAdd2()">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { getScheduling, searchProgramme, addShift, editShift, deleteShift } from '@/api/BasicData/ShiftManagement'
export default {
data() {
return {
roleName: '',
roleNames: [],
tableData: [],
hour: '',
minutes: '',
seconds: '',
tableDatate: [],
dialogFormVisible: false
}
},
created() {
this.searchData()
},
methods: {
searchData() {
searchProgramme().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.roleNames.push({
label: response.data[i].班次代码,
value: response.data[i].班次代码
})
}
})
},
searchTable() {
getScheduling(this.roleName).then(response => {
this.tableDatate = response.data
console.log(response.data)
for (let i = 0; i < this.tableDatate.length; i++) {
this.hour = this.tableDatate[i].开始工作时间.Hours
this.minutes = this.tableDatate[i].开始工作时间.Minutes
this.seconds = this.tableDatate[i].开始工作时间.Seconds
this.tableDatate[i].开始工作时间 = JSON.stringify(this.tableDatate[i].开始工作时间)
this.tableDatate[i].开始工作时间 = this.hour.toString() + ':' + this.minutes.toString() + ':' + this.seconds.toString()
}
for (let i = 0; i < this.tableDatate.length; i++) {
this.hour = this.tableDatate[i].结束工作时间.Hours
this.minutes = this.tableDatate[i].结束工作时间.Minutes
this.seconds = this.tableDatate[i].结束工作时间.Seconds
this.tableDatate[i].结束工作时间 = JSON.stringify(this.tableDatate[i].结束工作时间)
this.tableDatate[i].结束工作时间 = this.hour.toString() + ':' + this.minutes.toString() + ':' + this.seconds.toString()
}
this.tableData = this.tableDatate
})
},
submitAdd1() {
this.$refs['form1'].validate((valid) => {
if (valid) {
addShift(this.personnelNumber, this.form1.roleName).then(response => {
if (response.data[0].result === '1') {
this.$message.success('增加成功')
this.ssks = ''
this.form1.staffName = ''
this.form1.roleName = ''
this.searchData()
this.dialogFormVisible1 = false
} else { this.$message.error('增加失败') }
})
} else {
console.log('error submit!!')
return false
}
})
},
submitAdd2() {
this.$refs['form2'].validate((valid) => {
if (valid) {
editShift(this.personnelStream, this.personnelNumber, this.form2.roleName).then(response => {
if (response.data[0].result === '1') {
this.$message.success('修改成功')
this.ssks = ''
this.searchData()
this.dialogFormVisible2 = false
} else { this.$message.error('修改失败') }
})
} else {
console.log('error submit!!')
return false
}
})
},
handleDelete(row) { // 删除
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteShift(row.人员角色流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
} else { this.$message.error('删除失败') }
this.searchData()
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
handleCurrentChange(row) { // 获取当前行人员信息
this.ssks = row.节点名称
this.number = row.考勤编号
this.name = row.姓名
this.personnelNumber = row.人员编号
},
getName() { // 提交人员
this.cjscgy = this.number
this.dialogFormVisible = false
this.form1.staffName = this.name
this.form2.staffName = this.name
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom:15px;
margin-left: 15px;
margin-right: 15px;
}
</style>

View File

@@ -218,7 +218,6 @@ import { searchRequestCard, initWarehouse, addRequestCard, searchInventoryNum, S
import { mapGetters } from 'vuex'
export default {
name: '', // 离线合同
data() {
return {
purchasecard: '',

View File

@@ -109,7 +109,7 @@
</div>
<el-table
v-loading="loading1"
:data="tableData1"
:data="tableData2"
border
style="width: 100%;max-height: 300px;"
height="300px"
@@ -205,7 +205,7 @@
@click="addMateriel">选入物料</el-button>
</el-card>
<el-card>
<el-table v-loading="" :data="tableData2" border style="max-height: 300px;" height="300px" size="mini" highlight-current-row @row-click="searchTable3">
<el-table v-loading="" :data="tableData3" border style="max-height: 300px;" height="300px" size="mini" highlight-current-row @row-click="searchTable3">
<el-table-column label="请购单状态" align="center" width="80" fixed="left">
<template slot-scope="scope">
<el-tag v-if="parseInt(scope.row.是否传递)===0" type="warning" size="small">未传递</el-tag>
@@ -250,7 +250,7 @@
@current-change="handleCurrentChange2"/>
<el-button style="margin-left:500px;" type="warning" size="mini" icon="el-icon-download" @click="doneRequestCard()">传递</el-button>
</div>
<el-table v-loading="" :data="tableData3" border style="max-height: 300px;" height="300px" size="mini">
<el-table v-loading="" :data="tableData4" border style="max-height: 300px;" height="300px" size="mini">
<el-table-column label="离线请购单编号" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.请购单编号 }}
@@ -287,7 +287,62 @@
</template>
<script>
import { initProject, searchmachine, searchTeam } from '@/api/Inventory/PartsReplacement'
import { mapGetters } from 'vuex'
export default {
data() {
return {
ProjectValue: '',
Project: [],
MachineValue: '',
Machine: [],
GroupNumValue: '',
GroupNum: '',
tableData1: []
}
},
computed: {
...mapGetters([
'id' // 人员编号
])
},
created() {
this.fetchData()
},
methods: {
fetchData() {
this.getSelect(initProject, ['项目名称', '项目流水号'], 'Project') // 项目名称
},
searchMachine() { // 查询机床
this.Machine = []
this.GroupNum = []
this.MachineValue = ''
this.GroupNumValue = ''
console.log(this.ProjectValue)
if (this.ProjectValue !== '') {
searchmachine(1, this.ProjectValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Machine.push({
label: response.data[i].机床图号,
value: response.data[i].机床流水号
})
}
})
}
},
searchGroupList() { // 查询组号
this.GroupNum = []
this.GroupNumValue = ''
searchTeam(this.MachineValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.GroupNum.push({
label: response.data[i].组号,
value: response.data[i].组件流水号
})
}
})
}
}
}
</script>

View File

@@ -18,8 +18,8 @@
align="center"/>
<el-table-column label="打印状态" width="100" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.备料打印!=='0'" type="success" size="small">打印</el-tag>
<el-tag v-else type="warning" size="small">打印</el-tag>
<el-tag v-if="scope.row.备料打印!=='0'" type="success" size="small">导出</el-tag>
<el-tag v-else type="warning" size="small">导出</el-tag>
</template>
</el-table-column>
<el-table-column label="零件名称" align="center" width="220px">
@@ -27,7 +27,7 @@
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column label="零件图号" align="center" width="280px">
<el-table-column label="零件图号" align="center" width="240px">
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
@@ -58,8 +58,8 @@
<col style="width: 450px">
</colgroup>
<tr>
<th>GAOJING</th>
<th colspan="2"><span style="font-weight:bold">备料单</span></th>
<th height="60px">GAOJING</th>
<th colspan="2" height="60px"><span style="font-weight:bold">备料单</span></th>
</tr>
<tr>
<td align="center">零件名称</td>
@@ -101,6 +101,7 @@ export default {
searchTable() {
this.loading = true
this.tableData = []
this.Data = []
if (this.partName !== '' && this.partName !== null) {
this.partNamecheck = true
} else {
@@ -119,6 +120,7 @@ export default {
this.tableData.push({
零件名称: this.Data[i].零件名称,
零件图号: this.Data[i].零件图号,
备料打印: this.Data[i].备料打印,
工艺要求: response.data[i].工艺要求
})
})

View File

@@ -0,0 +1,141 @@
<template>
<div>
<el-card>
<el-row>
<span>零件图号:</span>
<el-input v-model="partName" placeholder="零件图号" size="small" clearable style="width:200px"/>
<el-button size="small" icon="el-icon-search" type="success" style="margin-left: 10px" @click="pageSize=10; pageCurrent=1;searchTable()">查询</el-button>
<el-checkbox v-model="all" size="mini">查询全部</el-checkbox>
<el-button size="small" icon="el-icon-success" type="primary" style="margin-left: 10px" @click="edit()">到货</el-button>
</el-row>
</el-card>
<el-card>
<el-table v-loading="loading" :data="tableData" height="580" style="width: 100%;" border element-loading-text="拼命加载中" @selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55"
align="center"/>
<el-table-column label="到货状态" width="100" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.备料到货==='1'" type="success" size="small">已到货</el-tag>
<el-tag v-if="scope.row.备料到货==='0'" type="warning" size="small">未到货</el-tag>
</template>
</el-table-column>
<el-table-column label="零件名称" align="center" width="220px">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column label="零件图号" align="center" width="240px">
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column label="备料" align="center">
<template slot-scope="scope">
{{ scope.row.工艺要求 }}
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination
v-if="!loading"
: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 { searchtable, searchtable2, edit, handlechange } from '@/api/ManufacturingCenter/MaterialArrivalManagement'
export default {
data() {
return {
arrest: [],
all: false,
partName: '',
loading: false,
tableData: [], // 表格数据
total: null, // 总条数
pageSize: 10, // 每页显示条数
pageCurrent: 1 // 后台获取页
}
},
created() {
this.searchTable()
},
methods: {
// 查询表格数据
searchTable() {
this.loading = true
this.tableData = []
this.Data = []
if (this.partName !== '' && this.partName !== null) {
this.partNamecheck = true
} else {
this.partNamecheck = false
}
searchtable(this.partNamecheck, this.partName, !this.all, this.pageCurrent, this.pageSize).then(response => {
if (response.data.total === 0) {
this.loading = false
} else {
this.Data = response.data.rows
this.total = response.data.total
}
}).then(() => {
for (let i = 0; i < this.Data.length; i++) {
searchtable2(this.Data[i].工艺计划流水号).then(response => {
this.tableData.push({
工艺计划流水号: this.Data[i].工艺计划流水号,
零件名称: this.Data[i].零件名称,
零件图号: this.Data[i].零件图号,
备料到货: this.Data[i].备料到货,
工艺要求: response.data[i].工艺要求,
工序流水号: response.data[i].工序流水号
})
})
this.loading = false
}
})
},
handleSelectionChange(val) {
this.arrest = val
},
edit() {
if (this.arrest.length === 0) {
this.$message.warning('暂无数据')
} else {
for (let i = 0; i < this.arrest.length; i++) {
edit(this.arrest[i].工艺计划流水号)
handlechange(this.arrest[i].工序流水号, '0000')
if (i === this.arrest.length - 1) {
this.searchTable()
}
}
}
},
// 分页
handleSizeChange(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChange(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>
<style scoped>
</style>

View File

@@ -32,7 +32,7 @@
size="small"
type="date"
placeholder="请选择结束日期"/>
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="pageSize = 10;PageCurrent = 1;fetchTableData1()">查询</el-button>
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="PageSize = 10;PageCurrent = 1;fetchTableData1()">查询</el-button>
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" style="margin-left: 10px;margin-right: 15px" @click="addBidBond();flag1 = 2">增加</el-button>
</el-card>
<el-card>

View File

@@ -11,7 +11,7 @@
</el-select>
<span style="margin-left: 10px">销售经理</span>
<el-input v-model="MarketingManagerValue" readonly clearable size="small" style="width:200px" placeholder="请双击选择营销经理" @dblclick.native="dialogFormVisiblePeople = true" @clear="clear()"/>
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="pageSize = 10;PageCurrent = 1;tableData2=[];getTableData()">查询</el-button>
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="PageSize = 10;PageCurrent = 1;tableData2=[];getTableData()">查询</el-button>
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" style="margin-left: 10px" @click="ADD('form2')">新增</el-button>
<el-badge :value="value" :max="99" class="item">
<el-button size="small" type="text" @click="AccountsReceivable">查看收款信息</el-button>
@@ -61,6 +61,11 @@
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="已完成进度" width="200">
<template slot-scope="scope">
{{ scope.row.执行进度名 }}
</template>
</el-table-column>
<el-table-column align="center" label="付款方式" width="200">
<template slot-scope="scope">
{{ scope.row.付款方式 }}
@@ -138,7 +143,7 @@
<el-pagination
:current-page="PageCurrent"
:page-sizes="[10, 20, 30, 40]"
:page-size="10"
:page-size="PageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@@ -243,12 +248,15 @@
title="收款计划"
width="200"
trigger="hover">
<div v-show="!scope.row.计划付款时间" style="text-align: center">
<div v-show="(scope.row.计划付款时间 === '' || scope.row.计划付款时间 === null) && parseInt(scope.row.未收金额)!==0 " style="text-align: center">
<h4>{{ scope.row.执行进度名 }} 未完成</h4>
</div>
<div v-show="scope.row.计划付款时间">
<div v-show="scope.row.计划付款时间 !== '' && scope.row.计划付款时间 !== null && parseInt(scope.row.未收金额)!==0">
<h4>{{ scope.row.执行进度名 }}{{ scope.row.节点日期 }}完成计划于{{ scope.row.计划付款时间 }}进行收款距离计划截止还剩{{ parseInt(scope.row.剩余天数) > 0 ? scope.row.剩余天数 : 0 }}</h4>
</div>
<div v-show="parseInt(scope.row.未收金额)=== 0 " style="text-align: center">
<h4>{{ scope.row.执行进度名 }}阶段收款已完成</h4>
</div>
<el-tag v-if="scope.row.计划付款时间===''||scope.row.计划付款时间===null" slot="reference" size="small" style="width: 66px">进度未完</el-tag>
<el-tag v-else-if="scope.row.计划付款时间!==''&&scope.row.计划付款时间!==null&&parseInt(scope.row.未收金额)===0" slot="reference" type="success" size="small" style="width: 66px">已完成</el-tag>
<el-tag v-else-if="scope.row.计划付款时间!==''&&scope.row.计划付款时间!==null&&scope.row.状态==='未开始'" slot="reference" type="primary" size="small" style="width: 66px">未开始</el-tag>
@@ -279,7 +287,7 @@
:current-page="PageCurrent2"
:page-sizes="[10, 20, 30, 40]"
:page-size="10"
:total="total2"
:total="PageSize2"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange2"
@current-change="handleCurrentChange2"/>
@@ -1091,7 +1099,7 @@ export default {
})
this.$message.success('删除成功')
} else {
this.$message.error('删除失败')
this.$message.error('数据占用')
}
})
})
@@ -1146,7 +1154,7 @@ export default {
this.$message.success('删除成功')
this.tableData2 = []
} else {
this.$message.error('删除失败')
this.$message.error('数据占用')
}
})
})

View File

@@ -27,7 +27,7 @@
size="small"
type="date"
placeholder="请选择结束日期"/>
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="pageSize = 10;PageCurrent = 1;fetchTableData1()">查询</el-button>
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="PageSize = 10;PageCurrent = 1;fetchTableData1()">查询</el-button>
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" style="margin-left: 10px" @click="ADD()">增加</el-button>
</el-card>
<el-card>
@@ -148,7 +148,7 @@
{{ scope.row.电话 }}
</template>
</el-table-column>
<el-table-column align="center" label="合同信息备注" width="150">
<el-table-column align="center" label="合同信息备注" width="250">
<template slot-scope="scope">
{{ scope.row.合同信息备注 }}
</template>
@@ -507,7 +507,7 @@
<!--客户选择-->
<el-dialog :visible.sync="dialogCustomerFormVisible" title="客户选择" center width="600px">
<el-input v-model="Customer" clearable size="small" style="width:200px" placeholder="请输入客户名称"/>
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="pageSize1 = 10;PageCurrent1 = 1;fetchCustomerData()">查询</el-button>
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="PageSize1 = 10;PageCurrent1 = 1;fetchCustomerData()">查询</el-button>
<el-table v-loading="loading1" :data="CustomerData" highlight-current-row height="300" show-overflow-tooltip style="height: 330px; margin-top: 20px" @row-click="handleCustomerChange">
<el-table-column label="省份" align="center" width="80">
<template slot-scope="scope">
@@ -533,7 +533,7 @@
<el-pagination
:current-page="PageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-size="10"
:page-size="PageSize1"
:total="total1"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"

View File

@@ -818,7 +818,7 @@ export default {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.getTable(addressSearch, [this.pageCurrent1, this.pageSize1], ['addressData', 'total1'])
} else { this.$message.error('删除失败') }
} else { this.$message.error('数据占用') }
})
}).catch(() => {
this.$message({
@@ -928,7 +928,7 @@ export default {
this.$message.sucess('删除成功')
this.getSelect(searchCargoBox, ['货箱号', '货箱号编号'], 'cargoBox', this.invoiceNum)
} else {
this.$message.error('删除失败')
this.$message.error('数据占用')
}
})
})
@@ -1107,7 +1107,7 @@ export default {
}
})
if (data[0].result === '0') {
this.$message.error('删除失败了。')
this.$message.error('数据占用')
}
},
handlePictureCardPreview(file) {

View File

@@ -28,7 +28,7 @@
size="small"
type="date"
placeholder="请选择结束日期"/>
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="pageSize = 10;PageCurrent = 1;fetchTableData1()">查询</el-button>
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="PageSize = 10;PageCurrent = 1;fetchTableData1()">查询</el-button>
</el-card>
<!--项目表格-->
<el-card>
@@ -286,7 +286,7 @@
<!--客户选择-->
<el-dialog :visible.sync="dialogCustomerFormVisible" title="客户选择" center width="600px">
<el-input v-model="Customer" clearable size="small" style="width:200px" placeholder="请输入客户名称"/>
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="pageSize1 = 10;PageCurrent1 = 1;fetchCustomerData()">查询</el-button>
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="PageSize1 = 10;PageCurrent1 = 1;fetchCustomerData()">查询</el-button>
<el-table v-loading="loading1" :data="CustomerData" highlight-current-row height="300" show-overflow-tooltip style="height: 330px; margin-top: 20px" @row-click="handleCustomerChange">
<el-table-column label="省份" align="center" width="80">
<template slot-scope="scope">
@@ -491,7 +491,7 @@ export default {
this.fetchTableData1()
this.fetchTableData2(row)
} else {
this.$message.error('修改失败')
this.$message.error('数据占用')
}
})
},
@@ -596,7 +596,7 @@ export default {
this.tableData2 = data
})
} else {
this.$message.error('增加失败')
this.$message.error('数据占用')
}
})
},
@@ -630,7 +630,7 @@ export default {
this.tableData2 = data
})
} else {
this.$message.error('修改失败')
this.$message.error('数据占用')
}
})
},

View File

@@ -0,0 +1,373 @@
<template>
<div>
<el-card>
<span>项目名称</span>
<el-select v-model="entryNameValue" filterable placeholder="项目名称" style="margin-right: 10px" size="small" clearable>
<el-option
v-for="item in entryName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span style="margin-left: 10px">开始日期</span>
<el-date-picker
v-model="startTime"
style="width: 200px;"
value-format="yyyy-MM-dd"
size="small"
type="date"
placeholder="请选择开始日期"/>
<span style="margin-left: 10px">结束日期</span>
<el-date-picker
v-model="endTime"
style="width: 200px;"
value-format="yyyy-MM-dd"
size="small"
type="date"
placeholder="请选择结束日期"/>
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="PageSize = 10;PageCurrent = 1;fetchTableData1()">查询</el-button>
</el-card>
<el-card>
<el-table
v-loading="listLoading1"
:data="tableData1"
highlight-current-row
style="width: 100%"
height="400"
border
size="mini"
@row-click="fetchTableData2">
<el-table-column align="center" label="合同编号" width="200">
<template slot-scope="scope">
<el-tag type="primary">{{ scope.row.合同编号 }}</el-tag>
</template>
</el-table-column>
<el-table-column align="center" label="项目名称" width="200">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="已完成进度" width="100">
<template slot-scope="scope">
{{ scope.row.执行进度名 }}
</template>
</el-table-column>
<el-table-column align="center" label="合同签订日期">
<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="客户名称">
<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="100">
<template slot-scope="scope">
{{ scope.row.电话 }}
</template>
</el-table-column>
<el-table-column align="center" label="合同信息备注">
<template slot-scope="scope">
{{ scope.row.合同信息备注 }}
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="260px">
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
icon="el-icon-circle-plus-outline"
@click.stop="openAddInvoiceRecordingDialog(); flag = 1">履约保证金</el-button>
<el-button
size="mini"
type="primary"
icon="el-icon-circle-plus-outline"
@click.stop="openAddInvoiceRecordingDialog(); flag = 3">履约保函</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="PageCurrent"
:page-sizes="[10, 20, 30, 40]"
:page-size="PageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-card>
<el-card>
<template>
<el-tabs v-model="activeName" type="card">
<el-tab-pane label="履约保证金" name="first">
<el-table
v-loading="listLoading2"
:data="tableData2"
highlight-current-row
style="width: 100%"
height="100"
border
size="mini">
<el-table-column align="center" label="履约保证金金额">
<template slot-scope="scope">
<el-tag type="primary" size="small">{{ scope.row.履约保证金金额 }}</el-tag>
</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.提前X天提醒我 }}天内收回
</template>
</el-table-column>
<el-table-column align="center" label="是否收回">
<template slot-scope="scope">
<el-tag v-if="parseInt(scope.row.是否收回) === 1" slot="reference" size="small" type="success" style="width: 66px">已收回</el-tag>
<el-tag v-else-if="parseInt(scope.row.是否收回) === 0" slot="reference" type="danger" size="small" style="width: 66px">未收回</el-tag>
</template>
</el-table-column>
<el-table-column align="center" label="实际收回日期">
<template slot-scope="scope">
{{ scope.row.实际收回日期 === '' || scope.row.实际收回日期 === null ? scope.row.实际收回日期 = '暂未收回' : scope.row.实际收回日期 }}
</template>
</el-table-column>
<el-table-column align="center" label="状态">
<template slot-scope="scope">
<el-popover
placement="top-start"
title="收回计划"
width="200"
trigger="hover">
<div v-show="(scope.row.计划收款日期 === '' || scope.row.计划收款日期 === null) && parseInt(scope.row.是否收回)!== 1 " style="text-align: center">
<h4>{{ scope.row.执行进度名 }} 未完成</h4>
</div>
<div v-show="scope.row.计划收款日期 !== '' && scope.row.计划收款日期 !== null && parseInt(scope.row.是否收回)!== 1">
<h4>{{ scope.row.执行进度名 }}{{ scope.row.节点日期 }}完成计划于{{ scope.row.计划收款日期 }}进行收款距离计划截止还剩{{ parseInt(scope.row.剩余天数) > 0 ? scope.row.剩余天数 : 0 }}</h4>
</div>
<div v-show="parseInt(scope.row.是否收回)=== 1 " style="text-align: center">
<h4>已于{{ scope.row.实际收回日期 }}收回</h4>
</div>
<el-tag v-if="scope.row.计划收款日期!==''&& scope.row.计划收款日期!==null && parseInt(scope.row.是否收回) === 0 && parseInt(scope.row.状态) === 1" slot="reference" size="small" type="warning" style="width: 66px">即将拖期</el-tag>
<el-tag v-else-if="scope.row.计划收款日期!==''&& scope.row.计划收款日期!==null &&parseInt(scope.row.是否收回) === 0 && parseInt(scope.row.状态) === 2" slot="reference" type="danger" size="small" style="width: 66px">已经拖期</el-tag>
<el-tag v-else-if="scope.row.计划收款日期!==''&& scope.row.计划收款日期!==null &&parseInt(scope.row.是否收回) === 0 && parseInt(scope.row.状态) === 0" slot="reference" type="primer" size="small" style="width: 66px">无计划</el-tag>
<el-tag v-else-if="scope.row.计划收款日期!==''&& scope.row.计划收款日期!==null &&parseInt(scope.row.是否收回) === 1" slot="reference" type="success" size="small" style="width: 66px">已完成</el-tag>
<el-tag v-else-if="scope.row.计划收款日期===''||scope.row.计划收款日期===null" slot="reference" size="small" style="width: 66px">进度未完</el-tag>
</el-popover>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="260px">
<template slot-scope="scope">
<el-button
:disabled="scope.row.是否禁用收回"
size="mini"
type="success"
@click.stop="takeBack(scope.row)">收回</el-button>
<el-button
size="mini"
type="warning"
@click.stop="openAddInvoiceRecordingDialog(); flag = 3">编辑</el-button>
<el-button
size="mini"
type="danger"
@click.stop="openAddInvoiceRecordingDialog(); flag = 3">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="履约保函" name="second">
履约保函
</el-tab-pane>
</el-tabs>
</template>
</el-card>
<el-dialog :visible.sync="dialogTimeVisible" title="实际收回日期" center style="min-height: 300px" width="23%">
<el-form ref="form" :model="form" :rules="rules" label-width="140px">
<el-form-item label="实际收回日期" prop="实际收回日期">
<el-date-picker
v-model="form.实际收回日期"
style="width: 200px;"
value-format="yyyy-MM-dd"
size="small"
type="date"
placeholder="请选择实际收回日期"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="callOffTime('form')">取消</el-button>
<el-button type="primary" @click="submitTime('form')"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import elInput from 'element-ui/packages/input'
import { initProject, searchTableData1, typeOfPerformanceBond, searchTableData2, takeBack } from '@/api/MarketingCenter/PerformanceBond'
export default {
components: {
elInput
},
data() {
return {
entryNameValue: '', // 查询条件_项目名称
entryName: [], // 查询条件_项目名称数组
startTime: '', // 查询条件_开始时间
endTime: '', // 查询条件_结束时间
PageSize: 10, // 项目信息表格初始一页显示十条
PageCurrent: 1, // 项目信息表格一次翻一页
total: null,
tableData1: [], // 项目信息表格数据
listLoading1: false, // 项目信息表格加载动画
flag: '', // 旗帜变量
activeName: 'first', // 标签页初始
projectId: '', // 项目流水号中间变量
tableData2: [], // 履约保证金信息
listLoading2: false,
dialogTimeVisible: false,
performanceBondCode: '', // 履约保证金流水号
form: {
实际收回日期: ''
},
rules: { // 表单验证规则
实际收回日期: [{ required: true, message: '请选择实际收回日期', trigger: 'change' }]
}
}
},
created() {
this.init()
},
methods: {
// 初始化条件
init() {
this.getSelect(initProject, ['项目名称', '项目流水号'], 'entryName')
},
// 查询合同(项目)信息
fetchTableData1() {
if (this.entryNameValue === '' || this.entryNameValue === null) { this.entryNameValue_check = 0 } else { this.entryNameValue_check = 1 }
if (this.startTime === '' || this.startTime === null) { this.startTime_check = 0 } else { this.startTime_check = 1 }
if (this.endTime === '' || this.endTime === null) { this.endTime_check = 0 } else { this.endTime_check = 1 }
this.listLoading1 = true
searchTableData1(this.PageCurrent, this.PageSize, this.entryNameValue, this.entryNameValue_check, this.startTime_check, this.endTime_check, this.startTime, this.endTime).then(response => {
this.listLoading1 = false
const data = response.data
for (let i = 0; i < data.rows.length; i++) {
data.rows[i].合同签订日期 = data.rows[i].合同签订日期.substring(0, data.rows[i].合同签订日期.length - 8)
}
this.tableData1 = data.rows
this.total = data.total
})
},
// 项目信息表格改变每页显示条数
handleSizeChange(val) {
this.PageCurrent = 1
this.PageSize = val
this.fetchTableData1()
},
// 项目信息表格翻页
handleCurrentChange(val) {
this.PageCurrent = val
this.fetchTableData1()
},
// 履约保证金查询
fetchTableData2(row) {
this.projectId = row.项目流水号
typeOfPerformanceBond(this.projectId).then(response => {
const data = response.data[0].履约保证金类型
return data
}).then(data => {
if (data === 1) {
this.activeName = 'first'
this.listLoading2 = true
searchTableData2(this.projectId).then(response => {
this.listLoading2 = false
const data = response.data
for (let i = 0; i < data.length; i++) {
data[i].实际收回日期 !== '' && data[i].实际收回日期 !== null ? data[i].实际收回日期 = data[i].实际收回日期.substring(0, data[i].实际收回日期.length - 8) : data[i].实际收回日期
data[i].节点日期 !== '' && data[i].节点日期 !== null ? data[i].节点日期 = data[i].节点日期.substring(0, data[i].节点日期.length - 8) : data[i].节点日期
data[i].计划收款日期 !== '' && data[i].计划收款日期 !== null ? data[i].计划收款日期 = data[i].计划收款日期.substring(0, data[i].计划收款日期.length - 8) : data[i].计划收款日期
parseInt(data[i].是否收回) === 1 ? data[i].是否禁用收回 = true : data[i].是否禁用收回 = false
}
this.tableData2 = data
})
} else if (data === 1) {
this.activeName = 'second'
} else {
this.$message.warning('未缴纳履约保证金')
}
})
},
takeBack(row) {
this.addForm('form')
this.performanceBondCode = row.履约保证金流水号
this.dialogTimeVisible = true
},
callOffTime() {
this.dialogTimeVisible = false
},
submitTime(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
takeBack(this.performanceBondCode, this.form.实际收回日期).then(response => {
if (response.data[0].result === '1') {
this.$message.success('操作成功')
this.dialogTimeVisible = false
typeOfPerformanceBond(this.projectId).then(response => {
const data = response.data[0].履约保证金类型
return data
}).then(data => {
if (data === 1) {
this.activeName = 'first'
this.listLoading2 = true
searchTableData2(this.projectId).then(response => {
this.listLoading2 = false
const data = response.data
for (let i = 0; i < data.length; i++) {
data[i].实际收回日期 !== '' && data[i].实际收回日期 !== null ? data[i].实际收回日期 = data[i].实际收回日期.substring(0, data[i].实际收回日期.length - 8) : data[i].实际收回日期
data[i].节点日期 !== '' && data[i].节点日期 !== null ? data[i].节点日期 = data[i].节点日期.substring(0, data[i].节点日期.length - 8) : data[i].节点日期
data[i].计划收款日期 !== '' && data[i].计划收款日期 !== null ? data[i].计划收款日期 = data[i].计划收款日期.substring(0, data[i].计划收款日期.length - 8) : data[i].计划收款日期
parseInt(data[i].是否收回) === 1 ? data[i].是否禁用收回 = true : data[i].是否禁用收回 = false
}
this.tableData2 = data
})
} else if (data === 1) {
this.activeName = 'second'
} else {
this.$message.warning('未缴纳履约保证金')
}
})
} else {
this.$message.error('操作失败')
}
})
}
})
}
}
}
</script>
<style scoped>
</style>

View File

@@ -12,7 +12,7 @@
:label="item.label"
:value="item.value"/>
</el-select>
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="pageSize = 10;PageCurrent = 1;fetchTableData1()">查询</el-button>
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="PageSize = 10;PageCurrent = 1;fetchTableData1()">查询</el-button>
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" style="margin-left: 10px;margin-right: 15px" @click="addSafetyMargin();flag1 = 1">增加</el-button>
<span>预警颜色说明</span>
<el-tag type="info">未到时间</el-tag>