index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  1. <template>
  2. <template-page ref="pageRef" :get-list="getList" :exportList="exportList" :table-attributes="tableAttributes"
  3. :table-events="tableEvents" :moreParameters="moreParameters" :column-parsing="columnParsing" :operation="operation"
  4. :operationColumnWidth="200" :replaceOrNotMap="false" :optionsEvensGroup="optionsEvensGroup">
  5. <div class="cartographer">
  6. <el-dialog :title="formTypeName[formType]" width="100%" :modal="false" :visible.sync="formDialog"
  7. :before-close="formCancel">
  8. <zj-form-container v-if="formDialog" ref="formRef" :form-data="formData" :styleSwitch="false">
  9. <zj-form-module title="基础信息" label-width="120px" :showPackUp="false" :form-data="formData"
  10. :form-items="formItems">
  11. </zj-form-module>
  12. <zj-form-module title="订单信息" label-width="120px" :showPackUp="false" :form-data="formData"
  13. :form-items="formItemsList">
  14. </zj-form-module>
  15. <zj-form-module title="附件图片" label-width="120px" :showPackUp="false" :form-data="formData"
  16. :form-items="formItemsImgs">
  17. </zj-form-module>
  18. </zj-form-container>
  19. <div slot="footer" v-if="formType" class="dialog-footer">
  20. <el-button size="mini" @click="formCancel">取 消</el-button>
  21. <el-button size="mini" @click="formConfirm" type="primary">确定</el-button>
  22. </div>
  23. </el-dialog>
  24. </div>
  25. </template-page>
  26. </template>
  27. <script>
  28. import TemplatePage from '@/components/template/template-page-1.vue'
  29. import import_mixin from '@/components/template/import_mixin.js'
  30. import { increOrderSettleList, increOrderSettleListExport, increOrderSettleDetail, increOrderSettleConfirm, increOrderSettleRefund } from "@/api/orderSettleManag.js"
  31. import ImageUpload from '@/components/file-upload'
  32. export default {
  33. props: {
  34. storageType: {
  35. type: String,
  36. default: ""
  37. }
  38. },
  39. components: { TemplatePage, ImageUpload },
  40. mixins: [import_mixin],
  41. data() {
  42. return {
  43. // 事件组合
  44. optionsEvensGroup: [[
  45. [
  46. {
  47. name: '批量结算',
  48. click: () => {
  49. if (this.recordSelected.length === 0) {
  50. this.$message.warning('请勾选订单')
  51. return
  52. }
  53. increOrderSettleConfirm(this.recordSelected.map(item => item.id)).then(res => {
  54. this.$message({ type: 'success', message: `成功!` })
  55. this.$refs.pageRef.refreshList()
  56. })
  57. }
  58. },
  59. ]
  60. ]],
  61. // 表格属性
  62. tableAttributes: {
  63. // 启用勾选列
  64. selectColumn: true
  65. },
  66. // 表格事件
  67. tableEvents: {
  68. 'selection-change': this.selectionChange
  69. },
  70. // 勾选选中数据
  71. recordSelected: [],
  72. formTypeName: ["查看", "结算"],
  73. formType: -1,
  74. formData: {
  75. pgIncreItems: []
  76. },
  77. formDialog: false,
  78. }
  79. },
  80. computed: {
  81. // 更多参数
  82. moreParameters() {
  83. return []
  84. },
  85. formItems() {
  86. return [{
  87. md: 24,
  88. isShow: true,
  89. name: 'slot-component',
  90. formItemAttributes: {
  91. label: '',
  92. prop: '',
  93. 'label-width': '0px'
  94. },
  95. render: (h, { props, onInput }) => {
  96. var { value } = props
  97. return (
  98. <div>
  99. <el-descriptions border title="" column={2} colon={false} labelStyle={{ width: '10%' }} contentStyle={{ width: '40%' }}>
  100. <el-descriptions-item label="所属商户">
  101. {this.formData.companyWechatName}
  102. </el-descriptions-item>
  103. <el-descriptions-item label="销售网点">
  104. {this.formData.websitName}
  105. </el-descriptions-item>
  106. <el-descriptions-item label="订单单号" >
  107. {this.formData.id}
  108. </el-descriptions-item>
  109. <el-descriptions-item label="师傅姓名" >
  110. {this.formData.workerName}
  111. </el-descriptions-item>
  112. <el-descriptions-item label="师傅联系电话">
  113. {this.formData.workerMobile}
  114. </el-descriptions-item>
  115. <el-descriptions-item label="师傅身份证号">
  116. {this.formData.workerIdcard}
  117. </el-descriptions-item>
  118. <el-descriptions-item label="客户姓名" >
  119. {this.formData.userName}
  120. </el-descriptions-item>
  121. <el-descriptions-item label="客户电话" >
  122. {this.formData.userMobile}
  123. </el-descriptions-item>
  124. <el-descriptions-item label="详细地址">
  125. {this.formData.userAddress}
  126. </el-descriptions-item>
  127. <el-descriptions-item label="内机条码">
  128. {this.formData.insideCode}
  129. </el-descriptions-item>
  130. <el-descriptions-item label="服务单号" >
  131. {this.formData.serviceNo}
  132. </el-descriptions-item>
  133. <el-descriptions-item label="发票价格" >
  134. {this.formData.invoiceAmount}
  135. </el-descriptions-item>
  136. <el-descriptions-item label="发票时间">
  137. {this.formData.invoiceTime}
  138. </el-descriptions-item>
  139. <el-descriptions-item label="服务截止时间">
  140. {this.formData.serviceEndTime}
  141. </el-descriptions-item>
  142. <el-descriptions-item label="创建人" >
  143. {this.formData.createBy}
  144. </el-descriptions-item>
  145. <el-descriptions-item label="创建时间" >
  146. {this.formData.createTime}
  147. </el-descriptions-item>
  148. <el-descriptions-item label="支付状态">
  149. {this.formData.payStatus}
  150. </el-descriptions-item>
  151. <el-descriptions-item label="支付方式">
  152. {this.formData.payType}
  153. </el-descriptions-item>
  154. <el-descriptions-item label="支付订单号" >
  155. {this.formData.payNo}
  156. </el-descriptions-item>
  157. <el-descriptions-item label="支付时间" >
  158. {this.formData.payTime}
  159. </el-descriptions-item>
  160. <el-descriptions-item label="微信流水号">
  161. {this.formData.transcationId}
  162. </el-descriptions-item>
  163. <el-descriptions-item label="师傅销售佣金">
  164. {this.formData.workerAmount}
  165. </el-descriptions-item>
  166. <el-descriptions-item label="结算人员" >
  167. {this.formData.updateBy}
  168. </el-descriptions-item>
  169. <el-descriptions-item label="操作时间" >
  170. {this.formData.updateTime}
  171. </el-descriptions-item>
  172. </el-descriptions>
  173. </div>
  174. )
  175. }
  176. }]
  177. },
  178. formItemsList() {
  179. return [{
  180. md: 24,
  181. isShow: true,
  182. name: 'slot-component',
  183. formItemAttributes: {
  184. label: '',
  185. prop: '',
  186. 'label-width': '0px'
  187. },
  188. render: (h, { props, onInput }) => {
  189. var { value } = props
  190. return (
  191. <zj-table
  192. columns={[{
  193. columnAttributes: {
  194. label: '服务类型',
  195. prop: 'type'
  196. }
  197. },
  198. {
  199. columnAttributes: {
  200. label: '使用类型',
  201. prop: 'usedType'
  202. }
  203. }, {
  204. columnAttributes: {
  205. label: '品牌',
  206. prop: 'brandName'
  207. }
  208. },
  209. {
  210. columnAttributes: {
  211. label: '产品大类',
  212. prop: 'mainName'
  213. }
  214. },
  215. {
  216. columnAttributes: {
  217. label: '服务内容',
  218. prop: 'content'
  219. }
  220. },
  221. {
  222. columnAttributes: {
  223. label: '服务金额(元)',
  224. prop: 'amount'
  225. }
  226. },
  227. {
  228. columnAttributes: {
  229. label: '使用限值',
  230. prop: 'limitNum'
  231. }
  232. },
  233. {
  234. columnAttributes: {
  235. label: '总手续费',
  236. prop: 'commissionAmount'
  237. }
  238. },
  239. {
  240. columnAttributes: {
  241. label: '师傅分成金额',
  242. prop: 'workerAmount'
  243. }
  244. },
  245. {
  246. columnAttributes: {
  247. label: '网点分成金额',
  248. prop: 'websitAmount'
  249. }
  250. }]}
  251. tableData={[{ ...(this.formData.increItem || {}), ...(this.formData.incre || {}), commissionAmount: this.formData.commissionAmount }]}
  252. tableAttributes={{
  253. size: 'mini',
  254. border: true,
  255. }} />
  256. )
  257. }
  258. }]
  259. },
  260. formItemsImgs() {
  261. return [{
  262. md: 24,
  263. name: 'slot-component',
  264. formItemAttributes: {
  265. label: '',
  266. prop: '',
  267. 'label-width': '0px'
  268. },
  269. render: (h, { props, onInput }) => {
  270. return (
  271. <ImageUpload
  272. fileList={
  273. [{ key: "insideCodeImg", name: "insideCodeImg" }, { key: "machineImg", name: "机器铭牌图片" }, { key: "buyCertImg", name: "购机凭证图片" }].map((item) => ({ url: this.formData[item.key], name: item.name }))
  274. }
  275. limit={1000}
  276. isEdit={false}
  277. viewOnline={false}
  278. download={false}
  279. showName={true}
  280. />
  281. )
  282. }
  283. }]
  284. },
  285. },
  286. methods: {
  287. // 列表请求函数
  288. getList: increOrderSettleList,
  289. // 列表导出函数
  290. exportList: increOrderSettleListExport,
  291. // 表格列解析渲染数据更改
  292. columnParsing(item, defaultData) {
  293. if (item.jname === 'residuNum') {
  294. defaultData.render = (h, { row, index, column }) => {
  295. return (
  296. <div style="padding:0 6px;cursor: pointer;">
  297. {row["increType"] != 1 ? row["residuNum"] : ""}
  298. </div>
  299. )
  300. }
  301. }
  302. if (item.jname === 'serviceEndTime') {
  303. defaultData.render = (h, { row, index, column }) => {
  304. return (
  305. <div style="padding:0 6px;cursor: pointer;">
  306. {row[column.columnAttributes.prop] ? row[column.columnAttributes.prop].split(" ")[0] : ""}
  307. </div>
  308. )
  309. }
  310. }
  311. return defaultData
  312. },
  313. // 监听勾选变化
  314. selectionChange(data) {
  315. this.recordSelected = data
  316. },
  317. // 操作按钮
  318. operation(h, { row, index, column }) {
  319. return (
  320. <div class='operation-btns'>
  321. <el-button type="text" onClick={() => {
  322. this.formType = 0
  323. this.getDetail(row.id)
  324. }}>查看</el-button>
  325. {["REFUND", "EXPIRE", "CANCEL", "WAIT"].includes(row.payStatus) ? (
  326. <el-button type="text" onClick={() => {
  327. this.$router.push({
  328. name: "workOrderPool",
  329. query: {
  330. pgIncreItemId: row.id,
  331. }
  332. })
  333. }}>服务单明细</el-button>
  334. ) : null}
  335. {["REFUND", "EXPIRE", "CANCEL", "WAIT"].includes(row.payStatus) ? (
  336. <el-popconfirm
  337. title={`是否确定退款?`}
  338. onConfirm={() => {
  339. increOrderSettleRefund({ id: row.id }).then(res => {
  340. this.$message({ type: 'success', message: `退款成功!` })
  341. this.$refs.pageRef.refreshList()
  342. })
  343. }}
  344. >
  345. <el-button type="text" slot="reference">退款</el-button>
  346. </el-popconfirm>
  347. ) : null}
  348. {["REFUND", "EXPIRE", "CANCEL", "WAIT"].includes(row.payStatus) ? (
  349. <el-button type="text" onClick={() => {
  350. this.formType = 1
  351. this.getDetail(row.id)
  352. }}>结算</el-button>
  353. ) : null}
  354. </div>
  355. )
  356. },
  357. getDetail(id) {
  358. increOrderSettleDetail({ id }).then(res => {
  359. Object.assign(this.formData, res.data)
  360. this.openForm()
  361. })
  362. },
  363. openForm() {
  364. this.formDialog = true
  365. },
  366. // 关闭弹窗
  367. formCancel() {
  368. this.$refs.formRef.$refs.inlineForm.clearValidate()
  369. this.$data.formData = this.$options.data().formData
  370. this.formDialog = false
  371. },
  372. formConfirm() {
  373. this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
  374. if (valid) {
  375. increOrderSettleConfirm([this.formData.id]).then(res => {
  376. this.$message({ type: 'success', message: `操作成功!` })
  377. this.formCancel()
  378. this.$refs.pageRef.refreshList()
  379. })
  380. }
  381. })
  382. },
  383. }
  384. }
  385. </script>
  386. <style lang="scss">
  387. .redbordererr {
  388. .el-form-item {
  389. margin: 0 !important;
  390. overflow: hidden;
  391. }
  392. }
  393. </style>