taskForm.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <template>
  2. <view class="container">
  3. <u-sticky offset-top="50">
  4. <u-subsection fontSize='25' mode='subsection' :list="list" :current="curNow" @change="sectionChange"
  5. activeColor='#157A2C'></u-subsection>
  6. </u-sticky>
  7. <!-- 收货确认单信息 -->
  8. <view v-show='curNow===0'>
  9. <view class="info-card">
  10. <view class="info-row">
  11. <text class="info-label">收货确认单编码</text>
  12. <text class="info-value">{{ form.receiveConfirmNo || '-' }}</text>
  13. </view>
  14. <view class="info-row">
  15. <text class="info-label">收货单</text>
  16. <text class="info-value">{{ form.receiveCode || '-' }}</text>
  17. </view>
  18. <view class="info-row">
  19. <text class="info-label">回执附件</text>
  20. <fileMain :value="replyFiles" type="view"></fileMain>
  21. </view>
  22. </view>
  23. </view>
  24. <!-- 收货信息 -->
  25. <view v-show='curNow===1'>
  26. <view class="info-card">
  27. <view class="info-row">
  28. <text class="info-label">收货单编码</text>
  29. <text class="info-value">{{ form.receiveCode || '-' }}</text>
  30. </view>
  31. <view class="info-row">
  32. <text class="info-label">订单编码</text>
  33. <text class="info-value">{{ form.orderNo || '-' }}</text>
  34. </view>
  35. <view class="info-row">
  36. <text class="info-label">供应商名称</text>
  37. <text class="info-value">{{ form.supplierName || '-' }}</text>
  38. </view>
  39. <view class="info-row">
  40. <text class="info-label">供应商联系人</text>
  41. <text class="info-value">{{ form.linkName || '-' }}</text>
  42. </view>
  43. <view class="info-row">
  44. <text class="info-label">供应商电话</text>
  45. <text class="info-value">{{ form.linkPhone || '-' }}</text>
  46. </view>
  47. <view class="info-row">
  48. <text class="info-label">车牌号</text>
  49. <text class="info-value">{{ form.carNo || '-' }}</text>
  50. </view>
  51. <view class="info-row">
  52. <text class="info-label">收货日期</text>
  53. <text class="info-value">{{ form.receiveDate || '-' }}</text>
  54. </view>
  55. <view class="info-row">
  56. <text class="info-label">附件</text>
  57. <fileMain :value="receiveFiles" type="view"></fileMain>
  58. </view>
  59. </view>
  60. </view>
  61. <!-- 物品清单 -->
  62. <view v-show='curNow===2'>
  63. <common-product-list :list="form.productList" :tableField="productField"></common-product-list>
  64. </view>
  65. </view>
  66. </template>
  67. <script>
  68. import fileMain from "@/pages/doc/index.vue"
  69. import commonProductList from "../common/commonProductList.vue"
  70. import { levelList, pricingWayList } from '@/enum/dict.js'
  71. import { getReceiveConfirmDetail } from '@/api/purchasingManage/index.js';
  72. import { mapGetters } from 'vuex'
  73. export default {
  74. components: {
  75. fileMain,
  76. commonProductList
  77. },
  78. props: {
  79. businessId: {
  80. default: ''
  81. }
  82. },
  83. computed: {
  84. ...mapGetters(['getDictValue']),
  85. levelList() {
  86. return levelList
  87. },
  88. pricingWayList() {
  89. return pricingWayList
  90. },
  91. // 处理附件字段,确保是数组类型
  92. replyFiles() {
  93. if (!this.form.repliedFiles) return [];
  94. if (Array.isArray(this.form.repliedFiles)) return this.form.repliedFiles;
  95. return [this.form.repliedFiles].filter(Boolean);
  96. },
  97. receiveFiles() {
  98. if (!this.form.receiveFiles) return [];
  99. if (Array.isArray(this.form.receiveFiles)) return this.form.receiveFiles;
  100. return [this.form.receiveFiles].filter(Boolean);
  101. }
  102. },
  103. data() {
  104. return {
  105. form: {
  106. receiveConfirmNo: '',
  107. receiveCode: '',
  108. repliedFiles: '',
  109. supplierName: '',
  110. linkName: '',
  111. linkPhone: '',
  112. carNo: '',
  113. receiveDate: '',
  114. receiveFiles: '',
  115. receiveNo: '',
  116. productList: []
  117. },
  118. list: ['收货确认单', '收货信息', '物品清单'],
  119. curNow: 0,
  120. productField: [
  121. { label: '名称', field: 'productName' },
  122. { label: '编码', field: 'productCode' },
  123. { label: '类型', field: 'productCategoryName' },
  124. { label: '工序', field: 'taskName' },
  125. { label: '批次号', field: 'batchNo' },
  126. { label: '牌号', field: 'productBrand' },
  127. { label: '型号', field: 'modelType' },
  128. { label: '供应商代号', field: 'supplierMark' },
  129. { label: '规格', field: 'specification' },
  130. { label: '仓库名称', field: 'warehouseName' },
  131. { label: '收货数量', field: 'totalCount', unitField: 'measuringUnit' },
  132. { label: '确认数量', field: 'confirmCount', unitField: 'measuringUnit' },
  133. { label: '计价方式', field: 'pricingWay', type: 'pricingWay' },
  134. { label: '包装规格', field: 'packingSpecification' },
  135. { label: '物品级别', field: 'goodsLevel', type: 'level' },
  136. { label: '单价', field: 'singlePrice' },
  137. { label: '不含税单价', field: 'notaxSinglePrice' },
  138. { label: '折后单价', field: 'discountSinglePrice' },
  139. { label: '合计', field: 'totalPrice' },
  140. { label: '折后合计', field: 'discountTotalPrice' },
  141. { label: '产地', field: 'provenance', type: 'dict', dictName: '产地' },
  142. { label: '机型', field: 'modelKey' },
  143. { label: '颜色', field: 'colorKey' },
  144. { label: '生产日期', field: 'productionDate' },
  145. { label: '交期截止日期', field: 'deliveryDeadline' },
  146. { label: '有效期', field: 'guaranteePeriod' },
  147. { label: '有效期截止日期', field: 'guaranteePeriodDeadline' },
  148. { label: '技术答疑人', field: 'technicalAnswerName' },
  149. { label: '技术参数', field: 'technicalParams' },
  150. { label: '备注', field: 'remark' },
  151. { label: '收货状态', field: 'isException', type: 'exception' },
  152. ],
  153. loading: false
  154. }
  155. },
  156. async mounted() {
  157. await this.getDetailData(this.businessId);
  158. },
  159. methods: {
  160. sectionChange(index) {
  161. this.curNow = index;
  162. },
  163. async getDetailData(id) {
  164. this.loading = true;
  165. const data = await getReceiveConfirmDetail(id);
  166. this.loading = false;
  167. if (data) {
  168. this.form = data;
  169. }
  170. }
  171. }
  172. }
  173. </script>
  174. <style scoped>
  175. .container {
  176. padding: 20rpx;
  177. }
  178. .section-title {
  179. font-size: 28rpx;
  180. font-weight: bold;
  181. color: #333;
  182. padding: 20rpx 0;
  183. border-bottom: 1rpx solid #eee;
  184. margin-bottom: 20rpx;
  185. }
  186. .info-card {
  187. background: #fff;
  188. border-radius: 12rpx;
  189. padding: 0 24rpx;
  190. margin-bottom: 20rpx;
  191. }
  192. .info-row {
  193. display: flex;
  194. justify-content: space-between;
  195. align-items: center;
  196. padding: 24rpx 0;
  197. border-bottom: 1rpx solid #f5f5f5;
  198. }
  199. .info-row:last-child {
  200. border-bottom: none;
  201. }
  202. .info-label {
  203. font-size: 26rpx;
  204. color: #666;
  205. flex-shrink: 0;
  206. }
  207. .info-value {
  208. font-size: 26rpx;
  209. color: #333;
  210. text-align: right;
  211. margin-left: 20rpx;
  212. word-break: break-all;
  213. }
  214. </style>