opt:整理判断相关业务代码,去除启用的代码

This commit is contained in:
zds
2024-10-23 11:16:39 +08:00
parent 5f77d68859
commit e02d3ff026
6 changed files with 3 additions and 580 deletions

View File

@@ -72,17 +72,6 @@
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
<!-- <el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
:disabled="add_flag"
@click="addrow"
>
新增一行
</el-button>-->
</span>
</div>
@@ -95,7 +84,7 @@
border
:highlight-current-row="true"
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@current-change="handleCurrentChange"
@selection-change="crud.selectionChangeHandler"
>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="sect_name" label="盘点库区" align="center" width="120px" />
@@ -132,18 +121,10 @@
<el-input v-model="scope.row.remark" size="mini" style="width: 250px" />
</template>
</el-table-column>
<!-- <el-table-column align="center" label="操作" width="160" fixed="right">
<template scope="scope">
<el-button :disabled="isCanDel(scope.$index, scope.row,1)" type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="deleteRow(scope.$index, tableData)" />
<el-button v-show="!scope.row.edit" :disabled="isCanDel(scope.$index, scope.row,2)" type="primary" class="filter-item" size="mini" icon="el-icon-edit" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
<el-button v-show="scope.row.edit" :disabled="isCanDel(scope.$index, scope.row,2)" type="success" class="filter-item" size="mini" icon="el-icon-check" @click="handleEdit(scope.$index, scope.row)">完成</el-button>
</template>
</el-table-column>-->
</el-table>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<!-- <el-button type="primary" @click="saveCheck">保存</el-button>-->
<el-button type="primary" @click="submitCheck">确认</el-button>
</span>
<DtlViewDialog :dialog-show.sync="dtlViewShow" :open-param="paramDtlView"/>
@@ -177,11 +158,7 @@ export default {
return {
dialogVisible: false,
paramDtlView: '',
materShow: false,
dtlViewShow: false,
add_flag: true,
nowrow: null,
nowindex: '',
storlist: [],
form: {
check_id: '',
@@ -228,134 +205,9 @@ export default {
close() {
this.$emit('AddChanged')
},
handleCurrentChange(current) {
if (current !== null) {
this.nowrow = current
const num = parseFloat(current.base_qty)
if (num > 0) {
this.add_flag = false
} else {
this.add_flag = true
}
} else {
this.nowrow = null
this.add_flag = true
}
},
isCanDel(index, row, type) {
if (type === 1) {
if (row.status === '1') {
return false
} else {
return true
}
}
},
isShow(index, row, type) {
const num = parseFloat(row.base_qty)
if (type === 1) {
if (row.status > '3') {
return false
} else {
if (num > 0) {
return false
} else {
if (row.edit) {
return false
} else {
return true
}
}
}
} else if (type === 2) {
if (row.status > '2') {
return false
} else {
if (row.edit) {
return false
} else {
return true
}
}
} else if (type === 3) {
if (row.status > '3') {
return true
} else {
if (num > 0) {
return true
} else {
if (row.edit) {
return true
} else {
return false
}
}
}
} else if (type === 4) {
if (row.status > '2') {
return true
} else {
if (row.edit) {
return true
} else {
return false
}
}
}
},
setForm(row) {
this.dialogVisible = true
this.form = row
},
bill_statusFormat(row, column) {
return this.dict.label.check_dtl_status[row.status]
},
check_resultFormat(row, column) {
return this.dict.label.check_result[row.check_result]
},
addrow() {
if (this.nowrow === null) {
this.crud.notify('请先选中一条已存在的库存明细!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
this.tableData.push({ check_id: this.form.check_id, check_code: this.form.check_code, checkdtl_id: '', sect_id: this.nowrow.sect_id, sect_name: this.nowrow.sect_name, struct_id: this.nowrow.struct_id, struct_name: this.nowrow.struct_name, storagevehicle_id: this.nowrow.storagevehicle_id, storagevehicle_code: this.nowrow.storagevehicle_code, status: '01', material_id: '', material_name: '', base_qty: '0', qty_unit_id: '42', qty_unit_name: '桶', is_down: '0', fac_qty: '', check_result: '0', edit: false })
this.form.dtl_num = this.tableData.length
},
tableChanged2(row) {
for (let i = 0; i < this.tableData.length; i++) {
if ((this.tableData[i].material_id === row.material_id) && (this.tableData[i].storagevehicle_code === this.nowrow.storagevehicle_code) && (this.tableData[i].struct_id === this.nowrow.struct_id)) {
this.crud.notify('不允许货位、载具、物料同时相同!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
}
this.nowrow.material_id = row.material_id
this.nowrow.material_code = row.material_code
this.nowrow.material_name = row.material_name
this.tableData.splice(this.nowindex, 1, this.nowrow) // 通过splice 替换数据 触发视图更新
},
handleEdit(index, row) {
// 判断是否可以关闭编辑状态
if (!row.edit) {
const num = parseFloat(row.base_qty)
const fac_qty = parseFloat(row.fac_qty)
if (num <= 0 && fac_qty <= 0) {
this.crud.notify('不允许新增明细,盘点数量为0', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (!row.material_id) {
this.crud.notify('物料不可为空!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
}
row.edit = !row.edit
this.tableData.splice(index, 1, row) // 通过splice 替换数据 触发视图更新
},
deleteRow(index, rows) {
rows.splice(index, 1)
this.nowindex = ''
this.nowrow = null
this.form.detail_count = this.tableData.length
},
submitCheck() {
check.confirm({ 'row': this.form, 'rows': this.tableData }).then(res => {
this.dialogVisible = false
@@ -363,21 +215,6 @@ export default {
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
})
},
saveCheck() {
if (this.tableData.length === 0) {
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
for (let i = 0; i < this.tableData.length; i++) {
if (!this.tableData[i].edit) {
this.crud.notify('尚有未完成编辑的物料明细序号' + (i + 1) + ',请检查!')
return false
}
}
check.saveCheck({ 'row': this.form, 'rows': this.tableData }).then(res => {
this.dialogVisible = false
})
},
openDtlView(row) {
this.paramDtlView = row.storagevehicle_code
this.dtlViewShow = true
@@ -397,7 +234,4 @@ export default {
margin-left: auto;
padding: 4px 4px;
}
.input-with-select {
background-color: #fff;
}
</style>

View File

@@ -37,7 +37,7 @@ import CRUD, { header, presenter } from '@crud/crud'
import check from '@/views/wms/st/inStor/check/check'
export default {
name: 'ProcessDialog',
name: 'RepairDialog',
mixins: [presenter(), header()],
props: {
dialogShow: {

View File

@@ -38,26 +38,6 @@ export function getOutBillDtl2(params) {
params
})
}
export function getOutBillDis(params) {
return request({
url: '/api/check/getOutBillDis',
method: 'get',
params
})
}
export function getInvTypes() {
return request({
url: '/api/check/getInvTypes',
method: 'get'
})
}
export function insertDtl(data) {
return request({
url: '/api/check/insertDtl',
method: 'post',
data
})
}
export function getStructIvt(params) {
return request({
url: '/api/check/getStructIvt',
@@ -73,34 +53,6 @@ export function confirm(data) {
data
})
}
export function handdown(data) {
return request({
url: '/api/check/handdown',
method: 'post',
data
})
}
export function saveCheck(data) {
return request({
url: '/api/check/saveCheck',
method: 'post',
data
})
}
export function process0(data) {
return request({
url: '/api/check/process0',
method: 'post',
data
})
}
export function process1(data) {
return request({
url: '/api/check/process1',
method: 'post',
data
})
}
export function disposeConfirm(data) {
return request({
url: '/api/check/disposeConfirm',
@@ -129,4 +81,4 @@ export function repairSubmit(data) {
data
})
}
export default { add, edit, del, getOutBillDtl, getStructIvt, getOutBillDtl2, confirm, getInvTypes, saveCheck, process0, getOutBillDis, process1, disposeConfirm, allInsert, confirmBtn, repairSubmit }
export default { add, edit, del, getOutBillDtl, getStructIvt, getOutBillDtl2, confirm, disposeConfirm, allInsert, confirmBtn, repairSubmit }