useCusPrice.tsx 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. import { ref, reactive, computed, toRefs } from "vue";
  2. import { SaletaskMx } from "./interface";
  3. import { ColumnProps, SearchProps } from "@/components/LjVxeTable/interface";
  4. import type { u_cus_price } from "@/typings/business";
  5. /**
  6. * @description 表格多选数据操作
  7. * @param {String} rowKey 当表格可以多选时,所指定的 id
  8. * */
  9. export const useCusPrice = (t: any) => {
  10. const state = reactive<SaletaskMx.SaletaskMxStateProps>({
  11. vxeTableRef: null,
  12. requestData: [],
  13. selectList: [],
  14. currentRecord: null,
  15. reason: ""
  16. });
  17. // 表格配置项
  18. const columns: ColumnProps<u_cus_price>[] = [
  19. { type: "seq", title: "#", fixed: "left", width: 80 },
  20. {
  21. title: "有效",
  22. field: "ifcancel",
  23. table: "u_cus_price",
  24. render: scope => {
  25. let _data: any = scope.row ?? scope;
  26. if (!_data) return "";
  27. switch (_data.ifcancel) {
  28. case 1:
  29. return (
  30. <>
  31. <el-checkbox class={"el-checkbox__disabled-checked"} checked={true} disabled={true} />
  32. </>
  33. );
  34. default:
  35. return (
  36. <>
  37. <el-checkbox class={"el-checkbox__disabled-checked"} checked={false} disabled={true} />
  38. </>
  39. );
  40. }
  41. }
  42. },
  43. {
  44. title: "币种",
  45. field: "name",
  46. table: "cw_currency"
  47. },
  48. {
  49. title: "产品编码",
  50. field: "mtrlcode",
  51. table: "u_mtrldef"
  52. },
  53. {
  54. title: "产品名称",
  55. field: "mtrlname",
  56. table: "u_mtrldef"
  57. },
  58. {
  59. title: "规格",
  60. field: "mtrlmode",
  61. table: "u_mtrldef"
  62. },
  63. {
  64. title: "单位",
  65. field: "unit",
  66. table: "u_mtrldef"
  67. },
  68. {
  69. title: "销售单价",
  70. field: "fprice",
  71. table: "u_cus_price"
  72. },
  73. {
  74. title: "销售折扣",
  75. field: "zqrate",
  76. table: "u_cus_price"
  77. },
  78. {
  79. title: "销售实价",
  80. field: "price",
  81. table: "u_cus_price"
  82. },
  83. {
  84. title: "报价单价",
  85. field: "fprice_bj",
  86. table: "u_cus_price"
  87. },
  88. {
  89. title: "报价折扣",
  90. field: "zqrate_bj",
  91. table: "u_cus_price"
  92. },
  93. {
  94. title: "报价实价",
  95. field: "price_bj",
  96. table: "u_cus_price"
  97. },
  98. {
  99. title: "标准销售价",
  100. field: "stsaleprice",
  101. table: "u_cus_price"
  102. },
  103. {
  104. title: "数量下限",
  105. field: "qty",
  106. table: "u_cus_price"
  107. },
  108. {
  109. title: "数量上限",
  110. field: "qty1",
  111. table: "u_cus_price"
  112. },
  113. {
  114. title: "配置",
  115. field: "status",
  116. table: "u_cus_price"
  117. },
  118. {
  119. title: "配置1",
  120. field: "woodcode",
  121. table: "u_cus_price"
  122. },
  123. {
  124. title: "配置2",
  125. field: "pcode",
  126. table: "u_cus_price"
  127. },
  128. {
  129. title: "备注",
  130. field: "dscrp",
  131. table: "u_cus_price"
  132. },
  133. {
  134. title: "类别",
  135. field: "mtrltype",
  136. table: "u_cus_price"
  137. },
  138. {
  139. title: "标准面料",
  140. field: "mtrlsectype",
  141. table: "u_mtrldef"
  142. },
  143. {
  144. title: "自定义2",
  145. field: "zxmtrlmode",
  146. table: "u_mtrldef"
  147. },
  148. {
  149. title: "自定义3",
  150. field: "usermtrlmode",
  151. table: "u_mtrldef"
  152. },
  153. {
  154. title: "对应价格表",
  155. field: "pricelistid",
  156. table: "u_cus_price"
  157. },
  158. {
  159. title: "价格表中存在",
  160. field: "ifpricelist",
  161. table: "u_cus_price"
  162. },
  163. {
  164. title: "客户产品编码",
  165. field: "cusmtrlcode",
  166. table: "u_cusmtrlname"
  167. },
  168. {
  169. title: "客户产品名称",
  170. field: "cusmtrlname",
  171. table: "u_cusmtrlname"
  172. },
  173. {
  174. title: "客户产品规格",
  175. field: "cusmtrlmode",
  176. table: "u_cusmtrlname"
  177. },
  178. {
  179. title: "配置码",
  180. field: "configcode",
  181. table: "u_mtrldef"
  182. },
  183. {
  184. title: "配置说明",
  185. field: "configname",
  186. table: "u_mtrldef"
  187. },
  188. {
  189. title: "颜色",
  190. field: "mtrlcolor",
  191. table: "u_mtrldef"
  192. },
  193. {
  194. title: "客户简称",
  195. field: "simplename",
  196. table: "u_mtrldef"
  197. },
  198. {
  199. title: "产品状态",
  200. field: "isuse",
  201. table: "u_mtrldef"
  202. },
  203. {
  204. title: "云端同步时间",
  205. field: "fx_sync_time",
  206. table: "u_cus_price"
  207. },
  208. {
  209. title: "客户价格 更新时间",
  210. field: "sys_changetime",
  211. table: "u_cus_price"
  212. },
  213. {
  214. title: "已同步云端",
  215. field: "ifsync",
  216. table: "u_cus_price"
  217. },
  218. {
  219. title: "单位",
  220. field: "unit",
  221. table: "u_cus_price"
  222. }
  223. ];
  224. return {
  225. ...toRefs(state),
  226. columns
  227. };
  228. };