feat: 工单转移
This commit is contained in:
@@ -77,5 +77,11 @@ export function changeActive(data) {
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
export function getYZDevice() {
|
||||||
|
return request({
|
||||||
|
url: 'api/device/getYZDevice',
|
||||||
|
method: 'post'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export default { add, edit, del, getWorkprocedure, getItemByDeviceId, copyAdd, changeActive, getAllRegions }
|
export default { add, edit, del, getWorkprocedure, getItemByDeviceId, copyAdd, changeActive, getAllRegions, getYZDevice }
|
||||||
|
|||||||
@@ -103,4 +103,11 @@ export function getMaterial() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export default { add, edit, del, submits, getDevice, getTable, openStart, saveReport, finish, getReportWork, forceFinish, getDtl, getMaterial }
|
export function changeDevice(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/workorder/changeDevice',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export default { add, edit, del, submits, getDevice, getTable, openStart, saveReport, finish, getReportWork, forceFinish, getDtl, getMaterial, changeDevice }
|
||||||
|
|||||||
@@ -86,6 +86,17 @@
|
|||||||
>
|
>
|
||||||
开工
|
开工
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
slot="right"
|
||||||
|
class="filter-item"
|
||||||
|
type="warning"
|
||||||
|
icon="el-icon-position"
|
||||||
|
size="mini"
|
||||||
|
:disabled="!(crud.selections[0]) || crud.selections[1]"
|
||||||
|
@click="changeDevice(crud.selections[0])"
|
||||||
|
>
|
||||||
|
工单变更
|
||||||
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
slot="right"
|
slot="right"
|
||||||
class="filter-item"
|
class="filter-item"
|
||||||
@@ -350,11 +361,37 @@
|
|||||||
<el-button type="primary" @click="toForceFinish">确认</el-button>
|
<el-button type="primary" @click="toForceFinish">确认</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
<!-- 提示对话框 -->
|
||||||
|
<el-dialog
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
:visible.sync="showDeviceChoose"
|
||||||
|
title="选择设备"
|
||||||
|
width="350px"
|
||||||
|
>
|
||||||
|
<el-select
|
||||||
|
v-model="cacheOrderDevice"
|
||||||
|
placeholder="转移设备"
|
||||||
|
style="width: 300px"
|
||||||
|
filterable
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in yzDeviceList"
|
||||||
|
:key="item.device_id"
|
||||||
|
:label="item.device_name"
|
||||||
|
:value="item.device_code"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="showDeviceChoose = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="doChangeDevice">确定</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import crudWorkorder from '@/api/wms/pdm/workorder'
|
import crudWorkorder from '@/api/wms/pdm/workorder'
|
||||||
|
import crudDevice from '@/api/wms/pdm/device'
|
||||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||||
import rrOperation from '@crud/RR.operation'
|
import rrOperation from '@crud/RR.operation'
|
||||||
import crudOperation from '@crud/CRUD.operation'
|
import crudOperation from '@crud/CRUD.operation'
|
||||||
@@ -416,7 +453,7 @@ const defaultForm = {
|
|||||||
}
|
}
|
||||||
export default {
|
export default {
|
||||||
name: 'Produceshiftorder',
|
name: 'Produceshiftorder',
|
||||||
components: { pagination, crudOperation, rrOperation, udOperation, MaterDtl, ViewDialog, DeviceDialog },
|
components: { pagination, crudOperation, rrOperation, udOperation, MaterDtl, ViewDialog, DeviceDialog, crudDevice },
|
||||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||||
dicts: ['pdm_workorder_status', 'priority_direction', 'is_used', 'is_or_not', 'material_type', 'vehicle_type', 'workorder_procedure', 'true_or_false', 'wood_vehicle_type'],
|
dicts: ['pdm_workorder_status', 'priority_direction', 'is_used', 'is_or_not', 'material_type', 'vehicle_type', 'workorder_procedure', 'true_or_false', 'wood_vehicle_type'],
|
||||||
cruds() {
|
cruds() {
|
||||||
@@ -470,10 +507,17 @@ export default {
|
|||||||
plan_date: [
|
plan_date: [
|
||||||
{ required: true, message: '计划生产日期不能为空', trigger: 'blur' }
|
{ required: true, message: '计划生产日期不能为空', trigger: 'blur' }
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
showDeviceChoose: false,
|
||||||
|
cacheOrderData: {},
|
||||||
|
cacheOrderDevice: null,
|
||||||
|
yzDeviceList: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
crudDevice.getYZDevice().then(res => {
|
||||||
|
this.yzDeviceList = res
|
||||||
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 工单状态多选搜索
|
// 工单状态多选搜索
|
||||||
@@ -545,6 +589,22 @@ export default {
|
|||||||
this.crud.toQuery()
|
this.crud.toQuery()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 工单变更
|
||||||
|
changeDevice(row) {
|
||||||
|
this.cacheOrderData = row
|
||||||
|
this.showDeviceChoose = true
|
||||||
|
},
|
||||||
|
doChangeDevice() {
|
||||||
|
// 工单更换
|
||||||
|
this.cacheOrderData.new_device_code = this.cacheOrderDevice
|
||||||
|
crudWorkorder.changeDevice(this.cacheOrderData).then(res => {
|
||||||
|
this.crud.notify('工单转移成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
|
this.showDeviceChoose = false
|
||||||
|
this.cacheOrderData = {}
|
||||||
|
this.cacheOrderDevice = null
|
||||||
|
this.crud.toQuery()
|
||||||
|
})
|
||||||
|
},
|
||||||
downloadExcel() {
|
downloadExcel() {
|
||||||
if (this.crud.query.createTime) {
|
if (this.crud.query.createTime) {
|
||||||
this.crud.query.begin_time = this.crud.query.createTime[0]
|
this.crud.query.begin_time = this.crud.query.createTime[0]
|
||||||
|
|||||||
Reference in New Issue
Block a user