retail_examine.vue 12 KB

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