| | |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div>{{ row.verify==='Y'?'已审核':'未审核' }}</div> |
| | | <div v-if="row.verify==='Y'" style="display: flex;align-items: center"><div style="margin-right: 5px;width:10px;height: 10px;border-radius: 50%;background-color: #42b983" />已审核</div> |
| | | <div v-if="row.verify==='N'" style="display: flex;align-items: center"><div style="margin-right: 5px;width:10px;height: 10px;border-radius: 50%;background-color: red" />未审核</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | |
| | | <el-input |
| | | v-if="row.isVisible===1" |
| | | v-model="row.report_qty" |
| | | oninput="value=value.replace(/[^0-9]/g,'')" |
| | | placeholder="请输入" |
| | | /> |
| | | <div v-else>{{ row.report_qty }}</div> |
| | |
| | | <el-input |
| | | v-if="row.isVisible===1" |
| | | v-model="row.ng_qty" |
| | | oninput="value=value.replace(/[^0-9]/g,'')" |
| | | placeholder="请输入" |
| | | /> |
| | | <div v-else>{{ row.ng_qty }}</div> |
| | |
| | | <el-input |
| | | v-if="row.isVisible===1" |
| | | v-model="row.bad_qty" |
| | | oninput="value=value.replace(/[^0-9]/g,'')" |
| | | placeholder="请输入" |
| | | /> |
| | | <div v-else>{{ row.bad_qty }}</div> |
| | |
| | | <el-input |
| | | v-if="row.isVisible===1" |
| | | v-model="row.bad_money" |
| | | oninput="value=value.replace(/[^0-9.]/g,'')" |
| | | placeholder="请输入" |
| | | /> |
| | | <div v-else>{{ row.bad_money }}</div> |
| | |
| | | <template slot-scope="{row}"> |
| | | <div class="operationClass"> |
| | | <div v-if=" row.verify==='Y'"> |
| | | <el-tooltip class="item" effect="dark" content="报工反核" placement="top"> |
| | | <el-tooltip class="item" effect="dark" content="报工反审核" placement="top"> |
| | | <i class="el-icon-document" style="color:#42b983;cursor:pointer;margin-right: 15px" @click="noVerify(row)" /> |
| | | </el-tooltip> |
| | | </div> |
| | |
| | | |
| | | <script> |
| | | import Pagination from '@/components/Pagination' |
| | | import { AddUpdateOrganization, DeleteOrganization, OrganizationSearch, PrentOrganization } from '@/api/jcsz' |
| | | import { getCookie } from '@/utils/auth' |
| | | import ImportPicker from '@/components/ImportPicker' |
| | | import { handleDatetime, validateCode } from '@/utils/global' |
| | | import { handleDatetime } from '@/utils/global' |
| | | import { |
| | | MesOrderStepDeleteSeave, |
| | | MesOrderStepNoVerifySeave, |
| | | MesOrderStepNoVerifySeave, MesOrderStepUpdateSeave, |
| | | MesOrderStepVerifySearch, |
| | | MesOrderStepVerifySeave |
| | | } from '@/api/scgl' |
| | |
| | | partspec: '', // 产品规格 |
| | | reportuser: '', // 报工人员 |
| | | reportdate: '', // 报工时间 |
| | | prop: 'lm_date', // 排序字段 |
| | | prop: 'report_date', // 排序字段 |
| | | order: 'desc', // 排序字段 |
| | | page: 1, // 第几页 |
| | | rows: 20 // 每页多少条 |
| | |
| | | |
| | | total: 10, |
| | | tableData: [], |
| | | |
| | | editRowData: {}, // 编辑时的数据暂存对象 |
| | | |
| | | tabClickIndex: null, // 点击的单元格 |
| | | tabClickLabel: '', // 当前点击的列名 |
| | |
| | | partspec: this.form.partspec, // 产品规格 |
| | | reportuser: this.form.reportuser, // 报工人员 |
| | | reportdate: tempDate, // 报工时间 |
| | | prop: 'eqp_code', // 排序字段 |
| | | order: 'desc', // 排序字段 |
| | | page: 1, // 第几页 |
| | | rows: 20 // 每页多少条 |
| | | prop: this.form.prop, // 排序字段 |
| | | order: this.form.order, // 排序字段 |
| | | page: this.form.page, // 第几页 |
| | | rows: this.form.rows // 每页多少条 |
| | | } |
| | | |
| | | const res = await MesOrderStepVerifySearch(data) |
| | |
| | | // 报工审核 |
| | | verify(row) { |
| | | const data = { |
| | | // report_dvalue: '+1', |
| | | // ng_dvalue: '+1', |
| | | // bad_dvalue: '+1', |
| | | // badmoney_dvalue: '+1' |
| | | |
| | | 'id': row.id, |
| | | 'sbid': row.sbid, |
| | | 'wo_code': row.wo_code, |
| | |
| | | 'route_code': row.route_code, |
| | | 'step_seq': row.step_seq, |
| | | 'step_code': row.step_code, |
| | | 'flw_type': row.flw_type, |
| | | 'flw_type': row.flwtype, |
| | | 'first_choke': row.first_choke, |
| | | 'last_choke': row.last_choke, |
| | | 'unprice': row.unprice, |
| | | 'unprice': row.unprice ? row.unprice : 0, |
| | | 'usercode': row.usercode, |
| | | 'report_date': row.report_date, |
| | | 'report_qty': row.report_qty, |
| | | 'report_dvalue': '+1', |
| | | 'report_dvalue': 0, |
| | | 'ng_qty': row.ng_qty, |
| | | 'ng_dvalue': '+1', |
| | | 'ng_dvalue': 0, |
| | | 'bad_qty': row.bad_qty, |
| | | 'bad_dvalue': '+1', |
| | | 'bad_dvalue': 0, |
| | | 'bad_money': row.bad_money, |
| | | 'badmoney_dvalue': '+1' |
| | | 'badmoney_dvalue': 0 |
| | | |
| | | } |
| | | // const objData = { ...row, ...data } |
| | |
| | | |
| | | MesOrderStepVerifySeave([data]).then(r => { |
| | | if (r.code === '200') { |
| | | this.$message.success('审核成功!') |
| | | this.$message.success('报工审核成功!') |
| | | this.getMesOrderStepVerifySearch() |
| | | } |
| | | }) |
| | | }, |
| | | // 报工反审 |
| | | noVerify(row) { |
| | | MesOrderStepNoVerifySeave([row]).then(r => { |
| | | const data = { |
| | | 'id': row.id, |
| | | 'sbid': row.sbid, |
| | | 'wo_code': row.wo_code, |
| | | 'partnumber': row.partnumber, |
| | | 'task_qty': row.task_qty, |
| | | 'wkshp_code': row.wkshp_code, |
| | | 'eqp_code': row.eqp_code, |
| | | 'route_code': row.route_code, |
| | | 'step_seq': row.step_seq, |
| | | 'step_code': row.step_code, |
| | | 'flw_type': row.flwtype, |
| | | 'first_choke': row.first_choke, |
| | | 'last_choke': row.last_choke, |
| | | 'unprice': row.unprice, |
| | | 'usercode': row.usercode, |
| | | 'report_date': row.report_date, |
| | | 'report_qty': row.report_qty, |
| | | 'report_dvalue': 0, |
| | | 'ng_qty': row.ng_qty, |
| | | 'ng_dvalue': 0, |
| | | 'bad_qty': row.bad_qty, |
| | | 'bad_dvalue': 0, |
| | | 'bad_money': row.bad_money, |
| | | 'badmoney_dvalue': 0 |
| | | } |
| | | |
| | | MesOrderStepNoVerifySeave([data]).then(r => { |
| | | if (r.code === '200') { |
| | | this.$message.success('审核成功!') |
| | | this.$message.success('报工反审成功!') |
| | | this.getMesOrderStepVerifySearch() |
| | | } |
| | | }) |
| | | }, |
| | | // 修改按钮 |
| | | edit(row) { |
| | | console.log(row, 1) |
| | | console.log(row.number, 1) |
| | | console.log(row.isVisible, 1) |
| | | |
| | | if (this.tableData.find(i => i.isVisible === 1)) { |
| | | return this.$message.info('请先保存当前数据!') |
| | | return this.$message.info('请先保存当前行数据!') |
| | | } |
| | | |
| | | row.isVisible = 1 |
| | | // 浅拷贝:数组和对象直接等号赋值的通常是浅拷贝,新对象改变,原对象也会改变,会互相影响 |
| | | // 深拷贝:把里面的内容一个一个的复制出来,开一个新内存放进去,新对象和原对象不会互相影响 |
| | | this.editRowData = { ...row }// 此处用深拷贝,避免互相影响 |
| | | this.tableData.forEach((item, index) => { |
| | | item.isVisible = 0 |
| | | if (item.number === row.number) { |
| | | this.tableData.splice(index, 1, row) |
| | | this.tableData[index].isVisible = 1 |
| | | } |
| | | }) |
| | | |
| | | console.log(this.tableData, 56789) |
| | | }, |
| | | // 保存 |
| | | save(row) { |
| | | // const editRowData = this.editRowData |
| | | |
| | | const data = { |
| | | 'id': row.id, |
| | | 'sbid': row.sbid, |
| | | 'wo_code': row.wo_code, |
| | | 'partnumber': row.partnumber, |
| | | 'task_qty': row.task_qty, |
| | | 'wkshp_code': row.wkshp_code, |
| | | 'eqp_code': row.eqp_code, |
| | | 'route_code': row.route_code, |
| | | 'step_seq': row.step_seq, |
| | | 'step_code': row.step_code, |
| | | 'flw_type': row.flwtype, |
| | | 'first_choke': row.first_choke, |
| | | 'last_choke': row.last_choke, |
| | | 'unprice': row.unprice, |
| | | 'usercode': row.usercode, |
| | | 'report_date': row.report_date, |
| | | 'report_qty': row.report_qty, |
| | | 'report_dvalue': parseFloat(row.report_qty) - this.editRowData.report_qty >= 0 ? '+' + (parseFloat(row.report_qty) - this.editRowData.report_qty) : (parseFloat(row.report_qty) - this.editRowData.report_qty).toString(), |
| | | 'ng_qty': row.ng_qty, |
| | | 'ng_dvalue': parseFloat(row.ng_qty) - this.editRowData.ng_qty >= 0 ? '+' + (parseFloat(row.ng_qty) - this.editRowData.ng_qty) : (parseFloat(row.ng_qty) - this.editRowData.ng_qty).toString(), |
| | | 'bad_qty': row.bad_qty, |
| | | 'bad_dvalue': parseFloat(row.bad_qty) - this.editRowData.bad_qty >= 0 ? '+' + (parseFloat(row.bad_qty) - this.editRowData.bad_qty) : (parseFloat(row.bad_qty) - this.editRowData.bad_qty).toString(), |
| | | 'bad_money': row.bad_money, |
| | | 'badmoney_dvalue': parseFloat(row.bad_money) - this.editRowData.bad_money >= 0 ? '+' + (parseFloat(row.bad_money) - this.editRowData.bad_money) : (parseFloat(row.bad_money) - this.editRowData.bad_money) |
| | | } |
| | | |
| | | console.log(data, 1) |
| | | // console.log(this.editRowData, 2) |
| | | // console.log(parseFloat(row.report_qty), 3) |
| | | // console.log(this.editRowData.report_qty, 3) |
| | | // console.log(parseFloat(row.report_qty) - this.editRowData.report_qty, 3) |
| | | |
| | | MesOrderStepUpdateSeave([data]).then(res => { |
| | | this.$message.success('报工修改成功!') |
| | | this.getMesOrderStepVerifySearch() |
| | | }) |
| | | |
| | | // this.getMesOrderStepVerifySearch() |
| | | |
| | | // this.tableData.forEach((item, index) => { |
| | | // item.isVisible = 0 |
| | | // if (item.number === row.number) { |
| | | // this.tableData.splice(index, 1, row) |
| | | // // this.tableData[index].isVisible = 1 |
| | | // } |
| | | // }) |
| | | }, |
| | | // 删除按钮 |
| | | async del(row) { |
| | |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | MesOrderStepDeleteSeave([row]).then(res => { |
| | | const data = { |
| | | 'id': row.id, |
| | | 'sbid': row.sbid, |
| | | 'wo_code': row.wo_code, |
| | | 'partnumber': row.partnumber, |
| | | 'task_qty': row.task_qty, |
| | | 'wkshp_code': row.wkshp_code, |
| | | 'eqp_code': row.eqp_code, |
| | | 'route_code': row.route_code, |
| | | 'step_seq': row.step_seq, |
| | | 'step_code': row.step_code, |
| | | 'flw_type': row.flwtype, |
| | | 'first_choke': row.first_choke, |
| | | 'last_choke': row.last_choke, |
| | | 'unprice': row.unprice, |
| | | 'usercode': row.usercode, |
| | | 'report_date': row.report_date, |
| | | 'report_qty': row.report_qty, |
| | | 'report_dvalue': '0', |
| | | 'ng_qty': row.ng_qty, |
| | | 'ng_dvalue': '0', |
| | | 'bad_qty': row.bad_qty, |
| | | 'bad_dvalue': '0', |
| | | 'bad_money': row.bad_money, |
| | | 'badmoney_dvalue': '0' |
| | | } |
| | | |
| | | MesOrderStepDeleteSeave([data]).then(res => { |
| | | if (res.code === '200') { |
| | | this.$message.success('删除成功!') |
| | | if (this.form.page > 1 && this.tableData.length === 1) { |
| | |
| | | this.$message.info('已取消删除') |
| | | }) |
| | | }, |
| | | save(row) { |
| | | row.isVisible = 0 |
| | | }, |
| | | |
| | | // 表格双击点击 |
| | | cellDblclick(row, column, cell, event) { |
| | | console.log(row, column, cell, event) |