retail_examine.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427
  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">订单信息 <span style="margin-left: 20px">经销商名称:{{detailData.customerName}}</span></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">
  16. <el-date-picker
  17. v-model="detailData.theTime"
  18. type="datetime"
  19. value-format="yyyy-MM-dd HH:mm:ss"
  20. style="width: 100%"
  21. placeholder="选择日期"
  22. >
  23. </el-date-picker>
  24. </div>
  25. </el-col>
  26. <el-col :span="8" class="item">
  27. <div class="label">单据状态</div>
  28. <div class="value">{{ detailData.examineStatus | statusFilter }}</div>
  29. </el-col>
  30. <el-col :span="16" class="item">
  31. <div class="label">备注</div>
  32. <div class="value">
  33. <template v-if="userName">
  34. <el-input v-model="detailData.remark" placeholder="填写备注" clearable></el-input>
  35. </template>
  36. <template v-else>
  37. {{ detailData.remark }}
  38. </template>
  39. </div>
  40. </el-col>
  41. <el-col :span="8" class="item">
  42. <div class="label">业务员</div>
  43. <div class="value">
  44. <el-select
  45. v-model="detailData.k3ServiceName"
  46. placeholder="选择业务员"
  47. style="width: 100%"
  48. @change="handleUser"
  49. >
  50. <el-option
  51. v-for="item in userList"
  52. :key="item.adminUserId"
  53. :label="item.nickName"
  54. :value="item.adminUserId"
  55. />
  56. </el-select>
  57. </div>
  58. </el-col>
  59. <el-col :span="8" class="item">
  60. <div class="label">制单人</div>
  61. <div class="value">{{ detailData.createName }}</div>
  62. </el-col>
  63. <el-col :span="8" class="item">
  64. <div class="label">审核人</div>
  65. <div class="value">{{ detailData.examineName }}</div>
  66. </el-col>
  67. <el-col :span="8" class="item">
  68. <div class="label">关闭人</div>
  69. <div class="value">{{ detailData.closeName }}</div>
  70. </el-col>
  71. <el-col :span="24" class="item" v-if="detailData.commercialType">
  72. <div class="label">计划单</div>
  73. <div class="value">
  74. <el-radio-group v-model="detailData.isPlanOrder" disabled>
  75. <el-radio :label="true">是</el-radio>
  76. <el-radio :label="false">否</el-radio>
  77. </el-radio-group>
  78. </div>
  79. </el-col>
  80. </el-row>
  81. </div>
  82. <div class="main-title">
  83. <div class="title">货品信息</div>
  84. </div>
  85. <div class="table" style="margin-top: 20px">
  86. <el-table
  87. :data="detailData.retailOrderItemList"
  88. element-loading-text="Loading"
  89. border
  90. fit
  91. highlight-current-row
  92. stripe
  93. max-height="400"
  94. show-summary
  95. :summary-method="$getSummaries"
  96. >
  97. <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
  98. <el-table-column
  99. align="center"
  100. label="销售类型"
  101. prop="saleTypeName"
  102. min-width="100"
  103. show-overflow-tooltip
  104. ></el-table-column>
  105. <el-table-column
  106. align="center"
  107. label="物料编码"
  108. prop="materialCode"
  109. min-width="160"
  110. show-overflow-tooltip
  111. ></el-table-column>
  112. <el-table-column
  113. align="center"
  114. label="产品名称"
  115. prop="materialName"
  116. min-width="160"
  117. show-overflow-tooltip
  118. ></el-table-column>
  119. <el-table-column
  120. align="center"
  121. label="规格型号"
  122. prop="specification"
  123. min-width="160"
  124. show-overflow-tooltip
  125. ></el-table-column>
  126. <el-table-column
  127. align="center"
  128. label="单位"
  129. prop="unit"
  130. min-width="100"
  131. show-overflow-tooltip
  132. ></el-table-column>
  133. <el-table-column
  134. align="center"
  135. label="单价"
  136. prop="price"
  137. min-width="100"
  138. show-overflow-tooltip
  139. ></el-table-column>
  140. <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
  141. <el-table-column
  142. align="center"
  143. label="订单金额"
  144. prop="totalAmount"
  145. min-width="100"
  146. show-overflow-tooltip
  147. ></el-table-column>
  148. <el-table-column
  149. align="center"
  150. label="返利类型"
  151. prop="customerWalletName2"
  152. min-width="100"
  153. show-overflow-tooltip
  154. >
  155. <template slot-scope="scope">
  156. <!-- v-for="item in scope.row.rebateWallets" -->
  157. <el-tag v-if="scope.row.customerWalletName2" type="success" size="small">
  158. {{ scope.row.customerWalletName2 }}
  159. </el-tag>
  160. </template>
  161. </el-table-column>
  162. <el-table-column align="center" label="返利金额" prop="payRebateAmount" min-width="100" show-overflow-tooltip>
  163. <template slot-scope="scope">
  164. {{ scope.row.payRebateAmount | numToFixed }}
  165. </template>
  166. </el-table-column>
  167. <el-table-column
  168. align="center"
  169. label="格力折扣"
  170. prop="discAmount"
  171. min-width="100"
  172. show-overflow-tooltip
  173. ></el-table-column>
  174. <el-table-column
  175. align="center"
  176. label="现金钱包"
  177. prop="customerWalletName"
  178. min-width="100"
  179. show-overflow-tooltip
  180. >
  181. <template slot-scope="scope">
  182. <!-- v-for="item in scope.row.rebateWallets" -->
  183. <el-tag type="success" size="small">
  184. {{ scope.row.customerWalletName }}
  185. </el-tag>
  186. </template>
  187. </el-table-column>
  188. <el-table-column
  189. align="center"
  190. label="实付金额"
  191. prop="payAmount"
  192. min-width="100"
  193. show-overflow-tooltip
  194. ></el-table-column>
  195. <!-- <el-table-column
  196. align="center"
  197. label="已退数量"
  198. prop="retiredQty"
  199. min-width="100"
  200. show-overflow-tooltip
  201. ></el-table-column> -->
  202. <el-table-column align="center" label="是否直调" prop="isDirectTransfer" min-width="100" show-overflow-tooltip>
  203. <template slot-scope="scope">
  204. {{ scope.row.isDirectTransfer ? '是' : '否' }}
  205. </template>
  206. </el-table-column>
  207. <el-table-column
  208. align="center"
  209. label="直调数量"
  210. prop="directTransferQty"
  211. min-width="100"
  212. show-overflow-tooltip
  213. ></el-table-column>
  214. <el-table-column
  215. align="center"
  216. label="原订单数量"
  217. prop="oldQty"
  218. min-width="100"
  219. show-overflow-tooltip
  220. ></el-table-column>
  221. <el-table-column align="left" label="表体业务员" prop="serviceName" min-width="100" show-overflow-tooltip />
  222. <el-table-column align="center" label="表体备注" prop="itemRemark" min-width="160" show-overflow-tooltip>
  223. <template slot-scope="scope">
  224. <!-- <div v-if="userName">
  225. <el-input v-model="scope.row.itemRemark" size="mini"></el-input>
  226. </div> -->
  227. <!-- <div v-else> -->
  228. {{ scope.row.itemRemark }}
  229. <!-- </div> -->
  230. </template>
  231. </el-table-column>
  232. <el-table-column align="center" label="税率" prop="tax" min-width="100" show-overflow-tooltip></el-table-column>
  233. </el-table>
  234. </div>
  235. <div class="main-title">
  236. <div class="title">审批信息</div>
  237. </div>
  238. <div class="diy-table-1">
  239. <el-row :gutter="0">
  240. <el-col :span="12" class="item">
  241. <div class="label">审批人</div>
  242. <div class="value">{{ userName }}</div>
  243. </el-col>
  244. <el-col :span="12" class="item">
  245. <div class="label">审批结果</div>
  246. <div class="value">
  247. <el-radio-group v-model="mainForm.status">
  248. <el-radio :label="true">通过</el-radio>
  249. <el-radio :label="false">驳回</el-radio>
  250. </el-radio-group>
  251. </div>
  252. </el-col>
  253. <el-col :span="24" class="item">
  254. <div class="label">审批说明</div>
  255. <div class="value">
  256. <el-input v-model="mainForm.remark" placeholder="请输入内容"></el-input>
  257. </div>
  258. </el-col>
  259. </el-row>
  260. </div>
  261. <div class="page-footer">
  262. <div class="footer" :class="classObj">
  263. <el-button type="primary" @click="clickSubmitForm" :loading="formLoading">{{
  264. formLoading ? '提交中 ...' : '提 交'
  265. }}</el-button>
  266. <el-button @click="goBack">返回列表</el-button>
  267. </div>
  268. </div>
  269. </div>
  270. </template>
  271. <script>
  272. import { examineData, getDetail, getUserList } from '@/api/supply/policy'
  273. export default {
  274. name: 'RetailExamine',
  275. componentName: 'RetailExamine',
  276. props: ['listItem'],
  277. filters: {
  278. statusFilter(val) {
  279. const statusList = [
  280. { label: '已保存', value: 'SAVE' },
  281. { label: '待审核', value: 'WAIT' },
  282. { label: '审核通过', value: 'OK' },
  283. { label: '审核驳回', value: 'FAIL' }
  284. ]
  285. let obj = statusList.find(o => o.value == val)
  286. return obj ? obj.label : ''
  287. }
  288. },
  289. data() {
  290. return {
  291. detailData: {},
  292. userName: JSON.parse(localStorage.getItem('supply_user')).nickName,
  293. userList: [],
  294. formLoading: false,
  295. mainForm: {
  296. status: true,
  297. remark: '',
  298. theTime: ''
  299. }
  300. }
  301. },
  302. computed: {
  303. sidebar() {
  304. return this.$store.state.app.sidebar
  305. },
  306. classObj() {
  307. return {
  308. hideSidebar: !this.sidebar.opened,
  309. openSidebar: this.sidebar.opened
  310. }
  311. }
  312. },
  313. created() {
  314. this.getDetail()
  315. },
  316. methods: {
  317. // 返回列表
  318. goBack() {
  319. this.$emit('backListFormDetail')
  320. },
  321. // 获取详情
  322. getDetail() {
  323. getDetail({ id: this.listItem.id }).then(res => {
  324. res.data.retailOrderItemList.forEach(item => {
  325. item.sums1 = ['directTransferQty', 'qty', 'refundableQty', 'oldQty', 'tdQty']
  326. item.sums2 = ['totalAmount', 'payAmount', 'price', 'discAmount', 'totalDiscAmount', 'rebateAmount']
  327. })
  328. this.detailData = res.data
  329. })
  330. getUserList({
  331. pageNum: 1,
  332. pageSize: -1,
  333. adminWebsitId: '',
  334. isCustomer: 0,
  335. roleId: '',
  336. status: true,
  337. userName: ''
  338. }).then(res => {
  339. this.userList = res.data.records
  340. })
  341. },
  342. handleUser(e) {
  343. const user = this.userList.filter(k => {
  344. return k.adminUserId === e
  345. })[0]
  346. this.detailData.k3ServiceId = user.adminUserId
  347. this.detailData.k3ServiceName = user.nickName
  348. },
  349. // 提交审批
  350. clickSubmitForm() {
  351. this.formLoading = true
  352. examineData({
  353. id: this.listItem.id,
  354. examineStatus: this.mainForm.status ? 'OK' : 'FAIL',
  355. examineRemark: this.mainForm.remark,
  356. remark: this.detailData.remark,
  357. theTime: this.detailData.theTime,
  358. serviceId: this.detailData.k3ServiceId
  359. })
  360. .then(res => {
  361. this.$successMsg('审批成功')
  362. this.goBack()
  363. this.$parent.getList()
  364. })
  365. .finally(res => {
  366. this.formLoading = false
  367. })
  368. }
  369. }
  370. }
  371. </script>
  372. <style scoped lang="scss">
  373. ::v-deep .el-input__prefix {
  374. display: none;
  375. left: 65px !important;
  376. -webkit-transition: all 0.3s;
  377. transition: all 0.3s;
  378. }
  379. ::v-deep .el-date-editor.el-input {
  380. width: 100%;
  381. box-sizing: border-box;
  382. padding-left: 10px;
  383. }
  384. .diy-table-1 {
  385. ::v-deep .el-form-item {
  386. margin: 0;
  387. }
  388. ::v-deep .el-input__suffix {
  389. right: -15px;
  390. -webkit-transition: all 0.3s;
  391. transition: all 0.3s;
  392. }
  393. }
  394. .detail-container {
  395. width: 100%;
  396. height: 100%;
  397. margin-bottom: 30px;
  398. }
  399. .main-title {
  400. display: flex;
  401. justify-content: space-between;
  402. align-items: center;
  403. margin-top: 20px;
  404. height: 60px;
  405. border-bottom: 1px solid #dcdfe6;
  406. margin-bottom: 20px;
  407. .title {
  408. font-size: 16px;
  409. font-weight: 600;
  410. padding-left: 10px;
  411. }
  412. }
  413. </style>