task_detail_buy.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038
  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.chooseImage({
  359. count: 1, //默认9
  360. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  361. sourceType: ['album','camera'], //从相册选择
  362. success: (res) => {
  363. //上传图片
  364. uploadImage(res.tempFilePaths[0], 'bankImg/',
  365. result => {
  366. if(that.bankImg == undefined){
  367. that.bankImg = ''
  368. }
  369. if (that.bankImg.length != 0) {
  370. that.bankImg1 = result
  371. uni.hideLoading()
  372. } else {
  373. that.bankImg = result
  374. that.$api.request('tran', 'bankShibie', {
  375. bankImg: result
  376. }, failres => {
  377. that.$api.msg(failres.errmsg)
  378. uni.hideLoading()
  379. }).then(res => {
  380. that.bankAccount = res.data.bankName
  381. that.bankNo = res.data.bankNo
  382. that.bankNameList = res.data.bankNameZhihang
  383. that.bankPhone = res.data.bankPhone
  384. that.$api.msg('请核对开户行、支行和银行卡号')
  385. uni.hideLoading()
  386. })
  387. }
  388. }
  389. )
  390. }
  391. });
  392. },
  393. ChooseImagePerson() {
  394. const that = this
  395. uni.chooseImage({
  396. count: 1, //默认9
  397. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  398. sourceType: ['album','camera'], //从相册选择
  399. success: (res) => {
  400. //上传图片
  401. //图片路径可自行修改
  402. uploadImage(res.tempFilePaths[0], 'personNoImg/',
  403. result => {
  404. if (this.personNoImg.length != 0) {
  405. this.personNoImg1 = result
  406. uni.hideLoading()
  407. } else {
  408. this.personNoImg = result
  409. that.$api.request('tran', 'personShibie', {
  410. personImg: result,
  411. type:"driver"
  412. }, failres => {
  413. that.$api.msg(failres.errmsg)
  414. uni.hideLoading()
  415. }).then(res => {
  416. that.driver = res.data.driver
  417. that.driverNo = res.data.driverNo
  418. that.$api.msg('请核对身份信息')
  419. uni.hideLoading()
  420. })
  421. }
  422. }
  423. )
  424. },
  425. complete:function(res){
  426. uni.hideLoading()
  427. }
  428. });
  429. },
  430. changeZhihang(){
  431. this.zhihangStatus = !this.zhihangStatus
  432. },
  433. bankNameChange(e) {
  434. this.bankNameIndex = e.detail.value
  435. this.bankNameZhihang = this.bankNameList[this.bankNameIndex]
  436. },
  437. driverNoInput(e) {
  438. this.driverNo = e.detail.value
  439. },
  440. bankNoInput(e) {
  441. this.bankNo = e.detail.value
  442. },
  443. bankAccountInput(e) {
  444. this.bankAccount = e.detail.value
  445. },
  446. bankNameZhihangInput(e) {
  447. this.bankNameZhihang = e.detail.value
  448. },
  449. priceInput(e){
  450. this.price = e.detail.value
  451. if(this.netWeight&&this.price&&this.bucklePrice){
  452. this.realPrice=this.numFilter(this.netWeight*this.price - this.bucklePrice)
  453. this.addNumStatus = true
  454. }
  455. },
  456. goodsNameInput(e){
  457. this.goodsName=e.detail.value
  458. },
  459. waterContentInput(e){
  460. this.waterContent = e.detail.value
  461. },
  462. bulkDensityInput(e){
  463. this.bulkDensity = e.detail.value
  464. },
  465. burntInput(e){
  466. this.burnt = e.detail.value
  467. },
  468. moldyInput(e){
  469. this.moldy = e.detail.value
  470. },
  471. bucklePriceInput(e){
  472. this.bucklePrice = e.detail.value
  473. if(this.netWeight&&this.price&&this.bucklePrice){
  474. this.realPrice=this.numFilter(this.netWeight*(this.price - this.bucklePrice))
  475. this.addNumStatus = true
  476. }
  477. },
  478. numFilter (value) {
  479. if(!value){
  480. return 0
  481. }
  482. // 截取当前数据到小数点后两位
  483. let realVal = parseFloat(value).toFixed(2)
  484. return realVal
  485. },
  486. uploadScaleStart(event){
  487. this.handwriting.uploadScaleStart(event)
  488. },
  489. uploadScaleMove(event){
  490. this.handwriting.uploadScaleMove(event)
  491. },
  492. uploadScaleEnd(event){
  493. this.handwriting.uploadScaleEnd(event)
  494. },
  495. retDraw() {
  496. this.handwriting.retDraw()
  497. },
  498. hideModal(e) {
  499. this.modalName = null
  500. },
  501. ViewImage(e) {
  502. var img = [];
  503. img = e.currentTarget.dataset.url.split(' ')
  504. uni.previewImage({
  505. current:0,
  506. urls: img
  507. });
  508. },
  509. DelImg(e) {
  510. uni.showModal({
  511. title: '提示',
  512. content: '确定要删除该照片吗?',
  513. cancelText: '取消',
  514. confirmText: '确定',
  515. success: res => {
  516. if (res.confirm) {
  517. if(e.currentTarget.dataset.index == 0){
  518. this.personNoImg = "";
  519. }
  520. else if(e.currentTarget.dataset.index == 1){
  521. this.personNoImg1 = "";
  522. }
  523. else if(e.currentTarget.dataset.index == 2){
  524. this.bankImg = "";
  525. }
  526. else if(e.currentTarget.dataset.index == 3){
  527. this.bankImg1= "";
  528. }
  529. else if(e.currentTarget.dataset.index == 4){
  530. this.otherImg = "";
  531. }
  532. else if(e.currentTarget.dataset.index == 5){
  533. this.poundImg = "";
  534. }
  535. }
  536. }
  537. })
  538. },
  539. ChooseImage() {
  540. uni.chooseImage({
  541. count: 1, //默认9
  542. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  543. sourceType: ['album','camera'], //从相册选择
  544. success: (res) => {
  545. //上传图片
  546. //图片路径可自行修改
  547. uploadImage(res.tempFilePaths[0], 'carNoImg/',
  548. result => {
  549. this.poundImg = result
  550. uni.hideLoading();
  551. }
  552. )
  553. }
  554. });
  555. },
  556. grossWeightInput(e) {
  557. this.grossWeight = e.detail.value
  558. if(this.grossWeight && this.skinWeight){
  559. this.netWeight = this.numFilter(this.grossWeight - this.skinWeight)
  560. this.addNumStatus = true
  561. }
  562. },
  563. skinWeightInput(e) {
  564. this.skinWeight = e.detail.value
  565. if(this.grossWeight && this.skinWeight){
  566. this.netWeight = this.numFilter(this.grossWeight - this.skinWeight)
  567. this.addNumStatus = true
  568. }
  569. },
  570. save(){
  571. const that = this
  572. uni.showLoading({
  573. title: '正在加载',
  574. mask:true
  575. })
  576. that.$api.request('tran', 'savePurchaseInfo', {
  577. driver:!that.driver?'':that.driver,
  578. personNoImg:!that.personNoImg?'':that.personNoImg,
  579. personNoImg1:!that.personNoImg1?'':that.personNoImg1,
  580. bankImg:!that.bankImg?'':that.bankImg,
  581. bankImg1:!that.bankImg1?'':that.bankImg1,
  582. grossWeight:!that.grossWeight?'':that.grossWeight,
  583. skinWeight:!that.skinWeight?'':that.skinWeight,
  584. netWeight:!that.netWeight?'':that.netWeight,
  585. poundImg:!that.poundImg?'':that.poundImg,
  586. otherImg:!that.otherImg?'':that.otherImg,
  587. goodsName:!that.goodsName?'':that.goodsName,
  588. price:!that.price?'':that.price,
  589. waterContent:!that.waterContent?'':that.waterContent,
  590. bulkDensity:!that.bulkDensity?'':that.bulkDensity,
  591. burnt:!that.burnt?'':that.burnt,
  592. moldy:!that.moldy?'':that.moldy,
  593. bucklePrice:!that.bucklePrice?'':that.bucklePrice,
  594. realPrice:!that.realPrice?'':that.realPrice,
  595. driverNo:!that.driverNo?'':that.driverNo,
  596. bankNo:!that.bankNo?'':that.bankNo,
  597. bankAccount:!that.bankAccount?'':that.bankAccount,
  598. bankNameZhihang:!that.bankAccount?'':that.bankNameZhihang,
  599. taskId:that.taskId
  600. }, failres => {
  601. that.$api.msg(failres.errmsg)
  602. uni.hideLoading()
  603. }).then(res => {
  604. that.$api.msg('保存成功')
  605. uni.hideLoading()
  606. })
  607. },
  608. finish(){
  609. const that = this
  610. if(!that.grossWeight){
  611. this.$api.msg('请填写毛重');
  612. return;
  613. }
  614. if(!that.skinWeight){
  615. this.$api.msg('请填写皮重');
  616. return;
  617. }
  618. if(!that.poundImg){
  619. this.$api.msg('请上传磅单照片');
  620. return;
  621. }
  622. if (!that.personNoImg || !that.personNoImg1) {
  623. that.$api.msg('请上传身份证正、反面照片(2张)');
  624. return
  625. }
  626. if (!that.bankImg || !that.bankImg1) {
  627. that.$api.msg('请上传收款人银行卡正、反面照片(2张)');
  628. return
  629. }
  630. if (!that.bankAccount) {
  631. that.$api.msg('请填写开户行');
  632. return
  633. }
  634. if (!that.bankNameZhihang) {
  635. that.$api.msg('请填写开户支行');
  636. return
  637. }
  638. if (!that.bankNo) {
  639. that.$api.msg('请填写银行卡号');
  640. return
  641. }
  642. if (!that.driverNo) {
  643. that.$api.msg('请填写送粮人身份证号');
  644. return
  645. }
  646. if (!that.price) {
  647. that.$api.msg('请填写单价');
  648. return
  649. }
  650. if(!that.goodsName){
  651. that.$api.msg('请填写货名');
  652. return
  653. }
  654. if (!that.waterContent) {
  655. that.$api.msg('请填写水分');
  656. return
  657. }
  658. if (!that.bulkDensity) {
  659. that.$api.msg('请填写容重');
  660. return
  661. }
  662. if (!that.bucklePrice) {
  663. that.$api.msg('请填写扣款');
  664. return
  665. }
  666. if (!that.realPrice) {
  667. that.$api.msg('请填写实付金额');
  668. return
  669. }
  670. uni.showLoading({
  671. title: '正在加载',
  672. mask:true
  673. })
  674. that.$api.request('tran', 'finishPurchaseInfo', {
  675. driver:!that.driver?'':that.driver,
  676. personNoImg:!that.personNoImg?'':that.personNoImg,
  677. personNoImg1:!that.personNoImg1?'':that.personNoImg1,
  678. bankImg:!that.bankImg?'':that.bankImg,
  679. bankImg1:!that.bankImg1?'':that.bankImg1,
  680. grossWeight:!that.grossWeight?'':that.grossWeight,
  681. skinWeight:!that.skinWeight?'':that.skinWeight,
  682. netWeight:!that.netWeight?'':that.netWeight,
  683. poundImg:!that.poundImg?'':that.poundImg,
  684. otherImg:!that.otherImg?'':that.otherImg,
  685. price:!that.price?'':that.price,
  686. goodsName:!that.goodsName?'':that.goodsName,
  687. waterContent:!that.waterContent?'':that.waterContent,
  688. bulkDensity:!that.bulkDensity?'':that.bulkDensity,
  689. burnt:!that.burnt?'':that.burnt,
  690. moldy:!that.moldy?'':that.moldy,
  691. bucklePrice:!that.bucklePrice?'':that.bucklePrice,
  692. realPrice:!that.realPrice?'':that.realPrice,
  693. driverNo:!that.driverNo?'':that.driverNo,
  694. bankNo:!that.bankNo?'':that.bankNo,
  695. bankAccount:!that.bankAccount?'':that.bankAccount,
  696. bankNameZhihang:!that.bankAccount?'':that.bankNameZhihang,
  697. taskId:that.taskId
  698. }, failres => {
  699. that.$api.msg(failres.errmsg)
  700. uni.hideLoading()
  701. }).then(res => {
  702. uni.hideLoading()
  703. that.$api.msg('完成成功')
  704. setTimeout(()=>{uni.navigateBack({
  705. delta: 2
  706. })},1000);
  707. })
  708. },
  709. gaipai(){
  710. const that = this
  711. uni.showLoading({
  712. title: '正在加载',
  713. mask:true
  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. .action-btn-group {
  834. .action-btn {
  835. width: 33.3333%;
  836. }
  837. }
  838. }
  839. @mixin playcenter {
  840. display: flex;
  841. align-items: center;
  842. justify-content: center;
  843. }
  844. .xsh-start {
  845. width: 105rpx;
  846. height: 105rpx;
  847. background: #FFFFFF;
  848. border-radius: 50%;
  849. font-size: 29rpx;
  850. color: #4135EB;
  851. @include playcenter;
  852. flex-wrap: wrap;
  853. }
  854. .x-modal {
  855. width: 100%;
  856. .x-m-title {
  857. width: 100%;
  858. height: 90rpx;
  859. padding: 0 38rpx 0 31rpx;
  860. box-sizing: border-box;
  861. font-size: 29rpx;
  862. color: #333333;
  863. border-bottom: 1px dashed #999;
  864. @include playcenter;
  865. justify-content: space-between;
  866. .xm-t-clear {
  867. font-size: 25rpx;
  868. color: #341DB7;
  869. @include playcenter;
  870. >image {
  871. width: 28rpx;
  872. height: 28rpx;
  873. display: block;
  874. margin-right: 8rpx;
  875. }
  876. }
  877. }
  878. .x-m-con {
  879. width: 100%;
  880. padding: 0 31rpx 18rpx;
  881. margin-top: 5rpx;
  882. box-sizing: border-box;
  883. }
  884. }
  885. .wrapper {
  886. width: 100%;
  887. height: 100%;
  888. margin: 30upx 0;
  889. overflow: hidden;
  890. display: flex;
  891. align-content: center;
  892. flex-direction: column;
  893. justify-content: center;
  894. font-size: 28upx;
  895. }
  896. .handWriting {
  897. background: #fff;
  898. width: 100%;
  899. height: 350upx;
  900. }
  901. .handRight {
  902. align-items: center;
  903. }
  904. .handCenter {
  905. border: 4upx dashed #e9e9e9;
  906. flex: 5;
  907. overflow: hidden;
  908. box-sizing: border-box;
  909. width: 90%;
  910. margin: 0 auto;
  911. }
  912. .handTitle {
  913. flex: 1;
  914. color: #666;
  915. justify-content: center;
  916. font-size: 30upx;
  917. }
  918. .handBtn {
  919. flex-direction: column;
  920. padding: 40upx 20upx;
  921. }
  922. .buttons{
  923. width: 100%;
  924. margin-top: 20upx;
  925. justify-content: space-between;
  926. }
  927. .buttons>button{
  928. font-size: 30upx;
  929. height: 80upx;
  930. }
  931. .delBtn {
  932. background: #23df02;
  933. color: #fff;
  934. }
  935. .color{
  936. align-items: center;
  937. }
  938. .color>text{
  939. margin-right: 20upx;
  940. }
  941. .subBtn {
  942. background: #008ef6;
  943. color: #fff;
  944. text-align: center;
  945. justify-content: center;
  946. }
  947. .black-select {
  948. width: 60upx;
  949. height: 60upx;
  950. }
  951. .black-select.color_select {
  952. width: 90upx;
  953. height: 90upx;
  954. }
  955. .red-select {
  956. width: 60upx;
  957. height: 60upx;
  958. }
  959. .red-select.color_select {
  960. width: 90upx;
  961. height: 90upx;
  962. }
  963. .slide-wrapper {
  964. align-items: center;
  965. margin-bottom: 20upx;
  966. }
  967. .slider{
  968. width: 400upx;
  969. padding-left: 20upx;
  970. }
  971. .drop {
  972. width: 50upx;
  973. height: 50upx;
  974. border-radius: 50%;
  975. background: #FFF;
  976. position: absolute;
  977. left: 0upx;
  978. top: -10upx;
  979. box-shadow: 0px 1px 5px #888888;
  980. }
  981. .slide {
  982. width: 250upx;
  983. height: 30upx;
  984. }
  985. .showimg{
  986. border: 4upx solid #e9e9e9;
  987. overflow: hidden;
  988. width: 90%;
  989. margin: 0 auto;
  990. background: #eee;
  991. height: 350upx;
  992. margin-top: 40upx;
  993. align-items: center;
  994. justify-content: center;
  995. }
  996. .showimg>image{
  997. width: 100%;
  998. height: 100%;
  999. }
  1000. .showimg>text{
  1001. font-size: 40upx;
  1002. color: #888;
  1003. }
  1004. .indexFixed{
  1005. position: fixed;
  1006. left:0;
  1007. bottom:0;
  1008. right:0;
  1009. }
  1010. </style>