選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

index.vue 54KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493
  1. <template>
  2. <div>
  3. <crud-template ref="crudRef" class="as-weight" :home-data="field" :tableData="tableData" @btnSearch="btnSearch"
  4. @CurrentChange="handleCurrentChange" @refreshLeft="refreshLeft" @pageSizeChange="(val) => {
  5. field.paging.currentPage = 1
  6. field.paging.pageSize = val
  7. getList()
  8. }">
  9. <template #search>
  10. <el-input maxlength="60" v-trim clearable v-model="searchForm.orderNo" style="width: 200px"
  11. placeholder="请输入单号" />
  12. <el-input maxlength="60" v-trim clearable v-model="searchForm.customerIdnum" style="width: 200px"
  13. placeholder="请输入证件号" />
  14. <el-input maxlength="60" v-trim clearable v-model="searchForm.customerTel" style="width: 200px"
  15. placeholder="请输入用户手机号" />
  16. <el-input maxlength="60" v-trim clearable v-model="searchForm.productName" style="width: 200px"
  17. placeholder="请输入产品名称" />
  18. <el-input maxlength="60" v-trim clearable v-model="searchForm.vehiclePlate" placeholder="请输入车牌号"
  19. :style="{ width: '320px', margin: '0 10px 10px 0' }">
  20. <template #append>
  21. <el-select clearable v-model="searchForm.vehiclePlateColor" placeholder="请选择车牌颜色" style="width: 150px;">
  22. <el-option :label="item.label" :key="item.label" :value="item.value" v-for="item in VEHICLE_COLOR_TYPE" />
  23. </el-select>
  24. </template>
  25. </el-input>
  26. <el-select clearable v-model="searchForm.artificialStatus" style="width: 200px" placeholder="请选择审核类型">
  27. <el-option v-for="item in artificialStatusList" :key="item.value" :label="item.label" :value="item.value" />
  28. </el-select>
  29. <el-select clearable v-model="searchForm.vanType" style="width: 200px" placeholder="请选择车辆类型">
  30. <el-option v-for="item in vehicleTypes" :key="item.value" :label="item.label" :value="item.value" />
  31. </el-select>
  32. <el-select clearable v-model="searchForm.promotionModes" style="width: 200px" placeholder="请选择办理方式">
  33. <el-option v-for="item in PATTERN_TYPE" :key="item.value" :label="item.label" :value="item.value" />
  34. </el-select>
  35. <el-select clearable @change="deviceTypeChange" v-model="searchForm.deviceType" style="width: 200px"
  36. placeholder="请选择设备类型">
  37. <el-option v-for="item in CSMSN_DEVICE_TYPE" :key="item.value" :label="item.label" :value="item.value" />
  38. </el-select>
  39. <!-- <el-select clearable v-model="searchForm.orderTypes" multiple style="width: 200px" placeholder="请选择订单类型">
  40. <el-option v-for="item in newOrderTypeList" :key="item.value" :label="item.label" :value="item.value" />
  41. </el-select> -->
  42. <!-- <div class="date-label">创建时间:</div> -->
  43. <el-date-picker unlink-panels v-model="searchForm.time" type="datetimerange" range-separator="到"
  44. start-placeholder="订单创建开始日期" end-placeholder="订单创建结束日期" format="YYYY-MM-DD HH:mm:ss"
  45. value-format="YYYY-MM-DDTHH:mm:ss" />
  46. </template>
  47. <template #searchCustomButton>
  48. <el-button v-if="IsPermission(route, 'DELIVERY_INFORMATION_ENTRY')" type="warning" icon="Download"
  49. @click="templateDownload" class="btn">
  50. 模板下载
  51. </el-button>
  52. <el-upload v-if="IsPermission(route, 'DELIVERY_INFORMATION_ENTRY')"
  53. style="display: inline-block; margin: 0 10px" ref="upload" :data="data" :action="uploadUrl"
  54. @success="onSuccess($event)" accept=".xls, .xlsx" :limit="1" :on-exceed="handleExceed" :show-file-list="false"
  55. :multiple="false">
  56. <el-button type="primary" class="btn" icon="Upload">批量发货导入</el-button>
  57. </el-upload>
  58. <el-button v-if="IsPermission(route, 'DELIVERY_INFORMATION_EXPORT')" type="success" icon="Download"
  59. @click="download" class="btn">
  60. 发货信息导出
  61. </el-button>
  62. </template>
  63. <template #button2>
  64. <el-tabs @tab-click="handleClick" v-model="activeName">
  65. <el-tab-pane v-for="(item, index) in tageList" :key="index" :label="item.label"
  66. :name="item.name"></el-tab-pane>
  67. </el-tabs>
  68. </template>
  69. <template #operation="{ scope }">
  70. <!-- 审核转移到订单领取审核 -->
  71. <!-- <el-button style="margin: 10px 5px;"
  72. v-if="'6' == scope.row.orderStep && scope.row.orderStatus != 99999 && IsPermission(route, 'AUDIT_LIST') && channelOperationAuthority(scope.row.agencyId)"
  73. type="success" size="small" @click="audit(scope.$index, scope.row, true)">
  74. 审核
  75. </el-button> -->
  76. <el-button style="margin: 10px 5px;" v-if="IsPermission(route, 'INFO_LIST')" type="warning" size="small"
  77. @click="audit(scope.$index, scope.row, false)">
  78. 详情
  79. </el-button>
  80. <el-button style="margin: 10px 5px;" v-if="(scope.row.orderStep < 9 || scope.row.orderStep == '26' || scope.row.orderStep == '27') && scope.row.orderStatus == '0' && IsPermission(route, 'CANCEL_ORDER_LIST') && channelOperationAuthority(scope.row.agencyId)
  81. " type="danger" size="small" @click="showData(scope.row, 1)">
  82. 取消订单
  83. </el-button>
  84. <el-button style="margin: 10px 5px;" v-if="scope.row.orderStep == 8 && scope.row.orderStatus == 0 &&
  85. IsPermission(route, 'DELIVER_GOODS_LIST') && channelOperationAuthority(scope.row.agencyId)
  86. " type="primary" size="small" @click="showData(scope.row, 3)">
  87. 订单发货
  88. </el-button>
  89. <el-button style="margin: 10px 5px;" v-if="(scope.row.orderStep == 9 || scope.row.orderStep == 10) && scope.row.orderStatus != 99999 &&
  90. IsPermission(route, 'RETURN_GOODS_LIST') && channelOperationAuthority(scope.row.agencyId)
  91. " type="danger" size="small" @click="showData(scope.row, 4)">
  92. 退货
  93. </el-button>
  94. <el-button style="margin: 10px 5px;" v-if="(scope.row.orderStep == 9 || scope.row.orderStep == 10) && scope.row.orderStatus != 99999 &&
  95. IsPermission(route, 'CHANGE_GOODS_LIST') && channelOperationAuthority(scope.row.agencyId)
  96. " type="danger" size="small" @click="showData(scope.row, 5)">
  97. 换货
  98. </el-button>
  99. <el-button style="margin: 10px 5px;" v-if="(scope.row.orderStep == 32 || scope.row.orderStep == 34) && scope.row.orderStatus != 99999 && channelOperationAuthority(scope.row.agencyId)
  100. " type="primary" size="small" @click="showData(scope.row, 8)">
  101. 确认收货
  102. </el-button>
  103. <el-button style="margin: 10px 5px;" v-if="(scope.row.securityDeposit == 1) && IsPermission(route, 'MARGIN_INQUIRY_LIST')
  104. " type="success" size="small" @click="showData(scope.row, 6)">
  105. 保证金查询
  106. </el-button>
  107. <el-button style="margin: 10px 5px;" type="success" size="small" v-if="IsPermission(route, 'BIDDING_PROCESS')"
  108. @click="showData(scope.row, 7)">
  109. 申办记录
  110. </el-button>
  111. <!-- <el-button
  112. v-if="((scope.row.orderStep == 13) && scope.row.orderStatus != 99999) && IsPermission(route, 'COMPLETE_RETURN')"
  113. size="small" type="success" @click="audit(scope.$index, scope.row, 0)">完成退货</el-button> -->
  114. <el-popover
  115. v-if="(scope.row.orderStep == 14 && scope.row.orderStatus != 99999 && scope.row.updateTime && -timesDiff((scope.row.updateTime).replaceAll('T', ' ')).days <= 30) && IsPermission(route, 'REUSE_LIST') && channelOperationAuthority(scope.row.agencyId)"
  116. style="margin: 10px 5px;" trigger="click" :visible="scope.row.visible2" placement="top" :width="160">
  117. <div>
  118. <div style="margin-bottom: 10px">
  119. <span>确认再次使用?</span>
  120. </div>
  121. <div class="as-layout-horizontal">
  122. <el-button type="default" @click="scope.row.visible2 = false" style="width: 100%">取消</el-button>
  123. <el-button type="primary" @click="completeReturn(scope.$index, scope.row, 2)"
  124. style="color: #fff; margin-right: 10px">确认</el-button>
  125. </div>
  126. </div>
  127. <template #reference>
  128. <el-button size="small" type="success" @click="scope.row.visible2 = true">再次使用</el-button>
  129. </template>
  130. </el-popover>
  131. <el-popover
  132. v-if="((scope.row.orderStep == 10 || scope.row.orderStep == 9) && scope.row.orderStatus != 99999 && scope.row.insertTime && -timesDiff((scope.row.insertTime).replaceAll('T', ' ')).days > 30) && IsPermission(route, 'CLOSE_ORDER_LIST') && channelOperationAuthority(scope.row.agencyId)"
  133. style="margin: 10px 5px;" trigger="click" :visible="scope.row.visible3" placement="top" :width="160">
  134. <div>
  135. <div style="margin-bottom: 10px">
  136. <span>确认结束订单?</span>
  137. </div>
  138. <div class="as-layout-horizontal">
  139. <el-button type="default" @click="scope.row.visible3 = false" style="width: 100%">取消</el-button>
  140. <el-button type="primary" @click="completeReturn(scope.$index, scope.row, 3)"
  141. style="color: #fff; margin-right: 10px">确认</el-button>
  142. </div>
  143. </div>
  144. <template #reference>
  145. <el-button size="small" type="danger" @click="scope.row.visible3 = true">结束订单</el-button>
  146. </template>
  147. </el-popover>
  148. </template>
  149. </crud-template>
  150. <!-- 详情弹窗 -->
  151. <el-dialog class="detail-dialog" :title="detailDialogTitle" v-model="visible">
  152. <div v-if="detailDialogTitle == '订单详情'">
  153. <div style="position: absolute; top: 0; right: 100px" v-if="visiinfoDatable">
  154. <!-- <el-affix v-if="9 > visiinfoDatable.orderStep" :offset="offset">
  155. <el-button type="danger" size="small" @click="showData(visiinfoDatable, 1)">
  156. 取消订单
  157. </el-button>
  158. </el-affix> -->
  159. <el-affix v-if="6 == visiinfoDatable.orderStep && autdisButton" :offset="offset + 50">
  160. <el-button type="danger" size="small" @click="showData(visiinfoDatable, 2)">
  161. 审核
  162. </el-button>
  163. </el-affix>
  164. <!-- <el-affix v-if="8 == visiinfoDatable.orderStep" :offset="offset + 100">
  165. <el-button type="danger" size="small" @click="showData(visiinfoDatable, 3)">
  166. 订单发货
  167. </el-button>
  168. </el-affix> -->
  169. <!-- <el-affix v-if="visiinfoDatable.orderStep == 9 || visiinfoDatable.orderStep == 10
  170. " :offset="offset + 50">
  171. <el-button type="danger" size="small" @click="showData(visiinfoDatable, 4)">
  172. 退货
  173. </el-button>
  174. </el-affix> -->
  175. <!-- <el-affix v-if="visiinfoDatable.orderStep == 9 || visiinfoDatable.orderStep == 10
  176. " :offset="offset + 100">
  177. <el-button type="danger" size="small" @click="showData(visiinfoDatable, 5)">
  178. 换货
  179. </el-button>
  180. </el-affix> -->
  181. </div>
  182. <orderInfo :infoData="visiinfoDatable"></orderInfo>
  183. </div>
  184. <div v-else-if="detailDialogTitle == '保证金详情'">
  185. <el-descriptions direction="vertical" border :column="3">
  186. <el-descriptions-item label="保证金(元)" :span="1"> {{ handleAmount(earnestMoneyObj?.amount) ?? '-'
  187. }}</el-descriptions-item>
  188. <el-descriptions-item label="支付状态" :span="1"> {{ earnestMoneyObj?.payType == 0 ? '未支付' :
  189. earnestMoneyObj?.payType == 1 ? '已支付' : '-' }}</el-descriptions-item>
  190. <el-descriptions-item label="支付时间" :span="1"> {{ earnestMoneyObj?.payTime ?? '-' }}</el-descriptions-item>
  191. <el-descriptions-item label="退款状态" :span="1"> {{ earnestMoneyObj?.refundType == 0 ? '未退款' :
  192. earnestMoneyObj?.payType == 1 ? '已退款' : '-' }}</el-descriptions-item>
  193. <el-descriptions-item label="退款时间" :span="1"> {{ earnestMoneyObj?.refundTime ?? '-' }}</el-descriptions-item>
  194. </el-descriptions>
  195. </div>
  196. </el-dialog>
  197. <!-- 简单操作弹窗(取消订单,退货,换货) -->
  198. <el-dialog v-model="dialogVisible" :width="startTitle === '申办记录' ? '40%' : '30%'" :title="startTitle">
  199. <div v-if="startTitle !== '申办记录'">
  200. <el-input v-trim clearable type="textarea" v-model="content" :placeholder="startTitle + `原因`"
  201. maxlength="200" show-word-limit></el-input>
  202. </div>
  203. <template #footer v-if="startTitle !== '申办记录'">
  204. <el-button @click="dialogVisible = false">取 消</el-button>
  205. <el-button type="primary" @click="operation()">确 定</el-button>
  206. </template>
  207. <div v-if="startTitle === '申办记录'" v-loading="biddingProcessLoading">
  208. <el-steps style="max-width: 600px" :active="biddingProcessList.length" align-center>
  209. <el-step v-for="item in biddingProcessList" :key="item.serviceType" :title="item.serviceType">
  210. <template v-slot:description>
  211. <div>
  212. {{ item.operateTime }}
  213. </div>
  214. <div @click="biddingProcessInfoFn(item.type)"
  215. v-if="item.type === 'APPLYRETURN' || item.type === 'APPLYREPLACEMENT' || item.type === 'PAYEND'"
  216. class="user-content">
  217. 查看详情
  218. </div>
  219. </template>
  220. </el-step>
  221. </el-steps>
  222. </div>
  223. </el-dialog>
  224. <!-- 订单发货 -->
  225. <el-dialog v-model="deliverGoods" width="40%" title="订单发货" @close="deliverClose">
  226. <el-form ref="form" :rules="rules" :model="sizeForm" label-width="120px">
  227. <el-form-item label="收件人姓名">
  228. <el-input v-trim clearable disabled v-model="sizeForm.orderInfoExt.consignee"
  229. placeholder="请输入收件人姓名"></el-input>
  230. </el-form-item>
  231. <el-form-item label="收件人电话">
  232. <el-input v-trim clearable disabled v-model="sizeForm.orderInfoExt.consigneeTel"
  233. placeholder="请输入收件人电话"></el-input>
  234. </el-form-item>
  235. <el-form-item label="收货地区">
  236. <el-input v-trim clearable disabled v-model="sizeForm.orderInfoExt.region" placeholder="请输入收货地址"></el-input>
  237. </el-form-item>
  238. <el-form-item label="详细地址">
  239. <el-input v-trim clearable disabled v-model="sizeForm.orderInfoExt.address" placeholder="请输入详细地址"></el-input>
  240. </el-form-item>
  241. <el-form-item label="邮政编码">
  242. <el-input v-trim clearable disabled v-model="sizeForm.orderInfoExt.postalCode"
  243. placeholder="请输入邮政编码"></el-input>
  244. </el-form-item>
  245. <el-form-item label="卡号" :prop="beanData.orderType === 'OFFICAL_SUPPLEMENT_OBU' ? '' : 'cardId'">
  246. <el-input v-trim clearable :disabled="cardIdDisabled" type="number"
  247. oninput="if(value.length>20)value=value.slice(0,20)" v-model="sizeForm.cardId" placeholder="卡号"></el-input>
  248. </el-form-item>
  249. <el-form-item label="OBU号" prop="obuId">
  250. <el-input v-trim clearable :disabled="obuIdDisabled" type="number"
  251. oninput="if(value.length>16)value=value.slice(0,16)" v-model="sizeForm.obuId" placeholder="OBU号"></el-input>
  252. </el-form-item>
  253. <el-form-item label="物流公司" prop="courierCompany">
  254. <el-select @change="courierCompanyChange" clearable v-model="sizeForm.courierCompany" placeholder="请选择物流公司">
  255. <el-option :label="item.label" :key="item.value" :value="item.value"
  256. v-for="item in EXPRESS_DELIVERY_COMPANY" />
  257. </el-select>
  258. </el-form-item>
  259. <el-form-item label="物流单号" prop="trackingNumber">
  260. <el-input v-trim clearable maxlength="60" :disabled="trackingNumberDisabled" v-model="sizeForm.trackingNumber"
  261. placeholder="物流单号"></el-input>
  262. </el-form-item>
  263. </el-form>
  264. <template #footer>
  265. <el-button @click="deliverGoods = false">取 消</el-button>
  266. <el-button type="primary" @click="submitForm(form)">确 定</el-button>
  267. </template>
  268. </el-dialog>
  269. <!-- 订单换货 -->
  270. <el-dialog v-model="exchangeInformationDialog" width="40%" title="订单换货" @close="exchangeInformationClose">
  271. <el-form ref="exchangeInformationRef" :rules="exchangeInformationRules" :model="exchangeInformationForm"
  272. label-width="120px">
  273. <el-form-item label="换货类型" prop="applyType">
  274. <el-select clearable v-model="exchangeInformationForm.applyType" placeholder="请选择换货类型">
  275. <el-option :label="item.label" :key="item.value" :value="item.value" v-for="item in applyTypeList" />
  276. </el-select></el-form-item>
  277. <!-- <el-form-item label="损坏方式">
  278. <el-radio-group v-model="exchangeInformationForm.damageMode">
  279. <el-radio label="1">自然损坏</el-radio>
  280. <el-radio label="0">人为损坏</el-radio>
  281. </el-radio-group>
  282. </el-form-item>
  283. <el-form-item label="上传图片">
  284. <el-upload ref="uploadImg" v-model:file-list="fileList" list-type="picture-card" :data="data"
  285. :action="uploadUrl">
  286. <el-icon>
  287. <Plus />
  288. </el-icon>
  289. </el-upload>
  290. </el-form-item> -->
  291. <el-form-item style="font-weight: 900;" label="邮寄方式"></el-form-item>
  292. <el-form-item label="是否需要邮寄" prop="sendStatus">
  293. <el-radio-group v-model="exchangeInformationForm.sendStatus">
  294. <el-radio label="1">邮寄</el-radio>
  295. <el-radio label="0">不邮寄</el-radio>
  296. </el-radio-group>
  297. </el-form-item>
  298. <div v-if="exchangeInformationForm.sendStatus == '1'">
  299. <el-form-item label="收件人姓名" prop="consignee">
  300. <el-input maxlength="60" v-trim clearable v-model="exchangeInformationForm.consignee"
  301. placeholder="请输入收件人姓名"></el-input>
  302. </el-form-item>
  303. <el-form-item label="收件人电话" prop="consigneeTel">
  304. <el-input maxlength="60" v-trim clearable v-model="exchangeInformationForm.consigneeTel"
  305. placeholder="请输入收件人电话"></el-input>
  306. </el-form-item>
  307. <el-form-item label="收货地区" prop="region">
  308. <el-cascader v-model="exchangeInformationForm.region" placeholder="请选择收货地址" :options="pcaText" />
  309. </el-form-item>
  310. <el-form-item label="详细地址" prop="address">
  311. <el-input maxlength="60" v-trim clearable v-model="exchangeInformationForm.address"
  312. placeholder="请输入详细地址"></el-input>
  313. </el-form-item>
  314. <el-form-item label="邮政编码" prop="postalCode">
  315. <el-input maxlength="60" v-trim clearable v-model="exchangeInformationForm.postalCode"
  316. placeholder="请输入邮政编码"></el-input>
  317. </el-form-item>
  318. </div>
  319. <el-form-item style="font-weight: 900;" label="收货方式"></el-form-item>
  320. <el-form-item label="收货方式" prop="receiveMethod">
  321. <el-radio-group v-model="exchangeInformationForm.receiveMethod">
  322. <el-radio label="1">线上</el-radio>
  323. <el-radio label="0">线下</el-radio>
  324. </el-radio-group>
  325. </el-form-item>
  326. <div v-if="exchangeInformationForm.receiveMethod == '1'">
  327. <el-form-item label="物流公司" prop="courierCompany">
  328. <el-select clearable v-model="exchangeInformationForm.courierCompany" placeholder="请选择物流公司">
  329. <el-option :label="item" :key="item" :value="item" v-for="item in logisticsCompanyList" />
  330. </el-select>
  331. </el-form-item>
  332. <el-form-item label="物流单号" prop="courierOrderId">
  333. <el-input maxlength="60" v-trim clearable v-model="exchangeInformationForm.courierOrderId"
  334. placeholder="请输入物流单号"></el-input>
  335. </el-form-item>
  336. </div>
  337. <el-form-item label="更换原因" prop="applyRes">
  338. <el-input v-trim clearable type="textarea" maxlength="100" show-word-limit
  339. v-model="exchangeInformationForm.applyRes" placeholder="请输入更换原因"></el-input>
  340. </el-form-item>
  341. </el-form>
  342. <template #footer>
  343. <el-button @click="exchangeInformationDialog = false">取 消</el-button>
  344. <el-button type="primary" @click="exchangeInformationsubmitForm(exchangeInformationRef)">确 定</el-button>
  345. </template>
  346. </el-dialog>
  347. <!-- 审核接口 -->
  348. <el-dialog v-model="check" width="30%" title="审核">
  349. <el-form ref="form" :model="autdis"
  350. :rules="{ reason: [{ required: true, message: '驳回类型不能为空', trigger: 'change' }] }" label-width="80px">
  351. <el-form-item label="">
  352. <el-radio-group v-model="autdis.auditStatus">
  353. <el-radio label="true">审核通过</el-radio>
  354. <el-radio label="false">审核不通过</el-radio>
  355. </el-radio-group>
  356. </el-form-item>
  357. <el-form-item v-if="autdis.auditStatus != 'true'" label="审核原因" prop="reason">
  358. <el-select clearable @change="autdisReasonChange" v-model="autdis.reason" placeholder="请选择审核原因类型">
  359. <el-option :label="item.label" :key="item.value" :value="item.value"
  360. v-for="item in NEW_CSMSN_APPLY_REASON" />
  361. </el-select>
  362. </el-form-item>
  363. <el-form-item v-if="autdisReasonType == '8' && autdis.auditStatus != 'true'" label="其他原因" prop="reason1">
  364. <el-input v-trim clearable type="textarea" v-model="autdis.reason1" :placeholder="`审核不通过原因`"
  365. maxlength="200" show-word-limit></el-input>
  366. </el-form-item>
  367. </el-form>
  368. <template #footer>
  369. <el-button @click="check = false">取 消</el-button>
  370. <el-button type="primary" @click="checkForm(form)">确 定</el-button>
  371. </template>
  372. </el-dialog>
  373. <!-- 完成退货,已加入业务审核该地方不使用 -->
  374. <!-- <returnInformation v-model="CompleteTeturnDialog" @completeReturn="getList()" :infoData="visiinfoDatable">
  375. </returnInformation> -->
  376. <!-- 申办查看详情 -->
  377. <el-dialog v-model="biddingProcessDialog" width="50%" :title="biddingProcessTypeTitle">
  378. <biddingProcessInfo :infoData="biddingProcessInfoData" :biddingProcessType="biddingProcessType"
  379. v-loading="biddingProcessInfoLoading">
  380. </biddingProcessInfo>
  381. </el-dialog>
  382. </div>
  383. </template>
  384. <!-- 订单管理 -->
  385. <script setup lang="ts">
  386. import { ref, reactive, onMounted, computed } from 'vue'
  387. import { useRoute } from 'vue-router'
  388. // @ts-ignore crudFrom模板
  389. import CrudTemplate from '@/crud/index.vue'
  390. import $storeinitData from '@/store/initData' //引入tab vuex
  391. import BaseService from '@/utils/baseService' //引入接口请求
  392. import { ElMessage, ElMessageBox, UploadInstance, UploadProps, UploadRawFile, genFileId } from 'element-plus' //提示
  393. import { getCache } from '@/utils/cache'
  394. // @ts-ignore crudFrom模板
  395. import orderInfo from '@/components/orderInfo/index.vue'
  396. import returnInformation from './returnInformation.vue'
  397. import { timesDiff } from '@/utils/utils'
  398. import biddingProcessInfo from './biddingProcessInfo.vue'
  399. import { pcaTextArr } from 'element-china-area-data'
  400. const pcaText: any = pcaTextArr
  401. import {
  402. getOrderInfo,
  403. salesReturnAffirm,
  404. cancellationOfOrder,
  405. getOrderList,
  406. deliverGoodsOrder,
  407. exchangeGoods,
  408. salesReturn,
  409. getAudit,
  410. } from '@/api/onlineBusinessHall/orderManagement'
  411. import { IsPermission } from '@/router/routerUtil'
  412. import { channelOperationAuthority } from '@/utils/channelOperationAuthority'
  413. import moment from 'moment'
  414. import handleAmount from '@/utils/handleAmount'
  415. import { exportFn, importFn } from '@/views/settlement/exportFn'
  416. const uploadUrl = '/minIo/upload'
  417. const data = { bucket: 'default-bucket' }
  418. const fileList = ref([])
  419. //或取路由传入过来的对象数据
  420. const route = useRoute()
  421. const crudRef = ref()
  422. let offset = ref(150)
  423. let cacheAccessToken = getCache(
  424. 'cacheAccessToken',
  425. { isSessionStorage: false },
  426. {}
  427. )
  428. let openId = cacheAccessToken['openId']
  429. let visible = ref(false)
  430. let dialogVisible = ref(false)
  431. let deliverGoods = ref(false)
  432. let check = ref(false) //审核弹窗
  433. let orderStep = ref('')
  434. const orderStatus = ref()
  435. let content = ref('')
  436. let form = ref()
  437. let startTitle = ref('取消订单') //取消订单 换货 退货
  438. let visiinfoDatable: any = reactive({})
  439. let activeName = null
  440. let sizeForm: any = ref({ orderInfoExt: {} }) //发货对象
  441. const autdis: any = reactive({ auditStatus: 'true', reason: '', reason1: '' }) //审核对象
  442. const detailDialogTitle = ref('订单详情')
  443. const exchangeInformationDialog = ref(false) // 换货弹框
  444. const CompleteTeturnDialog = ref()
  445. let rules = ref({
  446. cardId: [{ required: true, message: '不能为空且卡号为20位', trigger: 'blur', min: 20, max: 20 }],
  447. obuId: [{ required: true, message: '不能为空且OBU号为16位', trigger: 'blur', min: 16, max: 16 }],
  448. courierCompany: [{ required: true, message: '不能为空', trigger: 'blur' }],
  449. trackingNumber: [{ required: true, message: '不能为空', trigger: 'blur' }],
  450. })
  451. let exchangeInformationRules = ref({
  452. sendStatus: [{ required: true, message: '不能为空', trigger: 'change' }],
  453. consignee: [{ required: true, message: '不能为空', trigger: 'blur' }],
  454. consigneeTel: [{ required: true, message: '不能为空', trigger: 'blur' }, {
  455. pattern:
  456. /^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/, //正则校验不用字符串
  457. message: '请填写正确的手机号码',
  458. trigger: 'blur',
  459. },],
  460. region: [{ required: true, message: '不能为空', trigger: 'blur' }],
  461. address: [{ required: true, message: '不能为空', trigger: 'blur' }],
  462. receiveMethod: [{ required: true, message: '不能为空', trigger: 'change' }],
  463. courierCompany: [{ required: true, message: '不能为空', trigger: 'blur' }],
  464. courierOrderId: [{ required: true, message: '不能为空', trigger: 'blur' }],
  465. applyRes: [{ required: true, message: '不能为空', trigger: 'blur' }],
  466. applyType: [{ required: true, message: '不能为空', trigger: 'change' }]
  467. })
  468. const exchangeInformationForm = reactive<any>({
  469. sendStatus: '1',
  470. consignee: '',
  471. consigneeTel: '',
  472. region: '',
  473. address: '',
  474. postalCode: '',
  475. receiveMethod: '1',
  476. courierCompany: '',
  477. courierOrderId: '',
  478. applyRes: '',
  479. applyType: '',
  480. // damageMode: '1'
  481. })
  482. const artificialStatusList = [
  483. {
  484. label: '系统审核',
  485. value: '2'
  486. },
  487. {
  488. label: '人工审核',
  489. value: '1'
  490. },
  491. ]
  492. //订单阶段
  493. const ORDER_STAGE_TYPE = computed(() => {
  494. return $storeinitData.state.dictData['ORDER_STAGE_TYPE'] || []
  495. })
  496. const EXPRESS_DELIVERY_COMPANY = computed(() => {
  497. return $storeinitData.state.dictData['EXPRESS_DELIVERY_COMPANY'] || []
  498. })
  499. const CSMSN_DEVICE_TYPE = computed(() => {
  500. return $storeinitData.state.dictData['CSMSN_DEVICE_TYPE'] || []
  501. })
  502. //订单状态
  503. const ORDER_TYPE = computed(() => {
  504. return $storeinitData.state.dictData['ORDER_TYPE'] || []
  505. })
  506. //车牌颜色
  507. const VEHICLE_COLOR_TYPE = computed(() => {
  508. return $storeinitData.state.dictData['VEHICLE_COLOR_TYPE'] || []
  509. })
  510. // 车辆类型
  511. const vehicleTypes = computed(() => {
  512. return $storeinitData.state.dictData['VAN_TYPE'] || []
  513. })
  514. //产品类型
  515. const PRODUCT_TYPE = computed(() => {
  516. return $storeinitData.state.dictData['PRODUCT_TYPE_NEW'] || []
  517. })
  518. //办理模式
  519. const PATTERN_TYPE = computed(() => {
  520. return $storeinitData.state.dictData['PATTERN_TYPE'] || []
  521. })
  522. //订单状态
  523. const ORDER_STATUS = computed(() => {
  524. return $storeinitData.state.dictData['ORDER_STATUS'] || []
  525. })
  526. const NEW_CSMSN_APPLY_REASON = computed(() => {
  527. return $storeinitData.state.dictData['NEW_CSMSN_APPLY_REASON'] || []
  528. })
  529. const CERTIFICATE_TYPE = computed(() => {
  530. return $storeinitData.state.dictData["CERTIFICATE_TYPE"] ?? [];
  531. }); //用户证件类型
  532. const autdisReasonType = ref()
  533. function autdisReasonChange(value) {
  534. autdisReasonType.value = value
  535. }
  536. const applyTypeList = [
  537. {
  538. label: '换卡',
  539. value: 'CARD'
  540. },
  541. {
  542. label: '换签',
  543. value: 'OBU'
  544. },
  545. {
  546. label: '换卡签',
  547. value: 'ALL'
  548. },
  549. ] // 换货类型
  550. const logisticsCompanyList = ref([])
  551. function getLogisticsCompanyList() {
  552. BaseService.post('/managew/order/couriercompanyselect', {}).then((res: any) => {
  553. if (res && res.statusCode === 0) {
  554. logisticsCompanyList.value = res?.data ? res.data : []
  555. } else {
  556. ElMessage.error(res.message)
  557. }
  558. })
  559. }
  560. const newOrderTypeList = ref([])
  561. function deviceTypeChange(value) {
  562. console.log(value, 'value')
  563. if (value === 'TYMY9901') {
  564. newOrderTypeList.value = ORDER_TYPE.value.filter(item => {
  565. // 新办发行 更换卡 更换签 更换卡签
  566. return (item.value == 'ISSUE' || item.value == 'EXCHANGE_OBU' || item.value == 'EXCHANGE_CARD' || item.value == 'EXCHANGE_ALL' || item.value == 'FILL_CARD' || item.value == 'FILL_OBU')
  567. })
  568. } else {
  569. newOrderTypeList.value = ORDER_TYPE.value
  570. console.log(newOrderTypeList.value, 'newOrderTypeList.value')
  571. }
  572. }
  573. function getLabel(item, selectedValue) {
  574. let data = item.value
  575. let selectedLabel = ''
  576. for (var i = 0; i < data.length; i++) {
  577. if (data[i].code == selectedValue) {
  578. selectedLabel = data[i].name
  579. break
  580. }
  581. }
  582. return selectedLabel
  583. }
  584. // 物流单号
  585. const trackingNumberDisabled = ref(false)
  586. function courierCompanyChange(value) {
  587. if (value == '99') {
  588. sizeForm.value.trackingNumber = '000000'
  589. trackingNumberDisabled.value = true
  590. } else {
  591. sizeForm.value.trackingNumber = ''
  592. trackingNumberDisabled.value = false
  593. }
  594. }
  595. let tageList = [
  596. {
  597. label: '全部',
  598. name: null,
  599. value: ''
  600. },
  601. {
  602. label: '待签约',
  603. name: '3',
  604. value: 'NORMAL'
  605. },
  606. {
  607. label: '待审核',
  608. name: '6',
  609. value: 'NORMAL'
  610. },
  611. {
  612. label: '待发货',
  613. name: '8',
  614. value: 'NORMAL'
  615. },
  616. {
  617. label: '待收货',
  618. name: '9',
  619. value: 'NORMAL'
  620. },
  621. {
  622. label: '待激活',
  623. name: '10',
  624. value: 'NORMAL'
  625. },
  626. {
  627. label: '换货',
  628. name: '12',
  629. value: 'NORMAL'
  630. },
  631. {
  632. label: '退货',
  633. name: '13',
  634. value: 'NORMAL'
  635. },
  636. // {
  637. // label: '异地换货',
  638. // name: '34',
  639. // value: 'NORMAL'
  640. // },
  641. // {
  642. // label: '异地退货',
  643. // name: '32',
  644. // value: 'NORMAL'
  645. // },
  646. {
  647. label: '已完成',
  648. name: '11',
  649. value: 'ACTIVE'
  650. },
  651. {
  652. label: '已结束',
  653. name: '14',
  654. value: 'CANCEL'
  655. },
  656. {
  657. label: '审核不通过',
  658. name: '7',
  659. value: 'NORMAL'
  660. },
  661. {
  662. label: '待支付',
  663. name: '4',
  664. value: 'NORMAL'
  665. },
  666. {
  667. label: '已取消',
  668. name: '',
  669. value: 'CANCEL'
  670. },
  671. {
  672. label: '已封存',
  673. name: ' ',
  674. value: 'SEAL'
  675. },
  676. ]
  677. //查询参数
  678. const searchForm = ref({
  679. artificialStatus: '',
  680. orderNo: '',
  681. productName: '',
  682. vehiclePlate: '',
  683. vanType: '',
  684. orderTypes: '',
  685. orderStep: '',
  686. time: '',
  687. vehiclePlateColor: '',
  688. promotionModes: '',
  689. customerIdnum: '',
  690. customerTel: '',
  691. deviceType: '',
  692. })
  693. let tableData: any = ref([])
  694. onMounted(() => {
  695. getList()
  696. getLogisticsCompanyList()
  697. })
  698. // 搜索按钮
  699. function btnSearch() {
  700. field.value.paging.currentPage = 1
  701. getList()
  702. }
  703. //标签分页
  704. function handleClick(tab, event) {
  705. orderStep.value = tab.props.name
  706. orderStatus.value = tageList[tab.index].value
  707. getList()
  708. }
  709. //分页
  710. function handleCurrentChange(val: number) {
  711. field.value.paging.currentPage = val
  712. getList()
  713. }
  714. // 搜索重置
  715. function refreshLeft() {
  716. searchForm.value = {
  717. artificialStatus: '',
  718. orderNo: '',
  719. productName: '',
  720. vehiclePlate: '',
  721. vanType: '',
  722. orderTypes: '',
  723. orderStep: '',
  724. time: '',
  725. vehiclePlateColor: '',
  726. promotionModes: '',
  727. customerIdnum: '',
  728. customerTel: '',
  729. deviceType: '',
  730. }
  731. newOrderTypeList.value = ORDER_TYPE.value
  732. field.value.paging.currentPage = 1
  733. getList()
  734. }
  735. function deliverClose() {
  736. if (form.value) form.value.resetFields()
  737. }
  738. const uploadImg = ref()
  739. const exchangeInformationRef = ref()
  740. function exchangeInformationClose() {
  741. if (exchangeInformationRef.value) exchangeInformationRef.value.resetFields()
  742. if (uploadImg.value) uploadImg.value.clearFiles()
  743. exchangeInformationForm.sendStatus = '1',
  744. exchangeInformationForm.consignee = '',
  745. exchangeInformationForm.consigneeTel = '',
  746. exchangeInformationForm.region = '',
  747. exchangeInformationForm.address = '',
  748. exchangeInformationForm.postalCode = '',
  749. exchangeInformationForm.receiveMethod = '1',
  750. exchangeInformationForm.courierCompany = '',
  751. exchangeInformationForm.courierOrderId = '',
  752. exchangeInformationForm.applyRes = '',
  753. exchangeInformationForm.applyType = ''
  754. // exchangeInformationForm.damageMode = '1'
  755. }
  756. //订单发货
  757. let timer1: any = null
  758. function submitForm(formEl) {
  759. if (timer1) return
  760. timer1 = setTimeout(() => {
  761. formEl.validate((valid: any, fields: any) => {
  762. if (valid) {
  763. delete sizeForm.value.type
  764. sizeForm.value.opId = openId
  765. console.log(sizeForm.value)
  766. //订单发货
  767. BaseService.postN('/iaw/issue/order/orderDeliverGoods', sizeForm.value).then((res: any) => {
  768. if (res && res.code === 0) {
  769. deliverGoods.value = false
  770. ElMessage.success(res.message)
  771. getList() //页面数据刷新
  772. } else {
  773. ElMessage.error(res.message)
  774. }
  775. })
  776. } else {
  777. console.log('error submit!!')
  778. return false
  779. }
  780. })
  781. timer1 = null
  782. }, 1000)
  783. }
  784. // 订单换货
  785. let timerExchange: any = null
  786. function exchangeInformationsubmitForm(exchangeInformationRef) {
  787. if (timerExchange) return
  788. let params: any = {
  789. orderId: beanData.orderId,
  790. applyType: exchangeInformationForm.applyType,
  791. returnReason: exchangeInformationForm.applyRes,
  792. // damageMode: exchangeInformationForm.damageMode
  793. }
  794. // params.fileUrl = fileList.value.map((item: any) => {
  795. // return '/default-bucket/' + item?.response?.data?.ossFilePath
  796. // }).join()
  797. timerExchange = setTimeout(() => {
  798. exchangeInformationRef.validate((valid: any, fields: any) => {
  799. if (valid) {
  800. if (exchangeInformationForm.sendStatus == '0') {
  801. exchangeInformationForm.consignee = ''
  802. exchangeInformationForm.consigneeTel = ''
  803. exchangeInformationForm.region = ''
  804. exchangeInformationForm.address = ''
  805. exchangeInformationForm.postalCode = ''
  806. }
  807. if (exchangeInformationForm.receiveMethod == '0') {
  808. exchangeInformationForm.courierCompany = ''
  809. exchangeInformationForm.courierOrderId = ''
  810. }
  811. if (exchangeInformationForm.region && exchangeInformationForm.region.length !== 0) {
  812. exchangeInformationForm.region = exchangeInformationForm.region.join('')
  813. }
  814. let searchFormList = { ...exchangeInformationForm }
  815. for (let key in searchFormList) {
  816. if (searchFormList[key]) {
  817. params[key] = searchFormList[key]
  818. }
  819. }
  820. BaseService.post('/iaw/issue/order/replaceGoodsFill', params).then((res: any) => {
  821. if (res && res.statusCode === 0) {
  822. exchangeInformationDialog.value = false
  823. ElMessage.success(res.message)
  824. } else {
  825. ElMessage.error(res.message)
  826. }
  827. })
  828. } else {
  829. return false
  830. }
  831. })
  832. timerExchange = null
  833. }, 1000)
  834. }
  835. let timer3: any = null
  836. const completeReturn = (index, row, type) => {
  837. if (timer3) return
  838. timer3 = setTimeout(() => {
  839. let api = ''
  840. let params = {}
  841. if (type == 2) {
  842. api = '/managew/order/orderreuse'
  843. params = { orderId: row.orderId, orderSource: 'WEB' }
  844. } else if (type == 3) {
  845. api = '/managew/order/orderend'
  846. params = { orderId: row.orderId, orderSource: 'WEB' }
  847. }
  848. BaseService.post(api, params).then((res: any) => {
  849. if (res && res.statusCode === 0) {
  850. ElMessage.success('操作完成')
  851. getList()
  852. } else {
  853. ElMessage.error(res.message)
  854. }
  855. if (type == 1) {
  856. row.visible1 = false
  857. } else if (type == 2) {
  858. row.visible2 = false
  859. } else if (type == 3) {
  860. row.visible3 = false
  861. }
  862. })
  863. timer3 = null
  864. }, 1000)
  865. }
  866. let timer2: any = null
  867. //审核提交
  868. function checkForm(formEl) {
  869. if (timer2) return
  870. timer2 = setTimeout(() => {
  871. formEl.validate((valid: any, fields: any) => {
  872. if (valid) {
  873. if (autdisReasonType.value == '8' && autdis.reason1) {
  874. autdis.reason = autdis.reason1
  875. }
  876. if (autdis.auditStatus == 'true') {
  877. autdisReasonType.value = ''
  878. autdis.reason = ''
  879. autdis.reason1 = ''
  880. }
  881. BaseService.postN('/iaw/issue/order/orderManualVerify', autdis).then((res: any) => {
  882. if (res && res.code === 0) {
  883. ElMessage.success(res.message)
  884. check.value = false
  885. visible.value = false
  886. getList()
  887. } else {
  888. ElMessage.error(res.message)
  889. }
  890. })
  891. } else {
  892. return false
  893. }
  894. })
  895. timer2 = null
  896. }, 1000)
  897. }
  898. //审核弹窗
  899. const autdisButton = ref(false)
  900. function audit(idx: number, data: any, type) {
  901. beanData = data
  902. if (type !== 0) {
  903. detailDialogTitle.value = '订单详情'
  904. autdisButton.value = type
  905. offset.value = 150
  906. }
  907. visiinfoDatable = {}
  908. BaseService.postN('/iaw/issue/order/orderDetailQuery', { id: data.id }).then((res: any) => {
  909. if (res && res.code === 0) {
  910. try {
  911. visiinfoDatable = res.data.data
  912. } catch (e) {
  913. console.log(e)
  914. ElMessage.error('未知错误')
  915. } //渲详情数据
  916. if (visiinfoDatable) {
  917. if (type !== 0) {
  918. autdis.orderId = visiinfoDatable.orderNo
  919. visible.value = true
  920. } else {
  921. CompleteTeturnDialog.value = true
  922. }
  923. } else {
  924. ElMessage.error('没有查到详情数据')
  925. }
  926. } else {
  927. ElMessage.error(res.message)
  928. }
  929. })
  930. }
  931. const biddingProcessInfoData = ref([])
  932. const biddingProcessDialog = ref(false)
  933. const biddingProcessType = ref()
  934. const biddingProcessTypeTitle = ref()
  935. const biddingProcessInfoLoading = ref(false)
  936. // 申办详情
  937. function biddingProcessInfoFn(type) {
  938. let api = ''
  939. biddingProcessDialog.value = true
  940. biddingProcessType.value = type
  941. biddingProcessInfoLoading.value = true
  942. if (type === 'APPLYRETURN') { // 退货
  943. api = '/managew/api/generalAudit/verificationquery'
  944. biddingProcessTypeTitle.value = '退货详情'
  945. } else if (type === 'APPLYREPLACEMENT') { // 换货
  946. api = '0dff04ef1e8648e6a5cddfb1eae1ee4b'
  947. biddingProcessTypeTitle.value = '换货详情'
  948. } else if (type === 'PAYEND') { // 支付
  949. api = '/managew/api/generalAudit/paymentdetails'
  950. biddingProcessTypeTitle.value = '支付详情'
  951. }
  952. BaseService.post(api, { orderId: beanData.orderId }).then((res: any) => {
  953. if (res && res.statusCode === 0) {
  954. const data = res.data ?? []
  955. biddingProcessInfoData.value = data
  956. } else {
  957. ElMessage.error(res.message)
  958. }
  959. biddingProcessInfoLoading.value = false
  960. })
  961. }
  962. let beanData: any = {}
  963. let operationStart
  964. const earnestMoneyObj = ref<any>()
  965. const cardIdDisabled = ref(false)
  966. const obuIdDisabled = ref(false)
  967. //显示内容 1 取消订
  968. function showData(data: any, start: number) {
  969. beanData = data
  970. operationStart = start
  971. content.value = '' //进入清空
  972. if (start == 1) {
  973. //取消订单
  974. dialogVisible.value = true
  975. startTitle.value = '取消订单'
  976. } else if (start == 2) {
  977. //审核
  978. autdisReasonType.value = ''
  979. autdis.auditStatus = 'true'
  980. autdis.reason = ''
  981. autdis.reason1 = ''
  982. check.value = true
  983. } else if (start == 3) {
  984. //订单发货
  985. //数据内容赋值(先查详情)
  986. sizeForm.value = { orderInfoExt: {} }
  987. BaseService.postN('/iaw/issue/order/orderDetailQuery', { id: data.id }).then((res: any) => {
  988. if (res && res.code === 0) {
  989. const data = res.data.data
  990. cardIdDisabled.value = data.cardId ? true : false
  991. obuIdDisabled.value = data.obuId ? true : false
  992. sizeForm.value = Object.assign(sizeForm.value, data)
  993. sizeForm.value.courierCompany = ''
  994. sizeForm.value.trackingNumber = ''
  995. sizeForm.value.orderId = data.orderNo
  996. deliverGoods.value = true
  997. } else {
  998. ElMessage.error(res.message)
  999. }
  1000. })
  1001. } else if (start == 4) {
  1002. //退货
  1003. dialogVisible.value = true
  1004. startTitle.value = '退货'
  1005. } else if (start == 5) {
  1006. //换货
  1007. exchangeInformationDialog.value = true
  1008. } else if (start == 6) {
  1009. detailDialogTitle.value = '保证金详情'
  1010. BaseService.post('/managew/query/userdeposit', { orderId: data.orderId }).then((res: any) => {
  1011. if (res && res.statusCode === 0) {
  1012. earnestMoneyObj.value = res.data //渲详情数据
  1013. if (earnestMoneyObj.value) {
  1014. visible.value = true
  1015. } else {
  1016. ElMessage.error('没有查到数据')
  1017. }
  1018. } else {
  1019. ElMessage.error(res.message)
  1020. }
  1021. })
  1022. } else if (start == 7) {
  1023. // 申办记录
  1024. dialogVisible.value = true
  1025. startTitle.value = '申办记录'
  1026. biddingProcessLoading.value = true
  1027. getBiddingProcess(data)
  1028. } else if (start == 8) {
  1029. // 确认收货
  1030. ElMessageBox.confirm('确认收货吗?', '提示', {
  1031. confirmButtonText: '确认',
  1032. cancelButtonText: '取消',
  1033. type: 'warning',
  1034. })
  1035. .then(() => {
  1036. BaseService.post('6ffed187cf4c493cbe7772f6153b7eef', {
  1037. orderId: beanData.orderId,
  1038. orderStep: beanData.orderStep,
  1039. }).then((res: any) => {
  1040. dialogVisible.value = false
  1041. ElMessage.success(res.message)
  1042. getList()
  1043. })
  1044. })
  1045. .catch(() => { })
  1046. }
  1047. }
  1048. //
  1049. const biddingProcessLoading = ref(false)
  1050. const biddingProcessList: any = ref([])
  1051. function getBiddingProcess(row) {
  1052. biddingProcessList.value = []
  1053. BaseService.post('/managew/api/generalAudit/biddingprocess', {
  1054. orderId: row.orderId,
  1055. }).then((res: any) => {
  1056. if (res && res.statusCode === 0) {
  1057. biddingProcessLoading.value = false
  1058. biddingProcessList.value = res?.data ?? []
  1059. console.log(biddingProcessList.value, 'biddingProcessList.value')
  1060. } else {
  1061. biddingProcessLoading.value = false
  1062. }
  1063. }).catch(() => {
  1064. biddingProcessLoading.value = false
  1065. })
  1066. }
  1067. //审核(no) 取消订单(已完成)
  1068. let timer: any = null
  1069. function operation() {
  1070. if (timer) return
  1071. timer = setTimeout(() => {
  1072. let ifCode: string = '0'
  1073. let params: any = {
  1074. id: beanData.id,
  1075. orderId: beanData.orderId,
  1076. reason: content.value,
  1077. returnReason: content.value,
  1078. returnNetworkId: '52010106004',
  1079. orderSource: 'WEB',
  1080. returnNetworkName: '黔通智联自营网点',
  1081. examineRes: content.value, //换货申请原因
  1082. returnMode: 'OFFLINE', //线下
  1083. source: 'WEB',
  1084. opId: openId,
  1085. }
  1086. //取消订单
  1087. if (operationStart == 1) {
  1088. ifCode = '/iaw/issue/order/orderCancel'
  1089. startTitle.value = '取消订单'
  1090. } else if (operationStart == 4) {
  1091. //退货
  1092. ifCode = '/iaw/issue/order/refundGoodsApply'
  1093. } else {
  1094. timer = null
  1095. return
  1096. }
  1097. if (!content.value) {
  1098. ElMessage.error(startTitle.value + '原因不能为空!')
  1099. timer = null
  1100. return
  1101. }
  1102. BaseService.post(ifCode, params).then((res: any) => {
  1103. if (res && res.statusCode === 0) {
  1104. // //退货
  1105. // ElMessageBox.confirm('确认退货吗?', '提示', {
  1106. // confirmButtonText: '确认',
  1107. // cancelButtonText: '取消',
  1108. // type: 'warning',
  1109. // })
  1110. // .then(() => {
  1111. // BaseService.post(salesReturnAffirm, {
  1112. // id: beanData.id,
  1113. // opId: openId,
  1114. // }).then((res: any) => {
  1115. // dialogVisible.value = false
  1116. // ElMessage.success(res.message)
  1117. // getList()
  1118. // })
  1119. // })
  1120. // .catch(() => { })
  1121. dialogVisible.value = false
  1122. ElMessage.success(res.message)
  1123. getList()
  1124. } else {
  1125. crudRef.value.tableLoding = false
  1126. ElMessage.error(res.message)
  1127. }
  1128. })
  1129. timer = null
  1130. }, 1000)
  1131. }
  1132. function dateChange(time) {
  1133. if (time) {
  1134. time = moment(time).format('YYYY-MM-DDTHH:mm:ss')
  1135. }
  1136. return time
  1137. }
  1138. function getParams() {
  1139. let params: any = {
  1140. methods: 'page',
  1141. pageNo: field.value.paging.currentPage,
  1142. pageSize: field.value.paging.pageSize,
  1143. tabIndex: 0,
  1144. orderStep: orderStep.value,
  1145. opId: '54623263cb4d4a289dccbc983b22a4af',
  1146. source: 'WEB',
  1147. }
  1148. if (orderStatus.value) {
  1149. params.orderStatus = orderStatus.value
  1150. }
  1151. //赋值查询参数
  1152. let searchFormList = { ...searchForm.value }
  1153. for (let key in searchFormList) {
  1154. if (searchFormList[key]) {
  1155. params[key] = searchFormList[key]
  1156. }
  1157. }
  1158. if (params.time) {
  1159. params.startTime = dateChange(params.time[0])
  1160. params.endTime = dateChange(params.time[1])
  1161. }
  1162. return params
  1163. }
  1164. //获取列表
  1165. function getList() {
  1166. crudRef.value.tableLoding = true
  1167. BaseService.postN('/iaw/issue/order/queryPage', getParams()).then((res: any) => {
  1168. if (res && res.code === 0) {
  1169. //数据转换
  1170. let bizContent = res.data
  1171. let data = bizContent.data || []
  1172. console.log(data, 'data')
  1173. //数据渲染
  1174. tableData.value = data
  1175. crudRef.value.tableLoding = false
  1176. newOrderTypeList.value = ORDER_TYPE.value
  1177. //分页总数
  1178. field.value.paging.total = bizContent.totalCount
  1179. } else {
  1180. crudRef.value.tableLoding = false
  1181. ElMessage.error(res.message)
  1182. }
  1183. })
  1184. }
  1185. // 发货导出
  1186. function download() {
  1187. exportFn('/managew/api/order/deliverGoodsExport', getParams(), '发货信息')
  1188. }
  1189. // 发货导入
  1190. const upload = ref<UploadInstance>()
  1191. function onSuccess(response: any) {
  1192. const { ossFilePath, originalFileName } = response.data
  1193. const url = data.bucket + '/' + ossFilePath
  1194. console.log(ossFilePath, originalFileName)
  1195. BaseService.post('/managew/api/order/deliverGoodsImport', { path: url, }).then((res: any) => {
  1196. if (res && res.statusCode === 0) {
  1197. getList && getList();
  1198. console.log(res.bizContent, 'res')
  1199. const errUrl = JSON.parse(res.bizContent)?.url ?? ''
  1200. if (errUrl) {
  1201. ElMessage.error("导入失败,请查看下载到本地文件的具体错误信息");
  1202. BaseService.getDownload(
  1203. import.meta.env.VITE_APP_UPLOAD_URL + errUrl,
  1204. '错误信息文件'
  1205. )
  1206. } else {
  1207. ElMessage.success("导入成功");
  1208. }
  1209. } else {
  1210. ElMessage.error("导入失败," + res.message);
  1211. }
  1212. });
  1213. }
  1214. const handleExceed: UploadProps['onExceed'] = (files) => {
  1215. upload.value!.clearFiles()
  1216. const file = files[0] as UploadRawFile
  1217. file.uid = genFileId()
  1218. upload.value!.handleStart(file)
  1219. upload.value!.submit()
  1220. }
  1221. // 下载模板
  1222. const templateDownload = () => {
  1223. BaseService.getDownload(
  1224. import.meta.env.VITE_APP_UPLOAD_URL + 'default-bucket/发货信息.xlsx',
  1225. '发货信息录入模板'
  1226. )
  1227. }
  1228. //表单数据配置
  1229. let field = ref({
  1230. border: true, //是否添加边框(默认false)
  1231. searchShow: IsPermission(route, 'QUERY_BASE'), //搜索展示
  1232. crudShow: false, //是否显示添加功能等
  1233. paginStart: true, //是否显示分页查询
  1234. operateWidth: '250px', //操作栏宽度
  1235. operateFixed: true,
  1236. operateTitle: '操作', //操作栏标题(默认为"")
  1237. operate: {
  1238. edit: false, //是否编辑(默认true)
  1239. delete: false, //是否删除(默认true)
  1240. remark: false, // 详情
  1241. announcement: false, // 公告
  1242. forbidden: false, // 禁用
  1243. enable: false, // 启用
  1244. authorization: false, // 授权
  1245. cancel: false, // 取消订单
  1246. },
  1247. tableSize: -1,
  1248. isPageSizes: true,
  1249. pageLayout: 'total, sizes, prev, pager, next',
  1250. paging: {
  1251. pageSize: 10,
  1252. currentPage: 1,
  1253. total: 0,
  1254. },
  1255. extend: [
  1256. {
  1257. label: '序号',
  1258. type: 'index',
  1259. width: '80px',
  1260. },
  1261. ],
  1262. field: [
  1263. {
  1264. prop: 'orderId',
  1265. label: '单号',
  1266. },
  1267. {
  1268. prop: 'productName',
  1269. label: '产品名称',
  1270. },
  1271. {
  1272. prop: 'productType',
  1273. label: '产品类型',
  1274. listData: PRODUCT_TYPE
  1275. },
  1276. {
  1277. prop: 'promotionModes',
  1278. label: '办理方式',
  1279. listData: PATTERN_TYPE
  1280. },
  1281. {
  1282. prop: 'isValueCard',
  1283. label: '卡类型',
  1284. funRuleStarts: true,
  1285. funRule: (money: any) => {
  1286. //1-储值卡 2-记账卡
  1287. return money == '1' ? '储值卡' : '记账卡'
  1288. },
  1289. },
  1290. {
  1291. prop: 'type',
  1292. label: '车辆类型',
  1293. listData: vehicleTypes
  1294. },
  1295. {
  1296. prop: 'userType',
  1297. label: '用户类型', //PERSONAL_USER - 个人用户 UNIT_USER - 单位用户
  1298. funRuleStarts: true,
  1299. funRule: (money: any) => {
  1300. return money === 'PERSONAL_USER' ? '个人用户' : '单位用户'
  1301. },
  1302. },
  1303. {
  1304. prop: 'customerTel',
  1305. label: '手机号',
  1306. },
  1307. {
  1308. prop: 'customerIdtype',
  1309. label: '证件类型',
  1310. listData: CERTIFICATE_TYPE,
  1311. },
  1312. {
  1313. prop: 'cusotmerIdnum',
  1314. label: '证件号',
  1315. },
  1316. {
  1317. prop: 'vehiclePlate',
  1318. label: '车牌号',
  1319. },
  1320. {
  1321. prop: 'vehiclePlateColor',
  1322. label: '车牌颜色',
  1323. listData: VEHICLE_COLOR_TYPE
  1324. },
  1325. {
  1326. prop: 'cardId',
  1327. label: '卡号',
  1328. },
  1329. {
  1330. prop: 'obuId',
  1331. label: '签号',
  1332. },
  1333. {
  1334. prop: 'amount',
  1335. label: '订单金额',
  1336. funRuleStarts: true,
  1337. funRule: (money: any) => {
  1338. return !money || money === 0 ? '---' : money / 100 + ' 元'
  1339. },
  1340. },
  1341. {
  1342. prop: 'isMigrateData',
  1343. label: '系统来源',
  1344. funRuleStarts: true,
  1345. funRule: (isMigrateData: any) => {
  1346. return (isMigrateData == '0' ? '新系统订单' : '老系统订单')
  1347. },
  1348. },
  1349. {
  1350. prop: 'orderStatus', //1 - 已取消 0 - 正常
  1351. label: '订单状态',
  1352. listData: ORDER_STATUS
  1353. // funRuleStarts: true,
  1354. // funRule: (money: any) => {
  1355. // return money === '0' ? '正常' : '已取消'
  1356. // },
  1357. },
  1358. {
  1359. width: '180px',
  1360. prop: 'orderStep', //
  1361. label: '订单阶段',
  1362. funRuleStarts: true,
  1363. funRule: (money: any) => {
  1364. return getLabel(ORDER_STAGE_TYPE, money)
  1365. },
  1366. },
  1367. {
  1368. width: '180px',
  1369. prop: 'orderType', //
  1370. label: '订单类型',
  1371. funRuleStarts: true,
  1372. funRule: (money: any) => {
  1373. return getLabel(ORDER_TYPE, money)
  1374. },
  1375. },
  1376. {
  1377. prop: 'selfMark',
  1378. label: '是否自提',
  1379. funRuleStarts: true,
  1380. funRule: (money: any) => {
  1381. return money == '1' ? '是' : '否'
  1382. },
  1383. },
  1384. {
  1385. width: '180px',
  1386. prop: 'artificialStatus', //
  1387. label: '审核类型',
  1388. funRuleStarts: true,
  1389. funRule: (value: any) => {
  1390. return value == '1' ? '人工审核' : (value == '2' ? '系统审核' : '---')
  1391. },
  1392. },
  1393. {
  1394. width: '180px',
  1395. prop: 'auditPerson', //
  1396. label: '审核人',
  1397. },
  1398. {
  1399. width: '150px',
  1400. prop: 'insertTime',
  1401. label: '创建时间',
  1402. funRuleStarts: true,
  1403. funRule: (money: any) => {
  1404. return money ? money.replace('T', ' ') : '---'
  1405. },
  1406. },
  1407. ],
  1408. })
  1409. </script>
  1410. <style lang="scss" scoped>
  1411. .my-custom-class .el-dialog__wrapper {
  1412. overflow: hidden;
  1413. }
  1414. .my-custom-class .el-dialog__body::-webkit-scrollbar {
  1415. display: none;
  1416. }
  1417. .my-custom-class .el-dialog__body {
  1418. scrollbar-width: none;
  1419. /* Firefox */
  1420. -ms-overflow-style: none;
  1421. /* IE 10+ */
  1422. overflow: -moz-scrollbars-none;
  1423. /* Firefox */
  1424. }
  1425. ::v-deep .el-steps {
  1426. flex-flow: wrap;
  1427. overflow: hidden
  1428. }
  1429. ::v-deep .el-step.is-center .el-step__description {
  1430. padding-left: 10px;
  1431. padding-right: 10px;
  1432. }
  1433. ::v-deep .el-step.is-horizontal {
  1434. margin-bottom: 20px;
  1435. }
  1436. ::v-deep .el-step__title {
  1437. line-height: 25px;
  1438. }
  1439. // ::v-deep .el-dialog__headerbtn {
  1440. // position: fixed;
  1441. // top: 10px;
  1442. // right: 40px;
  1443. // z-index: 10;
  1444. // }
  1445. // ::v-deep .el-dialog__headerbtn .el-dialog__close {
  1446. // font-size: 30px;
  1447. // }
  1448. ::v-deep .el-step.is-horizontal {
  1449. // flex-basis: 20% !important;
  1450. // max-width: 20% !important
  1451. min-width: 20%;
  1452. }
  1453. </style>