|
|
@@ -14,20 +14,15 @@ |
|
|
|
<div class="staffs"> |
|
|
|
<div style="width: 192px;font-weight: 700;margin-bottom:20px">选择员工</div> |
|
|
|
<ul> |
|
|
|
<li |
|
|
|
class="staff_item" |
|
|
|
v-for="(item, i) in staff" |
|
|
|
@click="selected(item)" |
|
|
|
:key="i" |
|
|
|
> |
|
|
|
<li class="staff_item" v-for="(item, i) in staff" @click="selected(item)" :key="i"> |
|
|
|
<span>{{ item }}</span> |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
</div> |
|
|
|
<div class="wai"> |
|
|
|
<div> |
|
|
|
<span class='wai_title'>{{ staff_selected }}外判工资</span> |
|
|
|
<div class="wai_info" v-if="staff_selected == ''">请先选择员工</div> |
|
|
|
<span class="wai_title">{{ staff_selected }}外判工资</span> |
|
|
|
<div class="wai_info" v-if="staff_selected == ''">请先选择员工</div> |
|
|
|
<el-table |
|
|
|
v-else |
|
|
|
border |
|
|
@@ -49,87 +44,85 @@ |
|
|
|
<span class="star">*</span> |
|
|
|
</template> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-date-picker |
|
|
|
format="yyyy-MM-dd" value-format="yyyy-MM-dd" |
|
|
|
v-model="scope.row.date" |
|
|
|
type="date" |
|
|
|
:ref="scope.column.property" |
|
|
|
@blur="alterData(scope.row, scope.column)" |
|
|
|
size="mini" |
|
|
|
placeholder="请选择日期" |
|
|
|
> |
|
|
|
</el-date-picker> |
|
|
|
<!-- <DatePicker v-model="scope.row.date" size="small" type="date" placeholder="选择日期"></DatePicker> --> |
|
|
|
<!-- <el-input |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-date-picker |
|
|
|
format="yyyy-MM-dd" |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
v-model="scope.row.date" |
|
|
|
type="date" |
|
|
|
:ref="scope.column.property" |
|
|
|
@blur="alterData(scope.row, scope.column)" |
|
|
|
size="mini" |
|
|
|
placeholder="请选择日期" |
|
|
|
></el-date-picker> |
|
|
|
<!-- <DatePicker v-model="scope.row.date" size="small" type="date" placeholder="选择日期"></DatePicker> --> |
|
|
|
<!-- <el-input |
|
|
|
placeholder="请选择日期" |
|
|
|
:ref="scope.column.property" |
|
|
|
v-model="scope.row.date" |
|
|
|
@blur="alterData(scope.row, scope.column)" |
|
|
|
style="width: 100px" |
|
|
|
></el-input> --> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="项目编号" property="project" width="127"> |
|
|
|
<template slot="header" slot-scope="scope"> |
|
|
|
<span>项目编号</span> |
|
|
|
<span class="star">*</span> |
|
|
|
</template> |
|
|
|
></el-input>--> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="项目编号" property="project" width="127"> |
|
|
|
<template slot="header" slot-scope="scope"> |
|
|
|
<span>项目编号</span> |
|
|
|
<span class="star">*</span> |
|
|
|
</template> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input |
|
|
|
placeholder="请输入编号" |
|
|
|
:ref="scope.column.property" |
|
|
|
v-model="scope.row.project" |
|
|
|
@input="slect_pro(scope.row)" |
|
|
|
></el-input> |
|
|
|
<Projectlist |
|
|
|
v-if="showTable && scope.row.id == current_idx" |
|
|
|
:row="scope.row.id" |
|
|
|
class="tableShow" |
|
|
|
@quickEnter="quickInput" |
|
|
|
></Projectlist> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
label="项目" |
|
|
|
property="projectname" |
|
|
|
width="298" |
|
|
|
align="center" |
|
|
|
> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="金额" property="money" width="97"> |
|
|
|
<template slot="header" slot-scope="scope"> |
|
|
|
<span>金额</span> |
|
|
|
<span class="star">*</span> |
|
|
|
</template> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input style="float:right" |
|
|
|
v-if="moneyedit && scope.row.id == current_idx" |
|
|
|
:ref="scope.column.property" |
|
|
|
v-model="scope.row.money" |
|
|
|
@blur="alterData(scope.row)" |
|
|
|
></el-input> |
|
|
|
<span style="float:right" v-else>{{ scope.row.money }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input |
|
|
|
placeholder="请输入编号" |
|
|
|
:ref="scope.column.property" |
|
|
|
v-model="scope.row.project" |
|
|
|
@input="slect_pro(scope.row)" |
|
|
|
></el-input> |
|
|
|
<Projectlist |
|
|
|
v-if="showTable && scope.row.id == current_idx" |
|
|
|
:row="scope.row.id" |
|
|
|
class="tableShow" |
|
|
|
@quickEnter="quickInput" |
|
|
|
></Projectlist> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="项目" property="projectname" width="298" align="center"></el-table-column> |
|
|
|
<el-table-column label="金额" property="money" width="97"> |
|
|
|
<template slot="header" slot-scope="scope"> |
|
|
|
<span>金额</span> |
|
|
|
<span class="star">*</span> |
|
|
|
</template> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input |
|
|
|
style="float:right" |
|
|
|
v-if="moneyedit && scope.row.id == current_idx" |
|
|
|
:ref="scope.column.property" |
|
|
|
v-model="scope.row.money" |
|
|
|
@blur="alterData(scope.row)" |
|
|
|
></el-input> |
|
|
|
<span style="float:right" v-else>{{ scope.row.money }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
<div class="sum" v-if="staff_selected != ''" >{{allmoney}}</div> |
|
|
|
<div class="sum" v-if="staff_selected != ''">{{allmoney}}</div> |
|
|
|
</div> |
|
|
|
<div v-if="staff_selected != ''" style="margin-top: 30px; font-size: 24px"> |
|
|
|
<!-- 添加按钮 --> |
|
|
|
<div> |
|
|
|
<span class="svg-container" @click="addnew"> |
|
|
|
<svg-icon class="svg_c" icon-class="add" /> |
|
|
|
</span> |
|
|
|
</div> |
|
|
|
<div class="dels" v-if="items.length>1"> |
|
|
|
<div style="height:40px" v-for="(item,index) in items " :key="index" :index="index" class="svg-container" @click="deleteprj(item)"> |
|
|
|
<svg-icon class="svg_c" icon-class="dec2" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div |
|
|
|
v-if="staff_selected != ''" |
|
|
|
style="margin-top: 30px; font-size: 24px" |
|
|
|
> |
|
|
|
<!-- 添加按钮 --> |
|
|
|
<span slot="reference" class="svg-container" @click="addnew"> |
|
|
|
<svg-icon icon-class="add" /> |
|
|
|
</span> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<span slot="footer" class="dialog-footer" > |
|
|
|
<el-button size="mini" @click="dialog = false" type="primary">取消</el-button> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<el-button size="mini" @click="dialog = false" type="primary">取消</el-button> |
|
|
|
<el-button style="margin-right:30px" size="mini" @click="submit" type="primary">保存</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
@@ -141,8 +134,12 @@ import { mapActions, mapState } from "vuex"; |
|
|
|
export default { |
|
|
|
name: "WaianInput", |
|
|
|
props: { |
|
|
|
optype:{ |
|
|
|
|
|
|
|
optype: { |
|
|
|
default: 'add' |
|
|
|
}, |
|
|
|
data: { |
|
|
|
type: Object, |
|
|
|
default: null |
|
|
|
} |
|
|
|
}, |
|
|
|
components: { |
|
|
@@ -165,12 +162,12 @@ export default { |
|
|
|
created() { |
|
|
|
// this.record(); |
|
|
|
}, |
|
|
|
computed:{ |
|
|
|
allmoney(){ |
|
|
|
let sum = 0.00 |
|
|
|
computed: { |
|
|
|
allmoney() { |
|
|
|
let sum = 0.00 |
|
|
|
this.items.forEach(element => { |
|
|
|
let ee = parseFloat(element.money) |
|
|
|
if(!isNaN(ee)){ |
|
|
|
if (!isNaN(ee)) { |
|
|
|
sum += parseFloat(element.money) |
|
|
|
} |
|
|
|
}); |
|
|
@@ -178,7 +175,7 @@ export default { |
|
|
|
return sum.toFixed(2) |
|
|
|
} |
|
|
|
}, |
|
|
|
dateChange() {}, |
|
|
|
dateChange() { }, |
|
|
|
methods: { |
|
|
|
// ...mapActions({ 'gongzi': ["setWaipan"] }), |
|
|
|
...mapActions(["addWaipan"]), |
|
|
@@ -206,11 +203,25 @@ export default { |
|
|
|
|
|
|
|
this.showTable = false; |
|
|
|
}, |
|
|
|
|
|
|
|
deleteprj(item){ |
|
|
|
console.log('del',item,this.items) |
|
|
|
let idx = this.items.findIndex((element) => { |
|
|
|
return element.id == item.id |
|
|
|
}) |
|
|
|
console.log('del',idx,item) |
|
|
|
if(idx >=0){ |
|
|
|
this.items.splice(idx, 1) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
addnew() { |
|
|
|
const item = { id: 0, date: "", project: "", projectname: "", money: "" }; |
|
|
|
let id = this.items.length; |
|
|
|
|
|
|
|
let id = Math.max.apply(Math,this.items.map(item => { return item.id }))+1 |
|
|
|
|
|
|
|
item.id = id; |
|
|
|
console.log(item) |
|
|
|
this.items.push(item); |
|
|
|
}, |
|
|
|
modechg(row, val) { |
|
|
@@ -241,25 +252,25 @@ export default { |
|
|
|
}); |
|
|
|
}, |
|
|
|
alterData(item) { |
|
|
|
this.moneyedit = false; |
|
|
|
this.moneyedit = false; |
|
|
|
this.refreshTable(); |
|
|
|
|
|
|
|
console.log(item) |
|
|
|
|
|
|
|
let sum = 0.00 |
|
|
|
let idx = this.items.findIndex((element)=>{ |
|
|
|
element.id== item.id |
|
|
|
let sum = 0.00 |
|
|
|
let idx = this.items.findIndex((element) => { |
|
|
|
return element.id == item.id |
|
|
|
}) |
|
|
|
|
|
|
|
let ee = parseFloat(item.money) |
|
|
|
let newitem = JSON.parse(JSON.stringify(item)) |
|
|
|
newitem.money = isNaN(ee)?sum.toFixed(2):ee.toFixed(2) |
|
|
|
this.items.splice(idx,1,newitem) |
|
|
|
console.log('item',this.items) |
|
|
|
|
|
|
|
|
|
|
|
let ee = parseFloat(item.money) |
|
|
|
let newitem = JSON.parse(JSON.stringify(item)) |
|
|
|
newitem.money = isNaN(ee) ? sum.toFixed(2) : ee.toFixed(2) |
|
|
|
this.items.splice(idx, 1, newitem) |
|
|
|
console.log('item', this.items) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
refreshTable() { |
|
|
@@ -282,17 +293,16 @@ export default { |
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
/* 引入table样式 */ |
|
|
|
@import url("./waipan.scss"); |
|
|
|
@import url('./waipan.scss'); |
|
|
|
.container { |
|
|
|
|
|
|
|
display: flex; |
|
|
|
/* justify-content: flex-end; */ |
|
|
|
} |
|
|
|
::v-deep .el-dialog__header { |
|
|
|
height: 50px; |
|
|
|
padding: 14px 5px; |
|
|
|
border-bottom: 1px solid rgba(204,204,204, .5); |
|
|
|
.el-dialog__headerbtn{ |
|
|
|
border-bottom: 1px solid rgba(204, 204, 204, 0.5); |
|
|
|
.el-dialog__headerbtn { |
|
|
|
top: 15px; |
|
|
|
right: 10px; |
|
|
|
} |
|
|
@@ -300,12 +310,12 @@ export default { |
|
|
|
::v-deep .el-dialog__footer { |
|
|
|
height: 48px; |
|
|
|
padding: 10px 5px; |
|
|
|
border-top: 1px solid rgba(204,204,204, .5); |
|
|
|
border-top: 1px solid rgba(204, 204, 204, 0.5); |
|
|
|
} |
|
|
|
|
|
|
|
::v-deep .el-button--primary{ |
|
|
|
::v-deep .el-button--primary { |
|
|
|
background-color: rgb(22, 155, 213); |
|
|
|
border-color: rgb(22, 155, 213); |
|
|
|
border-color: rgb(22, 155, 213); |
|
|
|
} |
|
|
|
|
|
|
|
::v-deep .el-dialog__body { |
|
|
@@ -337,27 +347,27 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
::v-deep .el-date-picker { |
|
|
|
width: 600px; |
|
|
|
width: 600px; |
|
|
|
} |
|
|
|
::v-deep .el-date-picker .el-picker-panel__content { |
|
|
|
width: 600px; |
|
|
|
width: 600px; |
|
|
|
} |
|
|
|
::v-deep .el-picker-panel__icon-btn { |
|
|
|
font-size: 18px; |
|
|
|
font-size: 18px; |
|
|
|
} |
|
|
|
::v-deep .el-table .cell{ |
|
|
|
padding: 0 !important; |
|
|
|
::v-deep .el-table .cell { |
|
|
|
padding: 0 !important; |
|
|
|
} |
|
|
|
|
|
|
|
// ::v-deep .cell:nth-child(3){ |
|
|
|
|
|
|
|
|
|
|
|
// text-align: right; |
|
|
|
|
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
::v-deep .el-input__inner{ |
|
|
|
::v-deep .el-input__inner { |
|
|
|
padding: 0 25px; |
|
|
|
&:focus{ |
|
|
|
&:focus { |
|
|
|
background-color: rgb(255, 255, 228); |
|
|
|
} |
|
|
|
} |
|
|
@@ -371,30 +381,30 @@ export default { |
|
|
|
height: 35px; |
|
|
|
text-align: center; |
|
|
|
line-height: 35px; |
|
|
|
&:hover{ |
|
|
|
&:hover { |
|
|
|
background-color: rgb(122, 208, 247); |
|
|
|
} |
|
|
|
} |
|
|
|
.wai{ |
|
|
|
.wai { |
|
|
|
width: calc(100% - 192px); |
|
|
|
padding: 30px 40px 0; |
|
|
|
display: flex; |
|
|
|
.wai_title{ |
|
|
|
.wai_title { |
|
|
|
width: 100%; |
|
|
|
font-weight: 700; |
|
|
|
display:inline-block; |
|
|
|
text-align: center; |
|
|
|
padding: 0 0 10px 0; |
|
|
|
font-weight: 700; |
|
|
|
display: inline-block; |
|
|
|
text-align: center; |
|
|
|
padding: 0 0 10px 0; |
|
|
|
} |
|
|
|
.wai_info{ |
|
|
|
width: 100%; |
|
|
|
display:inline-block; |
|
|
|
text-align: center; |
|
|
|
padding: 0 0 10px 0; |
|
|
|
.wai_info { |
|
|
|
width: 100%; |
|
|
|
display: inline-block; |
|
|
|
text-align: center; |
|
|
|
padding: 0 0 10px 0; |
|
|
|
} |
|
|
|
.sum{ |
|
|
|
.sum { |
|
|
|
float: right; |
|
|
|
margin:5px 10px 0; |
|
|
|
margin: 5px 10px 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@@ -410,6 +420,15 @@ export default { |
|
|
|
min-height: 100px; |
|
|
|
background: #fff; |
|
|
|
} |
|
|
|
.dels{ |
|
|
|
margin-top: 9px; |
|
|
|
display: flex; |
|
|
|
flex-flow: column; |
|
|
|
} |
|
|
|
|
|
|
|
.svg_c{ |
|
|
|
fill: #222; |
|
|
|
} |
|
|
|
|
|
|
|
.svg-container { |
|
|
|
padding-left: 10px; |