| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="出库去向" prop="outTarget"> |
| | | <el-input class="command-data-cockpit-search-input" v-model="formData.outTarget" maxlength="50" placeholder="请输入" clearable /> |
| | | <el-select |
| | | class="command-data-cockpit-select" |
| | | popper-class="command-data-cockpit-select-popper" |
| | | v-model="formData.outTarget" |
| | | placeholder="请选择" |
| | | clearable |
| | | > |
| | | <el-option v-for="item in areaOptions" :key="item.value" :label="item.label" :value="item.label" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { computed, ref } from 'vue' |
| | | import { computed, onMounted, ref } from 'vue' |
| | | import { ElMessage } from 'element-plus' |
| | | import { getUserListApi } from '@/api/system/user' |
| | | import { getLazyTree } from '@/api/base/region' |
| | | import { fieldRules } from '@ztzf/utils' |
| | | import { fwDeviceTrackSubmitApi } from '@/views/basicManage/deviceStock/fwDeviceTrackApi' |
| | | |
| | |
| | | } |
| | | }) |
| | | |
| | | const areaOptions = ref([]) |
| | | |
| | | const rules = { |
| | | charger: fieldRules(true), // 负责人 |
| | | contactPhone: fieldRules(true, 50), // 联系电话 |
| | |
| | | } |
| | | |
| | | const userList = ref([]) |
| | | function getAreaOptions() { |
| | | getLazyTree('360800000000').then(res => { |
| | | const list = res?.data?.data ?? [] |
| | | areaOptions.value = list.map(item => ({ |
| | | label: item.title, |
| | | value: item.value, |
| | | })) |
| | | }) |
| | | } |
| | | |
| | | function getUserList() { |
| | | formData.value.charger = '' |
| | | getUserListApi().then(res => { |
| | |
| | | if (!isValid) return |
| | | submitting.value = true |
| | | try { |
| | | await fwDeviceTrackSubmitApi(formData.value) |
| | | const selected = areaOptions.value.find(item => item.value === formData.value.outTarget) |
| | | const payload = { |
| | | ...formData.value, |
| | | outTarget: selected?.label ?? formData.value.outTarget, |
| | | } |
| | | await fwDeviceTrackSubmitApi(payload) |
| | | ElMessage.success('出库成功') |
| | | visible.value = false |
| | | emit('success') |
| | |
| | | |
| | | onMounted(() => { |
| | | getUserList() |
| | | getAreaOptions() |
| | | }) |
| | | |
| | | defineExpose({ open }) |