task_detail.vue 29 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090
  1. <template>
  2. <view :class="showAutograph?'indexFixed container':'container '" >
  3. <view class="detail-desc">
  4. <view class="d-header">
  5. <text>派车单</text>
  6. </view>
  7. <view class="c-list">
  8. <view class="c-row b-b">
  9. <text class="tit">派车单号</text>
  10. <view class="con-list">
  11. <text>{{carInfo.sendCarNo}}</text>
  12. </view>
  13. </view>
  14. <view v-if='carInfo.startPlace' class="c-row b-b">
  15. <text class="tit">出发地</text>
  16. <view class="con-list">
  17. <text>{{carInfo.startPlace}}</text>
  18. </view>
  19. </view>
  20. <view v-if='carInfo.endPlace' class="c-row b-b">
  21. <text class="tit">目的地</text>
  22. <view class="con-list">
  23. <text>{{carInfo.endPlace}}</text>
  24. </view>
  25. </view>
  26. <view class="c-row b-b">
  27. <text class="tit">车牌号</text>
  28. <view class="con-list">
  29. <text>{{carInfo.carNo}}</text>
  30. </view>
  31. </view>
  32. <view v-if='carInfo.driver' class="c-row b-b">
  33. <text class="tit">司机</text>
  34. <view class="con-list">
  35. <text>{{carInfo.driver}}</text>
  36. </view>
  37. </view>
  38. <view v-if="carInfo.driverPhone" class="c-row b-b">
  39. <text class="tit">司机电话</text>
  40. <view class="con-list">
  41. <text>{{carInfo.driverPhone}}</text>
  42. </view>
  43. </view>
  44. <view v-if='carInfo.price' class="c-row b-b">
  45. <text class="tit">运价</text>
  46. <view class="con-list">
  47. <text>{{carInfo.price}}</text>
  48. </view>
  49. </view>
  50. <!-- <view v-if='carInfo.num' class="c-row b-b">
  51. <text class="tit">任务量</text>
  52. <view class="con-list">
  53. <text>{{numFilter(carInfo.num)}}</text>
  54. </view>
  55. </view> -->
  56. <view v-if="carInfo.netWeight" class="c-row b-b">
  57. <text class="tit">发运净重</text>
  58. <view class="con-list">
  59. <text>{{numFilter(carInfo.netWeight)}}</text>
  60. </view>
  61. </view>
  62. </view>
  63. <view class="d-header">
  64. <text v-if="taskType == '发运任务'">发运数据</text>
  65. <text v-else-if="taskType == '入库任务'">入库数据</text>
  66. <text v-else-if="taskType == '收货跟踪'">收货数据</text>
  67. <text v-else-if="taskType == '到站入库'">到站入库</text>
  68. </view>
  69. <view class="c-list">
  70. <view class="c-row b-b">
  71. <text class="tit">毛重(吨)</text>
  72. <view class="con-list">
  73. <input placeholder="请填写毛重" name="input" v-model="grossWeight" @input="grossWeightInput"></input>
  74. </view>
  75. </view>
  76. <view class="c-row b-b">
  77. <text class="tit">皮重(吨)</text>
  78. <view class="con-list">
  79. <input placeholder="请填写皮重" name="input" v-model="skinWeight" @input="skinWeightInput"></input>
  80. </view>
  81. </view>
  82. <view class="c-row b-b">
  83. <text class="tit">净重(自动计算)</text>
  84. <view class="con-list">
  85. <text>{{numFilter(netWeight)}}</text>
  86. </view>
  87. </view>
  88. <view v-if='carInfo.companyId==2' class="c-row b-b">
  89. <text class="tit">仓位号</text>
  90. <view class="con-list">
  91. <input placeholder="请填写仓位号" name="input" v-model="warehouse" @input="warehouseInput"></input>
  92. </view>
  93. </view>
  94. <view v-if='carInfo.companyId==2' class="c-row b-b">
  95. <text class="tit">蛋白</text>
  96. <view class="con-list">
  97. <input placeholder="请填写蛋白" name="input" v-model="protein" @input="proteinInput"></input>
  98. </view>
  99. </view>
  100. <view v-if='carInfo.companyId==2' class="c-row b-b">
  101. <text class="tit">水分</text>
  102. <view class="con-list">
  103. <input placeholder="请填写水分" name="input" v-model="waterContent" @input="waterContentInput"></input>
  104. </view>
  105. </view>
  106. <view v-if='carInfo.companyId==2' class="c-row b-b">
  107. <text class="tit">扣款金额(元/吨)</text>
  108. <view class="con-list">
  109. <input placeholder="请填写扣款金额" name="input" v-model="deduction" @input="deductionInput"></input>
  110. </view>
  111. </view>
  112. <view v-if='carInfo.companyId==2' class="c-row b-b">
  113. <text class="tit">扣款项</text>
  114. <view class="con-list">
  115. <input placeholder="请填写扣款项" name="input" v-model="remarks" @input="remarksInput"></input>
  116. </view>
  117. </view>
  118. <view v-if="taskType == '发运任务'&& carInfo.companyId==2" class="c-row b-b">
  119. <text class="tit">货值单价(元/吨)</text>
  120. <view class="con-list">
  121. <input placeholder="请填写货值单价" name="input" v-model="goodsValue" @input="goodsValueInput"></input>
  122. </view>
  123. </view>
  124. <view v-if="taskType == '入库任务'&& carInfo.companyId!=2" class="c-row b-b">
  125. <text class="tit">入库费(元/吨)</text>
  126. <view class="con-list">
  127. <input placeholder="请填写入库费" name="input" v-model="inFee" @input="inFeeInput"></input>
  128. </view>
  129. </view>
  130. <!-- <view v-if="taskType == '入库任务'&& carInfo.companyId!=2" class="c-row b-b">
  131. <text class="tit">卸车费(元/吨)</text>
  132. <view class="con-list">
  133. <input placeholder="请填写卸车费" name="input" v-model="inFee" @input="inFeeInput"></input>
  134. </view>
  135. </view> -->
  136. <view v-if="taskType == '入库任务'&& carInfo.companyId!=2" class="c-row b-b">
  137. <text class="tit">入库杂费(元/吨)</text>
  138. <view class="con-list">
  139. <input placeholder="请填写入库杂费" name="input" v-model="inOtherFee" @input="inOtherFeeInput"></input>
  140. </view>
  141. </view>
  142. <view v-if="taskType == '出库任务'&& carInfo.companyId!=2" class="c-row b-b">
  143. <text class="tit">出库费(元/吨)</text>
  144. <view class="con-list">
  145. <input placeholder="请填写出库费" name="input" v-model="outFee" @input="outFeeInput"></input>
  146. </view>
  147. </view>
  148. <view v-if="taskType == '出库任务'&& carInfo.companyId!=2" class="c-row b-b">
  149. <text class="tit">出库杂费(元/吨)</text>
  150. <view class="con-list">
  151. <input placeholder="请填写出库杂费" name="input" v-model="outOtherFee" @input="outOtherFeeInput"></input>
  152. </view>
  153. </view>
  154. <view v-if="addNumStatus && taskType == '发运任务'" class="c-list">
  155. <view class="c-row b-b">
  156. <text class="tit">申请运量</text>
  157. <view class="con-list">
  158. <input placeholder="请填写运量" name="input" v-model="addNum" @input="numInput"></input>
  159. </view>
  160. <button class='cu-btn bg-green shadow' @click="applyAddNum">申请运量</button>
  161. </view>
  162. </view>
  163. <view class="cu-bar bg-white ">
  164. <view class="action">
  165. 磅单照片
  166. </view>
  167. </view>
  168. <view class="cu-form-group">
  169. <view class="grid col-2 grid-square flex-sub">
  170. <view class="bg-img" v-if="poundImg != ''" @tap="ViewImage" :data-url="poundImg">
  171. <image :src="poundImg" mode="aspectFit"></image>
  172. <view class="cu-tag bg-red" @tap.stop="DelImg" >
  173. <text class='cuIcon-close'></text>
  174. </view>
  175. </view>
  176. <view class="solids" @tap="ChooseImage" v-if="poundImg == ''">
  177. <text class='cuIcon-cameraadd'></text>
  178. </view>
  179. </view>
  180. </view>
  181. <view v-if="carInfo.saleType == '移库' && taskType == '发运任务'" class="c-list">
  182. <view class="c-row b-b">
  183. <text v-if="carInfo.tranType == '1'" class="tit">接货人</text>
  184. <text v-else class="tit">入库外勤</text>
  185. <view class="con-list">
  186. <text>{{inPersonName}}</text>
  187. </view>
  188. <button v-if="carInfo.tranType == '1'" class='cu-btn bg-green shadow' @click="selectPerson">修改接货人</button>
  189. <button v-else class='cu-btn bg-green shadow' @click="selectPerson">修改入库外勤</button>
  190. </view>
  191. </view>
  192. <view v-if="taskType == '发运任务'" class="c-row b-b">
  193. <text class="tit">我的微信号</text>
  194. <view class="con-list">
  195. <input placeholder="请填写" name="input" v-model="wechatNo" @input="wechatNoInput"></input>
  196. </view>
  197. </view>
  198. <view v-if="taskType == '发运任务'" class="cu-bar bg-white ">
  199. <view class="action">
  200. 我的签名
  201. </view>
  202. </view>
  203. <!-- <button class='cu-btn bg-green shadow' @click="showGraph">手写签名</button> -->
  204. <view v-if="taskType == '发运任务'" class="cu-form-group">
  205. <view class="grid col-2 grid-square flex-sub">
  206. <view class="bg-img" v-if="signImg != ''" @tap="ViewSignImage" :data-url="signImg">
  207. <image :src="signImg" mode="aspectFit"></image>
  208. <view class="cu-tag bg-red" @tap.stop="DelSignImg" >
  209. <text class='cuIcon-close'></text>
  210. </view>
  211. </view>
  212. <view class="solids" @tap="ChooseSignImage" v-if="signImg == ''">
  213. <text class='cuIcon-cameraadd'></text>
  214. </view>
  215. </view>
  216. </view>
  217. </view>
  218. </view>
  219. <view class="cu-modal" :class="modalName=='inModal'?'show':''" @tap="hideModal">
  220. <scroll-view scroll-y class="cu-dialog" :style="userStyle" @tap.stop="">
  221. <view class="cu-list menu text-center" >
  222. <view class="cu-item" v-for="(item,index) in userList" :key="index" @click="selectInPerson(item)">
  223. <label class="flex justify-between align-center flex-sub">
  224. <view class="flex-sub">{{item.userName}}</view>
  225. </label>
  226. </view>
  227. </view>
  228. </scroll-view>
  229. </view>
  230. <view class="cu-modal" :class="modalName=='userModal'?'show':''" @tap="hideModal">
  231. <scroll-view scroll-y class="cu-dialog" :style="userStyle" @tap.stop="">
  232. <view class="cu-list menu text-center" >
  233. <view class="cu-item" v-for="(item,index) in userList" :key="index" @click="mygaipai(item.id)">
  234. <label class="flex justify-between align-center flex-sub">
  235. <view class="flex-sub">{{item.userName}}</view>
  236. </label>
  237. </view>
  238. </view>
  239. </scroll-view>
  240. </view>
  241. <view class="wrapper" v-if="showAutograph">
  242. <view class="handCenter">
  243. <canvas class="handWriting" disable-scroll="true" @touchstart="uploadScaleStart" @touchmove="uploadScaleMove"
  244. @touchend="uploadScaleEnd" @tap="mouseDown" canvas-id="handWriting">
  245. </canvas>
  246. </view>
  247. <view class="buttons">
  248. <button @click="retDraw" class="delBtn">重写</button>
  249. <button @click="subCanvas" class="subBtn">保存</button>
  250. </view>
  251. </view>
  252. <view v-if="taskStatus == 1 && (carInfo.status == 20 ||carInfo.status == 30)" class="page-bottom">
  253. <view class="action-btn-group">
  254. <button type="primary" class=" action-btn no-border buy-now-btn" @click="save">保存</button>
  255. <button type="primary" v-if="(carInfo.companyId==2&&carInfo.isConfirm == 0)||carInfo.companyId!=2" class=" action-btn no-border add-cart-btn" @click="finish">完成</button>
  256. <!-- <button type="primary" class=" action-btn no-border add-cart-btn" @click="gaipai">改派</button> -->
  257. </view>
  258. </view>
  259. </view>
  260. </template>
  261. <script>
  262. import uploadImage from '@/components/ossutil/uploadFile.js';
  263. import Handwriting from '@/components/ossutil/signature.js';
  264. import {
  265. mapState
  266. } from 'vuex';
  267. export default {
  268. data() {
  269. return {
  270. carInfo:[],
  271. poundImg:'',
  272. grossWeight:'',
  273. skinWeight:'',
  274. netWeight:'',
  275. taskStatus:'',
  276. userStyle:'',
  277. modalName:'',
  278. userList:[],
  279. inPersonName:'',
  280. inPersonId:'',
  281. taskType:'',
  282. signImg:'',
  283. showAutograph: false, //签名弹框是否显示
  284. ctx: [], //绘图图像
  285. points: [], //路径点集合
  286. signature: '',
  287. taskId:'',
  288. goodsValue:'',
  289. addNumStatus:false,
  290. wechatNo:'',
  291. lineColor:'black',
  292. slideValue:50,
  293. handwriting:'',
  294. selectColor:'black',
  295. color:'',
  296. inFee:'',
  297. inOfterFee:'',
  298. isFutures:'',
  299. outFee:'',
  300. outOtherFee:'',
  301. deduction:'',
  302. protein:'',
  303. warehouse:'',
  304. waterContent:'',
  305. remarks:''
  306. };
  307. },
  308. computed: {
  309. ...mapState(['hasLogin','userInfo'])
  310. },
  311. onShow() {
  312. },
  313. onLoad(options) {
  314. const that = this
  315. this.taskStatus = options.taskStatus
  316. this.taskType = options.taskType
  317. this.taskId = options.taskId
  318. uni.showLoading({
  319. title: '正在加载',
  320. mask:true
  321. })
  322. that.$api.request('tran', 'getCarInfoBySendCarNo', {
  323. sendCarNo: options.sendCarNo,
  324. taskId:options.taskId
  325. }, failres => {
  326. that.$api.msg(failres.errmsg)
  327. uni.hideLoading()
  328. }).then(res => {
  329. that.carInfo = res.data
  330. console.log(res.data,this.taskType)
  331. that.inPersonName = res.data.receiver
  332. if(that.taskType == '发运任务'){
  333. that.grossWeight = that.carInfo.grossWeight
  334. that.skinWeight = that.carInfo.skinWeight
  335. that.netWeight = that.carInfo.netWeight
  336. that.poundImg = that.carInfo.poundImg
  337. that.signImg = that.carInfo.signImg
  338. that.wechatNo = that.carInfo.wechatNo
  339. that.goodsValue = that.carInfo.goodsValue
  340. }
  341. else if(that.taskType == '入库任务' || that.taskType == '收货跟踪'){
  342. that.grossWeight = that.carInfo.grossWeightRec
  343. that.skinWeight = that.carInfo.skinWeightRec
  344. that.netWeight = that.carInfo.netWeightRec
  345. that.poundImg = that.carInfo.poundImgRec
  346. that.signImg = that.carInfo.signImg
  347. that.wechatNo = that.carInfo.wechatNo
  348. that.goodsValue = that.carInfo.goodsValue
  349. that.inFee=that.carInfo.inFee
  350. that.isFutures=that.carInfo.isFutures
  351. that.outOtherFee=that.carInfo.outOtherFee
  352. that.inOtherFee=that.carInfo.inOtherFee
  353. if(that.carInfo.isFutures==1){
  354. that.deduction=that.carInfo.deduction
  355. that.protein=that.carInfo.protein
  356. that.warehouse=that.carInfo.warehouse
  357. that.waterContent=that.carInfo.waterContent
  358. that.remarks=that.carInfo.remarks
  359. }
  360. }else if(that.taskType == '出库任务'){
  361. that.outFee=that.carInfo.outFee
  362. that.outOtherFee=that.carInfo.outOtherFee
  363. }
  364. uni.hideLoading()
  365. })
  366. },
  367. onReady(){
  368. },
  369. methods: {
  370. numFilter (value) {
  371. if(!value){
  372. return 0
  373. }
  374. // 截取当前数据到小数点后两位
  375. let realVal = parseFloat(value).toFixed(2)
  376. return realVal
  377. },
  378. ChooseSignImage() {
  379. this.handwriting = new Handwriting({
  380. lineColor: this.lineColor,
  381. slideValue: this.slideValue, // 0, 25, 50, 75, 100
  382. canvasName: 'handWriting',
  383. })
  384. this.showAutograph = true
  385. },
  386. uploadScaleStart(event){
  387. this.handwriting.uploadScaleStart(event)
  388. },
  389. uploadScaleMove(event){
  390. this.handwriting.uploadScaleMove(event)
  391. },
  392. uploadScaleEnd(event){
  393. this.handwriting.uploadScaleEnd(event)
  394. },
  395. retDraw() {
  396. this.handwriting.retDraw()
  397. },
  398. subCanvas(){
  399. this.handwriting.saveCanvas().then(res=>{
  400. let that = this;
  401. console.log(res)
  402. uploadImage(res, 'signImg/',
  403. result => {
  404. that.signImg = result
  405. that.showAutograph = false
  406. uni.hideLoading();
  407. }
  408. )
  409. }).catch(err=>{
  410. console.log(err);
  411. });
  412. },
  413. selectInPerson(item){
  414. this.inPersonId = item.id
  415. this.inPersonName = item.userName
  416. this.modalName = null
  417. },
  418. hideModal(e) {
  419. this.modalName = null
  420. },
  421. ViewImage(e) {
  422. var img = [];
  423. img = e.currentTarget.dataset.url.split(' ')
  424. uni.previewImage({
  425. current:0,
  426. urls: img
  427. });
  428. },
  429. ViewSignImage(e) {
  430. let imgsArray = [];
  431. imgsArray[0] = e.currentTarget.dataset.url;
  432. uni.previewImage({
  433. current: 0,
  434. urls: imgsArray,
  435. });
  436. },
  437. DelSignImg(e){
  438. uni.showModal({
  439. title: '提示',
  440. content: '确定要删除签名吗?',
  441. cancelText: '取消',
  442. confirmText: '确定',
  443. success: res => {
  444. if (res.confirm) {
  445. this.signImg = "";
  446. }
  447. }
  448. })
  449. },
  450. DelImg(e) {
  451. uni.showModal({
  452. title: '提示',
  453. content: '确定要删除该磅单照片吗?',
  454. cancelText: '取消',
  455. confirmText: '确定',
  456. success: res => {
  457. if (res.confirm) {
  458. this.poundImg = "";
  459. }
  460. }
  461. })
  462. },
  463. ChooseImage() {
  464. uni.chooseImage({
  465. count: 1, //默认9
  466. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  467. sourceType: ['album','camera'], //从相册选择
  468. success: (res) => {
  469. //上传图片
  470. //图片路径可自行修改
  471. uploadImage(res.tempFilePaths[0], 'carNoImg/',
  472. result => {
  473. this.poundImg = result
  474. uni.hideLoading();
  475. }
  476. )
  477. }
  478. });
  479. },
  480. goodsValueInput(e){
  481. this.goodsValue = e.detail.value
  482. },
  483. numInput(e){
  484. this.addNum = e.detail.value
  485. },
  486. wechatNoInput(e) {
  487. this.wechatNo = e.detail.value
  488. },
  489. inOtherFeeInput(e) {
  490. this.inOtherFee = e.detail.value
  491. },
  492. inFeeInput(e) {
  493. this.inFee = e.detail.value
  494. },
  495. outOtherFeeInput(e) {
  496. this.outOtherFee = e.detail.value
  497. },
  498. outFeeInput(e) {
  499. this.outFee = e.detail.value
  500. },
  501. deductionInput(e) {
  502. if(e.detail.value>0){
  503. this.deduction = e.detail.value
  504. }else{
  505. that.$api.msg('请填写正确的金额')
  506. }
  507. },
  508. proteinInput(e) {
  509. this.protein = e.detail.value
  510. },
  511. warehouseInput(e) {
  512. this.warehouse = e.detail.value
  513. },
  514. waterContentInput(e) {
  515. this.waterContent = e.detail.value
  516. },
  517. remarksInput(e) {
  518. if(e.detail.value.length>30){
  519. var maxChars = 30;//最多字符数
  520. if (e.detail.value > maxChars){
  521. that.$api.msg('最多输入30个字符,现已超出限制,自动截取前30个字符!')
  522. e.detail.value = e.detail.value.substring(0,maxChars);
  523. }
  524. }
  525. },
  526. grossWeightInput(e) {
  527. this.grossWeight = e.detail.value
  528. if(this.grossWeight && this.skinWeight){
  529. this.netWeight = this.numFilter(this.grossWeight - this.skinWeight)
  530. if(this.netWeight > this.carInfo.num){
  531. this.addNumStatus = true
  532. }
  533. }
  534. },
  535. skinWeightInput(e) {
  536. this.skinWeight = e.detail.value
  537. if(this.grossWeight && this.skinWeight){
  538. this.netWeight = this.numFilter(this.grossWeight - this.skinWeight)
  539. if(this.netWeight > this.carInfo.num){
  540. this.addNumStatus = true
  541. }
  542. else{
  543. this.addNumStatus = false
  544. }
  545. }
  546. },
  547. save(){
  548. const that = this
  549. uni.showLoading({
  550. title: '正在加载',
  551. mask:true
  552. })
  553. that.$api.request('tran', 'saveCarInfo', {
  554. sendCarNo: that.carInfo.sendCarNo,
  555. grossWeight:!that.grossWeight?'':that.grossWeight,
  556. skinWeight:!that.skinWeight?'':that.skinWeight,
  557. netWeight:!that.netWeight?'':that.netWeight,
  558. poundImg:!that.poundImg?'':that.poundImg,
  559. inPersonId:!that.inPersonId?'':that.inPersonId,
  560. signImg:!that.signImg?'':that.signImg,
  561. wechatNo:!that.wechatNo?'':that.wechatNo,
  562. taskType:that.taskType,
  563. goodsValue:!that.goodsValue?'':that.goodsValue,
  564. inFee:!that.inFee?'':that.inFee,
  565. inOtherFee:!that.inOtherFee?'':that.inOtherFee,
  566. outFee:!that.outFee?'':that.outFee,
  567. outOtherFee:!that.outOtherFee?'':that.outOtherFee,
  568. protein:!that.protein?'':that.protein,
  569. deduction:!that.deduction?'':that.deduction,
  570. warehouse:!that.warehouse?'':that.warehouse,
  571. waterContent:!that.waterContent?'':that.waterContent,
  572. remarks:!that.remarks?'':that.remarks
  573. }, failres => {
  574. that.$api.msg(failres.errmsg)
  575. uni.hideLoading()
  576. }).then(res => {
  577. that.$api.msg('保存成功')
  578. setTimeout(()=>{uni.navigateBack({
  579. delta: 1
  580. })},1000);
  581. uni.hideLoading()
  582. })
  583. },
  584. finish(){
  585. const that = this
  586. // console.log(that.carInfo.sendCarNo,that.grossWeight,that.skinWeight,that.netWeight,that.poundImg,that.inPersonId,that.signImg,that.wechatNo,that.taskId,that.taskType,that.goodsValue,that.inFee,that.inOtherFee,that.outFee,that.outOtherFee,that.protein,that.deduction,that.warehouse,that.waterContent,that.remarks)
  587. if(!that.grossWeight){
  588. this.$api.msg('请填写毛重');
  589. return;
  590. }
  591. if(!that.goodsValue && that.taskType == '发运任务'){
  592. this.$api.msg('请填写货值单价');
  593. return;
  594. }
  595. if(!that.skinWeight){
  596. this.$api.msg('请填写皮重');
  597. return;
  598. }
  599. if(!that.poundImg){
  600. this.$api.msg('请上传磅单照片');
  601. return;
  602. }
  603. if(!that.protein&&that.isFutures==1){
  604. this.$api.msg('请填写蛋白');
  605. return;
  606. }
  607. if(!that.warehouse&&that.isFutures==1){
  608. this.$api.msg('请填写仓位号');
  609. return;
  610. }
  611. if(!that.waterContent&&that.isFutures==1){
  612. this.$api.msg('请填写水分');
  613. return;
  614. }
  615. if(!that.signImg && that.taskType == '发运任务'){
  616. this.$api.msg('请手写签名');
  617. return;
  618. }
  619. if (!that.wechatNo && that.taskType == '发运任务') {
  620. that.$api.msg('请填写微信号');
  621. return
  622. }
  623. uni.showLoading({
  624. title: '正在加载',
  625. mask:true
  626. })
  627. that.$api.request('tran', 'finishCarInfo', {
  628. sendCarNo: that.carInfo.sendCarNo,
  629. grossWeight:!that.grossWeight?'':that.grossWeight,
  630. skinWeight:!that.skinWeight?'':that.skinWeight,
  631. netWeight:!that.netWeight?'':that.netWeight,
  632. poundImg:!that.poundImg?'':that.poundImg,
  633. inPersonId:!that.inPersonId?'':that.inPersonId,
  634. signImg:!that.signImg?'':that.signImg,
  635. wechatNo:!that.wechatNo?'':that.wechatNo,
  636. taskId:!that.taskId?'':that.taskId,
  637. taskType:!that.taskType?'':that.taskType,
  638. goodsValue:!that.goodsValue?'':that.goodsValue,
  639. inFee:!that.inFee?'':that.inFee,
  640. inOtherFee:!that.inOtherFee?'':that.inOtherFee,
  641. outFee:!that.outFee?'':that.outFee,
  642. outOtherFee:!that.outOtherFee?'':that.outOtherFee,
  643. protein:!that.protein?'':that.protein,
  644. deduction:!that.deduction?'':that.deduction,
  645. warehouse:!that.warehouse?'':that.warehouse,
  646. waterContent:!that.waterContent?'':that.waterContent,
  647. remarks:!that.remarks?'':that.remarks
  648. }, failres => {
  649. that.$api.msg(failres.errmsg)
  650. uni.hideLoading()
  651. }).then(res => {
  652. uni.hideLoading()
  653. if(that.taskType == "发运任务"){
  654. that.$api.msg('完成成功,请及时跟踪运输合同签订进度')
  655. setTimeout(()=>{uni.navigateBack({
  656. delta: 2
  657. })},1000);
  658. }
  659. else{
  660. that.$api.msg('完成成功')
  661. setTimeout(()=>{uni.navigateBack({
  662. delta: 1
  663. })},1000);
  664. }
  665. })
  666. },
  667. selectPerson(){
  668. const that = this
  669. uni.showLoading({
  670. title: '正在加载',
  671. mask:true
  672. })
  673. that.$api.request('user', 'getUserList', {
  674. role:'外勤'
  675. }, failres => {
  676. that.$api.msg(failres.errmsg)
  677. uni.hideLoading()
  678. }).then(res => {
  679. that.userList = res.data
  680. if(that.userList.length == 0){
  681. that.$api.msg('暂无外勤信息')
  682. }
  683. else{
  684. var height = that.userList.length * 100
  685. var width = 500
  686. that.userStyle = "height:"+height+"rpx;width:" + width+"rpx"
  687. that.modalName = 'inModal'
  688. }
  689. uni.hideLoading()
  690. })
  691. },
  692. applyAddNum(){
  693. const that = this
  694. if(!that.addNum){
  695. this.$api.msg('请填写申请运量');
  696. return;
  697. }
  698. uni.showLoading({
  699. title: '正在加载',
  700. mask:true
  701. })
  702. that.$api.request('task', 'applyNum', {
  703. id:that.taskId,
  704. sendCarNo:that.carInfo.sendCarNo,
  705. tranNum:that.addNum
  706. }, failres => {
  707. that.$api.msg(failres.errmsg)
  708. uni.hideLoading()
  709. }).then(res => {
  710. that.task = res.data
  711. that.$api.msg('运量申请成功')
  712. uni.hideLoading()
  713. })
  714. },
  715. gaipai(){
  716. const that = this
  717. uni.showLoading({
  718. title: '正在加载',
  719. mask:true
  720. })
  721. that.$api.request('user', 'getUserList', {
  722. role:'外勤'
  723. }, failres => {
  724. that.$api.msg(failres.errmsg)
  725. uni.hideLoading()
  726. }).then(res => {
  727. that.userList = res.data
  728. if(that.userList.length == 0){
  729. that.$api.msg('暂无外勤信息')
  730. }
  731. else{
  732. var height = that.userList.length * 100
  733. var width = 500
  734. that.userStyle = "height:"+height+"rpx;width:" + width+"rpx"
  735. that.modalName = 'userModal'
  736. }
  737. uni.hideLoading()
  738. })
  739. },
  740. mygaipai(id){
  741. var that = this
  742. that.$api.request('tran', 'gaipai',{
  743. taskId: that.taskId,
  744. outPersonId:id,
  745. taskType:that.taskType
  746. },failres => {
  747. that.$api.msg(failres.errmsg)
  748. that.modalName = null
  749. uni.hideLoading()
  750. }).then(res => {
  751. that.modalName = null
  752. uni.navigateBack({
  753. delta: 2
  754. })
  755. uni.hideLoading()
  756. })
  757. },
  758. },
  759. }
  760. </script>
  761. <style lang='scss' scoped="true">
  762. .container{
  763. padding-bottom: 160upx;
  764. }
  765. .detail-desc {
  766. background: #fff;
  767. margin-top: 16upx;
  768. width: 750upx;
  769. .d-header {
  770. display: flex;
  771. justify-content: center;
  772. align-items: center;
  773. height: 80upx;
  774. font-size: $font-base + 2upx;
  775. color: $font-color-dark;
  776. position: relative;
  777. text {
  778. padding: 0 20upx;
  779. background: #fff;
  780. position: relative;
  781. z-index: 1;
  782. }
  783. &:after {
  784. position: absolute;
  785. left: 50%;
  786. top: 50%;
  787. transform: translateX(-50%);
  788. width: 300upx;
  789. height: 0;
  790. content: '';
  791. border-bottom: 1px solid #ccc;
  792. }
  793. }
  794. }
  795. .c-list {
  796. font-size: $font-sm + 2upx;
  797. color: $font-color-base;
  798. background: #fff;
  799. .c-row {
  800. display: flex;
  801. align-items: center;
  802. padding: 20upx 30upx;
  803. position: relative;
  804. }
  805. .tit {
  806. width: 220upx;
  807. }
  808. .con {
  809. flex: 1;
  810. color: $font-color-dark;
  811. .selected-text {
  812. margin-right: 10upx;
  813. }
  814. }
  815. .bz-list {
  816. height: 40upx;
  817. font-size: $font-sm+2upx;
  818. color: $font-color-dark;
  819. text {
  820. display: inline-block;
  821. margin-right: 30upx;
  822. }
  823. }
  824. .con-list {
  825. flex: 1;
  826. display: flex;
  827. flex-direction: column;
  828. color: $font-color-dark;
  829. line-height: 40upx;
  830. text-align: right;
  831. padding-right: 20upx;
  832. }
  833. .red {
  834. color: $uni-color-primary;
  835. }
  836. }
  837. /* 底部操作菜单 */
  838. .page-bottom {
  839. position: fixed;
  840. left: 30upx;
  841. bottom: 30upx;
  842. z-index: 95;
  843. display: flex;
  844. justify-content: center;
  845. align-items: center;
  846. width: 690upx;
  847. height: 100upx;
  848. background: rgba(255, 255, 255, .9);
  849. box-shadow: 0 0 20upx 0 rgba(0, 0, 0, .5);
  850. border-radius: 16upx;
  851. .p-b-btn {
  852. display: flex;
  853. flex-direction: column;
  854. align-items: center;
  855. justify-content: center;
  856. font-size: $font-sm;
  857. color: $font-color-base;
  858. width: 96upx;
  859. height: 80upx;
  860. .yticon {
  861. font-size: 40upx;
  862. line-height: 48upx;
  863. color: $font-color-light;
  864. }
  865. &.active,
  866. &.active .yticon {
  867. color: $uni-color-primary;
  868. }
  869. .icon-fenxiang2 {
  870. font-size: 42upx;
  871. transform: translateY(-2upx);
  872. }
  873. .icon-shoucang {
  874. font-size: 46upx;
  875. }
  876. }
  877. .action-btn-group {
  878. .action-btn {
  879. width: 33.3333%;
  880. }
  881. }
  882. }
  883. @mixin playcenter {
  884. display: flex;
  885. align-items: center;
  886. justify-content: center;
  887. }
  888. .xsh-start {
  889. width: 105rpx;
  890. height: 105rpx;
  891. background: #FFFFFF;
  892. border-radius: 50%;
  893. font-size: 29rpx;
  894. color: #4135EB;
  895. @include playcenter;
  896. flex-wrap: wrap;
  897. }
  898. .x-modal {
  899. width: 100%;
  900. .x-m-title {
  901. width: 100%;
  902. height: 90rpx;
  903. padding: 0 38rpx 0 31rpx;
  904. box-sizing: border-box;
  905. font-size: 29rpx;
  906. color: #333333;
  907. border-bottom: 1px dashed #999;
  908. @include playcenter;
  909. justify-content: space-between;
  910. .xm-t-clear {
  911. font-size: 25rpx;
  912. color: #341DB7;
  913. @include playcenter;
  914. >image {
  915. width: 28rpx;
  916. height: 28rpx;
  917. display: block;
  918. margin-right: 8rpx;
  919. }
  920. }
  921. }
  922. .x-m-con {
  923. width: 100%;
  924. padding: 0 31rpx 18rpx;
  925. margin-top: 5rpx;
  926. box-sizing: border-box;
  927. }
  928. }
  929. .wrapper {
  930. width: 100%;
  931. height: 100%;
  932. margin: 30upx 0;
  933. overflow: hidden;
  934. display: flex;
  935. align-content: center;
  936. flex-direction: column;
  937. justify-content: center;
  938. font-size: 28upx;
  939. }
  940. .handWriting {
  941. background: #fff;
  942. width: 100%;
  943. height: 350upx;
  944. }
  945. .handRight {
  946. align-items: center;
  947. }
  948. .handCenter {
  949. border: 4upx dashed #e9e9e9;
  950. flex: 5;
  951. overflow: hidden;
  952. box-sizing: border-box;
  953. width: 90%;
  954. margin: 0 auto;
  955. }
  956. .handTitle {
  957. flex: 1;
  958. color: #666;
  959. justify-content: center;
  960. font-size: 30upx;
  961. }
  962. .handBtn {
  963. flex-direction: column;
  964. padding: 40upx 20upx;
  965. }
  966. .buttons{
  967. width: 100%;
  968. margin-top: 20upx;
  969. justify-content: space-between;
  970. }
  971. .buttons>button{
  972. font-size: 30upx;
  973. height: 80upx;
  974. }
  975. .delBtn {
  976. background: #23df02;
  977. color: #fff;
  978. }
  979. .color{
  980. align-items: center;
  981. }
  982. .color>text{
  983. margin-right: 20upx;
  984. }
  985. .subBtn {
  986. background: #008ef6;
  987. color: #fff;
  988. text-align: center;
  989. justify-content: center;
  990. }
  991. .black-select {
  992. width: 60upx;
  993. height: 60upx;
  994. }
  995. .black-select.color_select {
  996. width: 90upx;
  997. height: 90upx;
  998. }
  999. .red-select {
  1000. width: 60upx;
  1001. height: 60upx;
  1002. }
  1003. .red-select.color_select {
  1004. width: 90upx;
  1005. height: 90upx;
  1006. }
  1007. .slide-wrapper {
  1008. align-items: center;
  1009. margin-bottom: 20upx;
  1010. }
  1011. .slider{
  1012. width: 400upx;
  1013. padding-left: 20upx;
  1014. }
  1015. .drop {
  1016. width: 50upx;
  1017. height: 50upx;
  1018. border-radius: 50%;
  1019. background: #FFF;
  1020. position: absolute;
  1021. left: 0upx;
  1022. top: -10upx;
  1023. box-shadow: 0px 1px 5px #888888;
  1024. }
  1025. .slide {
  1026. width: 250upx;
  1027. height: 30upx;
  1028. }
  1029. .showimg{
  1030. border: 4upx solid #e9e9e9;
  1031. overflow: hidden;
  1032. width: 90%;
  1033. margin: 0 auto;
  1034. background: #eee;
  1035. height: 350upx;
  1036. margin-top: 40upx;
  1037. align-items: center;
  1038. justify-content: center;
  1039. }
  1040. .showimg>image{
  1041. width: 100%;
  1042. height: 100%;
  1043. }
  1044. .showimg>text{
  1045. font-size: 40upx;
  1046. color: #888;
  1047. }
  1048. .indexFixed{
  1049. position: fixed;
  1050. left:0;
  1051. bottom:0;
  1052. right:0;
  1053. }
  1054. </style>