zhangback
2025-12-03 d7e7e80121be970b323288a3f52a9cc51d51ab54
ui/admin-ui3/src/views/tms/tmsProductInfo/index.vue
@@ -99,82 +99,82 @@
      label: '基础信息',
      prop: 'jcxx',
      column: {
        customerId: {
          label: '所属客户',minWidth: 150,
          addDisplay: true,
          editDisplay: true,suffixIcon:'search',
          viewDisplay: true,
          hide: true,
          search: true,
          rules: [
            {
              required: true,
              message: "所属客户不能为空", trigger: "change"
            }
          ],
          type: 'table',
          children:{
            border: true,
            searchMenuSpan: 5,
            column:{
              customerType: {
                label: '客户类型', minWidth: 120,
                type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/customer_type',
                search: true,
              },
              customerShortName: {
                label: '客户简称', minWidth: 130,
                search: true,
              },
              customerCode: {
                label: '客户编号',minWidth: 120,
                search: true,
              },
              contactName: {
                label: '联系人姓名',minWidth: 120,
              },
              signCompanyName: {
                label: '签约公司', minWidth: 150,
              },
            },
          },
          props:{
            label: 'customerShortName',
            value: 'id'
          },
          onLoad: ({ page, value, data }: { page: any, value: any, data: any }, callback:any) => {
            if (value){
              let id = value;
              if (Array.isArray(value)){
                id = value[0]
              }
              getTmsCustomerInfo(id).then(res=>{
                return callback(res.data||{})
              })
            }else{
              listTmsCustomerInfo({pageSize:page.pageSize,pageNum:page.currentPage,...data}).then(res=>{
                return callback({
                  total: res.total,
                  data: res.rows||[],
                })
              })
            }
          },
          change: (val: any) => {
            const table = crudRef.value?.getPropRef?.('customerId')?.$refs?.temp;
            if (!table) return;
            let active = table.active;
            if (Array.isArray(active)) active = active[0];
            if (active) {
              Object.assign(form.value, {
                customerId: active.id,
                customer: active.customerShortName,
              });
            }
          },
        },
        // customerId: {
        //   label: '所属客户',minWidth: 150,
        //   addDisplay: true,
        //   editDisplay: true,suffixIcon:'search',
        //   viewDisplay: true,
        //   hide: true,
        //   search: true,
        //   rules: [
        //     {
        //       required: true,
        //       message: "所属客户不能为空", trigger: "change"
        //     }
        //   ],
        //   type: 'table',
        //   children:{
        //     border: true,
        //     searchMenuSpan: 5,
        //     column:{
        //       customerType: {
        //         label: '客户类型', minWidth: 120,
        //         type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/customer_type',
        //         search: true,
        //       },
        //       customerShortName: {
        //         label: '客户简称', minWidth: 130,
        //         search: true,
        //       },
        //       customerCode: {
        //         label: '客户编号',minWidth: 120,
        //         search: true,
        //       },
        //       contactName: {
        //         label: '联系人姓名',minWidth: 120,
        //       },
        //       signCompanyName: {
        //         label: '签约公司', minWidth: 150,
        //       },
        //     },
        //
        //   },
        //   props:{
        //     label: 'customerShortName',
        //     value: 'id'
        //   },
        //   onLoad: ({ page, value, data }: { page: any, value: any, data: any }, callback:any) => {
        //     if (value){
        //       let id = value;
        //       if (Array.isArray(value)){
        //         id = value[0]
        //       }
        //       getTmsCustomerInfo(id).then(res=>{
        //         return callback(res.data||{})
        //       })
        //     }else{
        //       listTmsCustomerInfo({pageSize:page.pageSize,pageNum:page.currentPage,...data}).then(res=>{
        //         return callback({
        //           total: res.total,
        //           data: res.rows||[],
        //         })
        //       })
        //     }
        //
        //   },
        //   change: (val: any) => {
        //     const table = crudRef.value?.getPropRef?.('customerId')?.$refs?.temp;
        //     if (!table) return;
        //     let active = table.active;
        //     if (Array.isArray(active)) active = active[0];
        //     if (active) {
        //       Object.assign(form.value, {
        //         customerId: active.id,
        //         customer: active.customerShortName,
        //       });
        //     }
        //   },
        // },
        productCode: {
          label: '货品编码',
          addDisplay: true,
@@ -411,12 +411,12 @@
    //   search: false,
    // },
    customer: {
      label: '所属客户',
      display: false,
      hide: false, minWidth: 150,
      search: true,
    },
    // customer: {
    //   label: '所属客户',
    //   display: false,
    //   hide: false, minWidth: 150,
    //   search: true,
    // },
    productCode: {
      label: '货品编码',
      display: false,