retail_examine.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. <template>
  2. <div class="detail-container">
  3. <el-page-header @back="goBack" content="审批"></el-page-header>
  4. <div class="main-title">
  5. <div class="title">订单信息</div>
  6. </div>
  7. <div class="diy-table-1">
  8. <el-row>
  9. <el-col :span="8" class="item">
  10. <div class="label">订单号</div>
  11. <div class="value">{{ detailData.id }}</div>
  12. </el-col>
  13. <el-col :span="8" class="item">
  14. <div class="label">订单日期</div>
  15. <div class="value">{{ detailData.theTime }}</div>
  16. </el-col>
  17. <el-col :span="8" class="item">
  18. <div class="label">单据状态</div>
  19. <div class="value">{{ detailData.examineStatus | statusFilter }}</div>
  20. </el-col>
  21. <el-col :span="8" class="item">
  22. <div class="label">业务员</div>
  23. <div class="value">{{ detailData.k3ServiceName }}</div>
  24. </el-col>
  25. <el-col :span="16" class="item">
  26. <div class="label">文件编号</div>
  27. <div class="value">{{ detailData.fileNo }}</div>
  28. </el-col>
  29. <el-col :span="24" class="item">
  30. <div class="label">备注</div>
  31. <div class="value">
  32. <template v-if="userName">
  33. <el-input v-model="detailData.remark" placeholder="填写备注" clearable></el-input>
  34. </template>
  35. <template v-else>
  36. {{ detailData.remark }}
  37. </template>
  38. </div>
  39. </el-col>
  40. <el-col :span="8" class="item">
  41. <div class="label">制单人</div>
  42. <div class="value">{{ detailData.createName }}</div>
  43. </el-col>
  44. <el-col :span="8" class="item">
  45. <div class="label">审核人</div>
  46. <div class="value">{{ detailData.examineName }}</div>
  47. </el-col>
  48. <el-col :span="8" class="item">
  49. <div class="label">关闭人</div>
  50. <div class="value">{{ detailData.closeName }}</div>
  51. </el-col>
  52. </el-row>
  53. </div>
  54. <div class="main-title">
  55. <div class="title">货品信息</div>
  56. </div>
  57. <div class="table" style="margin-top: 20px">
  58. <el-table
  59. :data="detailData.retailOrderItemList"
  60. element-loading-text="Loading"
  61. border
  62. fit
  63. highlight-current-row
  64. stripe
  65. max-height="400"
  66. show-summary
  67. :summary-method="$getSummaries"
  68. >
  69. <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
  70. <el-table-column align="left" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
  71. <el-table-column align="left" label="物料编码" prop="materialCode" min-width="120" show-overflow-tooltip></el-table-column>
  72. <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="120" show-overflow-tooltip></el-table-column>
  73. <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
  74. <el-table-column align="left" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
  75. <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  76. <el-table-column align="left" label="文件编号" prop="fileNo" min-width="100" show-overflow-tooltip></el-table-column>
  77. <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip>
  78. <template slot-scope="scope">
  79. {{ scope.row.price | numToFixed }}
  80. </template>
  81. </el-table-column>
  82. <el-table-column align="right" label="数量" prop="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
  83. <el-table-column align="right" label="订单金额" prop="totalAmount" min-width="100" show-overflow-tooltip>
  84. <template slot-scope="scope">
  85. {{ scope.row.totalAmount | numToFixed }}
  86. </template>
  87. </el-table-column>
  88. <el-table-column align="left" label="返利类型" prop="customerWalletName2" min-width="100" show-overflow-tooltip></el-table-column>
  89. <el-table-column align="right" label="返利金额" prop="payRebateAmount" min-width="100" show-overflow-tooltip>
  90. <template slot-scope="scope">
  91. {{ scope.row.payRebateAmount | numToFixed }}
  92. </template>
  93. </el-table-column>
  94. <el-table-column align="right" label="格力折扣" prop="totalDiscAmount" min-width="100" show-overflow-tooltip>
  95. <template slot-scope="scope">
  96. {{ scope.row.totalDiscAmount | numToFixed }}
  97. </template>
  98. </el-table-column>
  99. <el-table-column align="left" label="现金钱包" prop="customerWalletName" min-width="100" show-overflow-tooltip></el-table-column>
  100. <el-table-column align="right" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip>
  101. <template slot-scope="scope">
  102. {{ scope.row.payAmount | numToFixed }}
  103. </template>
  104. </el-table-column>
  105. <el-table-column align="left" label="是否直调" prop="isDirectTransfer" min-width="100" show-overflow-tooltip>
  106. <template slot-scope="scope">
  107. {{ scope.row.isDirectTransfer ? "是" : "否" }}
  108. </template>
  109. </el-table-column>
  110. <el-table-column align="right" label="直调数量" prop="directTransferQty" min-width="100" show-overflow-tooltip></el-table-column>
  111. <el-table-column align="right" label="原订单数量" prop="oldQty" min-width="100" show-overflow-tooltip></el-table-column>
  112. <el-table-column align="left" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
  113. <el-table-column align="right" label="税率" prop="tax" min-width="100" show-overflow-tooltip></el-table-column>
  114. </el-table>
  115. </div>
  116. <div class="main-title">
  117. <div class="title">审批信息</div>
  118. </div>
  119. <div class="diy-table-1">
  120. <el-row :gutter="0">
  121. <el-col :span="12" class="item">
  122. <div class="label">审批人</div>
  123. <div class="value">{{ userName }}</div>
  124. </el-col>
  125. <el-col :span="12" class="item">
  126. <div class="label">审批结果</div>
  127. <div class="value">
  128. <el-radio-group v-model="mainForm.status">
  129. <el-radio :label="true">通过</el-radio>
  130. <el-radio :label="false">驳回</el-radio>
  131. </el-radio-group>
  132. </div>
  133. </el-col>
  134. <el-col :span="24" class="item">
  135. <div class="label">审批说明</div>
  136. <div class="value">
  137. <el-input
  138. v-model="mainForm.remark"
  139. placeholder="请输入内容"
  140. ></el-input>
  141. </div>
  142. </el-col>
  143. </el-row>
  144. </div>
  145. <div class="page-footer">
  146. <div class="footer">
  147. <el-button
  148. type="primary"
  149. @click="clickSubmitForm"
  150. :loading="formLoading"
  151. >{{ formLoading ? "提交中 ..." : "提 交" }}</el-button
  152. >
  153. <el-button @click="goBack">关 闭</el-button>
  154. </div>
  155. </div>
  156. </div>
  157. </template>
  158. <script>
  159. import { getDetail, examineData } from "@/api/supply/retail";
  160. export default {
  161. name: "RetailExamine",
  162. componentName: "RetailExamine",
  163. props: ["listItem"],
  164. filters: {
  165. statusFilter(val) {
  166. const statusList = [
  167. { label: "已保存", value: "SAVE" },
  168. { label: "待审核", value: "WAIT" },
  169. { label: "审核通过", value: "OK" },
  170. // { label: '审核驳回', value: 'FAIL' },,
  171. ];
  172. let obj = statusList.find((o) => o.value == val);
  173. return obj ? obj.label : "";
  174. },
  175. },
  176. data() {
  177. return {
  178. detailData: {},
  179. userName: JSON.parse(localStorage.getItem("supply_user")).nickName,
  180. formLoading: false,
  181. mainForm: {
  182. status: true,
  183. remark: "",
  184. },
  185. };
  186. },
  187. created() {
  188. this.getDetail();
  189. },
  190. methods: {
  191. // 返回列表
  192. goBack() {
  193. this.$emit("backListFormDetail");
  194. },
  195. // 获取详情
  196. getDetail() {
  197. getDetail({ id: this.listItem.id }).then((res) => {
  198. if (res.data.retailOrderItemList) {
  199. res.data.retailOrderItemList.forEach((item) => {
  200. item.sums1 = ['directTransferQty', 'qty', 'refundableQty', 'oldQty'];
  201. item.sums2 = ['totalAmount', 'payAmount', 'price', 'payRebateAmount', 'discAmount', 'totalDiscAmount'];
  202. });
  203. }
  204. this.detailData = res.data;
  205. });
  206. },
  207. // 提交审批
  208. clickSubmitForm() {
  209. this.formLoading = true;
  210. examineData({
  211. id: this.listItem.id,
  212. examineStatus: this.mainForm.status ? "OK" : "FAIL",
  213. examineRemark: this.mainForm.remark,
  214. remark: this.detailData.remark,
  215. })
  216. .then((res) => {
  217. this.$successMsg("审批成功");
  218. this.goBack();
  219. this.$parent.getList();
  220. })
  221. .finally((res) => {
  222. this.formLoading = false;
  223. });
  224. },
  225. },
  226. };
  227. </script>
  228. <style scoped lang="scss">
  229. .detail-container {
  230. width: 100%;
  231. height: 100%;
  232. }
  233. .main-title {
  234. display: flex;
  235. justify-content: space-between;
  236. align-items: center;
  237. margin-top: 20px;
  238. height: 60px;
  239. border-bottom: 1px solid #dcdfe6;
  240. margin-bottom: 20px;
  241. .title {
  242. font-size: 16px;
  243. font-weight: 600;
  244. padding-left: 10px;
  245. }
  246. }
  247. </style>