|
|
@ -91,21 +91,21 @@ |
|
|
|
<span class="dialog-left-bottom" /> |
|
|
|
<div class="setting-dialog"> |
|
|
|
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="80px"> |
|
|
|
<el-form-item label="盘点单号" prop="taskName"> |
|
|
|
<el-input v-model="form.taskName" disabled /> |
|
|
|
<el-form-item label="盘点单号" prop="stockBill"> |
|
|
|
<el-input v-model="form.stockBill" disabled /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="盘点类型" prop="taskType"> |
|
|
|
<el-input v-model="form.taskType" disabled /> |
|
|
|
<el-form-item label="盘点类型" prop="stockTypeName"> |
|
|
|
<el-input v-model="form.stockTypeName" disabled /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="目标位置" prop="location"> |
|
|
|
<el-input v-model="form.location" disabled /> |
|
|
|
<el-form-item label="目标位置" prop="stockRegion"> |
|
|
|
<el-input v-model="form.stockRegion" disabled /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="目标数量" prop="number"> |
|
|
|
<el-input v-model="form.number" disabled /> |
|
|
|
<el-form-item label="目标数量" prop="stockGridNumName"> |
|
|
|
<el-input v-model="form.stockGridNumName" disabled /> |
|
|
|
</el-form-item> |
|
|
|
<el-row> |
|
|
|
<el-form-item label="备注" prop="remark"> |
|
|
|
<el-input v-model="form.remark" type="textarea" style="width: 572px;" :rows="4" /> |
|
|
|
<el-form-item label="备注" prop="stockRemarks"> |
|
|
|
<el-input v-model="form.stockRemarks" type="textarea" style="width: 572px;" :rows="4" /> |
|
|
|
</el-form-item> |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
@ -217,8 +217,8 @@ |
|
|
|
</div> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<!-- 排队中会多一个“删除盘点” 进行中的多一个“终止盘点” --> |
|
|
|
<el-button v-if="detailInfo.state === 1" type="primary" class="end-btn"><i class="iconfont icon-stop" />删除盘点</el-button> |
|
|
|
<el-button v-if="detailInfo.state === 2" type="primary" class="end-btn"><i class="iconfont icon-stop" />终止盘点</el-button> |
|
|
|
<el-button v-if="detailInfo.state === 1" :loading="crud.delAllLoading" type="primary" class="end-btn" @click="toDelete"><i class="iconfont icon-stop" />删除盘点</el-button> |
|
|
|
<el-button v-if="detailInfo.state === 2" type="primary" class="end-btn" @click="toStopStockBill"><i class="iconfont icon-stop" />终止盘点</el-button> |
|
|
|
<el-button :loading="crud.status.cu === 2" type="primary" @click="detailVisible=false">确定</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -238,7 +238,7 @@ import { mapGetters } from 'vuex' |
|
|
|
import { parseTime, saveAs, getBlob } from '@/utils/index' |
|
|
|
import qs from 'qs' |
|
|
|
|
|
|
|
const defaultForm = { id: null, taskType: null, taskName: null, location: null, number: null, remark: null } |
|
|
|
const defaultForm = { stockTypeName: '全量盘点', stockType: 1, stockBill: null, stockRegion: '全部区域', stockGridNum: null, stockGridNumName: null, stockRemarks: null, regionId: null, shelfId: null, gridShelf: null, gridId: null } |
|
|
|
export default { |
|
|
|
name: 'CheckLog', |
|
|
|
components: { crudOperation, rrOperation, pagination, taskStockLogEcharts }, |
|
|
@ -287,16 +287,16 @@ export default { |
|
|
|
del: ['admin', 'checkLog:del'] |
|
|
|
}, |
|
|
|
rules: { |
|
|
|
taskName: [ |
|
|
|
stockBill: [ |
|
|
|
{ required: true, message: '请输入盘点单号', trigger: 'blur' } |
|
|
|
], |
|
|
|
taskType: [ |
|
|
|
stockTypeName: [ |
|
|
|
{ required: true, message: '请输入盘点类型', trigger: 'blur' } |
|
|
|
], |
|
|
|
location: [ |
|
|
|
stockRegion: [ |
|
|
|
{ required: true, message: '请输入目标位置', trigger: 'blur' } |
|
|
|
], |
|
|
|
number: [ |
|
|
|
stockGridNumName: [ |
|
|
|
{ required: true, message: '请输入目标数量', trigger: 'blur' } |
|
|
|
] |
|
|
|
} |
|
|
@ -313,16 +313,34 @@ export default { |
|
|
|
}, |
|
|
|
[CRUD.HOOK.afterRefresh](crud) { |
|
|
|
}, |
|
|
|
// 新增前将多选的值设置为空 |
|
|
|
// 新增前 |
|
|
|
[CRUD.HOOK.beforeToAdd]() { |
|
|
|
}, // 初始化编辑时候的角色与岗位 |
|
|
|
if (this.crud.form.stockType === 1) { |
|
|
|
this.crud.form.stockTypeName = '全量盘点' |
|
|
|
} |
|
|
|
|
|
|
|
Promise.all([ |
|
|
|
crudStockTaskLog.FetchNewBillNo(), |
|
|
|
crudStockTaskLog.FetchStockGirdNum() |
|
|
|
]).then(([newBillNoRes, stockGridNumRes]) => { |
|
|
|
this.crud.form.stockBill = newBillNoRes |
|
|
|
this.crud.form.stockGridNumName = stockGridNumRes + ' / 层位' |
|
|
|
this.crud.form.stockGridNum = stockGridNumRes |
|
|
|
}).catch(error => { |
|
|
|
console.error(error) |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 初始化编辑时 |
|
|
|
[CRUD.HOOK.beforeToEdit](crud, form) { |
|
|
|
}, |
|
|
|
[CRUD.HOOK.beforeValidateCU](crud, form) { |
|
|
|
}, |
|
|
|
// 提交前做的操作 |
|
|
|
[CRUD.HOOK.afterValidateCU](crud) { |
|
|
|
return false |
|
|
|
console.log(crud.form) |
|
|
|
delete crud.form.stockGridNumName |
|
|
|
delete crud.form.stockTypeName |
|
|
|
return true |
|
|
|
}, |
|
|
|
clickRowHandler(row) { |
|
|
|
this.$refs.table.clearSelection() |
|
|
@ -416,6 +434,59 @@ export default { |
|
|
|
handleCloseDialog() { |
|
|
|
this.detailVisible = false |
|
|
|
this.tabIndex = 0 |
|
|
|
}, |
|
|
|
toDelete() { |
|
|
|
this.$confirm('此操作将删除当前盘点单任务<span>你是否还要继续?</span>', '提示', { |
|
|
|
confirmButtonText: '继续', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning', |
|
|
|
dangerouslyUseHTMLString: true |
|
|
|
}).then(() => { |
|
|
|
this.crud.delAllLoading = true |
|
|
|
const params = { |
|
|
|
'id': this.dbRowData.billId |
|
|
|
} |
|
|
|
console.log(params) |
|
|
|
crudStockTaskLog.del(params).then(res => { |
|
|
|
console.log(res) |
|
|
|
if (res && res.code !== 500) { |
|
|
|
this.$message({ message: '当前盘点单任务删除成功', type: 'success', offset: 8 }) |
|
|
|
this.crud.refresh() |
|
|
|
} else { |
|
|
|
this.$message({ message: res.message, type: 'error', offset: 8 }) |
|
|
|
} |
|
|
|
this.crud.delAllLoading = false |
|
|
|
}).catch(err => { |
|
|
|
this.crud.delAllLoading = false |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
}).catch(() => { |
|
|
|
this.crud.delAllLoading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
toStopStockBill() { |
|
|
|
this.$confirm('此操作将终止当前盘点单任务<span>你是否还要继续?</span>', '提示', { |
|
|
|
confirmButtonText: '继续', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning', |
|
|
|
dangerouslyUseHTMLString: true |
|
|
|
}).then(() => { |
|
|
|
const params = { |
|
|
|
'id': this.dbRowData.billId |
|
|
|
} |
|
|
|
crudStockTaskLog.FetchStopStockBill(params).then(res => { |
|
|
|
console.log(res) |
|
|
|
if (res && res.code !== 500) { |
|
|
|
this.$message({ message: '当前盘点单任务终止成功', type: 'success', offset: 8 }) |
|
|
|
this.crud.refresh() |
|
|
|
} else { |
|
|
|
this.$message({ message: res.message, type: 'error', offset: 8 }) |
|
|
|
} |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
}).catch(() => { |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|