SaleRfp.data.ts 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383
  1. import { BasicColumn } from '/@/components/Table';
  2. import { FormSchema } from '/@/components/Table';
  3. import { defHttp } from '/@/utils/http/axios';
  4. import { ref } from 'vue';
  5. const customerOption = ref([]);
  6. const projectOption = ref([]);
  7. //列表数据
  8. export const columns: BasicColumn[] = [
  9. {
  10. title: '单据编码(bill code)',
  11. align: 'center',
  12. dataIndex: 'billCode',
  13. },
  14. {
  15. title: '单据日期(bill date)',
  16. align: 'center',
  17. dataIndex: 'billDate',
  18. customRender: ({ text }) => {
  19. text = !text ? '' : text.length > 10 ? text.substr(0, 10) : text;
  20. return text;
  21. },
  22. },
  23. {
  24. title: '系统项目(project)',
  25. align: 'center',
  26. dataIndex: 'projectId_dictText',
  27. },
  28. {
  29. title: '客户(customer)',
  30. align: 'center',
  31. dataIndex: 'customerId_dictText',
  32. },
  33. {
  34. title: '采购方式(procurement method)',
  35. align: 'center',
  36. dataIndex: 'procurementMethod',
  37. },
  38. {
  39. title: '招标项目号(tender code)',
  40. align: 'center',
  41. dataIndex: 'tenderCode',
  42. },
  43. {
  44. title: '招标项目名称(tender name)',
  45. align: 'center',
  46. dataIndex: 'tenderName',
  47. },
  48. {
  49. title: '投标时间(bid Time)',
  50. align: 'center',
  51. dataIndex: 'bidTime',
  52. },
  53. {
  54. title: '开标时间(opening time)',
  55. align: 'center',
  56. dataIndex: 'openingTime',
  57. },
  58. {
  59. title: '项目总价(total money)',
  60. align: 'center',
  61. dataIndex: 'totalMoney',
  62. },
  63. {
  64. title: '投标结果(tender result)',
  65. align: 'center',
  66. dataIndex: 'tenderResult_dictText',
  67. },
  68. {
  69. title: '备注(notes)',
  70. align: 'center',
  71. dataIndex: 'notes',
  72. },
  73. {
  74. title: '提交(submit)',
  75. align: 'center',
  76. dataIndex: 'submit',
  77. customRender: function (t, r, index) {
  78. if (t.text == 1) {
  79. return '是(yes)';
  80. } else if (t.text == 0) {
  81. return '否(no)';
  82. }
  83. },
  84. },
  85. ];
  86. //查询数据
  87. export const searchFormSchema: FormSchema[] = [
  88. {
  89. label: '单据编码(bill code)',
  90. field: 'billCode',
  91. component: 'JInput',
  92. labelWidth: 180,
  93. componentProps: {
  94. AutoComplete: 'off',
  95. },
  96. //colProps: {span: 6},
  97. },
  98. {
  99. label: '客户(customer)',
  100. field: 'customerId',
  101. component: 'JSelect',
  102. labelWidth: 150,
  103. componentProps: {
  104. getOptionUrl: () => defHttp.get({ url: '/cuspCode/cuspCustomerProfile/list?pageSize=-1&status=1'}),
  105. showField:"currency_dictText+name"
  106. },
  107. //colProps: {span: 6},
  108. },
  109. {
  110. label: '系统项目(project)',
  111. field: 'projectId',
  112. component: 'ApiSelect',
  113. labelWidth: 180,
  114. componentProps: {
  115. // mode: 'multiple',//multiple: 多选;不填写为单选
  116. //请求api,返回结果{ result: { records: [{'id':'1',name:'scott'},{'id':'2',name:'小张'}] }}
  117. api: () => defHttp.get({ url: 'baseCode/baseProjectArchive/list',params:{pageSize: -1,status:1}}),
  118. //数值转成String
  119. numberToString: false,
  120. //标题字段
  121. labelField: 'code',
  122. //值字段
  123. valueField: 'id',
  124. //返回结果字段
  125. resultField: 'records',
  126. filterOption: 'true',
  127. optionFilterProp: 'label',
  128. showSearch: 'true',
  129. },
  130. },
  131. {
  132. label: '招标项目号(tender code)',
  133. field: 'tenderCode',
  134. component: 'JInput',
  135. labelWidth: 200,
  136. componentProps: {
  137. AutoComplete: 'off',
  138. },
  139. //colProps: {span: 6},
  140. },
  141. {
  142. label: '投标结果(tender result)',
  143. field: 'tenderResult',
  144. component: 'JDictSelectTag',
  145. componentProps: {
  146. dictCode: 'tender_result',
  147. },
  148. labelWidth: 180,
  149. //colProps: {span: 6},
  150. },
  151. {
  152. label: '投标时间(bid Time)',
  153. field: 'bidTime',
  154. component: 'RangePicker',
  155. labelWidth: 150,
  156. componentProps: {
  157. valueType: 'Date',
  158. showTime: false,
  159. },
  160. //colProps: {span: 6},
  161. },
  162. {
  163. label: '开标时间(opening time)',
  164. field: 'openingTime',
  165. component: 'RangePicker',
  166. labelWidth: 180,
  167. componentProps: {
  168. valueType: 'Date',
  169. showTime: false,
  170. },
  171. //colProps: {span: 6},
  172. },
  173. {
  174. label: '招标项目名称(tender name)',
  175. field: 'tenderName',
  176. component: 'JInput',
  177. labelWidth: 200,
  178. componentProps: {
  179. AutoComplete: 'off',
  180. },
  181. //colProps: {span: 6},
  182. },
  183. {
  184. label: '备注(notes)',
  185. field: 'tenderCode',
  186. component: 'JInput',
  187. labelWidth: 180,
  188. componentProps: {
  189. AutoComplete: 'off',
  190. },
  191. //colProps: {span: 6},
  192. },
  193. {
  194. label: '提交(submit)',
  195. field: 'submit',
  196. component: 'JDictSelectTag',
  197. labelWidth: 150,
  198. componentProps: {
  199. dictCode: 'yes_or_no',
  200. },
  201. //colProps: {span: 6},
  202. },
  203. ];
  204. //表单数据
  205. export const formSchema: FormSchema[] = [
  206. {
  207. label: '单据编码(bill code)',
  208. field: 'billCode',
  209. component: 'Input',
  210. labelWidth: 150,
  211. dynamicDisabled: true,
  212. componentProps: {
  213. placeholder: '自动生成',
  214. },
  215. },
  216. {
  217. label: '单据日期(bill date)',
  218. field: 'billDate',
  219. component: 'DatePicker',
  220. componentProps: {
  221. valueFormat: 'YYYY-MM-DD',
  222. },
  223. labelWidth: 220,
  224. dynamicRules: ({ model, schema }) => {
  225. return [{ required: true, message: '请输入单据日期!' }];
  226. },
  227. },
  228. {
  229. label: '系统项目(project)',
  230. field: 'projectName',
  231. component: 'Select',
  232. slot: 'project',
  233. },
  234. {
  235. label: '采购方式(procurement method)',
  236. field: 'procurementMethod',
  237. component: 'JDictSelectTag',
  238. componentProps: {
  239. dictCode: 'procurement_method',
  240. },
  241. labelWidth: 220,
  242. dynamicRules: ({ model, schema }) => {
  243. return [{ required: true, message: '请输入采购方式!' }];
  244. },
  245. },
  246. {
  247. label: '客户(customer)',
  248. field: 'customerName',
  249. component: 'Input',
  250. labelWidth: 150,
  251. dynamicDisabled: true,
  252. dynamicRules: ({ model, schema }) => {
  253. return [{ required: true, message: '请输入客户!' }];
  254. },
  255. },
  256. {
  257. label: '招标项目号(tender code)',
  258. field: 'tenderCode',
  259. component: 'Input',
  260. labelWidth: 220,
  261. componentProps: {
  262. AutoComplete: 'off',
  263. },
  264. },
  265. {
  266. label: '包号(packet number)',
  267. field: 'packetNumber',
  268. labelWidth: 150,
  269. component: 'Input',
  270. componentProps: {
  271. AutoComplete: 'off',
  272. },
  273. },
  274. {
  275. label: '招标项目名称(tender name)',
  276. field: 'tenderName',
  277. component: 'Input',
  278. labelWidth: 220,
  279. componentProps: {
  280. AutoComplete: 'off',
  281. },
  282. },
  283. {
  284. label: '投标时间(bid Time)',
  285. field: 'bidTime',
  286. labelWidth: 150,
  287. component: 'DatePicker',
  288. componentProps: {
  289. showTime: false,
  290. valueFormat: 'YYYY-MM-DD',
  291. },
  292. },
  293. {
  294. label: '开标时间(opening time)',
  295. field: 'openingTime',
  296. labelWidth: 220,
  297. component: 'DatePicker',
  298. componentProps: {
  299. showTime: false,
  300. valueFormat: 'YYYY-MM-DD',
  301. },
  302. },
  303. {
  304. label: '项目总价(total money)',
  305. labelWidth: 150,
  306. field: 'totalMoney',
  307. component: 'InputNumber',
  308. componentProps: {
  309. AutoComplete: 'off',
  310. },
  311. },
  312. {
  313. label: '投标结果(tender result)',
  314. field: 'tenderResult',
  315. labelWidth: 220,
  316. component: 'JDictSelectTag',
  317. componentProps: {
  318. dictCode: 'tender_result',
  319. },
  320. },
  321. {
  322. label: '中标方(winning bidder)',
  323. field: 'winningBidder',
  324. labelWidth: 150,
  325. component: 'Input',
  326. componentProps: {
  327. AutoComplete: 'off',
  328. },
  329. },
  330. {
  331. label: '中标价(bid price)',
  332. field: 'bidPrice',
  333. labelWidth: 220,
  334. component: 'InputNumber',
  335. componentProps: {
  336. AutoComplete: 'off',
  337. },
  338. },
  339. {
  340. label: '备注(notes)',
  341. field: 'notes',
  342. labelWidth: 150,
  343. component: 'Input',
  344. componentProps: {
  345. AutoComplete: 'off',
  346. },
  347. },
  348. {
  349. label: '附件(attachs)',
  350. field: 'attachs',
  351. labelWidth: 220,
  352. component: 'JUpload',
  353. },
  354. // TODO 主键隐藏字段,目前写死为ID
  355. {
  356. label: '',
  357. field: 'id',
  358. component: 'Input',
  359. show: false,
  360. },
  361. {
  362. label: '',
  363. field: 'projectId',
  364. component: 'Input',
  365. show: false,
  366. },
  367. {
  368. label: '',
  369. field: 'customerId',
  370. component: 'Input',
  371. show: false,
  372. },
  373. ];
  374. /**
  375. * 流程表单调用这个方法获取formSchema
  376. * @param param
  377. */
  378. export function getBpmFormSchema(_formData): FormSchema[] {
  379. // 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
  380. return formSchema;
  381. }