sales_examine.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  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 :gutter="0">
  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.orderTime}}</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.orderNo}}</div>
  24. </el-col>
  25. <el-col :span="16" class="item">
  26. <div class="label">经销商</div>
  27. <div class="value">{{detailData.customerName}}</div>
  28. </el-col>
  29. <el-col :span="8" class="item">
  30. <div class="label">仓库</div>
  31. <div class="value">{{detailData.correspondName}}</div>
  32. </el-col>
  33. <el-col :span="16" class="item">
  34. <div class="label">备注</div>
  35. <div class="value">{{detailData.remark}}</div>
  36. </el-col>
  37. </el-row>
  38. </div>
  39. <div class="main-title">
  40. <div class="title">货品信息</div>
  41. </div>
  42. <div class="table">
  43. <el-table
  44. :data="detailData.saleOrderData"
  45. element-loading-text="Loading"
  46. border
  47. fit
  48. highlight-current-row
  49. stripe
  50. max-height="400"
  51. show-summary
  52. :summary-method="$getSummaries">
  53. <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
  54. <el-table-column align="center" label="物料编码" prop="materialCode" min-width="120" show-overflow-tooltip></el-table-column>
  55. <el-table-column align="center" label="产品编码" prop="materialOldNumber" min-width="120" show-overflow-tooltip></el-table-column>
  56. <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
  57. <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
  58. <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  59. <el-table-column align="right" label="数量" prop="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
  60. <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip>
  61. <template slot-scope="scope">
  62. {{ scope.row.price | numToFixed }}
  63. </template>
  64. </el-table-column>
  65. <el-table-column align="right" label="订单金额" prop="payAmount" min-width="100" show-overflow-tooltip>
  66. <template slot-scope="scope">
  67. {{ scope.row.payAmount | numToFixed }}
  68. </template>
  69. </el-table-column>
  70. </el-table>
  71. </div>
  72. <div class="main-title">
  73. <div class="title">审批记录</div>
  74. </div>
  75. <div class="diy-table-1">
  76. <el-row :gutter="0">
  77. <el-col :span="12" class="item">
  78. <div class="label">审批人</div>
  79. <div class="value">{{userName}}</div>
  80. </el-col>
  81. <el-col :span="12" class="item">
  82. <div class="label">审批日期</div>
  83. <div class="value">{{getDate()}}</div>
  84. </el-col>
  85. <el-col :span="24" class="item">
  86. <div class="label">审批说明</div>
  87. <div class="value">
  88. <el-input v-model="examineForm.remark" placeholder="请输入内容"></el-input>
  89. </div>
  90. </el-col>
  91. </el-row>
  92. </div>
  93. <div class="page-footer">
  94. <div class="footer">
  95. <el-button type="primary" @click="clickSubmitForm('OK')">审批通过</el-button>
  96. <el-button type="warning" @click="clickSubmitForm('FAIL')">审批驳回</el-button>
  97. <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
  98. <el-button slot="reference">关 闭</el-button>
  99. </el-popconfirm>
  100. </div>
  101. </div>
  102. </div>
  103. </template>
  104. <script>
  105. import { getDetail, examineData } from "@/api/supply/sales";
  106. export default {
  107. name: 'SalesDetail',
  108. componentName: 'SalesDetail',
  109. props: ['listItem'],
  110. filters: {
  111. statusFilter(val) {
  112. const statusList = [
  113. { label: '已保存', value: 'SAVE' },
  114. { label: '待审核', value: 'WAIT' },
  115. { label: '审核通过', value: 'OK' },
  116. { label: '审核驳回', value: 'FAIL' },
  117. ];
  118. let obj = statusList.find(o => o.value == val);
  119. return obj ? obj.label : ''
  120. }
  121. },
  122. data() {
  123. return {
  124. userName: JSON.parse(localStorage.getItem("supply_user")).nickName,
  125. detailData: {},
  126. formLoading: false,
  127. examineForm: {
  128. remark: '',
  129. }
  130. }
  131. },
  132. created() {
  133. this.getDetail();
  134. },
  135. methods: {
  136. getDate() {
  137. var date = new Date();
  138. var seperator1 = "-";
  139. var year = date.getFullYear();
  140. var month = date.getMonth() + 1;
  141. var strDate = date.getDate();
  142. if (month >= 1 && month <= 9) {
  143. month = "0" + month;
  144. }
  145. if (strDate >= 0 && strDate <= 9) {
  146. strDate = "0" + strDate;
  147. }
  148. var currentdate = year + seperator1 + month + seperator1 + strDate;
  149. return currentdate;
  150. },
  151. // 返回列表
  152. goBack() {
  153. this.$emit('backListFormExamine');
  154. },
  155. // 获取详情
  156. getDetail() {
  157. getDetail({id: this.listItem.id}).then(res => {
  158. if(res.data.saleOrderData) {
  159. res.data.saleOrderData.forEach(item => {
  160. item.sums1 = ['refundableQty'];
  161. item.sums2 = ['payAmount', 'price'];
  162. })
  163. }
  164. this.detailData = res.data;
  165. })
  166. },
  167. // 提交审批
  168. clickSubmitForm(val) {
  169. this.$confirm('此操作将审批订单, 是否继续?', '提示', {
  170. confirmButtonText: '确定',
  171. cancelButtonText: '取消',
  172. type: 'warning'
  173. }).then(() => {
  174. let params = {
  175. id: this.listItem.id,
  176. approvalRemark: this.examineForm.remark,
  177. examineStatus: val,
  178. };
  179. this.formLoading = true;
  180. examineData(params).then(res => {
  181. this.$successMsg();
  182. this.goBack();
  183. this.$parent.getList();
  184. }).finally(res => {
  185. this.formLoading = false;
  186. })
  187. }).catch(() => {});
  188. },
  189. }
  190. }
  191. </script>
  192. <style scoped lang="scss">
  193. .detail-container {
  194. width: 100%;
  195. height: 100%;
  196. }
  197. .main-title {
  198. display: flex;
  199. justify-content: space-between;
  200. align-items: center;
  201. margin-top: 30px;
  202. height: 60px;
  203. border-bottom: 1px solid #DCDFE6;
  204. margin-bottom: 20px;
  205. .title {
  206. font-size: 16px;
  207. font-weight: 600;
  208. padding-left: 10px;
  209. }
  210. }
  211. </style>