deliver_goods.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. <template>
  2. <view>
  3. <view v-if='listData.length>0'>
  4. <block v-for="(item,index) in listData" :key="code">
  5. <view class="cardwrap">
  6. <view class='flex justify-between'>
  7. <view>车号</view>
  8. <view>{{item.carNo}}</view>
  9. </view>
  10. <view v-if="item.memo" class='flex justify-between'>
  11. <view class="th">件数</view>
  12. <view class="td">{{item.memo}}</view>
  13. </view>
  14. <view class='flex justify-between'>
  15. <view class="th ">发货日期</view>
  16. <view class="td">{{item.issuance | dateFormat1}}</view>
  17. </view>
  18. <view v-if="contractType =='销售合同'" class='flex justify-between'>
  19. <view class="th ">结算价(元/吨)</view>
  20. <view class="td" v-if="item.unitPrice1 == 0">未结算</view>
  21. <view class="td" v-else>{{item.unitPrice1}}</view>
  22. </view>
  23. <view class='flex justify-between'>
  24. <view class="th ">净重(吨)</view>
  25. <view class="td" v-if='item.netWeight'>{{item.netWeight}}(发)</view>
  26. <view class="td" v-if='item.netWeightRec'>{{item.netWeightRec}}(收)</view>
  27. </view>
  28. <view v-if="contractType =='销售合同' " class='flex justify-between'>
  29. <view class="th ">验收情况</view>
  30. <view class="td" v-if='item.checkType==1'>已验收</view>
  31. <view class="td" v-else>未验收</view>
  32. </view>
  33. <view v-if="contractType =='销售合同' " class='flex justify-between'>
  34. <view class="th">扣款(元/吨)</view>
  35. <view class="td">{{item.remarks}}</view>
  36. </view>
  37. <view v-if="contractType =='销售合同'&&item.poundImg " class='flex justify-between'>
  38. <view class="poundtital">到货磅单</view>
  39. <view class="grid col-2 grid-square bg-img" v-if="item.poundImg != ''" @tap="ViewImage" :data-url="item.poundImg">
  40. <image class='poundimg' :src="item.poundImg" mode="aspectFit"></image>
  41. </view>
  42. </view>
  43. <view v-if="contractType =='采购合同'&&item.poundImg " class='flex justify-between'>
  44. <view class="poundtital">发货磅单</view>
  45. <view class="grid col-2 grid-square bg-img" v-if="item.poundImg != ''" @tap="ViewImage" :data-url="item.poundImg">
  46. <image class='poundimg' :src="item.poundImg" mode="aspectFit"></image>
  47. </view>
  48. </view>
  49. <view v-if="item.taskStatus==4 && contractType =='销售合同'" class="padding flex flex-direction">
  50. <button class="cu-btn bg-orange margin-tb-sm" @click="commit">确认卸货</button>
  51. </view>
  52. </view>
  53. </block>
  54. </view>
  55. <view style='text-align:center;' v-else>
  56. 当前合同暂无车辆
  57. </view>
  58. <drag-button
  59. v-if="contractType =='销售合同'&& tradeStatus!='4'"
  60. :isDock="true"
  61. :existTabBar="true"
  62. text="发货"
  63. location="100"
  64. background="rgba(36, 90, 141, 0.5)"
  65. boxshadow="0 0 6rpx rgba(36, 90, 141, 0.5)"
  66. @btnClick="deliver"
  67. />
  68. <!-- <block v-if="tradeStatus!='3' && tradeStatus!='4'">
  69. <drag-button
  70. :isDock="true"
  71. :existTabBar="true"
  72. text="点价"
  73. location="40"
  74. background='rgba(36, 90, 141, 0.5)'
  75. boxshadow='0 0 6rpx rgba(36, 90, 141, 0.5)'
  76. @btnClick="price"
  77. />
  78. </block> -->
  79. <!-- <view v-show='showPopup' class="popupItem">
  80. <view class='wrap'>
  81. <view class="btnPopup">
  82. <button type="default" @click="btnCancel">取消</button>
  83. <button class='btnConfirm' @click="btnConfirm">确定</button>
  84. </view>
  85. </view>
  86. </view> -->
  87. <u-modal v-model="showPopup"
  88. :mask-close-able="true"
  89. title="修改点价"
  90. show-cancel-button="true"
  91. confirm-text="确定"
  92. cancel-text="取消"
  93. @confirm="btnConfirm"
  94. @cancel="btnCancel">
  95. <view class="cu-form-group">
  96. <view class="title">允许点价时间段:</view>
  97. </view>
  98. <view class="cu-form-group">
  99. 11:30-12:30
  100. </view>
  101. <view class="cu-form-group">
  102. 15:00-20:00
  103. </view>
  104. <view class="cu-form-group">
  105. 23:00-8:00
  106. </view>
  107. <view class="cu-form-group">
  108. <view class="title">点价金额</view>
  109. <input placeholder="请输入点价" @input="btnDown" v-model="unitPrice"></input>
  110. </view>
  111. </u-modal>
  112. </view>
  113. </template>
  114. <script>
  115. import {
  116. mapState
  117. } from 'vuex';
  118. export default {
  119. data() {
  120. return {
  121. listData:[],
  122. id:'',
  123. showPopup:false,
  124. unitPrice:'',
  125. contractType:'',
  126. tradeStatus:''
  127. };
  128. },
  129. computed: {
  130. },
  131. onShow() {
  132. this.loadData()
  133. },
  134. onLoad(options) {
  135. const that = this
  136. that.id=options.id
  137. that.contractType = options.contractType
  138. that.tradeStatus=options.tradeStatus
  139. },
  140. onReady(){
  141. },
  142. methods: {
  143. ViewImage(e) {
  144. var img = [];
  145. img = e.currentTarget.dataset.url.split(' ')
  146. uni.previewImage({
  147. current:0,
  148. urls: img
  149. });
  150. },
  151. ChooseImage() {
  152. uni.chooseImage({
  153. count: 1, //默认9
  154. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  155. sourceType: ['album','camera'], //从相册选择
  156. success: (res) => {
  157. //上传图片
  158. //图片路径可自行修改
  159. uploadImage(res.tempFilePaths[0], 'carNoImg/',
  160. result => {
  161. this.poundImg = result
  162. uni.hideLoading();
  163. }
  164. )
  165. }
  166. });
  167. },
  168. btnDown(e){
  169. this.unitPrice=e.detail.value
  170. },
  171. deliver(){
  172. const that = this
  173. uni.navigateTo({
  174. url: `/pageA/pages/account?tradeContractId=${that.id}`
  175. })
  176. },
  177. price(){
  178. this.showPopup=true
  179. },
  180. //下拉刷新
  181. onPullDownRefresh() {
  182. this.pages = 1
  183. this.isLoadMore = false
  184. this.loadStatus = 'loading'
  185. this.loadData()
  186. },
  187. btnCancel(){
  188. this.showPopup=false
  189. },
  190. loadData(){
  191. const that = this
  192. uni.showLoading({
  193. title: '正在加载',
  194. mask:true
  195. })
  196. that.$api.request('tradeContract', 'getTradeContractDetail', {
  197. id: that.id
  198. }, failres => {
  199. that.$api.msg(failres.errmsg)
  200. uni.hideLoading()
  201. uni.stopPullDownRefresh()
  202. }).then(res => {
  203. if(res.data.code=='SUCCESS'){
  204. that.listData = res.data.data
  205. }else{
  206. that.$api.msg('暂无物流信息')
  207. }
  208. uni.hideLoading()
  209. uni.stopPullDownRefresh()
  210. })
  211. },
  212. btnConfirm(){
  213. var that =this
  214. if(!this.unitPrice){
  215. that.$api.msg('请输入点价价格')
  216. return
  217. }
  218. uni.showLoading({
  219. title: '正在加载',
  220. mask:true
  221. })
  222. that.$api.request('trade', 'changePrice', {
  223. id: that.id,
  224. unitPrice:that.unitPrice
  225. }, failres => {
  226. that.$api.msg(failres.errmsg)
  227. setTimeout(()=>{
  228. },1000);
  229. uni.hideLoading()
  230. }).then(res => {
  231. that.$api.msg('修改点价成功')
  232. setTimeout(()=>{
  233. this.showPopup=false
  234. },1000);
  235. uni.hideLoading()
  236. })
  237. },
  238. commit(){
  239. var that =this
  240. uni.showLoading({
  241. title: '正在加载',
  242. mask:true
  243. })
  244. that.$api.request('trade', 'confirm', {
  245. id: that.id
  246. }, failres => {
  247. that.$api.msg(failres.errmsg)
  248. uni.hideLoading()
  249. }).then(res => {
  250. that.$api.msg('确认成功')
  251. this.showPopup=false
  252. uni.hideLoading()
  253. this.isLoadMore = false
  254. this.loadStatus = 'loading'
  255. this.loadData()
  256. })
  257. }
  258. },
  259. }
  260. </script>
  261. <style scoped>
  262. .grid.grid-square {
  263. height: 100px;
  264. }
  265. .poundimg{
  266. width: 100px;
  267. height: 100px;
  268. }
  269. .poundtital{
  270. line-height: 100px;
  271. }
  272. .cardwrap{
  273. /* background: rgba(255,255,255,0.3); */
  274. background: #fff;
  275. padding: 10px;
  276. margin: 10px 10px;
  277. box-shadow: 0 2px 6px #ccc;
  278. border-radius: 3px;
  279. }
  280. /* .cardwrap .flex view{
  281. background-image: linear-gradient(135deg, #1fa2ff, #a6ffcb);
  282. font-size: 20px;
  283. font-weight: bold;
  284. -webkit-background-clip: text;
  285. -moz-background-clip: text;
  286. background-clip: text;
  287. box-decoration-break: clone;
  288. -webkit-box-decoration-break: clone;
  289. -moz-box-decoration-break: clone;
  290. color: transparent;
  291. } */
  292. .popupItem{
  293. position: fixed;
  294. left: 0;
  295. top: 0;
  296. width: 100%;
  297. height: 100%;
  298. background-color: rgba(0,0,0,0.3);
  299. z-index: 1000000;
  300. }
  301. .wrap{
  302. text-align: center;
  303. background: white;
  304. z-index: 99;
  305. position: absolute;
  306. top: 50%; left: 50%;
  307. transform:translate(-50%,-50%);
  308. border-radius: 5%;
  309. padding:40rpx;
  310. }
  311. .btnPopup{
  312. display:flex;
  313. justify-content: space-between;
  314. margin: 10px 0 0;
  315. }
  316. .btnPopup button{
  317. height: 60rpx;
  318. line-height: 60rpx;
  319. font-size: 27rpx;
  320. }
  321. .btnConfirm{
  322. background: #39b54a;
  323. color:#fff;
  324. }
  325. </style>