|
@@ -101,7 +101,26 @@
|
|
|
<a-col :span="5" class="vehicle-info-content-item flex items-center">
|
|
|
<div class="vehicle-info-title">铸机</div>
|
|
|
<a-divider type="vertical" style="background-color: #1e91bb" />
|
|
|
- <div class="vehicle-info-desc">{{ vehicleInfo.ccmNo_dictText }}</div>
|
|
|
+ <a-select
|
|
|
+ ref="selectCcmNoRef"
|
|
|
+ class="select-zj"
|
|
|
+ v-if="vehicleInfo.ccmNo === '0' && String(vehicleInfo.positionNum) == '2'"
|
|
|
+ size="large"
|
|
|
+ :open="selectCcmNoOpen"
|
|
|
+ placeholder="请选择铸机"
|
|
|
+ v-model:value="selectCcmNo"
|
|
|
+ @change="ccmNoChange"
|
|
|
+ @focus="selectCcmNoOpen = true"
|
|
|
+ @blur="selectCcmNoOpen = false"
|
|
|
+ >
|
|
|
+ <a-select-option value="5" label="China">
|
|
|
+ <span role="img" aria-label="5zj" class="vehicle-select-option zj5">5#机</span>
|
|
|
+ </a-select-option>
|
|
|
+ <a-select-option value="6" label="USA">
|
|
|
+ <span role="img" aria-label="6zj" class="vehicle-select-option zj6">6#机</span>
|
|
|
+ </a-select-option>
|
|
|
+ </a-select>
|
|
|
+ <div class="vehicle-info-desc" v-else>{{ vehicleInfo.ccmNo_dictText }}</div>
|
|
|
</a-col>
|
|
|
<a-col :span="5" class="vehicle-info-content-item green flex items-center">
|
|
|
<div class="vehicle-info-title">班组</div>
|
|
@@ -172,8 +191,7 @@ import type { VehicleInfo, VehicleResponse } from './types'
|
|
|
|
|
|
const router = useRouter()
|
|
|
const route = useRoute()
|
|
|
-const ccmNo = route.params.ccmNo || '5'
|
|
|
-const positionNo = route.params.positionNo || '1'
|
|
|
+const { ccmNo, positionNo } = route.params
|
|
|
|
|
|
const loading = ref(false)
|
|
|
const vehicleInfo = ref<VehicleInfo>({
|
|
@@ -194,10 +212,18 @@ const vehicleInfo = ref<VehicleInfo>({
|
|
|
amountTotal: 0,
|
|
|
licensePlateStatus: 0,
|
|
|
hasDestination: false,
|
|
|
+ positionNum: '',
|
|
|
})
|
|
|
|
|
|
+const selectCcmNo = ref<string>('')
|
|
|
+const selectCcmNoRef = ref()
|
|
|
+const selectCcmNoOpen = ref(false)
|
|
|
+
|
|
|
// 获取目的地信息
|
|
|
const getDestinationOptions = computed(() => {
|
|
|
+ if (!ccmNo || !destinationOptions[String(ccmNo)]) {
|
|
|
+ return []
|
|
|
+ }
|
|
|
return destinationOptions[String(ccmNo)].map((oitem: MConfigProps) => oitem)
|
|
|
})
|
|
|
|
|
@@ -247,7 +273,7 @@ const getVehicleInfo = () => {
|
|
|
params: {
|
|
|
column: 'createTime',
|
|
|
order: 'desc',
|
|
|
- ccmNo: ccmNo || '5',
|
|
|
+ ccmNo: positionNo === '2' ? '0' : ccmNo,
|
|
|
positionNum: positionNo,
|
|
|
pageNo: 1,
|
|
|
pageSize: 1,
|
|
@@ -315,6 +341,12 @@ const { start, stop } = useTimeoutFn(() => {
|
|
|
|
|
|
// 按钮操作
|
|
|
const handleClick = (type: string) => {
|
|
|
+ if (positionNo === '2' && !['5', '6'].includes(vehicleInfo.value.ccmNo)) {
|
|
|
+ message.warning('请先选择铸机!')
|
|
|
+ selectCcmNoRef.value.focus()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
if (type === 'confirmCar') {
|
|
|
visible.value = false
|
|
|
Modal.confirm({
|
|
@@ -328,6 +360,7 @@ const handleClick = (type: string) => {
|
|
|
editInfo(
|
|
|
{
|
|
|
licensePlate: vehicleInfo.value.licensePlate,
|
|
|
+ ccmNo: '',
|
|
|
},
|
|
|
type,
|
|
|
)
|
|
@@ -398,7 +431,39 @@ const handleClick = (type: string) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-const editInfo = (params: { licensePlate?: string }, type: string) => {
|
|
|
+// 更改铸机号
|
|
|
+const ccmNoChange = (e: string) => {
|
|
|
+ console.log('changeCcmNo', e)
|
|
|
+ Modal.confirm({
|
|
|
+ iconType: 'warning',
|
|
|
+ centered: true,
|
|
|
+ title: h('div', [
|
|
|
+ h('span', '确定要把铸机修改为 '),
|
|
|
+ h(
|
|
|
+ 'span',
|
|
|
+ {
|
|
|
+ style: {
|
|
|
+ color: '#f5222d',
|
|
|
+ fontSize: '36px',
|
|
|
+ },
|
|
|
+ },
|
|
|
+ `【 ${e}#机 】`,
|
|
|
+ ),
|
|
|
+ ]),
|
|
|
+ content: () => `注:确认修改后,不能再次修改 !`,
|
|
|
+ class: 'confirm-destination-modal',
|
|
|
+ okText: '确认',
|
|
|
+ cancelText: '取消',
|
|
|
+ onOk: () => {
|
|
|
+ editInfo({ ccmNo: e, licensePlate: '' }, 'confirmCar')
|
|
|
+ },
|
|
|
+ onCancel: () => {
|
|
|
+ selectCcmNo.value = ''
|
|
|
+ },
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+const editInfo = (params: { licensePlate?: string; ccmNo?: string }, type: string) => {
|
|
|
stop()
|
|
|
loading.value = true
|
|
|
axios
|
|
@@ -648,6 +713,14 @@ onUnmounted(() => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ .select-zj {
|
|
|
+ width: 130px;
|
|
|
+
|
|
|
+ :deep(.ant-select-selector) {
|
|
|
+ border: 2px solid #ff4d4f;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
.ant-divider {
|
|
|
height: 28px;
|
|
|
margin-bottom: -2px;
|
|
@@ -737,6 +810,19 @@ onUnmounted(() => {
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+.vehicle-select-option {
|
|
|
+ font-size: 18px;
|
|
|
+ font-weight: bold;
|
|
|
+
|
|
|
+ &.zj5 {
|
|
|
+ color: #f50;
|
|
|
+ }
|
|
|
+
|
|
|
+ &.zj6 {
|
|
|
+ color: #108ee9;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|
|
|
<style lang="less">
|
|
|
.confirm-destination-modal {
|