displace_examine.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480
  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.displaceOrderId }}</div>
  12. </el-col>
  13. <el-col :span="8" class="item">
  14. <div class="label">订单日期</div>
  15. <div class="value">{{ detailData.orderDate ? detailData.orderDate.split(' ')[0] : '' }}</div>
  16. </el-col>
  17. <el-col :span="8" class="item">
  18. <div class="label">单据状态</div>
  19. <div class="value">{{ findExamineStatus(detailData.examineStatus) }}</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="8" class="item">
  26. <div class="label">订单类型</div>
  27. <div class="value">{{ findOrderType(detailData.orderType) }}</div>
  28. </el-col>
  29. <el-col :span="8" class="item">
  30. <div class="label">销售政策编号</div>
  31. <div class="value">{{ detailData.policyCode }}</div>
  32. </el-col>
  33. <el-col :span="8" class="item">
  34. <div class="label">销售政策</div>
  35. <div class="value">{{ detailData.policyTitle }}</div>
  36. </el-col>
  37. <el-col :span="8" class="item">
  38. <div class="label">销售政策说明</div>
  39. <div class="value">{{ detailData.policyRemark }}</div>
  40. </el-col>
  41. <el-col :span="8" class="item">
  42. <div class="label">工程登录编号</div>
  43. <div class="value">{{ detailData.enginRecordNo }}</div>
  44. </el-col>
  45. <el-col :span="8" class="item">
  46. <div class="label">业务员</div>
  47. <div class="value">{{ detailData.serviceName }}</div>
  48. </el-col>
  49. <el-col :span="8" class="item">
  50. <div class="label">经销商编号</div>
  51. <div class="value">{{ detailData.customerNumber }}</div>
  52. </el-col>
  53. <el-col :span="8" class="item">
  54. <div class="label">经销商名称</div>
  55. <div class="value">{{ detailData.customerName }}</div>
  56. </el-col>
  57. <el-col :xs="24" :sm="24" :lg="24" class="item">
  58. <div class="label">备注</div>
  59. <div class="value">{{ detailData.remark }}</div>
  60. </el-col>
  61. <el-col :span="8" class="item">
  62. <div class="label">申请人</div>
  63. <div class="value">{{ detailData.createName }}</div>
  64. </el-col>
  65. </el-row>
  66. </div>
  67. <div class="main-title">
  68. <div class="title">原订单货品信息</div>
  69. </div>
  70. <div class="table">
  71. <el-table :data="originGoodsList" element-loading-text="Loading" border fit highlight-current-row stripe>
  72. <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
  73. <el-table-column
  74. align="center"
  75. label="销售类型"
  76. prop="saleTypeName"
  77. min-width="160"
  78. show-overflow-tooltip
  79. ></el-table-column>
  80. <el-table-column
  81. align="center"
  82. label="产品编码"
  83. prop="materialNumber"
  84. min-width="160"
  85. show-overflow-tooltip
  86. ></el-table-column>
  87. <el-table-column
  88. align="center"
  89. label="产品旧编码"
  90. prop="materialOldNumber"
  91. min-width="160"
  92. show-overflow-tooltip
  93. ></el-table-column>
  94. <el-table-column
  95. align="center"
  96. label="产品名称"
  97. prop="materialName"
  98. min-width="160"
  99. show-overflow-tooltip
  100. ></el-table-column>
  101. <el-table-column
  102. align="center"
  103. label="规格型号"
  104. prop="specification"
  105. min-width="160"
  106. show-overflow-tooltip
  107. ></el-table-column>
  108. <el-table-column
  109. align="center"
  110. label="单位"
  111. prop="unit"
  112. min-width="160"
  113. show-overflow-tooltip
  114. ></el-table-column>
  115. <el-table-column
  116. align="center"
  117. label="单价"
  118. prop="price"
  119. min-width="160"
  120. show-overflow-tooltip
  121. ></el-table-column>
  122. <el-table-column align="center" label="数量" prop="qty" min-width="160" show-overflow-tooltip></el-table-column>
  123. <el-table-column
  124. align="center"
  125. label="订单金额"
  126. prop="totalAmount"
  127. min-width="100"
  128. show-overflow-tooltip
  129. ></el-table-column>
  130. <el-table-column
  131. align="center"
  132. label="返利类型"
  133. prop="customerWalletName2"
  134. min-width="100"
  135. show-overflow-tooltip
  136. ></el-table-column>
  137. <el-table-column
  138. align="center"
  139. label="返利金额"
  140. prop="rebateAmount"
  141. min-width="100"
  142. show-overflow-tooltip
  143. ></el-table-column>
  144. <el-table-column
  145. align="center"
  146. label="格力折扣"
  147. prop="discAmount"
  148. min-width="100"
  149. show-overflow-tooltip
  150. ></el-table-column>
  151. <el-table-column
  152. align="center"
  153. label="现金钱包"
  154. prop="customerWalletName"
  155. min-width="100"
  156. show-overflow-tooltip
  157. ></el-table-column>
  158. <el-table-column
  159. align="center"
  160. label="实付金额"
  161. prop="payAmount"
  162. min-width="100"
  163. show-overflow-tooltip
  164. ></el-table-column>
  165. <el-table-column
  166. align="center"
  167. label="置换数量"
  168. prop="displaceQty"
  169. min-width="100"
  170. show-overflow-tooltip
  171. ></el-table-column>
  172. <el-table-column
  173. align="center"
  174. label="备注"
  175. prop="remark"
  176. min-width="100"
  177. show-overflow-tooltip
  178. ></el-table-column>
  179. <el-table-column align="center" label="税率" prop="tax" min-width="100" show-overflow-tooltip></el-table-column>
  180. </el-table>
  181. </div>
  182. <div class="main-title">
  183. <div class="title">置换货品信息</div>
  184. </div>
  185. <div class="table" style="margin-top: 20px">
  186. <el-table
  187. :data="goodsList"
  188. element-loading-text="Loading"
  189. border
  190. fit
  191. highlight-current-row
  192. stripe
  193. max-height="400"
  194. >
  195. <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
  196. <el-table-column
  197. align="center"
  198. label="销售类型"
  199. prop="saleTypeName"
  200. min-width="160"
  201. show-overflow-tooltip
  202. ></el-table-column>
  203. <el-table-column
  204. align="center"
  205. label="产品名称"
  206. prop="materialName"
  207. min-width="160"
  208. show-overflow-tooltip
  209. ></el-table-column>
  210. <el-table-column
  211. align="center"
  212. label="产品编码"
  213. prop="materialNumber"
  214. min-width="120"
  215. show-overflow-tooltip
  216. ></el-table-column>
  217. <el-table-column
  218. align="center"
  219. label="产品旧编码"
  220. prop="materialOldNumber"
  221. min-width="120"
  222. show-overflow-tooltip
  223. ></el-table-column>
  224. <el-table-column
  225. align="center"
  226. label="规格型号"
  227. prop="specification"
  228. min-width="200"
  229. show-overflow-tooltip
  230. ></el-table-column>
  231. <el-table-column
  232. align="center"
  233. label="单位"
  234. prop="unit"
  235. min-width="100"
  236. show-overflow-tooltip
  237. ></el-table-column>
  238. <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip>
  239. <template slot-scope="scope">
  240. <el-input v-model="scope.row.price" size="small" type="number" @mousewheel.native.prevent></el-input>
  241. </template>
  242. </el-table-column>
  243. <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip>
  244. <template slot-scope="scope">
  245. <el-input v-model="scope.row.qty" size="small" type="number" @mousewheel.native.prevent></el-input>
  246. </template>
  247. </el-table-column>
  248. <el-table-column align="center" label="订单金额" min-width="100" show-overflow-tooltip>
  249. <template slot-scope="scope">
  250. {{ (scope.row.price || 0) * (scope.row.qty || 0) }}
  251. </template>
  252. </el-table-column>
  253. <el-table-column
  254. align="center"
  255. label="返利类型"
  256. prop="customerWalletName2"
  257. min-width="100"
  258. show-overflow-tooltip
  259. ></el-table-column>
  260. <el-table-column
  261. align="center"
  262. label="返利金额"
  263. prop="rebateAmount"
  264. min-width="100"
  265. show-overflow-tooltip
  266. ></el-table-column>
  267. <el-table-column align="center" label="格力折扣" prop="discAmount" min-width="100" show-overflow-tooltip>
  268. <template slot-scope="scope">
  269. <el-input v-model="scope.row.discAmount" size="small" type="number" @mousewheel.native.prevent></el-input>
  270. </template>
  271. </el-table-column>
  272. <el-table-column
  273. align="center"
  274. label="现金钱包"
  275. prop="customerWalletName"
  276. min-width="100"
  277. show-overflow-tooltip
  278. ></el-table-column>
  279. <el-table-column align="center" label="备注" prop="remark" min-width="200" show-overflow-tooltip>
  280. <template slot-scope="scope">
  281. <el-input v-model="scope.row.remark" size="small"></el-input>
  282. </template>
  283. </el-table-column>
  284. <el-table-column
  285. align="center"
  286. label="税率"
  287. prop="taxRate"
  288. min-width="100"
  289. show-overflow-tooltip
  290. ></el-table-column>
  291. </el-table>
  292. </div>
  293. <div class="main-title">
  294. <div class="title">审批信息</div>
  295. </div>
  296. <div class="diy-table-1">
  297. <el-row :gutter="0">
  298. <el-col :span="12" class="item">
  299. <div class="label">审批人</div>
  300. <div class="value">{{ userName }}</div>
  301. </el-col>
  302. <el-col :span="12" class="item">
  303. <div class="label">审批结果</div>
  304. <div class="value">
  305. <el-radio-group v-model="examineForm.examineResult">
  306. <el-radio :label="true">通过</el-radio>
  307. <el-radio :label="false">驳回</el-radio>
  308. </el-radio-group>
  309. </div>
  310. </el-col>
  311. <el-col :span="24" class="item">
  312. <div class="label">审批说明</div>
  313. <div class="value"><el-input v-model="examineForm.examineNote" placeholder="请输入内容"></el-input></div>
  314. </el-col>
  315. </el-row>
  316. </div>
  317. <div class="page-footer">
  318. <div class="footer" :class="classObj">
  319. <el-button type="primary" @click="clickSubmitForm" :loading="formLoading">{{
  320. formLoading ? '提交中 ...' : '提 交'
  321. }}</el-button>
  322. <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px">
  323. <el-button slot="reference">关 闭</el-button>
  324. </el-popconfirm>
  325. </div>
  326. </div>
  327. </div>
  328. </template>
  329. <script>
  330. import { examineOrder, getDetail } from '@/api/supply/displace'
  331. export default {
  332. name: 'DisplaceExamine',
  333. componentName: 'DisplaceExamine',
  334. props: ['listItem'],
  335. data() {
  336. return {
  337. detailData: {},
  338. goodsList: [],
  339. originGoodsList: [],
  340. userName: JSON.parse(localStorage.getItem('supply_user')).nickName,
  341. formLoading: false,
  342. examineForm: {
  343. displaceOrderId: '',
  344. orderType: '',
  345. orderNo: '',
  346. orderDate: '',
  347. mainId: '',
  348. mainName: '',
  349. enginRecordNo: '',
  350. projectNo: '',
  351. projectName: '',
  352. useUnit: '',
  353. installAddress: '',
  354. policyId: '',
  355. policyCode: '',
  356. policyTitle: '',
  357. policyRemark: '',
  358. serviceId: '',
  359. serviceName: '',
  360. takeDeposit: '',
  361. remark: '',
  362. examineStatus: '',
  363. examineResult: true,
  364. examineNote: ''
  365. }
  366. }
  367. },
  368. computed: {
  369. sidebar() {
  370. return this.$store.state.app.sidebar
  371. },
  372. classObj() {
  373. return {
  374. hideSidebar: !this.sidebar.opened,
  375. openSidebar: this.sidebar.opened
  376. }
  377. }
  378. },
  379. created() {
  380. this.getDetail()
  381. },
  382. methods: {
  383. // 返回列表
  384. goBack() {
  385. this.$emit('backListFormDetail')
  386. },
  387. // 获取详情
  388. getDetail() {
  389. getDetail({ id: this.listItem.displaceOrderId }).then(res => {
  390. this.detailData = res.data
  391. this.goodsList = res.data.items
  392. this.originGoodsList = res.data.originItems
  393. })
  394. },
  395. findOrderType(val) {
  396. const obj = this.orderType.find(value => value.val === val)
  397. return obj ? obj.label : ''
  398. },
  399. findExamineStatus(val) {
  400. const obj = this.examineStatus.find(value => value.val === val)
  401. return obj ? obj.label : ''
  402. },
  403. clickSubmitForm() {
  404. if (this.formLoading) {
  405. return
  406. }
  407. this.formLoading = true
  408. examineOrder({
  409. displaceOrderId: this.listItem.displaceOrderId,
  410. examineResult: this.examineForm.examineResult,
  411. examineNote: this.examineForm.examineNote,
  412. originItems: this.originGoodsList,
  413. items: this.goodsList
  414. })
  415. .then(res => {
  416. this.$successMsg('审批成功')
  417. this.$nextTick(() => {
  418. this.goBack()
  419. })
  420. })
  421. .finally(res => {
  422. this.formLoading = false
  423. })
  424. }
  425. }
  426. }
  427. </script>
  428. <style scoped lang="scss">
  429. .detail-container {
  430. width: 100%;
  431. height: 100%;
  432. }
  433. .main-title {
  434. display: flex;
  435. justify-content: space-between;
  436. align-items: center;
  437. margin-top: 20px;
  438. height: 60px;
  439. border-bottom: 1px solid #dcdfe6;
  440. margin-bottom: 20px;
  441. .title {
  442. font-size: 16px;
  443. font-weight: 600;
  444. padding-left: 10px;
  445. }
  446. }
  447. .add {
  448. display: flex;
  449. align-items: center;
  450. justify-content: center;
  451. border: 1px solid #ebeef5;
  452. border-top: none;
  453. height: 50px;
  454. }
  455. ::v-deep input::-webkit-outer-spin-button,
  456. ::v-deep input::-webkit-inner-spin-button {
  457. -webkit-appearance: none;
  458. }
  459. ::v-deep input[type='number'] {
  460. -moz-appearance: textfield;
  461. }
  462. </style>