task_detail_buy.vue 27 KB

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