task_detail.vue 29 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084
  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. })
  321. that.$api.request('tran', 'getCarInfoBySendCarNo', {
  322. sendCarNo: options.sendCarNo,
  323. taskId:options.taskId
  324. }, failres => {
  325. that.$api.msg(failres.errmsg)
  326. uni.hideLoading()
  327. }).then(res => {
  328. that.carInfo = res.data
  329. console.log(res.data,this.taskType)
  330. that.inPersonName = res.data.receiver
  331. if(that.taskType == '发运任务'){
  332. that.grossWeight = that.carInfo.grossWeight
  333. that.skinWeight = that.carInfo.skinWeight
  334. that.netWeight = that.carInfo.netWeight
  335. that.poundImg = that.carInfo.poundImg
  336. that.signImg = that.carInfo.signImg
  337. that.wechatNo = that.carInfo.wechatNo
  338. that.goodsValue = that.carInfo.goodsValue
  339. }
  340. else if(that.taskType == '入库任务' || that.taskType == '收货跟踪'){
  341. that.grossWeight = that.carInfo.grossWeightRec
  342. that.skinWeight = that.carInfo.skinWeightRec
  343. that.netWeight = that.carInfo.netWeightRec
  344. that.poundImg = that.carInfo.poundImgRec
  345. that.signImg = that.carInfo.signImg
  346. that.wechatNo = that.carInfo.wechatNo
  347. that.goodsValue = that.carInfo.goodsValue
  348. that.inFee=that.carInfo.inFee
  349. that.isFutures=that.carInfo.isFutures
  350. that.outOtherFee=that.carInfo.outOtherFee
  351. that.inOtherFee=that.carInfo.inOtherFee
  352. if(that.carInfo.isFutures==1){
  353. that.deduction=that.carInfo.deduction
  354. that.protein=that.carInfo.protein
  355. that.warehouse=that.carInfo.warehouse
  356. that.waterContent=that.carInfo.waterContent
  357. that.remarks=that.carInfo.remarks
  358. }
  359. }else if(that.taskType == '出库任务'){
  360. that.outFee=that.carInfo.outFee
  361. that.outOtherFee=that.carInfo.outOtherFee
  362. }
  363. uni.hideLoading()
  364. })
  365. },
  366. onReady(){
  367. },
  368. methods: {
  369. numFilter (value) {
  370. if(!value){
  371. return 0
  372. }
  373. // 截取当前数据到小数点后两位
  374. let realVal = parseFloat(value).toFixed(2)
  375. return realVal
  376. },
  377. ChooseSignImage() {
  378. this.handwriting = new Handwriting({
  379. lineColor: this.lineColor,
  380. slideValue: this.slideValue, // 0, 25, 50, 75, 100
  381. canvasName: 'handWriting',
  382. })
  383. this.showAutograph = true
  384. },
  385. uploadScaleStart(event){
  386. this.handwriting.uploadScaleStart(event)
  387. },
  388. uploadScaleMove(event){
  389. this.handwriting.uploadScaleMove(event)
  390. },
  391. uploadScaleEnd(event){
  392. this.handwriting.uploadScaleEnd(event)
  393. },
  394. retDraw() {
  395. this.handwriting.retDraw()
  396. },
  397. subCanvas(){
  398. this.handwriting.saveCanvas().then(res=>{
  399. let that = this;
  400. console.log(res)
  401. uploadImage(res, 'signImg/',
  402. result => {
  403. that.signImg = result
  404. that.showAutograph = false
  405. uni.hideLoading();
  406. }
  407. )
  408. }).catch(err=>{
  409. console.log(err);
  410. });
  411. },
  412. selectInPerson(item){
  413. this.inPersonId = item.id
  414. this.inPersonName = item.userName
  415. this.modalName = null
  416. },
  417. hideModal(e) {
  418. this.modalName = null
  419. },
  420. ViewImage(e) {
  421. var img = [];
  422. img = e.currentTarget.dataset.url.split(' ')
  423. uni.previewImage({
  424. current:0,
  425. urls: img
  426. });
  427. },
  428. ViewSignImage(e) {
  429. let imgsArray = [];
  430. imgsArray[0] = e.currentTarget.dataset.url;
  431. uni.previewImage({
  432. current: 0,
  433. urls: imgsArray,
  434. });
  435. },
  436. DelSignImg(e){
  437. uni.showModal({
  438. title: '提示',
  439. content: '确定要删除签名吗?',
  440. cancelText: '取消',
  441. confirmText: '确定',
  442. success: res => {
  443. if (res.confirm) {
  444. this.signImg = "";
  445. }
  446. }
  447. })
  448. },
  449. DelImg(e) {
  450. uni.showModal({
  451. title: '提示',
  452. content: '确定要删除该磅单照片吗?',
  453. cancelText: '取消',
  454. confirmText: '确定',
  455. success: res => {
  456. if (res.confirm) {
  457. this.poundImg = "";
  458. }
  459. }
  460. })
  461. },
  462. ChooseImage() {
  463. uni.chooseImage({
  464. count: 1, //默认9
  465. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  466. sourceType: ['album','camera'], //从相册选择
  467. success: (res) => {
  468. //上传图片
  469. //图片路径可自行修改
  470. uploadImage(res.tempFilePaths[0], 'carNoImg/',
  471. result => {
  472. this.poundImg = result
  473. uni.hideLoading();
  474. }
  475. )
  476. }
  477. });
  478. },
  479. goodsValueInput(e){
  480. this.goodsValue = e.detail.value
  481. },
  482. numInput(e){
  483. this.addNum = e.detail.value
  484. },
  485. wechatNoInput(e) {
  486. this.wechatNo = e.detail.value
  487. },
  488. inOtherFeeInput(e) {
  489. this.inOtherFee = e.detail.value
  490. },
  491. inFeeInput(e) {
  492. this.inFee = e.detail.value
  493. },
  494. outOtherFeeInput(e) {
  495. this.outOtherFee = e.detail.value
  496. },
  497. outFeeInput(e) {
  498. this.outFee = e.detail.value
  499. },
  500. deductionInput(e) {
  501. if(e.detail.value>0){
  502. this.deduction = e.detail.value
  503. }else{
  504. that.$api.msg('请填写正确的金额')
  505. }
  506. },
  507. proteinInput(e) {
  508. this.protein = e.detail.value
  509. },
  510. warehouseInput(e) {
  511. this.warehouse = e.detail.value
  512. },
  513. waterContentInput(e) {
  514. this.waterContent = e.detail.value
  515. },
  516. remarksInput(e) {
  517. if(e.detail.value.length>30){
  518. var maxChars = 30;//最多字符数
  519. if (e.detail.value > maxChars){
  520. that.$api.msg('最多输入30个字符,现已超出限制,自动截取前30个字符!')
  521. e.detail.value = e.detail.value.substring(0,maxChars);
  522. }
  523. }
  524. },
  525. grossWeightInput(e) {
  526. this.grossWeight = e.detail.value
  527. if(this.grossWeight && this.skinWeight){
  528. this.netWeight = this.numFilter(this.grossWeight - this.skinWeight)
  529. if(this.netWeight > this.carInfo.num){
  530. this.addNumStatus = true
  531. }
  532. }
  533. },
  534. skinWeightInput(e) {
  535. this.skinWeight = e.detail.value
  536. if(this.grossWeight && this.skinWeight){
  537. this.netWeight = this.numFilter(this.grossWeight - this.skinWeight)
  538. if(this.netWeight > this.carInfo.num){
  539. this.addNumStatus = true
  540. }
  541. else{
  542. this.addNumStatus = false
  543. }
  544. }
  545. },
  546. save(){
  547. const that = this
  548. uni.showLoading({
  549. title: '正在加载'
  550. })
  551. that.$api.request('tran', 'saveCarInfo', {
  552. sendCarNo: that.carInfo.sendCarNo,
  553. grossWeight:!that.grossWeight?'':that.grossWeight,
  554. skinWeight:!that.skinWeight?'':that.skinWeight,
  555. netWeight:!that.netWeight?'':that.netWeight,
  556. poundImg:!that.poundImg?'':that.poundImg,
  557. inPersonId:!that.inPersonId?'':that.inPersonId,
  558. signImg:!that.signImg?'':that.signImg,
  559. wechatNo:!that.wechatNo?'':that.wechatNo,
  560. taskType:that.taskType,
  561. goodsValue:!that.goodsValue?'':that.goodsValue,
  562. inFee:!that.inFee?'':that.inFee,
  563. inOtherFee:!that.inOtherFee?'':that.inOtherFee,
  564. outFee:!that.outFee?'':that.outFee,
  565. outOtherFee:!that.outOtherFee?'':that.outOtherFee,
  566. protein:!that.protein?'':that.protein,
  567. deduction:!that.deduction?'':that.deduction,
  568. warehouse:!that.warehouse?'':that.warehouse,
  569. waterContent:!that.waterContent?'':that.waterContent,
  570. remarks:!that.remarks?'':that.remarks
  571. }, failres => {
  572. that.$api.msg(failres.errmsg)
  573. uni.hideLoading()
  574. }).then(res => {
  575. that.$api.msg('保存成功')
  576. setTimeout(()=>{uni.navigateBack({
  577. delta: 1
  578. })},1000);
  579. uni.hideLoading()
  580. })
  581. },
  582. finish(){
  583. const that = this
  584. // 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)
  585. if(!that.grossWeight){
  586. this.$api.msg('请填写毛重');
  587. return;
  588. }
  589. if(!that.goodsValue && that.taskType == '发运任务'){
  590. this.$api.msg('请填写货值单价');
  591. return;
  592. }
  593. if(!that.skinWeight){
  594. this.$api.msg('请填写皮重');
  595. return;
  596. }
  597. if(!that.poundImg){
  598. this.$api.msg('请上传磅单照片');
  599. return;
  600. }
  601. if(!that.protein&&that.isFutures==1){
  602. this.$api.msg('请填写蛋白');
  603. return;
  604. }
  605. if(!that.warehouse&&that.isFutures==1){
  606. this.$api.msg('请填写仓位号');
  607. return;
  608. }
  609. if(!that.waterContent&&that.isFutures==1){
  610. this.$api.msg('请填写水分');
  611. return;
  612. }
  613. if(!that.signImg && that.taskType == '发运任务'){
  614. this.$api.msg('请手写签名');
  615. return;
  616. }
  617. if (!that.wechatNo && that.taskType == '发运任务') {
  618. that.$api.msg('请填写微信号');
  619. return
  620. }
  621. uni.showLoading({
  622. title: '正在加载'
  623. })
  624. that.$api.request('tran', 'finishCarInfo', {
  625. sendCarNo: that.carInfo.sendCarNo,
  626. grossWeight:!that.grossWeight?'':that.grossWeight,
  627. skinWeight:!that.skinWeight?'':that.skinWeight,
  628. netWeight:!that.netWeight?'':that.netWeight,
  629. poundImg:!that.poundImg?'':that.poundImg,
  630. inPersonId:!that.inPersonId?'':that.inPersonId,
  631. signImg:!that.signImg?'':that.signImg,
  632. wechatNo:!that.wechatNo?'':that.wechatNo,
  633. taskId:!that.taskId?'':that.taskId,
  634. taskType:!that.taskType?'':that.taskType,
  635. goodsValue:!that.goodsValue?'':that.goodsValue,
  636. inFee:!that.inFee?'':that.inFee,
  637. inOtherFee:!that.inOtherFee?'':that.inOtherFee,
  638. outFee:!that.outFee?'':that.outFee,
  639. outOtherFee:!that.outOtherFee?'':that.outOtherFee,
  640. protein:!that.protein?'':that.protein,
  641. deduction:!that.deduction?'':that.deduction,
  642. warehouse:!that.warehouse?'':that.warehouse,
  643. waterContent:!that.waterContent?'':that.waterContent,
  644. remarks:!that.remarks?'':that.remarks
  645. }, failres => {
  646. that.$api.msg(failres.errmsg)
  647. uni.hideLoading()
  648. }).then(res => {
  649. uni.hideLoading()
  650. if(that.taskType == "发运任务"){
  651. that.$api.msg('完成成功,请及时跟踪运输合同签订进度')
  652. setTimeout(()=>{uni.navigateBack({
  653. delta: 2
  654. })},1000);
  655. }
  656. else{
  657. that.$api.msg('完成成功')
  658. setTimeout(()=>{uni.navigateBack({
  659. delta: 1
  660. })},1000);
  661. }
  662. })
  663. },
  664. selectPerson(){
  665. const that = this
  666. uni.showLoading({
  667. title: '正在加载'
  668. })
  669. that.$api.request('user', 'getUserList', {
  670. role:'外勤'
  671. }, failres => {
  672. that.$api.msg(failres.errmsg)
  673. uni.hideLoading()
  674. }).then(res => {
  675. that.userList = res.data
  676. if(that.userList.length == 0){
  677. that.$api.msg('暂无外勤信息')
  678. }
  679. else{
  680. var height = that.userList.length * 100
  681. var width = 500
  682. that.userStyle = "height:"+height+"rpx;width:" + width+"rpx"
  683. that.modalName = 'inModal'
  684. }
  685. uni.hideLoading()
  686. })
  687. },
  688. applyAddNum(){
  689. const that = this
  690. if(!that.addNum){
  691. this.$api.msg('请填写申请运量');
  692. return;
  693. }
  694. uni.showLoading({
  695. title: '正在加载'
  696. })
  697. that.$api.request('task', 'applyNum', {
  698. id:that.taskId,
  699. sendCarNo:that.carInfo.sendCarNo,
  700. tranNum:that.addNum
  701. }, failres => {
  702. that.$api.msg(failres.errmsg)
  703. uni.hideLoading()
  704. }).then(res => {
  705. that.task = res.data
  706. that.$api.msg('运量申请成功')
  707. uni.hideLoading()
  708. })
  709. },
  710. gaipai(){
  711. const that = this
  712. uni.showLoading({
  713. title: '正在加载'
  714. })
  715. that.$api.request('user', 'getUserList', {
  716. role:'外勤'
  717. }, failres => {
  718. that.$api.msg(failres.errmsg)
  719. uni.hideLoading()
  720. }).then(res => {
  721. that.userList = res.data
  722. if(that.userList.length == 0){
  723. that.$api.msg('暂无外勤信息')
  724. }
  725. else{
  726. var height = that.userList.length * 100
  727. var width = 500
  728. that.userStyle = "height:"+height+"rpx;width:" + width+"rpx"
  729. that.modalName = 'userModal'
  730. }
  731. uni.hideLoading()
  732. })
  733. },
  734. mygaipai(id){
  735. var that = this
  736. that.$api.request('tran', 'gaipai',{
  737. taskId: that.taskId,
  738. outPersonId:id,
  739. taskType:that.taskType
  740. },failres => {
  741. that.$api.msg(failres.errmsg)
  742. that.modalName = null
  743. uni.hideLoading()
  744. }).then(res => {
  745. that.modalName = null
  746. uni.navigateBack({
  747. delta: 2
  748. })
  749. uni.hideLoading()
  750. })
  751. },
  752. },
  753. }
  754. </script>
  755. <style lang='scss' scoped="true">
  756. .container{
  757. padding-bottom: 160upx;
  758. }
  759. .detail-desc {
  760. background: #fff;
  761. margin-top: 16upx;
  762. width: 750upx;
  763. .d-header {
  764. display: flex;
  765. justify-content: center;
  766. align-items: center;
  767. height: 80upx;
  768. font-size: $font-base + 2upx;
  769. color: $font-color-dark;
  770. position: relative;
  771. text {
  772. padding: 0 20upx;
  773. background: #fff;
  774. position: relative;
  775. z-index: 1;
  776. }
  777. &:after {
  778. position: absolute;
  779. left: 50%;
  780. top: 50%;
  781. transform: translateX(-50%);
  782. width: 300upx;
  783. height: 0;
  784. content: '';
  785. border-bottom: 1px solid #ccc;
  786. }
  787. }
  788. }
  789. .c-list {
  790. font-size: $font-sm + 2upx;
  791. color: $font-color-base;
  792. background: #fff;
  793. .c-row {
  794. display: flex;
  795. align-items: center;
  796. padding: 20upx 30upx;
  797. position: relative;
  798. }
  799. .tit {
  800. width: 220upx;
  801. }
  802. .con {
  803. flex: 1;
  804. color: $font-color-dark;
  805. .selected-text {
  806. margin-right: 10upx;
  807. }
  808. }
  809. .bz-list {
  810. height: 40upx;
  811. font-size: $font-sm+2upx;
  812. color: $font-color-dark;
  813. text {
  814. display: inline-block;
  815. margin-right: 30upx;
  816. }
  817. }
  818. .con-list {
  819. flex: 1;
  820. display: flex;
  821. flex-direction: column;
  822. color: $font-color-dark;
  823. line-height: 40upx;
  824. text-align: right;
  825. padding-right: 20upx;
  826. }
  827. .red {
  828. color: $uni-color-primary;
  829. }
  830. }
  831. /* 底部操作菜单 */
  832. .page-bottom {
  833. position: fixed;
  834. left: 30upx;
  835. bottom: 30upx;
  836. z-index: 95;
  837. display: flex;
  838. justify-content: center;
  839. align-items: center;
  840. width: 690upx;
  841. height: 100upx;
  842. background: rgba(255, 255, 255, .9);
  843. box-shadow: 0 0 20upx 0 rgba(0, 0, 0, .5);
  844. border-radius: 16upx;
  845. .p-b-btn {
  846. display: flex;
  847. flex-direction: column;
  848. align-items: center;
  849. justify-content: center;
  850. font-size: $font-sm;
  851. color: $font-color-base;
  852. width: 96upx;
  853. height: 80upx;
  854. .yticon {
  855. font-size: 40upx;
  856. line-height: 48upx;
  857. color: $font-color-light;
  858. }
  859. &.active,
  860. &.active .yticon {
  861. color: $uni-color-primary;
  862. }
  863. .icon-fenxiang2 {
  864. font-size: 42upx;
  865. transform: translateY(-2upx);
  866. }
  867. .icon-shoucang {
  868. font-size: 46upx;
  869. }
  870. }
  871. .action-btn-group {
  872. .action-btn {
  873. width: 33.3333%;
  874. }
  875. }
  876. }
  877. @mixin playcenter {
  878. display: flex;
  879. align-items: center;
  880. justify-content: center;
  881. }
  882. .xsh-start {
  883. width: 105rpx;
  884. height: 105rpx;
  885. background: #FFFFFF;
  886. border-radius: 50%;
  887. font-size: 29rpx;
  888. color: #4135EB;
  889. @include playcenter;
  890. flex-wrap: wrap;
  891. }
  892. .x-modal {
  893. width: 100%;
  894. .x-m-title {
  895. width: 100%;
  896. height: 90rpx;
  897. padding: 0 38rpx 0 31rpx;
  898. box-sizing: border-box;
  899. font-size: 29rpx;
  900. color: #333333;
  901. border-bottom: 1px dashed #999;
  902. @include playcenter;
  903. justify-content: space-between;
  904. .xm-t-clear {
  905. font-size: 25rpx;
  906. color: #341DB7;
  907. @include playcenter;
  908. >image {
  909. width: 28rpx;
  910. height: 28rpx;
  911. display: block;
  912. margin-right: 8rpx;
  913. }
  914. }
  915. }
  916. .x-m-con {
  917. width: 100%;
  918. padding: 0 31rpx 18rpx;
  919. margin-top: 5rpx;
  920. box-sizing: border-box;
  921. }
  922. }
  923. .wrapper {
  924. width: 100%;
  925. height: 100%;
  926. margin: 30upx 0;
  927. overflow: hidden;
  928. display: flex;
  929. align-content: center;
  930. flex-direction: column;
  931. justify-content: center;
  932. font-size: 28upx;
  933. }
  934. .handWriting {
  935. background: #fff;
  936. width: 100%;
  937. height: 350upx;
  938. }
  939. .handRight {
  940. align-items: center;
  941. }
  942. .handCenter {
  943. border: 4upx dashed #e9e9e9;
  944. flex: 5;
  945. overflow: hidden;
  946. box-sizing: border-box;
  947. width: 90%;
  948. margin: 0 auto;
  949. }
  950. .handTitle {
  951. flex: 1;
  952. color: #666;
  953. justify-content: center;
  954. font-size: 30upx;
  955. }
  956. .handBtn {
  957. flex-direction: column;
  958. padding: 40upx 20upx;
  959. }
  960. .buttons{
  961. width: 100%;
  962. margin-top: 20upx;
  963. justify-content: space-between;
  964. }
  965. .buttons>button{
  966. font-size: 30upx;
  967. height: 80upx;
  968. }
  969. .delBtn {
  970. background: #23df02;
  971. color: #fff;
  972. }
  973. .color{
  974. align-items: center;
  975. }
  976. .color>text{
  977. margin-right: 20upx;
  978. }
  979. .subBtn {
  980. background: #008ef6;
  981. color: #fff;
  982. text-align: center;
  983. justify-content: center;
  984. }
  985. .black-select {
  986. width: 60upx;
  987. height: 60upx;
  988. }
  989. .black-select.color_select {
  990. width: 90upx;
  991. height: 90upx;
  992. }
  993. .red-select {
  994. width: 60upx;
  995. height: 60upx;
  996. }
  997. .red-select.color_select {
  998. width: 90upx;
  999. height: 90upx;
  1000. }
  1001. .slide-wrapper {
  1002. align-items: center;
  1003. margin-bottom: 20upx;
  1004. }
  1005. .slider{
  1006. width: 400upx;
  1007. padding-left: 20upx;
  1008. }
  1009. .drop {
  1010. width: 50upx;
  1011. height: 50upx;
  1012. border-radius: 50%;
  1013. background: #FFF;
  1014. position: absolute;
  1015. left: 0upx;
  1016. top: -10upx;
  1017. box-shadow: 0px 1px 5px #888888;
  1018. }
  1019. .slide {
  1020. width: 250upx;
  1021. height: 30upx;
  1022. }
  1023. .showimg{
  1024. border: 4upx solid #e9e9e9;
  1025. overflow: hidden;
  1026. width: 90%;
  1027. margin: 0 auto;
  1028. background: #eee;
  1029. height: 350upx;
  1030. margin-top: 40upx;
  1031. align-items: center;
  1032. justify-content: center;
  1033. }
  1034. .showimg>image{
  1035. width: 100%;
  1036. height: 100%;
  1037. }
  1038. .showimg>text{
  1039. font-size: 40upx;
  1040. color: #888;
  1041. }
  1042. .indexFixed{
  1043. position: fixed;
  1044. left:0;
  1045. bottom:0;
  1046. right:0;
  1047. }
  1048. </style>