wujianwei
2025-12-17 6af332fe421d8a76cfeba378537b031d3caf81a5
ui/admin-ui3/src/views/tms/tmsContainer/index.vue
@@ -65,6 +65,7 @@
import {usePagePlus} from "@/hooks/usePagePlus";
import {hasPermission} from "@/utils/permissionUtils";
import {getTmsServiceProvider, listTmsServiceProvider} from "@/api/tms/tmsServiceProvider";
import {getTmsSettlementEntity, listTmsSettlementEntity} from "@/api/tms/tmsSettlementEntity";
const {proxy} = useCurrentInstance();
const crudRef = ref();
@@ -110,6 +111,21 @@
            {
              required: true,
              message: "系统编号不能为空", trigger: "blur"
            }
          ],
        },
        selfLeasType: {
          label: '自租类型',
          type: 'radio', dataType: 'string', dicUrl: '/system/dict/data/type/self_leas_type',
          addDisplay: true,
          editDisplay: true,minWidth:150,
          viewDisplay: true,
          hide: false,
          search: true,
          rules: [
            {
              required: true,
              message: "自租类型不能为空", trigger: "change"
            }
          ],
        },
@@ -162,56 +178,62 @@
          addDisplay: true,
          editDisplay: true,
          viewDisplay: true,
          hide: false,minWidth:150,
          hide: false,minWidth:150,dataType: 'string',
          search: true,
          rules: [
            {
              required: true,
              message: "产权归属不能为空", trigger: "blur"
              message: "产权归属不能为空", trigger: "change"
            }
          ],
          type: 'table', suffixIcon: 'search',
          change: (val: any) => {
            const table = crudRef.value?.getPropRef?.('ownerTeamId')?.$refs?.temp;
            if (!table) return;
            let active = table.active;
            if (Array.isArray(active)) active = active[0];
            if (active) {
              Object.assign(form.value, {
                ownerTeamId: active.id,
                ownerTeamName: active.customerShortName,
              });
            }
          },
          children: {
            border: true,
            searchLabelWidth: 100,
            searchMenuSpan: 5,
            column: {
              serviceCode: {
                label: '服务商编码', minWidth: 130,
              customerType: {
                label: '客户类型',
                type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/customer_type',
                display: false,
                hide: false,minWidth:150,
                search: true,
              },
              serviceShortName: {
                label: '服务商简称', minWidth: 120,
              customerShortName: {
                label: '客户简称',
                display: false,
                hide: false,minWidth:150,
                search: true,
              },
              serviceType: {
                label: '服务类型', multiple: true,
                type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/service_type',
                minWidth: 150,
              },
              isTransport: {
                label: '是否运输服务商',
                type: 'radio', dataType: 'string', dicUrl: '/system/dict/data/type/sys_number_is',
                minWidth: 150,
              },
              isStorage: {
                label: '是否仓储服务商',
                type: 'radio', dataType: 'string', dicUrl: '/system/dict/data/type/sys_number_is',
                minWidth: 150,
              },
              isExpress: {
                label: '是否快递服务商',
                type: 'radio', dataType: 'string', dicUrl: '/system/dict/data/type/sys_number_is',
                minWidth: 150,
              customerCode: {
                label: '客户编号',
                display: false,
                hide: false,minWidth:150,
                search: true,
              },
              contactName: {
                label: '联系人姓名', minWidth: 120,
                label: '联系人姓名',
                display: false,
                hide: false,minWidth:150,
                search: true,
              },
            },
          },
          props: {
            label: 'serviceShortName',
            label: 'customerShortName',
            value: 'id'
          },
          onLoad: ({page, value, data}: { page: any, value: any, data: any }, callback: any) => {
@@ -220,11 +242,11 @@
              if (Array.isArray(value)) {
                id = value[0]
              }
              getTmsServiceProvider(id).then(res => {
              getTmsSettlementEntity(id).then(res => {
                return callback(res.data || {})
              })
            } else {
              listTmsServiceProvider({pageSize: page.pageSize, pageNum: page.currentPage, ...data}).then(res => {
              listTmsSettlementEntity({pageSize: page.pageSize, pageNum: page.currentPage, ...data}).then(res => {
                return callback({
                  total: res.total,
                  data: res.rows || [],
@@ -445,6 +467,12 @@
      hide: false,minWidth:150,
      search: true,
    },
    selfLeasType: {
      label: '自租类型',
      type: 'radio', dataType: 'string', dicUrl: '/system/dict/data/type/self_leas_type',
      hide: false,      display: false,
      search: true,
    },
    containerCode: {
      label: '集装箱号',
      display: false,
@@ -552,24 +580,5 @@
  }
})
onMounted(() => {
  watch(() => form.value.ownerTeamId, () => {
    if (!form.value.ownerTeamId){
      return;
    }
    const table = crudRef.value?.getPropRef?.('ownerTeamId')?.$refs?.temp;
    if (!table) return;
    let active = table.active;
    if (Array.isArray(active)) active = active[0];
    if (active) {
      Object.assign(form.value, {
        ownerTeamId: active.id,
        ownerTeamName: active.serviceShortName,
      });
    }
  });
});
</script>