SaleContract.data.ts 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687
  1. import {BasicColumn} from '/@/components/Table';
  2. import {FormSchema} from '/@/components/Table';
  3. import {JVxeTypes,JVxeColumn} from '/@/components/jeecg/JVxeTable/types'
  4. import { defHttp } from '/@/utils/http/axios';
  5. //列表数据
  6. export const columns: BasicColumn[] = [
  7. {
  8. title: '单据编码(bill code)',
  9. align:"center",
  10. dataIndex: 'billCode'
  11. },
  12. {
  13. title: '单据日期(bill date)',
  14. align:"center",
  15. sorter: true,
  16. dataIndex: 'billDate',
  17. customRender:({text}) =>{
  18. text = !text ? "" : (text.length > 10 ? text.substr(0,10) : text);
  19. return text;
  20. },
  21. },
  22. {
  23. title: '项目(Project)',
  24. align:"center",
  25. dataIndex: 'quotationProjectName'
  26. },
  27. {
  28. title: '客户(Customer)',
  29. align:"center",
  30. dataIndex: 'quotationCustomerName'
  31. },
  32. {
  33. title: '优先级(priority)',
  34. align:"center",
  35. dataIndex: 'priority_dictText'
  36. },
  37. {
  38. title: '产品分类(production class)',
  39. align:"center",
  40. dataIndex: 'productionClass'
  41. },
  42. {
  43. title: '机型(model)',
  44. align:"center",
  45. dataIndex: 'model'
  46. },
  47. {
  48. title: '厂家(maker)',
  49. align:"center",
  50. dataIndex: 'maker'
  51. },
  52. {
  53. title: '业务类型(busyness type)',
  54. align:"center",
  55. dataIndex: 'busynessType',
  56. // width:250,
  57. },
  58. {
  59. title: '销售部门(sale department)',
  60. align:"center",
  61. dataIndex: 'saleDepartment'
  62. },
  63. {
  64. title: '业务员(salesman)',
  65. align:"center",
  66. dataIndex: 'salesman'
  67. },
  68. {
  69. title: '关闭(close)',
  70. align:"center",
  71. dataIndex: 'isClose_dictText'
  72. },
  73. {
  74. title: '提交(submit)',
  75. align:"center",
  76. dataIndex: 'status_dictText'
  77. },
  78. {
  79. title: '版本号',
  80. align:"center",
  81. dataIndex: 'version'
  82. },
  83. ];
  84. //查询数据
  85. export const searchFormSchema: FormSchema[] = [
  86. {
  87. label: "单据编码(bill code)",
  88. field: "billCode",
  89. component: 'Input',
  90. labelWidth: 150,
  91. //colProps: {span: 6},
  92. },
  93. {
  94. label: "单据日期(bill date)",
  95. field: "billDate",
  96. component: 'RangePicker',
  97. labelWidth: 150,
  98. componentProps: {
  99. valueType: 'Date',
  100. },
  101. //colProps: {span: 6},
  102. },
  103. {
  104. label: "业务类型(busyness type)",
  105. field: "busynessType",
  106. labelWidth: 180,
  107. component: 'JDictSelectTag',
  108. componentProps:{
  109. dictCode:"busyness_type"
  110. },
  111. //colProps: {span: 6},
  112. },
  113. {
  114. label: "客户(Customer)",
  115. field: "quotationCustomerName",
  116. labelWidth: 150,
  117. component: 'Input',
  118. //colProps: {span: 6},
  119. },
  120. {
  121. label: "项目(Project)",
  122. field: "quotationProjectName",
  123. labelWidth: 150,
  124. component: 'Input',
  125. //colProps: {span: 6},
  126. },
  127. {
  128. label: "优先级(priority)",
  129. field: "priority",
  130. labelWidth: 150,
  131. component: 'JDictSelectTag',
  132. componentProps:{
  133. dictCode:"priority"
  134. },
  135. //colProps: {span: 6},
  136. },
  137. {
  138. label: "产品分类(production class)",
  139. field: "productionClass",
  140. labelWidth: 180,
  141. component: 'ApiSelect',
  142. componentProps: {
  143. // mode: 'multiple',//multiple: 多选;不填写为单选
  144. //请求api,返回结果{ result: { records: [{'id':'1',name:'scott'},{'id':'2',name:'小张'}] }}
  145. api: ()=> defHttp.get({ url: 'baseCode/baseProductClass/list?pageSize=-1' }),
  146. //数值转成String
  147. numberToString: false,
  148. //标题字段
  149. labelField: 'name',
  150. //值字段
  151. valueField: 'id',
  152. //请求参数
  153. params:{},
  154. //返回结果字段
  155. resultField:'records'
  156. },
  157. //colProps: {span: 6},
  158. },
  159. {
  160. label: "机型(model)",
  161. field: "model",
  162. labelWidth: 150,
  163. component: 'JDictSelectTag',
  164. componentProps:{
  165. dictCode:"model_typer"
  166. },
  167. //colProps: {span: 6},
  168. },
  169. {
  170. label: "厂家(maker)",
  171. field: "maker",
  172. labelWidth: 150,
  173. component: 'Input',
  174. //colProps: {span: 6},
  175. },
  176. {
  177. label: "业务员(salesman)",
  178. field: "salesman",
  179. labelWidth: 150,
  180. component: 'JSelectUser',
  181. componentProps:{
  182. },
  183. //colProps: {span: 6},
  184. },
  185. {
  186. label: "销售部门(sale department)",
  187. field: "saleDepartment",
  188. labelWidth: 180,
  189. component: 'JSelectDept',
  190. componentProps:{
  191. },
  192. //colProps: {span: 6},
  193. },
  194. {
  195. label: "提交(submit)",
  196. field: "status",
  197. labelWidth: 150,
  198. component: 'JDictSelectTag',
  199. componentProps:{
  200. dictCode:"yes_or_no"
  201. },
  202. //colProps: {span: 6},
  203. },
  204. {
  205. label: "关闭(close)",
  206. field: "isClose",
  207. labelWidth: 150,
  208. component: 'JDictSelectTag',
  209. componentProps:{
  210. dictCode:"yes_or_no"
  211. },
  212. //colProps: {span: 6},
  213. },
  214. ];
  215. //表单数据
  216. export const formSchema: FormSchema[] = [
  217. {
  218. label: '合同编号(bill code)',
  219. field: 'billCode',
  220. labelWidth: 200,
  221. component: 'Input',
  222. },
  223. {
  224. label: '单据日期(bill date)',
  225. field: 'billDate',
  226. component: 'DatePicker',
  227. componentProps: {
  228. valueFormat: 'YYYY-MM-DD',
  229. },
  230. dynamicDisabled:true,
  231. labelWidth: 200,
  232. },
  233. {
  234. label: '报价项目(quotation project)',
  235. labelWidth: 200,
  236. field: 'quotationProjectName',
  237. component: 'InputSearch',
  238. slot: 'quotationProjectName',
  239. dynamicRules: ({model,schema}) => {
  240. return [
  241. { required: true, message: '请输入报价项目名称!'},
  242. ];
  243. },
  244. },
  245. {
  246. label: '客户(customer)',
  247. labelWidth: 200,
  248. field: 'quotationCustomerName',
  249. component: 'Input',
  250. dynamicDisabled:true,
  251. },
  252. {
  253. label: '业务类型(busyness type)',
  254. labelWidth: 200,
  255. field: 'busynessType',
  256. component: 'JDictSelectTag',
  257. componentProps:{
  258. dictCode:"busyness_type"
  259. },
  260. },
  261. {
  262. label: '优先级(priority)',
  263. labelWidth: 200,
  264. field: 'priority',
  265. component: 'JDictSelectTag',
  266. componentProps:{
  267. dictCode:"priority"
  268. },
  269. },
  270. {
  271. label: '产品分类(production class)',
  272. labelWidth: 200,
  273. field: 'productionClass',
  274. component: 'ApiSelect',
  275. componentProps: {
  276. // mode: 'multiple',//multiple: 多选;不填写为单选
  277. //请求api,返回结果{ result: { records: [{'id':'1',name:'scott'},{'id':'2',name:'小张'}] }}
  278. api: ()=> defHttp.get({ url: 'baseCode/baseProductClass/list?pageSize=-1' }),
  279. //数值转成String
  280. numberToString: false,
  281. //标题字段
  282. labelField: 'name',
  283. //值字段
  284. valueField: 'id',
  285. //请求参数
  286. params:{},
  287. //返回结果字段
  288. resultField:'records'
  289. },
  290. },
  291. {
  292. label: '机型(model)',
  293. field: 'model',
  294. labelWidth: 200,
  295. component: 'JDictSelectTag',
  296. componentProps:{
  297. dictCode:"model_typer"
  298. },
  299. },
  300. {
  301. label: '厂家(maker)',
  302. labelWidth: 200,
  303. field: 'maker',
  304. component: 'Input',
  305. },
  306. {
  307. label: '币种(currency)',
  308. labelWidth: 200,
  309. field: 'currency',
  310. component: 'JDictSelectTag',
  311. componentProps:{
  312. dictCode:"currency"
  313. },
  314. },
  315. {
  316. label: '交货条款(delivery terms)',
  317. labelWidth: 200,
  318. field: 'deliveryTerms',
  319. component: 'JDictSelectTag',
  320. componentProps:{
  321. dictCode:"delivery_terms"
  322. },
  323. },
  324. {
  325. label: '付款条件(payment terms)',
  326. field: 'paymentTerms',
  327. labelWidth: 200,
  328. component: 'JDictSelectTag',
  329. componentProps:{
  330. dictCode:"payment_terms"
  331. },
  332. },
  333. {
  334. label: '付款条件2',
  335. field: 'paymentInfo',
  336. labelWidth: 200,
  337. component: 'Input',
  338. },
  339. {
  340. label: '销售部门(sale department)',
  341. field: 'saleDepartment',
  342. labelWidth: 200,
  343. component: 'Input',
  344. dynamicDisabled:true,
  345. componentProps:{
  346. },
  347. },
  348. {
  349. label: '业务员(salesman)',
  350. field: 'salesman',
  351. labelWidth: 200,
  352. component: 'Input',
  353. dynamicDisabled:true,
  354. componentProps:{
  355. },
  356. },
  357. {
  358. label: '汇率(exchange rate)',
  359. field: 'exchangeRate',
  360. labelWidth: 200,
  361. component: 'Input',
  362. },
  363. {
  364. label: '备注(notes)',
  365. field: 'notes',
  366. labelWidth: 200,
  367. component: 'Input',
  368. },
  369. {
  370. label: '附件(attachs)',
  371. field: 'attachs',
  372. labelWidth: 200,
  373. component: 'JUpload',
  374. },
  375. {
  376. label: '',
  377. field: 'id',
  378. component: 'Input',
  379. show: false
  380. },
  381. {
  382. label: '',
  383. field: 'quotationCustomer',
  384. component: 'Input',
  385. show: false
  386. },
  387. {
  388. label: '',
  389. field: 'quotationProject',
  390. component: 'Input',
  391. show: false
  392. },
  393. {
  394. label: '',
  395. field: 'status',
  396. component: 'Input',
  397. show: false
  398. },
  399. ];
  400. //子表单数据
  401. //子表表格配置
  402. export const saleContractShipColumns: JVxeColumn[] = [
  403. {
  404. title: '船名(ship name)',
  405. key: 'shipName',
  406. type: JVxeTypes.normal,
  407. placeholder: '请输入${title}',
  408. defaultValue:'',
  409. },
  410. {
  411. title: '主机号(hostN number)',
  412. key: 'hostNumber',
  413. type: JVxeTypes.input,
  414. placeholder: '请输入${title}',
  415. defaultValue:'',
  416. },
  417. {
  418. title: '工程编号(project No)',
  419. key: 'projectNo',
  420. type: JVxeTypes.input,
  421. placeholder: '请输入${title}',
  422. defaultValue:'',
  423. },
  424. {
  425. title: '船厂(ship factory)',
  426. key: 'shipFactory',
  427. type: JVxeTypes.normal,
  428. width:"200px",
  429. placeholder: '请输入${title}',
  430. defaultValue:'',
  431. },
  432. {
  433. title: '船东(shipowner)',
  434. key: 'shipowner',
  435. type: JVxeTypes.normal,
  436. placeholder: '请输入${title}',
  437. defaultValue:'',
  438. },
  439. {
  440. title: '操作(operation)',
  441. key: 'action',
  442. width:"400px",
  443. // 固定在右侧
  444. fixed: 'right',
  445. // 对齐方式为居中
  446. align: 'center',
  447. // 组件类型定义为【插槽】
  448. type: JVxeTypes.slot,
  449. // slot 的名称,对应 v-slot 冒号后面和等号前面的内容
  450. slotName: 'action',
  451. },
  452. ]
  453. export const saleContractProductColumns: JVxeColumn[] = [
  454. {
  455. title: '交期(delivery time)',
  456. key: 'deliveryTime',
  457. type: JVxeTypes.date,
  458. width:"200px",
  459. placeholder: '请输入${title}',
  460. defaultValue:'',
  461. },
  462. {
  463. title: '产品分类(product class)',
  464. key: 'productClass',
  465. type: JVxeTypes.normal,
  466. width:"200px",
  467. placeholder: '请输入${title}',
  468. defaultValue:'',
  469. },
  470. {
  471. title: '产品编码(product code)',
  472. key: 'productCode',
  473. type: JVxeTypes.normal,
  474. width:"200px",
  475. placeholder: '请输入${title}',
  476. defaultValue:'',
  477. },
  478. {
  479. title: '产品中文名chinese name)',
  480. key: 'chineseName',
  481. type: JVxeTypes.normal,
  482. width:"200px",
  483. placeholder: '请输入${title}',
  484. defaultValue:'',
  485. },
  486. {
  487. title: '产品英文名(english name)',
  488. key: 'englishName',
  489. type: JVxeTypes.normal,
  490. width:"200px",
  491. placeholder: '请输入${title}',
  492. defaultValue:'',
  493. },
  494. {
  495. title: '型号(model)',
  496. key: 'model',
  497. type: JVxeTypes.normal,
  498. width:"200px",
  499. placeholder: '请输入${title}',
  500. defaultValue:'',
  501. },
  502. {
  503. title: '备件号(partno)',
  504. key: 'partno',
  505. type: JVxeTypes.normal,
  506. width:"200px",
  507. placeholder: '请输入${title}',
  508. defaultValue:'',
  509. },
  510. {
  511. title: '图号(drawingno)',
  512. key: 'drawingno',
  513. type: JVxeTypes.normal,
  514. width:"200px",
  515. placeholder: '请输入${title}',
  516. defaultValue:'',
  517. },
  518. {
  519. title: '订货号(orderno)',
  520. key: 'orderno',
  521. type: JVxeTypes.normal,
  522. width:"200px",
  523. placeholder: '请输入${title}',
  524. defaultValue:'',
  525. },
  526. {
  527. title: '厂家(factory)',
  528. key: 'factory',
  529. type: JVxeTypes.normal,
  530. width:"200px",
  531. placeholder: '请输入${title}',
  532. defaultValue:'',
  533. },
  534. {
  535. title: '质量等级(quality grade)',
  536. key: 'qualityGrade',
  537. type: JVxeTypes.normal,
  538. width:"200px",
  539. placeholder: '请输入${title}',
  540. defaultValue:'',
  541. },
  542. {
  543. title: '数量(quantity)',
  544. key: 'quantity',
  545. type: JVxeTypes.inputNumber,
  546. width:"200px",
  547. placeholder: '请输入${title}',
  548. defaultValue:'',
  549. },
  550. {
  551. title: '税率(tax rate)',
  552. key: 'taxRate',
  553. type: JVxeTypes.inputNumber,
  554. width:"200px",
  555. placeholder: '请输入${title}',
  556. defaultValue:'',
  557. },
  558. {
  559. title: '折扣(discount)',
  560. key: 'discount',
  561. type: JVxeTypes.input,
  562. width:"200px",
  563. placeholder: '请输入${title}',
  564. defaultValue:'',
  565. },
  566. {
  567. title: '含税单价(tax price)',
  568. key: 'taxPrice',
  569. type: JVxeTypes.inputNumber,
  570. width:"200px",
  571. placeholder: '请输入${title}',
  572. defaultValue:'',
  573. },
  574. {
  575. title: '含税金额(tax amount)',
  576. key: 'taxAmount',
  577. type: JVxeTypes.normal,
  578. width:"200px",
  579. placeholder: '请输入${title}',
  580. defaultValue:'',
  581. },
  582. {
  583. title: '备注(notes)',
  584. key: 'notes',
  585. type: JVxeTypes.input,
  586. width:"200px",
  587. placeholder: '请输入${title}',
  588. defaultValue:'',
  589. },
  590. {
  591. title: '操作(operation)',
  592. key: 'action',
  593. width:"200px",
  594. // 固定在右侧
  595. fixed: 'right',
  596. // 对齐方式为居中
  597. align: 'center',
  598. // 组件类型定义为【插槽】
  599. type: JVxeTypes.slot,
  600. // slot 的名称,对应 v-slot 冒号后面和等号前面的内容
  601. slotName: 'action',
  602. },
  603. ]
  604. // 高级查询数据
  605. export const superQuerySchema = {
  606. hisId: {title: '历史主键',order: 0,view: 'text', type: 'string',},
  607. status: {title: '状态(1-已提交,0-未提交)',order: 1,view: 'number', type: 'number',},
  608. billDate: {title: '单据日期',order: 2,view: 'date', type: 'string',},
  609. billCode: {title: '单据编码',order: 3,view: 'text', type: 'string',},
  610. quotationProject: {title: '报价项目',order: 4,view: 'text', type: 'string',},
  611. quotationProjectName: {title: '报价项目名称',order: 5,view: 'text', type: 'string',},
  612. quotationCustomer: {title: '报价客户',order: 6,view: 'text', type: 'string',},
  613. quotationCustomerName: {title: '报价客户名称',order: 7,view: 'text', type: 'string',},
  614. busynessType: {title: '业务类型(busyness type)',order: 8,view: 'text', type: 'string',},
  615. priority: {title: '优先级(priority)',order: 9,view: 'text', type: 'string',},
  616. productionClass: {title: '产品分类(production class)',order: 10,view: 'text', type: 'string',},
  617. model: {title: '机型(model)',order: 11,view: 'text', type: 'string',},
  618. maker: {title: '厂家(maker)',order: 12,view: 'text', type: 'string',},
  619. currency: {title: '币种(currency)',order: 13,view: 'text', type: 'string',},
  620. deliveryTerms: {title: '交货条款(delivery terms)',order: 14,view: 'text', type: 'string',},
  621. paymentTerms: {title: '付款条件(payment terms)',order: 15,view: 'text', type: 'string',},
  622. paymentInfo: {title: '付款条件2',order: 16,view: 'text', type: 'string',},
  623. saleDepartment: {title: '销售部门(sale department)',order: 17,view: 'sel_depart', type: 'string',},
  624. salesman: {title: '业务员(salesman)',order: 18,view: 'sel_user', type: 'string',},
  625. exchangeRate: {title: '汇率(exchange rate)',order: 19,view: 'text', type: 'string',},
  626. notes: {title: '备注(notes)',order: 20,view: 'text', type: 'string',},
  627. attachs: {title: '附件(attachs)',order: 21,view: 'text', type: 'string',},
  628. version: {title: '版本号',order: 22,view: 'text', type: 'string',},
  629. isClose: {title: '关闭(1-是,0-否)',order: 23,view: 'number', type: 'number',},
  630. //子表高级查询
  631. saleContractShip: {
  632. title: '销售合同-船明细',
  633. view: 'table',
  634. fields: {
  635. status: {title: '状态(1-启用,0-停用)',order: 0,view: 'number', type: 'number',},
  636. headId: {title: '表头主键(销售合同)',order: 2,view: 'text', type: 'string',},
  637. shipId: {title: '船id',order: 3,view: 'text', type: 'string',},
  638. shipName: {title: '船名',order: 4,view: 'text', type: 'string',},
  639. hostNumber: {title: '主机号',order: 5,view: 'text', type: 'string',},
  640. projectNo: {title: '工程编号',order: 6,view: 'text', type: 'string',},
  641. shipFactory: {title: '船厂',order: 7,view: 'text', type: 'string',},
  642. shipowner: {title: '船东',order: 8,view: 'text', type: 'string',},
  643. }
  644. },
  645. saleContractProduct: {
  646. title: '销售合同-产品明细',
  647. view: 'table',
  648. fields: {
  649. status: {title: '状态(1-启用,0-停用)',order: 0,view: 'number', type: 'number',},
  650. headId: {title: '表头主键(销售报价单)',order: 2,view: 'text', type: 'string',},
  651. deliveryTime: {title: '交期',order: 3,view: 'datetime', type: 'string',},
  652. productId: {title: '产品id',order: 4,view: 'text', type: 'string',},
  653. productClass: {title: '产品分类',order: 5,view: 'text', type: 'string',},
  654. productCode: {title: '产品编码',order: 6,view: 'text', type: 'string',},
  655. chineseName: {title: '产品中文名',order: 7,view: 'text', type: 'string',},
  656. englishName: {title: '产品英文名',order: 8,view: 'text', type: 'string',},
  657. specifications: {title: '规格',order: 9,view: 'text', type: 'string',},
  658. model: {title: '型号',order: 10,view: 'text', type: 'string',},
  659. partno: {title: '备件号',order: 11,view: 'text', type: 'string',},
  660. drawingno: {title: '图号',order: 12,view: 'text', type: 'string',},
  661. orderno: {title: '订货号',order: 13,view: 'text', type: 'string',},
  662. factory: {title: '厂家',order: 14,view: 'text', type: 'string',},
  663. qualityGrade: {title: '质量等级',order: 15,view: 'text', type: 'string',},
  664. quantity: {title: '数量',order: 16,view: 'number', type: 'number',},
  665. unit: {title: '单位',order: 17,view: 'text', type: 'string',},
  666. taxRate: {title: '税率(tax rate)',order: 18,view: 'number', type: 'number',},
  667. discount: {title: '折扣(discount)',order: 19,view: 'text', type: 'string',},
  668. taxPrice: {title: '含税单价(tax price)',order: 20,view: 'number', type: 'number',},
  669. taxAmount: {title: '含税金额(tax amount)',order: 21,view: 'number', type: 'number',},
  670. notes: {title: '备注(notes)',order: 22,view: 'text', type: 'string',},
  671. }
  672. },
  673. };
  674. /**
  675. * 流程表单调用这个方法获取formSchema
  676. * @param param
  677. */
  678. export function getBpmFormSchema(_formData): FormSchema[]{
  679. // 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
  680. return formSchema;
  681. }