detail.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. // headData:描述区显示数据
  2. // title:主标题内容
  3. // tabs:tab数据页
  4. // ownertable:数据表名称
  5. // delParam:删除数据的请求参数
  6. // utils.isDisabled(数据状态,[与之匹配的数据],()=>{自定义方法,优先级高于前面的判断})
  7. <template>
  8. <div>
  9. <detail-template :headData="mainAreaData" :title="'订单号:' + orderData.sonum" :tabs="['订单明细']" ownertable="sa_order"
  10. :delParam="{id:'20221031141202',content:{userids:[router.currentRoute.value.query.id]}}" :disable="utils.isDisabled(userData.status,['ACTIVE'])">
  11. <template #operation>
  12. </template>
  13. <template #tab0>
  14. </template>
  15. </detail-template>
  16. </div>
  17. </template>
  18. <script setup>
  19. import Api from '@/api/api'
  20. import tool from '@/utils/utils'
  21. import detailTemplate from '@/components/detailTemplate/index.vue'
  22. import edit from './modules/edit.vue'
  23. import { useRouter } from "vue-router";
  24. import { onMounted,ref } from "vue";
  25. const router = useRouter()
  26. const mainAreaData = ref([])
  27. const param = ref({
  28. "id": 20221109093902,
  29. "content": {
  30. "sa_orderid": 0, //订单ID
  31. "pageNumber": 1,
  32. "pageSize": 20,
  33. "where": {
  34. "condition": ""
  35. }
  36. },
  37. })
  38. const orderData = ref({})
  39. const mianData = async ()=>{
  40. const res = await Api.requested({
  41. "id":'20221108151302',
  42. "content": {
  43. "nocache":true,
  44. "sa_orderid": router.currentRoute.value.query.id
  45. }
  46. })
  47. orderData.value = res.data
  48. changeDataStructure(res.data)
  49. }
  50. const changeDataStructure = (data) => {
  51. mainAreaData.value = [
  52. {
  53. label:'订单状态',
  54. value:data.status,
  55. style:function() {
  56. let style = {}
  57. switch (data.status) {
  58. case '新建':
  59. style = {color:"#000000"}
  60. break;
  61. case '提交':
  62. style = {color:"#d90a0a"}
  63. break;
  64. case '交期待确认':
  65. style = {color:"#e09a1a"}
  66. break;
  67. case '交期确认':
  68. style = {color:"#3874f6"}
  69. break;
  70. case '审核':
  71. style = {color:"#52C41A"}
  72. break;
  73. case '关闭':
  74. style = {color:"#b2c0ea"}
  75. break;
  76. default:
  77. break;
  78. }
  79. return style
  80. }
  81. },
  82. {
  83. label:'订单类型',
  84. value:data.type
  85. },
  86. {
  87. label:'明细分类',
  88. value:data.typemx
  89. },
  90. {
  91. label:'单据日期',
  92. value:data.billdate
  93. },
  94. {
  95. label:'企业名称',
  96. value:data.enterprisename
  97. },
  98. {
  99. label:'订单总金额',
  100. value:data.defaultamount,
  101. style:function () {
  102. let style = {color:"#ff0000"}
  103. return style
  104. }
  105. },
  106. {
  107. label:'合计数量',
  108. value:data.qty,
  109. style:function () {
  110. let style = {color:"#ff0000"}
  111. return style
  112. }
  113. },
  114. {
  115. label:'品牌',
  116. value:data.brandname
  117. },
  118. {
  119. label:'领域',
  120. value:data.tradefield
  121. },
  122. {
  123. label:'领域明细',
  124. value:data.tradefieldmx
  125. },
  126. {
  127. label:'业务员',
  128. value:data.saler_name
  129. },
  130. {
  131. label:'销售分类',
  132. value:`${data.saletype}`
  133. },
  134. {
  135. label:'退回原因',
  136. value:data.backreason
  137. },
  138. {
  139. label:'备注',
  140. value:data.remarks
  141. },
  142. ]
  143. }
  144. const onSelectChange = (val) =>{
  145. console.log(val,'orderManage')
  146. }
  147. const columns = [
  148. {
  149. title:'行号',
  150. dataIndex:'rowno',
  151. width:90,
  152. ellipsis:true,
  153. },
  154. {
  155. title:'产品名称',
  156. dataIndex:'itemname',
  157. width:180,
  158. ellipsis:true,
  159. },
  160. {
  161. title:'产品编号',
  162. dataIndex:'itemno',
  163. width:180,
  164. ellipsis:true,
  165. },
  166. {
  167. title:'erp编号',
  168. dataIndex:'erpitemno',
  169. width:180,
  170. ellipsis:true,
  171. },
  172. {
  173. title:'型号',
  174. dataIndex:'model',
  175. width:180,
  176. ellipsis:true,
  177. },
  178. {
  179. title:'规格',
  180. dataIndex:'spec',
  181. width:180,
  182. ellipsis:true,
  183. },
  184. {
  185. title:'数量',
  186. dataIndex:'qty',
  187. width:180,
  188. ellipsis:true,
  189. },
  190. {
  191. title:'标准价格',
  192. dataIndex:'marketprice',
  193. width:180,
  194. ellipsis:true,
  195. },
  196. {
  197. title:'单价',
  198. dataIndex:'price',
  199. width:180,
  200. ellipsis:true,
  201. },
  202. {
  203. title:'金额',
  204. dataIndex:'amount',
  205. width:180,
  206. ellipsis:true,
  207. },
  208. {
  209. title:'库存数量',
  210. dataIndex:'cansaleqty',
  211. width:180,
  212. ellipsis:true,
  213. },
  214. {
  215. title:'库存状态',
  216. dataIndex:'stockstatus',
  217. width:180,
  218. ellipsis:true,
  219. },
  220. {
  221. title:'包装数量',
  222. dataIndex:'packageqty',
  223. width:180,
  224. ellipsis:true,
  225. },
  226. {
  227. title:'未发货数量',
  228. dataIndex:'undeliqty',
  229. width:180,
  230. ellipsis:true,
  231. },
  232. {
  233. title:'备注',
  234. dataIndex:'remarks',
  235. width:360,
  236. ellipsis:true,
  237. }
  238. ]
  239. onMounted (()=>{
  240. mianData()
  241. })
  242. </script>
  243. <style>
  244. </style>