|
@@ -177,10 +177,9 @@
|
|
:disabled="Number(scope.row.state) === 0"
|
|
:disabled="Number(scope.row.state) === 0"
|
|
type="text"
|
|
type="text"
|
|
size="small"
|
|
size="small"
|
|
- @click="startTask(scope.row.taskId)"
|
|
|
|
|
|
+ @click="startTask(scope.row)"
|
|
>开始</el-button
|
|
>开始</el-button
|
|
>
|
|
>
|
|
- <!-- <el-button v-if="isAuth('work:clt:start')" type="text" size="small" @click="startTask(scope.row.taskId)">开始</el-button>-->
|
|
|
|
<el-button
|
|
<el-button
|
|
v-if="isAuth('work:clt:transfer') && Number(scope.row.state) !== 3"
|
|
v-if="isAuth('work:clt:transfer') && Number(scope.row.state) !== 3"
|
|
type="text"
|
|
type="text"
|
|
@@ -199,7 +198,7 @@
|
|
"
|
|
"
|
|
type="text"
|
|
type="text"
|
|
size="small"
|
|
size="small"
|
|
- @click="completeTask(scope.row.taskId)"
|
|
|
|
|
|
+ @click="completeTask(scope.row)"
|
|
>报工</el-button
|
|
>报工</el-button
|
|
>
|
|
>
|
|
<el-button
|
|
<el-button
|
|
@@ -271,6 +270,36 @@
|
|
>
|
|
>
|
|
</el-pagination>
|
|
</el-pagination>
|
|
|
|
|
|
|
|
+ <el-dialog
|
|
|
|
+ title="开始任务"
|
|
|
|
+ width="30%"
|
|
|
|
+ :visible.sync="startDialogFormVisible"
|
|
|
|
+ >
|
|
|
|
+ <el-form
|
|
|
|
+ :model="startDialogForm"
|
|
|
|
+ :rules="startDialogFormRules"
|
|
|
|
+ ref="startDialogForm"
|
|
|
|
+ >
|
|
|
|
+ <el-form-item label="数量" prop="count">
|
|
|
|
+ <el-input-number v-model="startDialogForm.count" :min="1" :max="startDialogForm.maxCount"></el-input-number>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="设备" >
|
|
|
|
+ <el-select v-model="startDialogForm.usageRecordId">
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in devices"
|
|
|
|
+ :key="item.value"
|
|
|
|
+ :label="item.label"
|
|
|
|
+ :value="item.value">
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ <div slot="footer">
|
|
|
|
+ <el-button @click="startDialogFormVisible = false">取 消</el-button>
|
|
|
|
+ <el-button type="primary" @click="startSubmit" v-reClick>确 定</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
|
|
+
|
|
<el-dialog
|
|
<el-dialog
|
|
title="移交任务"
|
|
title="移交任务"
|
|
width="30%"
|
|
width="30%"
|
|
@@ -281,12 +310,9 @@
|
|
:rules="transferDialogFormRules"
|
|
:rules="transferDialogFormRules"
|
|
ref="transferDialogForm"
|
|
ref="transferDialogForm"
|
|
>
|
|
>
|
|
- <!-- <el-form-item label="检验类型" prop="checkType" label-width="120px">
|
|
|
|
- <el-select v-model="transferDialogForm.checkType" placeholder="请选择检验类型">
|
|
|
|
- <el-option label="通过" value="1"></el-option>
|
|
|
|
- <el-option label="不通过" value="2"></el-option>
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item> -->
|
|
|
|
|
|
+ <el-form-item label="数量" prop="count" label-width="120px">
|
|
|
|
+ <el-input-number v-model="transferDialogForm.count" :min="1" :max="transferDialogForm.maxCount"></el-input-number>
|
|
|
|
+ </el-form-item>
|
|
<el-form-item label="移交类型" prop="transferType" label-width="120px">
|
|
<el-form-item label="移交类型" prop="transferType" label-width="120px">
|
|
<el-select
|
|
<el-select
|
|
v-model="transferDialogForm.transferType"
|
|
v-model="transferDialogForm.transferType"
|
|
@@ -465,6 +491,9 @@
|
|
:rules="finishDialogFormRules"
|
|
:rules="finishDialogFormRules"
|
|
ref="finishDialogForm"
|
|
ref="finishDialogForm"
|
|
>
|
|
>
|
|
|
|
+ <el-form-item label="数量" prop="count" label-width="120px">
|
|
|
|
+ <el-input-number v-model="finishDialogForm.count" :min="1" :max="finishDialogForm.maxCount"></el-input-number>
|
|
|
|
+ </el-form-item>
|
|
<el-form-item
|
|
<el-form-item
|
|
label="完成记录说明"
|
|
label="完成记录说明"
|
|
prop="operationRecords"
|
|
prop="operationRecords"
|
|
@@ -546,7 +575,6 @@
|
|
<script>
|
|
<script>
|
|
import {
|
|
import {
|
|
getMyTaskList,
|
|
getMyTaskList,
|
|
- startTask,
|
|
|
|
transferTask,
|
|
transferTask,
|
|
completeTask,
|
|
completeTask,
|
|
checkTask,
|
|
checkTask,
|
|
@@ -557,7 +585,8 @@ import {
|
|
batchCheckTask,
|
|
batchCheckTask,
|
|
batchCompleteTask,
|
|
batchCompleteTask,
|
|
submitTask,
|
|
submitTask,
|
|
- revokeBatch
|
|
|
|
|
|
+ revokeBatch,
|
|
|
|
+ deviceList
|
|
} from '@/api/task'
|
|
} from '@/api/task'
|
|
import { workTypeMasterList } from '@/api/worktype'
|
|
import { workTypeMasterList } from '@/api/worktype'
|
|
import templateList from '../warehouse/template-list'
|
|
import templateList from '../warehouse/template-list'
|
|
@@ -600,24 +629,19 @@ export default {
|
|
totalPage: 0,
|
|
totalPage: 0,
|
|
dataListLoading: false,
|
|
dataListLoading: false,
|
|
dataListSelections: [],
|
|
dataListSelections: [],
|
|
- // optionsState: [
|
|
|
|
- // {
|
|
|
|
- // code: '1',
|
|
|
|
- // value: '未开始'
|
|
|
|
- // },
|
|
|
|
- // {
|
|
|
|
- // code: '2',
|
|
|
|
- // value: '待操作'
|
|
|
|
- // },
|
|
|
|
- // {
|
|
|
|
- // code: '3',
|
|
|
|
- // value: '已完成'
|
|
|
|
- // }
|
|
|
|
- // ],
|
|
|
|
|
|
+ startDialogFormVisible: false,
|
|
|
|
+ startDialogForm: {
|
|
|
|
+ count: 0
|
|
|
|
+ },
|
|
|
|
+ startDialogFormRules: {},
|
|
transferDialogFormVisible: false,
|
|
transferDialogFormVisible: false,
|
|
- transferDialogForm: {},
|
|
|
|
|
|
+ transferDialogForm: {
|
|
|
|
+ count: 0
|
|
|
|
+ },
|
|
finishDialogFormVisible: false,
|
|
finishDialogFormVisible: false,
|
|
- finishDialogForm: {},
|
|
|
|
|
|
+ finishDialogForm: {
|
|
|
|
+ count: 0
|
|
|
|
+ },
|
|
finishDialogFormRules: {
|
|
finishDialogFormRules: {
|
|
operationRecords: [
|
|
operationRecords: [
|
|
{ required: true, message: '完成记录说明不能为空', trigger: 'blur' }
|
|
{ required: true, message: '完成记录说明不能为空', trigger: 'blur' }
|
|
@@ -701,7 +725,8 @@ export default {
|
|
taskIds: '',
|
|
taskIds: '',
|
|
maxNumber: 0,
|
|
maxNumber: 0,
|
|
number: 0
|
|
number: 0
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ devices: [{}] // 设备列表
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created () {
|
|
created () {
|
|
@@ -754,42 +779,57 @@ export default {
|
|
this.dataListSelections = val
|
|
this.dataListSelections = val
|
|
},
|
|
},
|
|
// 开始
|
|
// 开始
|
|
- startTask (taskId) {
|
|
|
|
- this.$confirm('是否开始任务?', '提示', {
|
|
|
|
- confirmButtonText: '确定',
|
|
|
|
- cancelButtonText: '取消',
|
|
|
|
- type: 'warning'
|
|
|
|
|
|
+ startTask (item) {
|
|
|
|
+ this.startDialogFormVisible = true
|
|
|
|
+ this.startDialogForm.taskIds = item.taskIds
|
|
|
|
+ this.startDialogForm.count = item.taskIds == null ? 0 : item.taskIds.length
|
|
|
|
+ this.startDialogForm.maxCount = this.startDialogForm.count
|
|
|
|
+
|
|
|
|
+ let params = {
|
|
|
|
+ current: 1,
|
|
|
|
+ size: 50
|
|
|
|
+ }
|
|
|
|
+ deviceList(params).then(({data}) => {
|
|
|
|
+ if (data && data.code === '200') {
|
|
|
|
+ this.devices = []
|
|
|
|
+ for (item in data.records) {
|
|
|
|
+ this.devices.push({
|
|
|
|
+ label: item.name,
|
|
|
|
+ value: item.id
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
})
|
|
})
|
|
- .then(() => {
|
|
|
|
- startTask({ taskId }).then(({ data }) => {
|
|
|
|
- if (data && data.code === '200') {
|
|
|
|
- this.$message({
|
|
|
|
- type: 'success',
|
|
|
|
- message: '操作成功!'
|
|
|
|
- })
|
|
|
|
- this.getDataList()
|
|
|
|
- } else {
|
|
|
|
- this.$message({
|
|
|
|
- type: 'error',
|
|
|
|
- message: data.msg
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ startSubmit () {
|
|
|
|
+ let data = {
|
|
|
|
+ taskIds: this.startDialogForm.taskIds.slice(0, this.startDialogForm.count)
|
|
|
|
+ }
|
|
|
|
+ batchStart(data).then(({ data }) => {
|
|
|
|
+ this.startDialogFormVisible = false
|
|
|
|
+ if (data && data.code === '200') {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: 'success',
|
|
|
|
+ message: '操作成功!'
|
|
})
|
|
})
|
|
- })
|
|
|
|
- .catch(() => {
|
|
|
|
|
|
+ this.getDataList()
|
|
|
|
+ } else {
|
|
this.$message({
|
|
this.$message({
|
|
- type: 'info',
|
|
|
|
- message: '已取消'
|
|
|
|
|
|
+ type: 'error',
|
|
|
|
+ message: data.msg
|
|
})
|
|
})
|
|
- })
|
|
|
|
|
|
+ }
|
|
|
|
+ })
|
|
},
|
|
},
|
|
// 移交
|
|
// 移交
|
|
transferTask (item) {
|
|
transferTask (item) {
|
|
- let {taskId, workTypeId, taskType} = item
|
|
|
|
|
|
+ let {taskIds, workTypeId, taskType} = item
|
|
this.transferDialogFormVisible = true
|
|
this.transferDialogFormVisible = true
|
|
- this.transferDialogForm.taskIdList = taskId
|
|
|
|
|
|
+ this.transferDialogForm.taskIds = taskIds
|
|
this.transferDialogForm.taskType = taskType
|
|
this.transferDialogForm.taskType = taskType
|
|
this.transferDialogForm.cnt = 1
|
|
this.transferDialogForm.cnt = 1
|
|
|
|
+ this.transferDialogForm.count = taskIds == null ? 0 : taskIds.length
|
|
|
|
+ this.transferDialogForm.maxCount = this.transferDialogForm.count
|
|
|
|
|
|
if (taskType !== 'routine') {
|
|
if (taskType !== 'routine') {
|
|
workTypeMasterList(workTypeId).then(({ data }) => {
|
|
workTypeMasterList(workTypeId).then(({ data }) => {
|
|
@@ -803,6 +843,8 @@ export default {
|
|
transferSubmit () {
|
|
transferSubmit () {
|
|
this.$refs['transferDialogForm'].validate((valid) => {
|
|
this.$refs['transferDialogForm'].validate((valid) => {
|
|
if (valid) {
|
|
if (valid) {
|
|
|
|
+ let taskIds = this.transferDialogForm.taskIds.slice(0, this.transferDialogForm.count)
|
|
|
|
+ this.transferDialogForm.taskIdList = taskIds.join(',')
|
|
transferTask(this.transferDialogForm).then(({ data }) => {
|
|
transferTask(this.transferDialogForm).then(({ data }) => {
|
|
if (data && data.code === '200') {
|
|
if (data && data.code === '200') {
|
|
this.$message({
|
|
this.$message({
|
|
@@ -822,15 +864,18 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 完成
|
|
// 完成
|
|
- completeTask (taskId) {
|
|
|
|
|
|
+ completeTask (item) {
|
|
this.finishDialogFormVisible = true
|
|
this.finishDialogFormVisible = true
|
|
- this.finishDialogForm.taskId = taskId
|
|
|
|
|
|
+ this.finishDialogForm.taskIds = item.taskIds
|
|
|
|
+ this.finishDialogForm.count = item.taskIds == null ? 0 : item.taskIds.length
|
|
|
|
+ this.finishDialogForm.maxCount = this.finishDialogForm.count
|
|
},
|
|
},
|
|
// 确认完成
|
|
// 确认完成
|
|
finishSubmit () {
|
|
finishSubmit () {
|
|
this.$refs['finishDialogForm'].validate((valid) => {
|
|
this.$refs['finishDialogForm'].validate((valid) => {
|
|
if (valid) {
|
|
if (valid) {
|
|
let submitData = this.finishDialogForm
|
|
let submitData = this.finishDialogForm
|
|
|
|
+ submitData.taskIds = this.finishDialogForm.taskIds.slice(0, this.finishDialogForm.count)
|
|
if (this.checkDialogBatch) {
|
|
if (this.checkDialogBatch) {
|
|
// 批量
|
|
// 批量
|
|
batchCompleteTask(submitData).then(({ data }) => {
|
|
batchCompleteTask(submitData).then(({ data }) => {
|