mission.vue 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051
  1. <template>
  2. <el-tabs v-model="activeName" @tab-click="handleClick">
  3. <el-tab-pane label="订单管理" name="first">
  4. <div style="display: inline-block;">
  5. <div style="position: relative;display: inline-block;margin: 3px;">
  6. <span>状态:</span>
  7. <el-select v-model="status" style="width:150px;margin-left: 10px;" @change="animeDat2(status)">
  8. <el-option v-for="item in taskstates" :key="item.value" :label="item.label" :value="item.value"></el-option>
  9. </el-select>&nbsp;&nbsp;&nbsp;
  10. </div>
  11. <div style="position: relative;display: inline-block;margin: 3px;">
  12. <span>订单类型:</span>
  13. <el-select v-model="orderType" style="width:150px;margin-left: 10px;" @change="animeDat2(orderType)">
  14. <el-option v-for="item in orderTypes" :key="item.value" :label="item.label" :value="item.value"></el-option>
  15. </el-select>&nbsp;&nbsp;&nbsp;
  16. </div>
  17. <div style="position: relative;display: inline-block;margin: 3px;">
  18. <span>订单号:</span>
  19. <el-input style="width: 200px;" @keydown.enter.native="phoneSelect" placeholder="请输入订单号"
  20. v-model="orderNumber"></el-input>&nbsp;&nbsp;
  21. </div>
  22. <div style="position: relative;display: inline-block;margin: 3px;">
  23. <span>商铺名称:</span>
  24. <el-input style="width: 200px;" @keydown.enter.native="phoneSelect" placeholder="请输入商户名称" v-model="shopName">
  25. </el-input>&nbsp;&nbsp;
  26. </div>
  27. <div style="position: relative;display: inline-block;margin: 3px;">
  28. <span>手机号:</span>
  29. <el-input style="width: 200px;" @keydown.enter.native="phoneSelect" placeholder="请输入手机号" v-model="phone">
  30. </el-input>&nbsp;&nbsp;
  31. </div>
  32. <div style="position: relative;display: inline-block; margin: 3px;">
  33. <span>骑手电话:</span>
  34. <el-input style="width: 200px;" @keydown.enter.native="phoneSelect" placeholder="请输入骑手电话" v-model="riderPhone">
  35. </el-input>&nbsp;&nbsp;
  36. </div>
  37. <div style="position: relative;display: inline-block;margin: 3px;">
  38. <span>昵称:</span>
  39. <el-input style="width: 200px;" @keydown.enter.native="phoneSelect" placeholder="请输入昵称" v-model="userName">
  40. </el-input>&nbsp;&nbsp;
  41. </div>
  42. <el-button style="margin-left:15px;" size="mini" type="primary" icon="document" @click="phoneSelect">查询
  43. </el-button>
  44. <el-button style="margin-left:15px;" size="mini" type="primary" icon="document" @click="cleans2">重置</el-button>
  45. </div>
  46. <el-table v-loading="tableDataLoading" :data="tableData2.list">
  47. <el-table-column fixed prop="orderId" label="编号" width="80"></el-table-column>
  48. <el-table-column fixed prop="userName" label="下单用户">
  49. <template slot-scope="scope">
  50. <span style="color: #4f9dec;cursor: pointer;" @click="updates(scope.row.userId)">
  51. {{ scope.row.userName ? scope.row.userName : '未绑定' }}
  52. </span>
  53. </template>
  54. </el-table-column>
  55. <el-table-column fixed prop="userName" label="用户头像">
  56. <template slot-scope="scope">
  57. <img v-if="scope.row.avatar" :src="scope.row.avatar" width="60" height="60" />
  58. <span v-else>
  59. <img src="../../assets/img/avatar.png" width="60" height="60" />
  60. </span>
  61. </template>
  62. </el-table-column>
  63. <el-table-column prop="phone" label="手机号"></el-table-column>
  64. <el-table-column prop="shopName" label="商铺信息" width="300">
  65. <template slot-scope="scope">
  66. <div>店铺名称:{{scope.row.shopName}}</div>
  67. <div>店铺电话:{{scope.row.shopPhone}}</div>
  68. <div>店铺地址:{{scope.row.detailedAddress}}</div>
  69. </template>
  70. </el-table-column>
  71. <el-table-column prop="orderType" label="订单类型">
  72. <template slot-scope="scope">
  73. <div>{{scope.row.orderType==1?'到店取餐':'外卖配送'}}</div>
  74. </template>
  75. </el-table-column>
  76. <el-table-column prop="address" label="配送信息" width="300">
  77. <template slot-scope="scope">
  78. <div v-if="scope.row.orderType==2">
  79. <div>订餐人:{{scope.row.address.userName}}</div>
  80. <div>订餐人电话:{{scope.row.address.userPhone}}</div>
  81. <div>订餐地址:{{scope.row.address.address}}({{scope.row.address.addressDetail}})</div>
  82. </div>
  83. <div v-else style="text-align: center;width: 100%;"> - </div>
  84. </template>
  85. </el-table-column>
  86. <el-table-column prop="riderNickName" label="骑手昵称" width="120">
  87. <template slot-scope="scope">
  88. <div style="color: #4f9dec;cursor: pointer;" @click="updates(scope.row.riderUserId)">{{scope.row.riderNickName}}</div>
  89. </template>
  90. </el-table-column>
  91. <el-table-column prop="riderPhone" label="骑手电话" width="200"></el-table-column>
  92. <el-table-column prop="orderNumber" label="订单号" width="180"></el-table-column>
  93. <el-table-column prop="content" label="内容" width="300">
  94. <template slot-scope="scope">
  95. <div>
  96. <div v-for="(item,index) in scope.row.orderGoodsList" :key="index">
  97. <span>{{index+1}}.
  98. 商品名:{{item.goodsName}},</span><span>数量:{{item.goodsNum}},</span><span>规格:{{item.skuMessage}}</span>
  99. </div>
  100. </div>
  101. </template>
  102. </el-table-column>
  103. <el-table-column prop="goodsPriceZ" label="商品总价(元)" width="100">
  104. </el-table-column>
  105. <el-table-column prop="couponMoney" label="优惠金额(元)" width="100">
  106. <template slot-scope="scope">
  107. <div>
  108. <div>
  109. <span>{{scope.row.couponMoney?scope.row.couponMoney:'0'}}元</span>
  110. </div>
  111. </div>
  112. </template>
  113. </el-table-column>
  114. <el-table-column prop="packMoney" label="打包费(元/个 具体按照数量计算)" width="100">
  115. <template slot-scope="scope">
  116. <div>{{scope.row.packMoney}}元/个</div>
  117. </template>
  118. </el-table-column>
  119. <el-table-column prop="errandMoney" label="跑腿费(元)" width="100">
  120. <template slot-scope="scope">
  121. <div>{{scope.row.orderType==1?'0':scope.row.errandMoney}}元</div>
  122. </template>
  123. </el-table-column>
  124. <el-table-column prop="payMoney" label="支付金额(元)" width="100">
  125. </el-table-column>
  126. <el-table-column prop="remark" label="订单备注" width="150">
  127. </el-table-column>
  128. <el-table-column prop="payTime" label="支付时间"></el-table-column>
  129. <el-table-column prop="payType" label="支付方式" width="100">
  130. <template slot-scope="scope">
  131. <span v-if="scope.row.payType === 1 ">微信</span>
  132. <span v-if="scope.row.payType === 2 ">余额</span>
  133. <span v-if="scope.row.payType === 3 ">其他</span>
  134. </template>
  135. </el-table-column>
  136. <el-table-column prop="orderCode" label="取餐号" width="100"></el-table-column>
  137. <el-table-column fixed="right" prop="status" label="状态" width="100">
  138. <template slot-scope="scope">
  139. <span style="color: #4f9dec;" v-if="scope.row.status === 0 ">待结算</span>
  140. <span style="color: #4f9dec;" v-if="scope.row.status === 1 || scope.row.status === 2 ">待支付</span>
  141. <span style="color: #4f9dec;" v-if="scope.row.status === 3 ">
  142. {{scope.row.orderType==1?'待取餐':'待配送'}}
  143. </span>
  144. <span style="color: #4f9dec;" v-if="scope.row.status === 4 ">已完成</span>
  145. <span style="color: #999;" v-if="scope.row.status === 5 ">已取消</span>
  146. <span style="color: #999;" v-if="scope.row.status === 6 ">制作中</span>
  147. <span style="color: #999;" v-if="scope.row.status === 7 ">商家待接单</span>
  148. <span style="color: #999;" v-if="scope.row.status === 8 ">商家已拒单</span>
  149. </template>
  150. </el-table-column>
  151. <el-table-column fixed="right" prop="status" label="操作" width="250">
  152. <template slot-scope="scope">
  153. <el-button size="mini" type="primary" v-if="scope.row.status === 6 " :disabled="!isAuth('mission:qucan')"
  154. @click="wancheng(scope.row)">制作已完成</el-button>
  155. <el-button size="mini" type="danger" :disabled="!isAuth('mission:tuikuan')" style="margin: 10px;"
  156. v-if="scope.row.status === 3 || scope.row.status === 6|| scope.row.status === 7"
  157. @click="tuikuan(scope.row)">退款</el-button>
  158. <el-button size="mini" type="primary" v-if="scope.row.status === 3 " :disabled="!isAuth('mission:qucan')"
  159. @click="wancheng(scope.row)" style="margin: 5px 0;">{{scope.row.orderType==1?'餐品已完成':'餐品已完成'}}
  160. </el-button>
  161. <el-button size="mini" type="primary" v-if="scope.row.status == 3 ||scope.row.status === 4 || scope.row.status === 6"
  162. :disabled="!isAuth('mission:qucan')" @click="dayin(scope.row)" style="margin: 3px;">打印小票</el-button>
  163. <el-button size="mini" type="primary" @click="complainDetails(scope.row)" style="margin: 3px;">聊天内容
  164. </el-button>
  165. </template>
  166. </el-table-column>
  167. </el-table>
  168. <div style="color: #B94A48;font-size: 20px;margin-top: 10px;" v-if="totalMoney">本页累计交易统计:{{totalMoney}}元</div>
  169. <div style="text-align: center;margin-top: 10px;">
  170. <el-pagination @size-change="handleSizeChange3" @current-change="handleCurrentChange3"
  171. :page-sizes="[10, 20, 30, 40]" :page-size="limit" :current-page="page" layout="total,sizes, prev, pager, next"
  172. :total="tableData2.totalCount">
  173. </el-pagination>
  174. </div>
  175. </el-tab-pane>
  176. <!-- 任务拒绝弹框 -->
  177. <el-dialog title="任务拒绝" :visible.sync="dialogFormVisible7" center>
  178. <div style="margin-bottom: 10px;">
  179. <span style="width: 200px;display: inline-block;text-align: right;">拒绝理由:</span>
  180. <el-input style="width:50%;" v-model="content" type="text" placeholder="请输入拒绝理由"></el-input>
  181. </div>
  182. <div slot="footer" class="dialog-footer">
  183. <el-button @click="dialogFormVisible7 = false">取 消</el-button>
  184. <el-button type="primary" @click="refuseto()">确 定</el-button>
  185. </div>
  186. </el-dialog>
  187. <!-- 图片展示-->
  188. <el-dialog title="图片" :visible.sync="dialogVisible" width="35%" :before-close="handleClose">
  189. <span v-if="imageUrl.length>0" v-for="(item, index) in imageUrl" :key="index" style="width: 100px;
  190. height: 100px;display:inline-block;">
  191. <!-- <el-image style = "width: 100px; height: 100px" :src = "item" :preview-src-list="imageUrl"></el-image>-->
  192. <img :src="item" alt="" style="width: 100px; height: 100px">
  193. </span>
  194. <span v-else>暂无图片</span>
  195. </el-dialog>
  196. <!-- 聊天内容 -->
  197. <el-dialog title="聊天内容" :visible.sync="dialogFormVisible" center>
  198. <!-- <div style="margin:2% 0;display: inline-block;">
  199. <span>内容:</span>
  200. <el-input style="width: 150px;" @keydown.enter.native="select1" clearable placeholder="请输入聊天内容"
  201. v-model="content">
  202. </el-input>
  203. </div>
  204. <div style="display: inline-block;">
  205. <el-button style='margin-left:15px;' size="mini" type="primary" icon="document" @click="select1">查询</el-button>
  206. <el-button style='margin-left:15px;' size="mini" type="primary" icon="document" @click="cleans1">重置</el-button>
  207. </div> -->
  208. <el-table v-loading="tableDataLoading1" :data="userData.list">
  209. <el-table-column prop="chatContentId" label="编号" width="80">
  210. </el-table-column>
  211. <el-table-column prop="userName" label="用户昵称">
  212. <template slot-scope="scope">
  213. <div v-if="scope.row.shopId" >
  214. {{ scope.row.shopName}}
  215. </div>
  216. <div v-else style="color: #4f9dec;cursor: pointer;" @click="details(scope.row)">
  217. {{scope.row.userName ? scope.row.userName : scope.row.riderName}}
  218. </div>
  219. </template>
  220. </el-table-column>
  221. <el-table-column prop="title" label="用户头像">
  222. <template slot-scope="scope">
  223. <!-- <div v-if="scope.row.avatar == null || scope.row.avatar == ''">
  224. 暂无图片
  225. </div> -->
  226. <div >
  227. <el-popover placement="top-start" title="" trigger="hover">
  228. <img style="width: 50px; height: 50px" :src="scope.row.shopCover?scope.row.shopCover:scope.row.riderAvatar?scope.row.riderAvatar:scope.row.userAvatar" alt="" slot="reference">
  229. <img style="width: 200px; height: 200px" :src="scope.row.shopCover?scope.row.shopCover:scope.row.riderAvatar?scope.row.riderAvatar:scope.row.userAvatar" alt="">
  230. </el-popover>
  231. </div>
  232. </template>
  233. </el-table-column>
  234. <el-table-column prop="content" label="信息内容" width="280">
  235. <template slot-scope="scope">
  236. <div v-if="scope.row.messageType==1">{{scope.row.content}}</div>
  237. <div v-if="scope.row.messageType==2">
  238. <el-popover placement="top-start" title="" trigger="hover">
  239. <img style="width: 50px; height: 50px" :src="scope.row.content" alt="" slot="reference">
  240. <img style="width: 200px; height: 200px" :src="scope.row.content" alt="">
  241. </el-popover>
  242. </div>
  243. <div v-if="scope.row.messageType==3">
  244. <audio :src="scope.row.content" type="audio/wav" controls="controls"></audio>
  245. </div>
  246. <div v-if="scope.row.messageType==4">
  247. <el-popover placement="top-start" title="" trigger="hover">
  248. <img style="width: 50px; height: 50px"
  249. :src="'https://www.daweilinli.com/emoji/'+scope.row.content" alt="" slot="reference">
  250. <img style="width: 200px; height: 200px"
  251. :src="'https://www.daweilinli.com/emoji/'+scope.row.content" alt="">
  252. </el-popover>
  253. </div>
  254. <!-- <div v-if="scope.row.messageType==4">
  255. <el-popover placement="top-start" title="" trigger="hover">
  256. <img style="width: 50px; height: 50px" :src="'https://www.daweilinli.com/emoji/'+scope.row.content" alt="" slot="reference">
  257. <img style="width: 200px; height: 200px" :src="'https://www.daweilinli.com/emoji/'+scope.row.content" alt="">
  258. </el-popover>
  259. </div> -->
  260. </template>
  261. </el-table-column>
  262. <el-table-column prop="createTime" label="创建时间" width="150">
  263. </el-table-column>
  264. <el-table-column prop="createTime" label="操作" width="100" fixed="right">
  265. <template slot-scope="scope">
  266. <el-button size="mini" type="danger" :disabled="!isAuth('userList:delete')" @click="deleteuser(scope.row)">
  267. 删除</el-button>
  268. </template>
  269. </el-table-column>
  270. </el-table>
  271. <div style="text-align: center;margin-top: 10px;">
  272. <el-pagination @size-change="handleSizeChange1" @current-change="handleCurrentChange1"
  273. :page-sizes="[10, 20, 30, 50, 100]" :page-size="limit1" :current-page="page1"
  274. layout="total,sizes, prev, pager, next" :total="userData.totalCount">
  275. </el-pagination>
  276. </div>
  277. </el-dialog>
  278. </el-tabs>
  279. </template>
  280. <script>
  281. export default {
  282. data() {
  283. return {
  284. dialogVisible: false,
  285. imageUrl: [],
  286. limit: 10,
  287. page: 1,
  288. totalMoney: 0,
  289. phone: '',
  290. userName: '',
  291. orderNumber: '',
  292. status: '',
  293. describes: '',
  294. token: '',
  295. taskNum: '',
  296. taskMoney: '',
  297. statesnum: [{
  298. label: '全部',
  299. value: 0
  300. },
  301. {
  302. label: '待接单',
  303. value: 2
  304. },
  305. {
  306. label: '制作中',
  307. value: 6
  308. },
  309. {
  310. label: '待送达',
  311. value: 3
  312. },
  313. {
  314. label: '已完成',
  315. value: 4
  316. },
  317. {
  318. label: '已下架',
  319. value: 5
  320. },
  321. ],
  322. taskstates: [{
  323. label: '全部',
  324. value: ''
  325. },
  326. {
  327. label: '待结算',
  328. value: 0
  329. },
  330. {
  331. label: '待支付',
  332. value: 1
  333. },
  334. {
  335. label: '商家待接单',
  336. value: 7
  337. },
  338. {
  339. label: '制作中',
  340. value: 6
  341. },
  342. {
  343. label: '待取餐/待配送', //待取餐、派送中
  344. value: 3
  345. },
  346. {
  347. label: '已完成',
  348. value: 4
  349. },
  350. {
  351. label: '已取消',
  352. value: 5
  353. },
  354. {
  355. label: '商家已拒单',
  356. value: 8
  357. }
  358. ],
  359. orderType: '',
  360. orderTypes: [{
  361. label: '全部',
  362. value: ''
  363. },
  364. {
  365. label: '到店取餐',
  366. value: 1
  367. },
  368. {
  369. label: '外卖配送',
  370. value: 2
  371. },
  372. ],
  373. shopId: '',
  374. shopName: '',
  375. shopList: '',
  376. sort: 10,
  377. id: '',
  378. btnChangeEnable: true,
  379. helpTakeId: '',
  380. helpMaintainId: '',
  381. content: '',
  382. classifyIcon: '',
  383. classifyId: '',
  384. classifyUrl: '',
  385. classifyName: '',
  386. classifyDeatilsName: '',
  387. formLabelWidth: '200px',
  388. activeName: 'first',
  389. tableDataLoading: false,
  390. tableDataLoading1:false,
  391. dialogFormVisible: false,
  392. dialogFormVisible1: false,
  393. dialogFormVisible2: false,
  394. dialogFormVisible3: false,
  395. dialogFormVisible4: false,
  396. dialogFormVisible5: false,
  397. dialogFormVisible6: false,
  398. dialogFormVisible7: false,
  399. dialogFormVisible8: false,
  400. tableData: [],
  401. tableData2: {},
  402. form: {
  403. id: '',
  404. classifyName: '',
  405. classifyUrl: '',
  406. classifyIcon: '',
  407. describes: ''
  408. },
  409. form2: {
  410. id: '',
  411. classifyDeatilsName: '',
  412. classifyUrl: '',
  413. classifyIcon: '',
  414. taskNum: '',
  415. taskMoney: '',
  416. },
  417. protectjieData: [],
  418. protectpaiData: [],
  419. helpTaskData: [],
  420. safeguardData: [],
  421. classifyData: [],
  422. checkBoxData: [], //多选框选择的值
  423. checkBoxData2: [], //多选框选择的值
  424. chatConversationId: '',
  425. userData: {},
  426. limit1: 10,
  427. page1: 1,
  428. riderPhone:'',
  429. }
  430. },
  431. methods: {
  432. // 详情跳转
  433. updates(userId) {
  434. this.$router.push({
  435. path: '/userDetail',
  436. query: {
  437. userId: userId
  438. }
  439. })
  440. },
  441. // 详情跳转
  442. details(row) {
  443. if (!row.shopId) {
  444. }
  445. let userId = row.userId ? row.userId : row.riderId
  446. this.$router.push({
  447. path: '/userDetail',
  448. query: {
  449. userId: userId
  450. }
  451. })
  452. },
  453. // 图标上传一级分类
  454. handleAvatarSuccess(file) {
  455. this.classifyIcon = file.data
  456. },
  457. // 图标上传一级分类编辑
  458. handleAvatarSuccess2(file) {
  459. this.form.classifyIcon = file.data
  460. },
  461. // 多选
  462. changeFun(val) {
  463. this.checkBoxData = val
  464. },
  465. // 多选
  466. changeFun2(val) {
  467. this.checkBoxData2 = val
  468. },
  469. handleSizeChange(val) {
  470. this.limit = val
  471. this.dataSelect()
  472. },
  473. handleCurrentChange(val) {
  474. this.page = val
  475. this.dataSelect()
  476. },
  477. handleSizeChange2(val) {
  478. this.limit = val
  479. this.classifySelect()
  480. },
  481. handleCurrentChange2(val) {
  482. this.page = val
  483. this.classifySelect()
  484. },
  485. handleSizeChange3(val) {
  486. this.limit = val
  487. this.taskdataSelect()
  488. },
  489. handleCurrentChange3(val) {
  490. this.page = val
  491. this.taskdataSelect()
  492. },
  493. handleSizeChange1(val) {
  494. this.limit1 = val;
  495. this.neirongSelect(this.chatConversationId)
  496. },
  497. handleCurrentChange1(val) {
  498. this.page1 = val;
  499. this.neirongSelect(this.chatConversationId)
  500. },
  501. // tabs切换
  502. handleClick(tab, event) {
  503. if (tab._props.label == '订单管理') {
  504. this.page = 1
  505. this.limit = 10
  506. this.taskdataSelect()
  507. }
  508. },
  509. // 下架
  510. soldClick(row) {
  511. this.$confirm(`确定要下架此任务?`, '提示', {
  512. confirmButtonText: '确定',
  513. cancelButtonText: '取消',
  514. type: 'warning'
  515. }).then(() => {
  516. this.$http({
  517. url: this.$http.adornUrl(`help/outHelpOrder/?helpOrderId=${row.id}`),
  518. method: 'post',
  519. data: this.$http.adornData({})
  520. }).then(({
  521. data
  522. }) => {
  523. if (data.code == 0) {
  524. this.$message({
  525. message: '操作成功',
  526. type: 'success',
  527. duration: 1500,
  528. onClose: () => {
  529. this.dataSelect()
  530. }
  531. })
  532. } else {
  533. this.$message({
  534. message: data.msg,
  535. type: 'error',
  536. duration: 1500,
  537. onClose: () => {
  538. this.dataSelect()
  539. }
  540. })
  541. }
  542. })
  543. }).catch(() => {})
  544. },
  545. //查看照片
  546. refund(e) {
  547. this.imageUrl = []
  548. if (e.image != null) {
  549. let img = e.image.split(',')
  550. if (img.length != 0) {
  551. this.imageUrl = img
  552. }
  553. }
  554. this.dialogVisible = true
  555. },
  556. handleClose(done) {
  557. // this.$confirm('确认关闭?')
  558. // .then(_ => {
  559. done()
  560. // })
  561. // .catch(_ => {});
  562. },
  563. // 添加一级分类弹框
  564. classifyStair() {
  565. this.dialogFormVisible = true
  566. },
  567. // 添加一级分类确定
  568. StairNoticeTo() {
  569. if (this.classifyName == '') {
  570. this.$notify({
  571. title: '提示',
  572. duration: 1800,
  573. message: '请输入分类名称',
  574. type: 'warning'
  575. })
  576. return
  577. }
  578. // if (this.classifyUrl == '') {
  579. // this.$notify({
  580. // title: '提示',
  581. // duration: 1800,
  582. // message: '请输入分类链接',
  583. // type: 'warning'
  584. // });
  585. // return
  586. // }
  587. if (this.describes == '') {
  588. this.$notify({
  589. title: '提示',
  590. duration: 1800,
  591. message: '请输入分类描述',
  592. type: 'warning'
  593. })
  594. return
  595. }
  596. if (this.classifyIcon == '') {
  597. this.$notify({
  598. title: '提示',
  599. duration: 1800,
  600. message: '请上传分类图标',
  601. type: 'warning'
  602. })
  603. return
  604. }
  605. this.$http({
  606. url: this.$http.adornUrl('helpClassify/saveHelpClassify'),
  607. method: 'post',
  608. data: this.$http.adornData({
  609. 'classifyName': this.classifyName,
  610. 'state': this.state,
  611. 'sort': this.sort,
  612. 'classifyIcon': this.classifyIcon,
  613. 'classifyUrl': this.classifyUrl,
  614. 'describes': this.describes
  615. })
  616. }).then(({
  617. data
  618. }) => {
  619. this.dialogFormVisible = false
  620. this.$message({
  621. message: '一级分类添加成功',
  622. type: 'success',
  623. duration: 1500,
  624. onClose: () => {
  625. this.classifyUrl = ''
  626. this.classifyName = ''
  627. this.classifyIcon = ''
  628. this.describes = ''
  629. this.classifySelect()
  630. }
  631. })
  632. })
  633. },
  634. // 修改一级分类
  635. compile(index, rows) {
  636. this.dialogFormVisible2 = true
  637. this.form.id = rows.id
  638. this.form.classifyName = rows.classifyName
  639. this.form.classifyUrl = rows.classifyUrl
  640. this.form.classifyIcon = rows.classifyIcon
  641. this.form.describes = rows.describes
  642. },
  643. // 修改一级分类确定
  644. CompileNoticeTo() {
  645. if (this.form.classifyName == '') {
  646. this.$notify({
  647. title: '提示',
  648. duration: 1800,
  649. message: '请输入分类名称',
  650. type: 'warning'
  651. })
  652. return
  653. }
  654. if (this.form.describes == '') {
  655. this.$notify({
  656. title: '提示',
  657. duration: 1800,
  658. message: '请输入分类描述',
  659. type: 'warning'
  660. })
  661. return
  662. }
  663. if (this.form.classifyIcon == '') {
  664. this.$notify({
  665. title: '提示',
  666. duration: 1800,
  667. message: '请上传分类图标',
  668. type: 'warning'
  669. })
  670. return
  671. }
  672. this.$http({
  673. url: this.$http.adornUrl('helpClassify/updateHelpClassify'),
  674. method: 'post',
  675. data: this.$http.adornData({
  676. 'id': this.form.id,
  677. 'classifyName': this.form.classifyName,
  678. 'classifyUrl': this.form.classifyUrl,
  679. 'classifyIcon': this.form.classifyIcon,
  680. 'describes': this.form.describes
  681. })
  682. }).then(({
  683. data
  684. }) => {
  685. this.dialogFormVisible2 = false
  686. this.$message({
  687. message: '操作成功',
  688. type: 'success',
  689. duration: 1500,
  690. onClose: () => {
  691. this.classifySelect()
  692. }
  693. })
  694. })
  695. },
  696. //删除一级
  697. deleteStair(row) {
  698. let delid = row.id
  699. this.$confirm(`确定删除此条信息?`, '提示', {
  700. confirmButtonText: '确定',
  701. cancelButtonText: '取消',
  702. type: 'warning'
  703. }).then(() => {
  704. this.$http({
  705. url: this.$http.adornUrl(`helpClassify/deleteClassifyById/?id=${delid}`),
  706. method: 'post',
  707. data: this.$http.adornData({})
  708. }).then(({
  709. data
  710. }) => {
  711. this.$message({
  712. message: '删除成功',
  713. type: 'success',
  714. duration: 1500,
  715. onClose: () => {
  716. this.name = ''
  717. this.classifySelect()
  718. }
  719. })
  720. })
  721. }).catch(() => {})
  722. },
  723. // 手机号搜索
  724. phoneSelect() {
  725. this.page = 1
  726. this.limit = 10
  727. this.taskdataSelect()
  728. },
  729. // 重置
  730. cleans2() {
  731. this.page = 1
  732. this.phone = ''
  733. this.riderPhone = ''
  734. this.userName = ''
  735. this.orderNumber = ''
  736. this.status = ''
  737. this.shopName = ''
  738. this.orderType = ''
  739. this.taskdataSelect()
  740. },
  741. // 查询
  742. select() {
  743. this.page = 1
  744. this.limit = 10
  745. this.dataSelect()
  746. },
  747. // 重置
  748. cleans() {
  749. this.phone = ''
  750. this.status = 0
  751. this.content = ''
  752. this.dataSelect()
  753. },
  754. // select选择事件
  755. animeDat(state) {
  756. this.dataSelect()
  757. },
  758. animeDat2(state) {
  759. this.page = 1
  760. this.taskdataSelect()
  761. },
  762. // 获取派单数据列表
  763. dataSelect() {
  764. this.tableDataLoading = true
  765. this.$http({
  766. url: this.$http.adornUrl('help/selectStatusHelpOrder'),
  767. method: 'get',
  768. params: this.$http.adornParams({
  769. 'page': this.page,
  770. 'limit': this.limit,
  771. 'phone': this.phone,
  772. 'status': this.status,
  773. 'content': this.content
  774. })
  775. }).then(({
  776. data
  777. }) => {
  778. this.tableDataLoading = false
  779. let returnData = data.data
  780. this.tableData = returnData
  781. })
  782. },
  783. // 获取接单数据列表
  784. taskdataSelect() {
  785. this.totalMoney = 0
  786. this.tableDataLoading = true
  787. this.$http({
  788. url: this.$http.adornUrl('admin/order/selectAllOrderAdmin'),
  789. method: 'get',
  790. params: this.$http.adornParams({
  791. 'page': this.page,
  792. 'limit': this.limit,
  793. 'phone': this.phone,
  794. 'userName': this.userName,
  795. 'orderNumber': this.orderNumber,
  796. 'status': this.status,
  797. 'shopName': this.shopName,
  798. 'orderType': this.orderType,
  799. 'riderPhone':this.riderPhone
  800. })
  801. }).then(({
  802. data
  803. }) => {
  804. this.tableDataLoading = false
  805. let returnData = data.data
  806. this.tableData2 = returnData
  807. for (var i in this.tableData2.list) {
  808. this.tableData2.list[i].goodsPriceZ = 0
  809. this.totalMoney = this.totalMoney + this.tableData2.list[i].payMoney
  810. if (this.tableData2.list[i].address) {
  811. this.tableData2.list[i].address = JSON.parse(this.tableData2.list[i].address)
  812. }
  813. for (var j in this.tableData2.list[i].orderGoodsList) {
  814. this.tableData2.list[i].orderGoodsList[j].goodsPriceZ = (this.tableData2.list[i].orderGoodsList[j]
  815. .goodsPrice * this.tableData2.list[i].orderGoodsList[j].goodsNum)
  816. this.tableData2.list[i].goodsPriceZ = this.tableData2.list[i].goodsPriceZ + this.tableData2.list[i]
  817. .orderGoodsList[j].goodsPriceZ
  818. }
  819. }
  820. this.totalMoney = this.totalMoney.toFixed(2)
  821. })
  822. },
  823. // 商铺列表
  824. classifySelect() {
  825. this.tableDataLoading = true
  826. this.$http({
  827. url: this.$http.adornUrl('admin/goods/selectAllShopList'),
  828. method: 'get',
  829. params: this.$http.adornParams({})
  830. }).then(({
  831. data
  832. }) => {
  833. this.tableDataLoading = false
  834. let returnData = data.data
  835. this.shopList = returnData
  836. })
  837. },
  838. // 餐品完成
  839. wancheng(row) {
  840. if (row.status == 3) {
  841. var status1 = 4
  842. }
  843. if (row.status == 6) {
  844. var status1 = 3
  845. }
  846. this.$http({
  847. url: this.$http.adornUrl('admin/order/updateOrder'),
  848. method: 'post',
  849. data: this.$http.adornData({
  850. 'status': status1,
  851. 'orderId': row.orderId,
  852. 'orderNumber': row.orderNumber
  853. })
  854. }).then(({
  855. data
  856. }) => {
  857. if (data.code == 0) {
  858. this.$message({
  859. message: '操作成功',
  860. type: 'success',
  861. duration: 1500,
  862. onClose: () => {
  863. this.taskdataSelect()
  864. }
  865. })
  866. } else {
  867. this.$message({
  868. message: data.msg,
  869. type: 'warning',
  870. duration: 1500,
  871. onClose: () => {}
  872. })
  873. }
  874. })
  875. },
  876. // 退款
  877. tuikuan(row) {
  878. console.log('退款')
  879. this.$confirm(`确定要退款?`, '提示', {
  880. confirmButtonText: '确定',
  881. cancelButtonText: '取消',
  882. type: 'warning'
  883. }).then(() => {
  884. console.log('取定')
  885. this.$http({
  886. url: this.$http.adornUrl('admin/order/adminCancelOrder'),
  887. method: 'post',
  888. params: this.$http.adornParams({
  889. 'orderId': row.orderId
  890. })
  891. }).then(({
  892. data
  893. }) => {
  894. if (data.code == 0) {
  895. this.$message({
  896. message: '操作成功',
  897. type: 'success',
  898. duration: 1500,
  899. onClose: () => {
  900. this.taskdataSelect()
  901. }
  902. })
  903. } else {
  904. this.$message({
  905. message: data.msg,
  906. type: 'error',
  907. duration: 1500,
  908. onClose: () => {}
  909. })
  910. }
  911. })
  912. }).catch(() => {
  913. console.log('取消')
  914. })
  915. },
  916. // 打印小票
  917. dayin(row) {
  918. this.$http({
  919. url: this.$http.adornUrl('admin/order/print'),
  920. method: 'post',
  921. params: this.$http.adornParams({
  922. 'orderId': row.orderId
  923. })
  924. }).then(({
  925. data
  926. }) => {
  927. if (data.code == 0) {
  928. this.$message({
  929. message: '操作成功',
  930. type: 'success',
  931. duration: 1500,
  932. onClose: () => {
  933. this.taskdataSelect()
  934. }
  935. })
  936. } else {
  937. this.$message({
  938. message: data.msg,
  939. type: 'warning',
  940. duration: 1500,
  941. onClose: () => {}
  942. })
  943. }
  944. })
  945. },
  946. // 聊天内容
  947. complainDetails(row) {
  948. this.chatConversationId = row.orderId
  949. this.neirongSelect(this.chatConversationId)
  950. this.dialogFormVisible = true
  951. },
  952. select1() {
  953. this.page1 = 1
  954. this.neirongSelect(this.chatConversationId)
  955. },
  956. // 重置
  957. cleans1() {
  958. this.content = ''
  959. this.page1 = 1
  960. this.neirongSelect(this.chatConversationId)
  961. },
  962. // 获取聊天内容列表
  963. neirongSelect(chatConversationId) {
  964. this.tableDataLoading1 = true
  965. this.$http({
  966. url: this.$http.adornUrl('shop/ordersChat/selectGameChatDetails'),
  967. method: 'get',
  968. params: this.$http.adornParams({
  969. 'page': this.page1,
  970. 'limit': this.limit1,
  971. 'ordersId': this.chatConversationId,
  972. 'content': this.content
  973. })
  974. }).then(({
  975. data
  976. }) => {
  977. this.tableDataLoading1 = false
  978. let returnData = data.data;
  979. this.userData = returnData
  980. })
  981. },
  982. //删除聊天
  983. deleteuser(row) {
  984. // let delid = row.userId
  985. this.$confirm(`确定删除此条信息?`, '提示', {
  986. confirmButtonText: '确定',
  987. cancelButtonText: '取消',
  988. type: 'warning'
  989. }).then(() => {
  990. this.$http({
  991. url: this.$http.adornUrl('shop/ordersChat/deleteOrdersChat?chatContentId=' + row.chatContentId),
  992. method: 'post',
  993. params: this.$http.adornParams({})
  994. }).then(({
  995. data
  996. }) => {
  997. if (data.code == 0) {
  998. this.$message({
  999. message: '删除成功',
  1000. type: 'success',
  1001. duration: 1500,
  1002. onClose: () => {
  1003. this.neirongSelect(this.chatConversationId)
  1004. }
  1005. })
  1006. } else {
  1007. this.$message({
  1008. message: data.msg,
  1009. type: 'warning',
  1010. duration: 1500,
  1011. onClose: () => {}
  1012. })
  1013. }
  1014. })
  1015. })
  1016. },
  1017. },
  1018. mounted() {
  1019. this.classifySelect()
  1020. this.taskdataSelect()
  1021. }
  1022. }
  1023. </script>
  1024. <style>
  1025. </style>