info.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922
  1. <template>
  2. <view class="app-content">
  3. <view v-if="!$util.isEmpty(detailInfo)" class="info-content_box">
  4. <view class="title"> 供货商 </view>
  5. <view class="address-des_bx content-box">
  6. <view>
  7. <view> {{ detailInfo.supplierName }} {{ detailInfo.supplierMobile }} </view>
  8. <view class="">
  9. {{ detailInfo.supplierAddress}}
  10. </view>
  11. </view>
  12. <view>
  13. <i @click="callUp(detailInfo.supplierMobile)" class="iconfont icondianhua1" ></i>
  14. </view>
  15. </view>
  16. <view class="title">
  17. <text>单据信息</text>
  18. </view>
  19. <view class="bills-info_box content-box">
  20. <view class="order-info_box">
  21. <view>订单日期:</view>
  22. <view>{{ detailInfo.addTime?detailInfo.addTime.substr(2,14):'' }}</view>
  23. </view>
  24. <view class="order-info_box">
  25. <view>入库日期:</view>
  26. <view>
  27. <text v-if="detailInfo.status==4">{{ detailInfo.entryTime?detailInfo.entryTime.substr(2,14):'' }}</text>
  28. <text v-else>待入库</text>
  29. </view>
  30. <view class="price">
  31. <button @click="openPicker" class="admin-button-com default" >修改</button>
  32. </view>
  33. </view>
  34. <view class="order-info_box">
  35. <view>采购人员:</view>
  36. <view>{{ detailInfo.cgStaffName }}</view>
  37. </view>
  38. <view class="order-info_box">
  39. <view>录入人员:</view>
  40. <view>{{ detailInfo.adminName }}</view>
  41. </view>
  42. <view class="order-info_box">
  43. <view>订单编码:</view>
  44. <view>{{ detailInfo.orderSn }}</view>
  45. <view class="price">
  46. <button @click="copy(detailInfo.orderSn)" class="admin-button-com default" > 复制 </button>
  47. </view>
  48. </view>
  49. <view class="order-info_box">
  50. <view>核销编码:</view>
  51. <view>{{ detailInfo.checkCode }}</view>
  52. </view>
  53. <view class="order-info_box">
  54. <view>入库状态:</view>
  55. <view>{{ detailInfo.status==1?'待确认' :detailInfo.status==2?'待发货' :detailInfo.status==3?'待入库' :detailInfo.status==4?'已入库' :'已取消' }}</view>
  56. </view>
  57. <view v-if="detailInfo.refund == 2" class="order-info_box">
  58. <view style="color:red;font-weight:bold;">累计退款:</view>
  59. <view style="color:red;font-weight:bold;font-size:30upx;">¥{{detailInfo.tkPrice?parseFloat(detailInfo.tkPrice):0}}</view>
  60. <view class="price" v-if="detailInfo.refund==2">
  61. <text @click="pageTo({url: '/pagesPurchase/refundList',query: {orderSn: detailInfo.orderSn}})" style="font-weight:normal;color:#3385FF;">售后记录</text>
  62. </view>
  63. </view>
  64. </view>
  65. <view class="bills-info_box content-box" style="margin-top:18upx;">
  66. <view class="order-info_box" v-if="detailInfo.debt == 1">
  67. <view>订单状态:</view>
  68. <view style="color:red;font-weight:bold;">挂账</view>
  69. <view class="price">
  70. <text @click="goToClear(detailInfo)" style="font-weight:normal;color:#3385FF;">全部挂账</text>
  71. </view>
  72. </view>
  73. <view class="order-info_box" v-else>
  74. <view>订单状态:</view>
  75. <view v-if="detailInfo.clearId > 0">已结清</view>
  76. <view class="price" v-if="detailInfo.clearId > 0">
  77. <button @click="pageTo({url: '/admin/clear/info',query: {id: detailInfo.clearId}})" class="admin-button-com">查看结账单</button>
  78. </view>
  79. <view v-if="detailInfo.clearId == 0"></view>
  80. </view>
  81. </view>
  82. <view class="title">
  83. 商品信息
  84. <block v-if="!$util.isEmpty(getLoginInfo.admin) && getLoginInfo.admin.currentGhsShopId > 0">
  85. <text @click="goRefund(detailInfo)" v-if="detailInfo.status == 4"
  86. style="float:right;font-weight:normal;color:#3385FF;margin-right:30upx;">申请售后</text>
  87. <text @click="printAllLabelConfirm(detailInfo,1)" style="float:right;font-weight:normal;color:#3385FF;margin-right:30upx;">
  88. 打全部价码
  89. </text>
  90. <text @click="printAllLabelConfirm(detailInfo,0)" style="float:right;font-weight:normal;color:#3385FF;margin-right:30upx;">
  91. 打全部标签
  92. </text>
  93. </block>
  94. </view>
  95. <view style="text-align: right;" v-if="detailInfo.pfLevel && detailInfo.pfLevel == 1">
  96. <button @tap="assignOrder()" class="admin-button-com middle blue" style="">刷新货位</button>
  97. <button @tap="changeView()" class="admin-button-com middle blue" style="margin-left:50upx;">{{showSeat == 0 ?'显示货位':'隐藏货位'}}</button>
  98. </view>
  99. <view class="module-com content-box">
  100. <view class="commodity-view">
  101. <view class="commodity-list">
  102. <view v-for="(s, idx) in detailInfo.itemInfo" :key="idx">
  103. <view class="commodity-item">
  104. <image class="item-icon" :src="s.cover" alt="" />
  105. <view class="item-info">
  106. <view class="info-line">
  107. <text class="item-name" @click="pageTo({ url: '/admin/item/detail?id='+s.productId })">
  108. <text style="font-size:22upx;border:1upx solid #3385ff;color:white;background-color:#3385ff;margin-right:5upx;padding-left:5upx;padding-right:5upx;" v-if="s.presell == 1">预售</text>
  109. {{ s.name }}
  110. </text>
  111. <text class="item-price">
  112. <text class="price">¥{{s.totalPrice ? parseFloat(s.totalPrice) : 0}}</text>
  113. </text>
  114. </view>
  115. <view class="info-line" style="position:relative;">
  116. <block v-if="!$util.isEmpty(getLoginInfo.admin) && getLoginInfo.admin.currentGhsShopId > 0">
  117. <text class="item-type" style="color:#3385FF;" @click.stop="printLabel(s,0)">打标签</text>
  118. <text class="item-type" style="color:#3385FF;" @click.stop="printLabel(s,1)">打价码</text>
  119. </block>
  120. <text class="item-count">
  121. {{ parseFloat(s.itemNum) }}扎 ×
  122. <text style="font-weight:bold;margin-left:5upx;" v-if="s.aboutPrice==1">约</text>
  123. <text v-else style="margin-left:5upx;"></text>
  124. ¥{{ s.bigPrice ? parseFloat(s.bigPrice) : 0 }}
  125. </text>
  126. <text style="font-weight:bold;color:red;position:absolute;top:45upx;font-size:20upx;">
  127. <text style="font-weight:bold;color:#CCCCCC;margin-right:20upx;">{{s.ratio}}{{s.smallUnit}}装</text>
  128. <text v-if="s.refundNum>0">已退{{s.refundNum}}</text>
  129. </text>
  130. </view>
  131. </view>
  132. </view>
  133. <block v-if="showSeat == 1">
  134. <view v-if="Number(s.noSeatNum)>0" style="margin-bottom:7upx;margin-top:8upx;font-size:30upx;">
  135. 无货位 {{ s.noSeatNum }}
  136. </view>
  137. <view v-if="!$util.isEmpty(s.sendList)" style="margin-bottom:10upx;font-size:30upx;">
  138. <view v-for="(send, sendIndex) in s.sendList" style="margin-bottom:7upx;">
  139. {{ send.customName }}({{ send.seatSn }}) 数量 {{ send.num }}
  140. <text style="margin-left:20upx;">{{ send.status == 0 ?'待上架':send.status == 1?'已上架':'已取消' }}</text>
  141. </view>
  142. </view>
  143. </block>
  144. </view>
  145. </view>
  146. <view class="summary-bar">
  147. <view class="operate-view" ></view>
  148. <view class="describe-view">
  149. 共<text>{{ detailInfo.itemNum ? parseFloat(detailInfo.itemNum) : 0 }}扎</text>,
  150. 合计 ¥<text class="price">{{ detailInfo.price ? parseFloat(detailInfo.price) : 0 }}</text>
  151. </view>
  152. </view>
  153. </view>
  154. </view>
  155. <view class="content-box price-detail" v-if="detailInfo.location == 0">
  156. <div class="module-com input-line-wrap">
  157. <tui-list-cell class="line-cell" :hover="false">
  158. <div class="tui-title">运费支付</div>
  159. <div class="detail-price_box" style="font-size: 28upx;">{{detailInfo.yfPayWay==1?'寄付':'到付'}}</div>
  160. </tui-list-cell>
  161. <tui-list-cell class="line-cell" :hover="false">
  162. <div class="tui-title">打包费</div>
  163. <div class="detail-price_box" style="font-size: 28upx;">¥{{ detailInfo.packingCharge?parseFloat(detailInfo.packingCharge):0 }}</div>
  164. </tui-list-cell>
  165. <tui-list-cell v-if="detailInfo.yfPayWay==1" class="line-cell" :hover="false">
  166. <div class="tui-title">短途运费</div>
  167. <div class="detail-price_box" style="font-size: 28upx;">¥{{ detailInfo.shortCharge?parseFloat(detailInfo.shortCharge):0 }}</div>
  168. </tui-list-cell>
  169. <tui-list-cell v-if="detailInfo.yfPayWay==1" class="line-cell" :hover="false">
  170. <div class="tui-title">长途运费</div>
  171. <div class="detail-price_box" style="font-size: 28upx;">¥{{ detailInfo.longCharge?parseFloat(detailInfo.longCharge):0 }}</div>
  172. </tui-list-cell>
  173. </div>
  174. </view>
  175. <view class="content-box price-detail">
  176. <div class="module-com input-line-wrap">
  177. <tui-list-cell class="line-cell" :hover="false">
  178. <div class="tui-title">总金额</div>
  179. <div class="detail-price_box" style="font-size: 30upx;">¥{{ detailInfo.prePrice ? parseFloat(detailInfo.prePrice) : 0 }}</div>
  180. </tui-list-cell>
  181. <tui-list-cell v-if="detailInfo.refundPrice > 0" class="line-cell" :hover="false">
  182. <div class="tui-title">退款金额</div>
  183. <div class="detail-price_box red" style="font-size:30upx">-¥{{ detailInfo.tkPrice ? parseFloat(detailInfo.tkPrice) : 0 }}</div>
  184. </tui-list-cell>
  185. <tui-list-cell v-if="detailInfo.discountAmount > 0" class="line-cell" :hover="false">
  186. <div class="tui-title">减免</div>
  187. <div class="detail-price_box" style="font-size: 30upx;">¥{{ detailInfo.discountAmount ? parseFloat(detailInfo.discountAmount) : 0 }}</div>
  188. </tui-list-cell>
  189. <tui-list-cell class="line-cell" :hover="false">
  190. <div class="tui-title">实际金额</div>
  191. <div class="detail-price_box" style="font-size:32upx;color:#3385FF;">¥{{ detailInfo.realPrice ? parseFloat(detailInfo.realPrice) : 0 }}</div>
  192. </tui-list-cell>
  193. </div>
  194. </view>
  195. <view class="content-box price-detail" v-if="!$util.isEmpty(getLoginInfo.admin) && getLoginInfo.admin.currentGhsShopId > 0">
  196. <div class="module-com input-line-wrap">
  197. <tui-list-cell class="line-cell" :hover="false">
  198. <div class="tui-title">备注</div>
  199. <textarea style="height: 130upx;width:350upx;" v-model="detailInfo.remark" placeholder="这里写备注"/>
  200. <button class="admin-button-com blue mini-btn" @click="modifyRemark(item)" >修改</button>
  201. </tui-list-cell>
  202. </div>
  203. </view>
  204. <view class="content-box price-detail" v-if="detailInfo.location == 0">
  205. <div class="module-com input-line-wrap">
  206. <tui-list-cell v-if="detailInfo.yfPayWay==2" class="line-cell" :hover="false">
  207. <div class="tui-title">短途运费</div>
  208. <div class="detail-price_box" style="font-size: 28upx;">¥{{ detailInfo.shortCharge?parseFloat(detailInfo.shortCharge):0 }}</div>
  209. </tui-list-cell>
  210. <tui-list-cell v-if="detailInfo.yfPayWay==2" class="line-cell" :hover="false">
  211. <div class="tui-title">长途运费</div>
  212. <div class="detail-price_box" style="font-size: 28upx;">¥{{ detailInfo.longCharge?parseFloat(detailInfo.longCharge):0 }}</div>
  213. </tui-list-cell>
  214. <tui-list-cell class="line-cell" :hover="false">
  215. <div class="tui-title">提货费</div>
  216. <div class="detail-price_box" style="font-size: 28upx;">¥{{ detailInfo.pickCharge?parseFloat(detailInfo.pickCharge):0 }}</div>
  217. </tui-list-cell>
  218. <tui-list-cell class="line-cell" :hover="false">
  219. <div class="tui-title">本地运费</div>
  220. <div class="detail-price_box" style="font-size: 28upx;">¥{{ detailInfo.localCharge?parseFloat(detailInfo.localCharge):0 }}</div>
  221. </tui-list-cell>
  222. <tui-list-cell class="line-cell" :hover="false">
  223. <div class="tui-title">合计费用</div>
  224. <div class="detail-price_box" style="font-size: 30upx;">¥{{ detailInfo.totalFreight?parseFloat(detailInfo.totalFreight):0 }}</div>
  225. </tui-list-cell>
  226. <tui-list-cell class="line-cell" :hover="false">
  227. <div class="tui-title">合计成本</div>
  228. <div class="detail-price_box" style="font-size: 30upx;">¥{{ detailInfo.totalCgCost?parseFloat(detailInfo.totalCgCost):0 }}</div>
  229. </tui-list-cell>
  230. <tui-list-cell class="line-cell" :hover="false">
  231. <div class="tui-title">总重量</div>
  232. <div class="detail-price_box" style="font-size: 30upx;">{{ detailInfo.totalWeight?parseFloat(detailInfo.totalWeight):0 }}</div>
  233. </tui-list-cell>
  234. <tui-list-cell class="line-cell" :hover="false">
  235. <div class="tui-title">每公斤运费</div>
  236. <div class="detail-price_box" style="font-size: 30upx;">¥{{ detailInfo.avgKgWeight?parseFloat(detailInfo.avgKgWeight):0 }}</div>
  237. </tui-list-cell>
  238. <tui-list-cell class="line-cell" :hover="false">
  239. <div class="tui-title">物流费用</div>
  240. <div class="detail-price_box" style="font-size: 30upx;">{{detailInfo.isCost==0?'不算成本':'算成本'}}</div>
  241. </tui-list-cell>
  242. </div>
  243. </view>
  244. </view>
  245. <block v-if="!$util.isEmpty(getLoginInfo.admin) && getLoginInfo.admin.currentGhsShopId > 0">
  246. <view class="app-footer open_btn" v-if="detailInfo.location == 0">
  247. <!-- #ifdef MP-WEIXIN -->
  248. <button class="admin-button-com middle blue" open-type="share">分享</button>
  249. <!-- #endif -->
  250. <!-- #ifdef APP-PLUS -->
  251. <view @click="shareOrder()" class="admin-button-com middle blue">分享</view>
  252. <!-- #endif -->
  253. <view v-if="detailInfo.status != 3" @click="changePrice()" class="admin-button-com middle blue">修改价格</view>
  254. <view v-if="detailInfo.status == 2 || detailInfo.status == 3 || detailInfo.status == 4" @click="printBillFn(detailInfo)" class="admin-button-com middle blue">打印({{detailInfo.printNum}})</view>
  255. <view v-if="detailInfo.status == 3" @click="cancelIn()" class="admin-button-com middle blue">取消入库</view>
  256. <view v-if="detailInfo.status == 3" @click="changePrice()" class="admin-button-com middle blue">入库和改价</view>
  257. </view>
  258. <view class="app-footer open_btn" v-else>
  259. <!-- #ifdef MP-WEIXIN -->
  260. <button class="admin-button-com middle blue" open-type="share">分享</button>
  261. <!-- #endif -->
  262. <!-- #ifdef APP-PLUS -->
  263. <view @click="shareOrder()" class="admin-button-com middle blue">分享</view>
  264. <!-- #endif -->
  265. <view v-if="detailInfo.status != 3" @click="changePrice()" class="admin-button-com middle blue">修改价格</view>
  266. <view v-if="detailInfo.status == 2 || detailInfo.status == 3 || detailInfo.status == 4" @click="printBillFn(detailInfo)" class="admin-button-com middle blue">打印({{detailInfo.printNum}})</view>
  267. <view v-if="detailInfo.status == 3" @click="cancelIn()" class="admin-button-com middle blue">取消入库</view>
  268. <view v-if="detailInfo.status == 3" @click="changePrice()" class="admin-button-com middle blue">入库和改价</view>
  269. </view>
  270. </block>
  271. <modal-module :show="printLabelShow" @click="dialogInputConfirm" :maskClosable="true" :title="printType==0?'标签数量':'价码数量'" padding="30rpx 30rpx" >
  272. <template v-slot:content>
  273. <div class="app-modal-input-wrap">
  274. <div class="inp-list-line">
  275. <div class="line-input">
  276. <input type="number" ref="input" style="width:61.8%;text-align:center;" v-model="printNum" :adjust-position="false" class="inp-input" @focus="printNum=''" />
  277. </div>
  278. </div>
  279. <div class="inp-list-line" v-if="printType==0">
  280. <div class="line-input" style="justify-content: center;margin-top: 30upx;">
  281. <button class="admin-button-com big" :class="priceOption === 0 ? 'blue' : 'default'" @click="priceOption = 0" style="margin-right:20upx;">没价格</button>
  282. <button class="admin-button-com big" :class="priceOption === 1 ? 'blue' : 'default'" @click="priceOption = 1" style="margin-right:20upx;">有价格</button>
  283. <button class="admin-button-com big" :class="priceOption === 2 ? 'blue' : 'default'" @click="priceOption = 2">纯名字</button>
  284. </div>
  285. </div>
  286. </div>
  287. </template>
  288. </modal-module>
  289. <modal-module :show="printAllLabelShow" @click="printAllLabelConfirmFn" :maskClosable="true" title="提示" padding="30rpx 30rpx" >
  290. <template v-slot:content>
  291. <div class="app-modal-input-wrap">
  292. <div class="inp-list-line" style="justify-content: center;margin-top: 30upx;">
  293. <text style="text-align:center;color:black;font-size:38upx;">确认打全部{{printAllLabelType==0?'标签':'价码'}}?</text>
  294. </div>
  295. <div class="inp-list-line" v-if="printAllLabelType==0">
  296. <div class="line-input" style="justify-content: center;margin-top: 30upx;">
  297. <button class="admin-button-com big" :class="printAllPriceOption === 0 ? 'blue' : 'default'" @click="printAllPriceOption = 0" style="margin-right:20upx;">没价格</button>
  298. <button class="admin-button-com big" :class="printAllPriceOption === 1 ? 'blue' : 'default'" @click="printAllPriceOption = 1" style="margin-right:20upx;">有价格</button>
  299. <button class="admin-button-com big" :class="printAllPriceOption === 2 ? 'blue' : 'default'" @click="printAllPriceOption = 2">纯名字</button>
  300. </div>
  301. </div>
  302. </div>
  303. </template>
  304. </modal-module>
  305. <mx-date-picker :show="showPicker" format="yyyy-mm-dd" type="date" :value="defaultPickerDate" :show-tips="true" @confirm="confirmPicker" @cancel="showPicker = false" />
  306. </view>
  307. </template>
  308. <script>
  309. import { getPurchaseDetailApi,getCgDetail,updateRemark,printAll,confirmPutIn,cancelPutIn,printBill,assignSeat,checkSeatRemin,modifyEntryTime } from "@/api/purchase";
  310. import productMins from "@/mixins/product";
  311. import TuiListCell from "@/components/plugin/list-cell";
  312. import ModalModule from "@/components/plugin/modal"
  313. import { print } from '@/api/product';
  314. import { getPrint } from "@/api/shop";
  315. import { mapGetters } from "vuex";
  316. import { IMGHOST,CURRENT_ENV } from '@/config'
  317. import MxDatePicker from '@/components/mx-datepicker/mx-datepicker.vue';
  318. export default {
  319. name: "info",
  320. components: {
  321. TuiListCell,
  322. ModalModule,
  323. MxDatePicker
  324. },
  325. computed: {
  326. ...mapGetters(["getLoginInfo"]),
  327. ...mapGetters({ dictInfo:"getDictionariesInfo" }),
  328. },
  329. mixins: [productMins],
  330. data() {
  331. return {
  332. defaultPickerDate:'',
  333. showPicker: false,
  334. selectJobType: "order_change",
  335. autoLoad: false,
  336. stepActive: 0,
  337. form: {
  338. name: ""
  339. },
  340. detailInfo: {},
  341. loading: false,
  342. printItemId:0,
  343. printType:0,
  344. printLabelShow:false,
  345. printNum:'',
  346. wcPrintNum:1,
  347. entryTime:'',
  348. T:null,
  349. orderSn:'',
  350. salt:'',
  351. showSeat:1,
  352. title:'',
  353. imageUrl:'',
  354. currentEnv:'production',
  355. priceOption:0,
  356. printAllLabelShow:false,
  357. printAllLabelType:0,
  358. printAllPriceOption:0
  359. };
  360. },
  361. onPullDownRefresh() {
  362. this.initCgData().then(res => {
  363. uni.stopPullDownRefresh()
  364. })
  365. },
  366. onLoad() {
  367. this.initCgData()
  368. let pages = getCurrentPages();
  369. let prevPage = pages[ pages.length - 2 ];
  370. if(this.option.refresh && this.option.refresh == 1){
  371. //采购入库之后去的详情页返回列表需要刷新
  372. prevPage.$vm.needRefresh = 1
  373. }else{
  374. //返回上一页时不需要刷新
  375. prevPage.$vm.needRefresh = 0
  376. }
  377. this.imageUrl = IMGHOST+'/custom/cg_share.jpg'
  378. //当前环境
  379. this.currentEnv = CURRENT_ENV
  380. },
  381. onUnload(){
  382. clearInterval(this.T)
  383. },
  384. onShareAppMessage(res) {
  385. console.log("pagesPurchase/info?orderSn="+this.detailInfo.orderSn+'&salt='+this.detailInfo.salt)
  386. return {
  387. title: this.title,
  388. desc: "",
  389. imageUrl: this.imageUrl,
  390. path: "pagesPurchase/info?orderSn="+this.detailInfo.orderSn+'&salt='+this.detailInfo.salt,
  391. }
  392. },
  393. methods: {
  394. openPicker(){
  395. this.showPicker = true
  396. },
  397. confirmPicker(e) {
  398. let that = this
  399. let currentDate = e.value
  400. that.$util.confirmModal({content:'确认修改?'},() => {
  401. that.showPicker = false
  402. modifyEntryTime({id:that.detailInfo.id,date:currentDate}).then(res=>{
  403. if(res.code == 1){
  404. that.$msg(res.msg)
  405. that.initCgData()
  406. }
  407. })
  408. })
  409. },
  410. changeView(){
  411. if(this.showSeat == 0){
  412. if(this.detailInfo.status == 4){
  413. this.initCgData()
  414. this.showSeat = 1
  415. }else if(this.detailInfo.status == 5){
  416. this.$msg('订单已取消')
  417. }else{
  418. this.assignOrder()
  419. }
  420. }else{
  421. this.showSeat = 0
  422. }
  423. },
  424. assignOrder(){
  425. uni.showLoading()
  426. assignSeat({id:this.detailInfo.id,salt:this.salt}).then(res=>{
  427. uni.hideLoading()
  428. if(res.code == 1){
  429. if(res.data && res.data.assign == 1){
  430. this.$msg(res.msg)
  431. this.initCgData()
  432. this.showSeat = 1
  433. }
  434. }
  435. })
  436. },
  437. printBillFn(info){
  438. let that = this
  439. if(this.wcPrintNum > 1){
  440. let arr = ['请选择','机器1']
  441. if(this.wcPrintNum == 2){
  442. arr = ['请选择','机器1','机器2']
  443. }
  444. if(this.wcPrintNum == 3){
  445. arr = ['请选择','机器1','机器2','机器3']
  446. }
  447. uni.showActionSheet({
  448. itemList: arr,
  449. success: function (res) {
  450. if(res.tapIndex == 0){
  451. return false
  452. }
  453. let order = res.tapIndex
  454. printBill({id:info.id,order:order}).then((res) => {
  455. info.printNum++
  456. that.$msg('打印成功')
  457. })
  458. }
  459. })
  460. }else{
  461. printBill({id:info.id}).then((res) => {
  462. info.printNum++
  463. that.$msg('打印成功')
  464. })
  465. }
  466. },
  467. dialogInputConfirm(val) {
  468. let that=this;
  469. if (val.index == 0) {
  470. that.printLabelShow = false
  471. return
  472. }
  473. let currentNum = this.printNum
  474. let itemId = this.printItemId
  475. if (currentNum == null) {
  476. that.$msg('请填写数量')
  477. return
  478. }
  479. if (currentNum <= 0) {
  480. that.$msg('数量不能小于1')
  481. return
  482. }
  483. if (itemId == 0) {
  484. that.$msg('打印的花材id出错')
  485. that.printLabelShow = false
  486. return
  487. }
  488. print({id:itemId,num:currentNum,type:this.printType,priceOption:this.priceOption}).then(res=>{
  489. if(res.code == 1){
  490. that.printLabelShow = false
  491. uni.showToast({ title: '操作成功', duration: 1500 })
  492. } else if(res.code == 0){
  493. that.printLabelShow = false
  494. that.$msg(res.msg)
  495. }
  496. })
  497. },
  498. printLabel(item,type){
  499. this.printType = type
  500. this.printItemId = item.productId
  501. this.printLabelShow = true
  502. this.priceOption = 0
  503. this.printNum = item.itemNum
  504. },
  505. shareOrder(){
  506. console.log("pagesPurchase/info?orderSn="+this.detailInfo.orderSn+'&salt='+this.detailInfo.salt)
  507. let that = this
  508. let miniOriginalId = that.dictInfo.miniOriginalId && that.dictInfo.miniOriginalId.current && that.dictInfo.miniOriginalId.current.ghs ? that.dictInfo.miniOriginalId.current.ghs : ''
  509. uni.share({
  510. provider: "weixin", //分享服务提供商(即weixin|qq|sinaweibo)
  511. scene: 'WXSceneSession', //场景,可取值参考下面说明。
  512. type: 5, //分享形式
  513. title: that.title, //分享内容的标题
  514. summary: '暂无', //分享内容的摘要
  515. imageUrl: this.imageUrl,
  516. miniProgram: {
  517. id: miniOriginalId,//小程序原始id,发起分享的 App 与小程序属于同一微信开放平台账号
  518. path: "pagesPurchase/info?orderSn="+this.detailInfo.orderSn+'&salt='+this.detailInfo.salt,
  519. type: 0,// 0-正式版; 1-测试版; 2-体验版
  520. webUrl: 'https://www.wixhb.com'
  521. },
  522. success: function(res) {
  523. //console.log(res)
  524. },
  525. fail: function(err) {
  526. //console.log(err)
  527. }
  528. })
  529. },
  530. changePrice(){
  531. this.$util.pageTo({url: "/pagesPurchase/components/pageSuccess?orderSn="+this.detailInfo.orderSn+"&id="+this.detailInfo.id+"&status="+this.detailInfo.status,type:2})
  532. },
  533. cancelIn(){
  534. let that = this
  535. that.$util.confirmModal({content:'确认取消入库?'},() => {
  536. uni.showLoading({mask:true})
  537. cancelPutIn({id:that.detailInfo.id}).then(res=>{
  538. uni.hideLoading()
  539. if(res.code == 1){
  540. that.initCgData()
  541. }
  542. })
  543. })
  544. },
  545. confirmIn(){
  546. let that = this
  547. that.$util.confirmModal({content:'确认现在入库?'},() => {
  548. uni.showLoading({mask:true})
  549. confirmPutIn({id:that.detailInfo.id}).then(res=>{
  550. uni.hideLoading()
  551. if(res.code == 1){
  552. if(res.data.status == 4){
  553. that.$util.pageTo({url: "/pagesPurchase/components/pageSuccess?orderSn="+res.data.orderSn+"&id="+res.data.id+"&status="+res.data.status,type:2})
  554. }
  555. }
  556. })
  557. })
  558. },
  559. goRefund(info){
  560. this.$util.pageTo({url:'/pagesPurchase/refund?orderSn='+info.orderSn})
  561. },
  562. printAllLabel(item,type){
  563. let that = this
  564. that.$util.confirmModal({content:'确认打印'},() => {
  565. printAll({orderSn:item.orderSn,type:type,priceOption:that.printAllPriceOption}).then(res=>{
  566. if(res.code == 1){
  567. that.$msg(res.msg)
  568. }
  569. })
  570. })
  571. },
  572. printAllLabelConfirm(item,type){
  573. this.printAllLabelShow = true
  574. this.printAllLabelType = type
  575. this.printAllPriceOption = 0
  576. },
  577. printAllLabelConfirmFn(val){
  578. let that = this
  579. if (val.index == 0) {
  580. that.printAllLabelShow = false
  581. return
  582. }
  583. printAll({orderSn:that.detailInfo.orderSn,type:that.printAllLabelType,priceOption:that.printAllPriceOption}).then(res=>{
  584. if(res.code == 1){
  585. that.$msg(res.msg)
  586. that.printAllLabelShow = false
  587. }
  588. })
  589. },
  590. goToClear (item) {
  591. this.pageTo({
  592. url: '/pagesGys/details?id='+item.ghsId
  593. })
  594. },
  595. modifyRemark(){
  596. const self = this;
  597. let remark = this.detailInfo.remark
  598. updateRemark({id:this.detailInfo.id,remark:remark}).then((res) => {
  599. self.$msg(res.msg);
  600. })
  601. },
  602. copy(val) {
  603. const self = this;
  604. uni.setClipboardData({
  605. data: val,
  606. success: function() {
  607. self.$msg("复制成功");
  608. }
  609. });
  610. },
  611. callUp(mobile) {
  612. uni.makePhoneCall({
  613. phoneNumber: mobile
  614. });
  615. },
  616. init(){
  617. },
  618. checkRemind(){
  619. let that = this
  620. if(this.T){
  621. clearInterval(this.T)
  622. }
  623. this.T = setInterval(function(){
  624. checkSeatRemin({orderSn:that.orderSn,salt:that.salt}).then(res=>{
  625. if(res.code == 1){
  626. if(res.data.need && res.data.need == 1){
  627. clearInterval(that.T)
  628. that.$util.confirmModal({content:'货位有变,请刷新',singer:true},() => {
  629. that.assignOrder()
  630. },()=>{
  631. that.checkRemind()
  632. })
  633. }
  634. }
  635. })
  636. },5000)
  637. },
  638. async initCgData() {
  639. let that = this
  640. clearInterval(that.T)
  641. if(that.option.orderSn){
  642. that.orderSn = that.option.orderSn
  643. that.salt = that.option.salt
  644. if((this.getLoginInfo && !this.$util.isEmpty(this.getLoginInfo.admin)) && this.$util.isEmpty(that.salt)){
  645. const { data } = await getPurchaseDetailApi(that.option.orderSn);
  646. that.detailInfo = data;
  647. if(that.detailInfo && that.detailInfo.needRemindRefreshSeat == 1){
  648. that.checkRemind()
  649. }else{
  650. clearInterval(that.T)
  651. }
  652. getPrint().then(res=>{
  653. if(res.code == 1){
  654. that.wcPrintNum = res.data.wcPrintNum ? Number(res.data.wcPrintNum) : 1
  655. }
  656. })
  657. if(that.detailInfo.pfLevel == 0){
  658. this.showSeat = 0
  659. }
  660. }else{
  661. const { data } = await getCgDetail({orderSn:that.orderSn,salt:that.salt})
  662. that.detailInfo = data
  663. if(that.detailInfo && that.detailInfo.needRemindRefreshSeat == 1){
  664. that.checkRemind()
  665. }else{
  666. clearInterval(that.T)
  667. }
  668. }
  669. }else{
  670. if(that.option.q){
  671. let currentUrl = decodeURIComponent(that.option.q)
  672. let str = currentUrl.substring(currentUrl.lastIndexOf("?") + 1)
  673. var sceneItem = str.split("&");
  674. var arr, name, value;
  675. var sceneArray = new Array();
  676. for (var i = 0, l = sceneItem.length; i < l; i++) {
  677. arr = sceneItem[i].split("=");
  678. name = arr[0];
  679. value = arr[1];
  680. sceneArray[name] = value;
  681. }
  682. if(sceneArray.orderSn && sceneArray.salt){
  683. that.orderSn = sceneArray.orderSn
  684. that.salt = sceneArray.salt
  685. const { data } = await getCgDetail({orderSn:sceneArray.orderSn,salt:sceneArray.salt})
  686. that.detailInfo = data
  687. if(that.detailInfo && that.detailInfo.needRemindRefreshSeat == 1){
  688. that.checkRemind()
  689. }else{
  690. clearInterval(that.T)
  691. }
  692. }
  693. }
  694. }
  695. //如果在预订中分享的图片是不一样的
  696. if(that.detailInfo && that.detailInfo.onBooking == 1){
  697. this.imageUrl = IMGHOST+'/custom/cg_share_seat_sn.jpg'
  698. }
  699. let ghsName = this.detailInfo.ghsName ? this.detailInfo.ghsName : ''
  700. let actPrice = this.detailInfo.actPrice ? parseFloat(this.detailInfo.actPrice) : 0
  701. this.title = ghsName+' '+this.detailInfo.entryTime.substr(5,11)+' ¥'+actPrice
  702. if(this.detailInfo.tkPrice && Number(this.detailInfo.tkPrice)>0){
  703. this.title = this.title+' 已退¥'+parseFloat(this.detailInfo.tkPrice)
  704. }
  705. this.title = this.title+' 核销码'+this.detailInfo.checkCode
  706. }
  707. }
  708. };
  709. </script>
  710. <style lang="scss" scoped>
  711. .info-content_box {
  712. padding: 0 20upx 100upx;
  713. & > .title {
  714. color: #666666;
  715. font-size: 28upx;
  716. font-weight: 600;
  717. padding: 30upx 3upx;
  718. }
  719. & .address-des_bx {
  720. display: flex;
  721. padding: 20upx 10upx 20upx 20upx;
  722. & > view:nth-child(1) {
  723. flex: 1;
  724. margin-top: 10upx;
  725. & > view:nth-child(1) {
  726. color: #333333;
  727. font-size: 32upx;
  728. font-weight: bold;
  729. }
  730. & > view:nth-child(2) {
  731. color: #666666;
  732. font-size: 28upx;
  733. font-weight: 400;
  734. margin-top: 20upx;
  735. }
  736. }
  737. & > view:nth-child(2) {
  738. display: flex;
  739. & .icondianhua1 {
  740. font-size: 50upx;
  741. color: #3385ff;
  742. margin-left: 0upx;
  743. margin-right:30upx;
  744. }
  745. }
  746. }
  747. .bills-info_box {
  748. padding: 30upx 20upx 30upx;
  749. // border-bottom: 1upx solid #EEEEEE;
  750. & > .order-info_box {
  751. display: flex;
  752. align-items: center;
  753. font-size: 26upx;
  754. font-weight: 400;
  755. margin-bottom: 5upx;
  756. & > view:nth-child(1) {
  757. color: #999999;
  758. width: 135upx;
  759. text-align: right;
  760. }
  761. & > view:nth-child(2) {
  762. color: #333333;
  763. }
  764. & > .price {
  765. flex: 1;
  766. font-size: 30upx;
  767. color: #333333;
  768. display: flex;
  769. align-items: center;
  770. justify-content: flex-end;
  771. & .iconxiangyou {
  772. color: #999999;
  773. font-size: 25upx;
  774. margin-left: 12upx;
  775. }
  776. }
  777. }
  778. }
  779. .content-box {
  780. background-color: #ffffff;
  781. border-radius: 10upx;
  782. }
  783. .commodity-view {
  784. display: flex;
  785. flex-direction: column;
  786. .commodity-list {
  787. padding: 20upx;
  788. .commodity-item {
  789. display: flex;
  790. margin-bottom:10upx;
  791. .item-icon {
  792. flex-shrink: 0;
  793. width: 140upx;
  794. height: 140upx;
  795. }
  796. .item-info {
  797. display: flex;
  798. flex-direction: column;
  799. justify-content: center;
  800. flex: 1;
  801. margin-left: 20upx;
  802. .info-line {
  803. margin-bottom: 20upx;
  804. display: flex;
  805. justify-content: space-between;
  806. align-items: flex-end;
  807. .item-name {
  808. color: #333333;
  809. font-size:32upx;
  810. font-weight: bold;
  811. }
  812. .item-price {
  813. color: #333;
  814. font-size: 22upx;
  815. .price {
  816. font-size: 30upx;
  817. font-weight: bold;
  818. }
  819. }
  820. .item-type {
  821. color: #999;
  822. font-size: 24upx;
  823. }
  824. .item-count {
  825. color: #333333;
  826. font-size: 28upx;
  827. }
  828. }
  829. }
  830. }
  831. }
  832. .summary-bar {
  833. padding: 0 20upx;
  834. height: 90upx;
  835. display: flex;
  836. align-items: center;
  837. justify-content: space-between;
  838. border-top: 1upx solid #eeeeee;
  839. .operate-view {
  840. display: flex;
  841. align-items: center;
  842. color: #3385ff;
  843. font-size: 26upx;
  844. .iconfont {
  845. margin-right: 20upx;
  846. font-size: 40upx;
  847. }
  848. }
  849. .describe-view {
  850. display: flex;
  851. align-items: center;
  852. color: #333;
  853. font-size: 26upx;
  854. .price {
  855. font-weight: bold;
  856. }
  857. }
  858. }
  859. }
  860. .shipping-address {
  861. display: flex;
  862. align-items: center;
  863. margin-top: 20upx;
  864. & > view:nth-child(1) {
  865. color: #999999;
  866. font-size: 28upx;
  867. font-weight: 400;
  868. display: inline-block;
  869. padding: 30upx 0 30upx 20upx;
  870. flex: 1;
  871. & > text {
  872. color: #333333;
  873. font-weight: 600;
  874. }
  875. }
  876. & > view:nth-child(2) {
  877. font-size: 60upx;
  878. color: #d6e7ff;
  879. margin-right: 10upx;
  880. }
  881. }
  882. .price-detail {
  883. margin-top: 20upx;
  884. margin-bottom: 20upx;
  885. }
  886. .detail-price_box {
  887. color: #333333;
  888. font-size: 22upx;
  889. text-align: right;
  890. flex: 1;
  891. font-weight: 600;
  892. &.red {
  893. color: #ff2842;
  894. }
  895. }
  896. }
  897. </style>