addaccessory.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606
  1. <template>
  2. <view class="content">
  3. <view class='wrap'>
  4. <view class="xinxi" v-if="reType == 2 || expensesType == '2'" style="font-size: 28rpx; ">请款信息</view>
  5. <view class="xinxi" v-if="reType == 1 || expensesType == '1'" style="font-size: 28rpx; ">收款信息</view>
  6. <view class="c-row">
  7. <view class="title">用途</view>
  8. <view class="con-list">
  9. <view>{{detailData.purpose}}
  10. <u-icon name="arrow-right" color=""></u-icon>
  11. </view>
  12. </view>
  13. </view>
  14. <view class="c-row" v-if="detailData.purpose == '库点费用'">
  15. <view class="title">仓库名称</view>
  16. <view class="con-list">
  17. <view >{{detailData.warehouseName?detailData.warehouseName:"请选择仓库名称"}}
  18. <u-icon name="arrow-right" color=""></u-icon>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="c-row" v-if="detailData.purpose == '库点费用'&&reType == 2">
  23. <view class="title">仓储费</view>
  24. <view class="con-list">
  25. <view>{{detailData.flag}}
  26. <u-icon name="arrow-right" color=""></u-icon>
  27. </view>
  28. </view>
  29. </view>
  30. <view class="c-row" v-if="detailData.purpose == '库点费用'">
  31. <view class="title">类型</view>
  32. <view class="con-list">
  33. <view >{{detailData.wareExpenseType?detailData.wareExpenseType:"请选择类型"}}
  34. <u-icon name="arrow-right" color=""></u-icon>
  35. </view>
  36. </view>
  37. </view>
  38. <view class="c-row" v-if="detailData.purpose == '合同费用'">
  39. <view class="title">合同编号</view>
  40. <view class="con-list">
  41. <view>{{detailData.contractNo?detailData.contractNo:"请选择合同编号"}}
  42. <u-icon name="arrow-right" color=""></u-icon>
  43. </view>
  44. </view>
  45. </view>
  46. <view class="c-row">
  47. <view class="title">费用名称</view>
  48. <view class="con-list">
  49. <input disabled v-model='detailData.expenseName' placeholder="输入费用名称,1-15个字"></input>
  50. </view>
  51. </view>
  52. <view v-if="reType == 2 || expensesType == '2'" class="c-row">
  53. <view class="title">付款方名头</view>
  54. <view class="con-list">
  55. <input disabled v-model='detailData.payerHeader' maxlength='25' placeholder="输入付款方名头"></input>
  56. </view>
  57. </view>
  58. <view v-show="reType == 2&&detailData.purpose=='经营性费用' || expensesType == '2'&&detailData.purpose=='经营性费用'" class="c-row">
  59. <view class="title">所属名头</view>
  60. <view class="con-list">
  61. <view >{{detailData.belongName?detailData.belongName:"请选择所属名头"}}
  62. <u-icon name="arrow-right" color=""></u-icon>
  63. </view>
  64. </view>
  65. </view>
  66. <view class="c-row">
  67. <view class="title">金额(元)</view>
  68. <view class="con-list">
  69. <input disabled type='digit' v-if="reType == '2' || expensesType == '2'" v-model='detailData.amountMoney'
  70. placeholder="输入请款金额"></input>
  71. <input disabled type='digit' v-if="reType == '1' || expensesType == '1'" v-model='detailData.amountMoney'
  72. placeholder="输入收款金额"></input>
  73. </view>
  74. </view>
  75. <view class="c-row">
  76. <view class="left">备注</view>
  77. </view>
  78. <view style='position:relative;' class="wrap no-boder">
  79. <u-input disabled class='textarea' v-model="detailData.remark" :type="typeRemark" :border="border"
  80. placeholder="选填,不超过150字" :height="height" :auto-height="autoHeight" maxlength="150" />
  81. <view class="remark">
  82. {{detailData.remark?detailData.remark.length:'0'}}/150个字
  83. </view>
  84. </view>
  85. <view class="c-row">
  86. <view class="title">附件(选填)</view>
  87. </view>
  88. <view style="display: flex;flex-wrap: wrap;">
  89. <view v-for='(item,index) in imglist2' v-if="imglist2 && imglist2.length > 0"
  90. style="position: relative;margin-left: 20rpx;">
  91. <view v-if='length<index+1' class="delete_img" @click="deleteImg(index)">X</view>
  92. <image :src="item.appendixPath" mode="" style="width: 100px;height: 100px;"></image>
  93. </view>
  94. <view class="biankuang" @click="uploadClick" v-if="imglist2.length < 30">
  95. <view class="tubiao">
  96. <image class="upload" src="../../static/img/oa_office/upload.png" mode="">
  97. </image>
  98. <view class="" style="color:#8c8f98;">
  99. 选择图片
  100. </view>
  101. </view>
  102. </view>
  103. </view>
  104. </view>
  105. <view v-if="reType == 2 || expensesType == '2'" class='wrap margin-bottom'>
  106. <view class="xinxi" style="font-size: 28rpx; ">收款账户信息</view>
  107. <view class="c-row">
  108. <view class="title">收款方</view>
  109. <view class="con-list">
  110. <input disabled v-model='detailData.payee' placeholder="输入收款方"></input>
  111. </view>
  112. </view>
  113. <view class="c-row">
  114. <view class="title">账户</view>
  115. <view class="con-list">
  116. <input disabled v-model='detailData.accountNumber' placeholder="输入账户"></input>
  117. </view>
  118. </view>
  119. <view class="c-row">
  120. <view class="title">开户行</view>
  121. <view class="con-list">
  122. <input disabled v-model='detailData.bank' placeholder="输入开户行"></input>
  123. </view>
  124. </view>
  125. <view class="c-row">
  126. <view class="title">开户支行</view>
  127. <view class="con-list">
  128. <input disabled v-model='detailData.bankBranch' placeholder="输入开户支行"></input>
  129. </view>
  130. </view>
  131. </view>
  132. <u-toast ref="uToast" />
  133. <view class="bottom-btn">
  134. <view @click="submit()" class="btn">提交</view>
  135. </view>
  136. </view>
  137. </template>
  138. <script>
  139. import * as config from '../../config'
  140. export default {
  141. data() {
  142. return {
  143. show: false,
  144. show2:false,
  145. showWare: false,
  146. length:0,
  147. detailData: {
  148. flag:'否',
  149. purpose: '库点费用',
  150. remark: "",
  151. wareExpenseType:'杂费',
  152. warehouseName: '选择仓库',
  153. expenseName: '',
  154. amountMoney: '',
  155. expensesPurpose: '3',
  156. expensesType: '',
  157. // contractId: '',
  158. fieldName: '',
  159. identification: '1',
  160. costType: '3',
  161. agent: '',
  162. totalDistribution: '0',
  163. },
  164. fileList1: [],
  165. show1:false,
  166. warehouseType: '1',
  167. typeRemark: 'textarea',
  168. border: true,
  169. show3:false,
  170. imglist: [], //存
  171. imglist2: [], //展示
  172. height: 150,
  173. autoHeight: true,
  174. purposeList: [{
  175. purpose: "合同费用"
  176. },
  177. {
  178. purpose: "库点费用"
  179. },
  180. {
  181. purpose: "经营性费用"
  182. },
  183. ],
  184. typeList1:[
  185. {value: "是"},
  186. {value: "否"},
  187. ],
  188. typeList:[
  189. {value: "杂费"},
  190. {value: "电费"},
  191. {value: "煤费"},
  192. {value: "人工费"},
  193. ],
  194. namelist:[
  195. {name: "黑龙江中天昊元贸易有限公司"},
  196. {name: "中天昊元-建发合营"},
  197. {name: "中天昊元-六水香合营"},
  198. {name: "中天昊元-昊友合营"},
  199. {name: "黑龙江中天昊元贸易有限公司辽宁分公司"},
  200. {name: "黑龙江众利合粮食贸易有限公司"},
  201. {name: "黑龙江欣洋粮食贸易有限公司"},
  202. {name: "黑龙江启兴粮食贸易有限公司"},
  203. {name: "黑龙江鑫满仓粮食贸易有限公司"},
  204. {name: "黑龙江谷香粮食贸易有限公司"},
  205. {name: "黑龙江益储益运粮食贸易有限公司"},
  206. {name: "黑龙江海天粮食农业发展有限公司"},
  207. {name: "黑龙江中天绿粮供应链管理有限公司"},
  208. {name: "中天昊元(海南)国际贸易有限公司"},
  209. {name: "克东县嘉达建筑装潢有限责任公司"},
  210. {name: "克东县金博粮食有限公司"},
  211. {name: "克东县安正商贸有限公司"},
  212. {name: "克东县万祥农业科技开发有限公司"},
  213. {name: "克东县万润运输有限公司"},
  214. {name: "黑龙江大金仓农业科技有限公司"},
  215. {name: "克东县华祥通讯管线工程有限公司"},
  216. {name: "黑龙江峰海粮食贸易有限公司(季度报 增值税季度)"},
  217. {name: "黑龙江鑫宝仓粮食贸易有限公司"},
  218. {name: "黑龙江中仓粮食贸易有限公司"},
  219. {name: "黑龙江晟鸿泰粮食贸易有限公司"},
  220. {name: "黑龙江新粮仓粮食贸易有限公司"},
  221. {name: "齐齐哈尔米林设备制造有限公司"},
  222. ],
  223. reType: "",
  224. flag: "",
  225. warehouseInfo: {},
  226. contractNoInfo: {},
  227. }
  228. },
  229. onLoad(options) {
  230. this.reType = options.reType
  231. this.expensesType = options.expensesType
  232. if(this.reType==2||this.expensesType==2){
  233. uni.setNavigationBarTitle({title: '请款'});
  234. }
  235. this.id = options.id
  236. if (this.id) {
  237. this.getRequest()
  238. } else {
  239. return
  240. }
  241. },
  242. onShow() {
  243. this.warehouseInfo = uni.getStorageSync('theWarehouse');
  244. if (this.warehouseInfo && this.detailData.purpose == "库点费用") {
  245. this.detailData.warehouseName = this.warehouseInfo.warehouseName
  246. this.$forceUpdate()
  247. }
  248. this.contractNoInfo = uni.getStorageSync('reContractNo');
  249. if (this.contractNoInfo && this.detailData.purpose == "合同费用") {
  250. this.detailData.contractId = this.contractNoInfo.id
  251. this.detailData.contractNo = this.contractNoInfo.contractNo
  252. this.$api.doRequest('get', 'customerInfo/getPayeeInfo', {
  253. contractNo: this.detailData.contractNo
  254. }).then(res => {
  255. this.detailData.payee=res.customerType=="企业客户"?res.compName:res.customerName
  256. this.detailData.accountNumber=res.bankCard
  257. this.detailData.bank=res.bankDeposit
  258. this.detailData.bankBranch=res.bankDepositBranch
  259. this.$forceUpdate()
  260. })
  261. }
  262. },
  263. watch: {
  264. imglist: {
  265. handler: function() {
  266. this.$api.doRequest('get', 'appendix/query/getFileList', {
  267. appendixIds: this.imglist.toString()
  268. }).then(res => {
  269. this.imglist2 = res.data.data
  270. })
  271. },
  272. deep: true
  273. }
  274. },
  275. methods: {
  276. typeCheck(e){
  277. this.detailData.wareExpenseType=this.typeList[e[0]].value
  278. },
  279. typeCheck1(e){
  280. this.detailData.flag=this.typeList1[e[0]].value
  281. },
  282. afterRead(e) {
  283. console.log(e)
  284. },
  285. async uploadClick() {
  286. let baseUrlNew = config.def().baseUrlNew
  287. let pcUserInfo = uni.getStorageSync('pcUserInfo')
  288. console.log('baseUrlNew',baseUrlNew)
  289. if(!pcUserInfo){
  290. uni.showToast({
  291. title:"登录已失效,请重新登录"
  292. })
  293. return
  294. }
  295. uni.chooseImage({
  296. count:10,
  297. success: (chooseImageRes) => {
  298. console.log('chooseImageRes',chooseImageRes)
  299. let files = []
  300. for (let item of chooseImageRes.tempFiles) {
  301. files.push({
  302. name: 'fileName',
  303. url : item.path
  304. });
  305. }
  306. console.log(files)
  307. for (let i = 0; i < files.length; i++) {
  308. uni.uploadFile({
  309. url: baseUrlNew + 'appendix/api/uploadFiles',
  310. // url: baseUrlNew+'appendix/api/uploadFiles', //仅为示例,非真实的接口地址
  311. // files: files[i],
  312. filePath:files[i].url,
  313. name:files[i].name,
  314. formData: {
  315. // fileName: chooseImageRes.tempFiles[0],
  316. companyId: pcUserInfo.compId,
  317. modelId: '',
  318. vesselId: '',
  319. },
  320. success: (uploadFileRes) => {
  321. console.log(JSON.parse(uploadFileRes.data))
  322. var data = JSON.parse(uploadFileRes.data).data
  323. data.compId = pcUserInfo.compId
  324. this.$api.doRequest('post', '/appendix/api/saveFilesApp', {
  325. newAppendixs: [data],
  326. oldAppendixIds: ""
  327. }).then(res => {
  328. this.imglist.push(res.data.data[0])
  329. console.log(res)
  330. })
  331. console.log(uploadFileRes.data);
  332. },
  333. fail(res) {
  334. console.log(res);
  335. }
  336. });
  337. }
  338. }
  339. });
  340. },
  341. deleteImg(index) {
  342. this.imglist.splice(index, 1)
  343. },
  344. calculate() {
  345. const query = uni.createSelectorQuery().in(this);
  346. query.selectAll('.left')
  347. console.log(query)
  348. },
  349. ltCheck(e) {
  350. this.detailData.purpose = this.purposeList[e[0]].purpose
  351. if (this.detailData.purpose == "合同费用") {
  352. this.detailData.expensesPurpose = "1"
  353. delete this.detailData.warehouseName
  354. } else if (this.detailData.purpose == "库点费用") {
  355. this.detailData.expensesPurpose = "3"
  356. delete this.detailData.contractNo
  357. } else {
  358. this.detailData.expensesPurpose = "5"
  359. delete this.detailData.warehouseName
  360. delete this.detailData.contractNo
  361. if(this.reType == 2){
  362. this.show1 = true
  363. }
  364. }
  365. console.log(this.detailData)
  366. },
  367. confirmname(e) {
  368. this.detailData.belongName = this.namelist[e[0]].name
  369. },
  370. selectCon() {
  371. uni.navigateTo({
  372. url: '/pages/reimbursement/selectContract'
  373. })
  374. },
  375. selectWare() {
  376. uni.navigateTo({
  377. url: '/pages/reimbursement/selectWarehouse?warehouseType=1'
  378. })
  379. },
  380. submit() {
  381. var that = this
  382. var title
  383. var theInterface
  384. if (that.expensesType == '1') {
  385. title = "确定提交收款信息?"
  386. } else {
  387. title = "确定提交请款信息?"
  388. }
  389. uni.showModal({
  390. content: '确定提交附件信息?',
  391. showCancel: true,
  392. confirmText: '提交',
  393. success: function(res) {
  394. if (res.confirm) {
  395. var obj={
  396. id:that.id,
  397. addressUrl: that.imglist.toString(),
  398. operatorId:uni.getStorageSync('userInfo').id
  399. }
  400. uni.showLoading({
  401. title: "加载中",
  402. mask: true
  403. })
  404. that.$api.doRequest('post', '/expenseInfo/uploadAttachments', obj)
  405. .then(res => {
  406. if (res.data.code == 200) {
  407. uni.hideLoading()
  408. that.$api.msg('提交成功')
  409. uni.navigateBack({
  410. delta: 1
  411. });
  412. } else {
  413. that.$api.msg(res.data.message)
  414. }
  415. })
  416. }
  417. }
  418. })
  419. },
  420. //获取信息
  421. getRequest() {
  422. this.$api.doRequest('get', '/expenseInfo/ExpenseInfo', {
  423. id: this.id,
  424. }).then(res => {
  425. if (res.data.code == 200) {
  426. this.detailData = res.data.data
  427. this.imglist = this.detailData.addressUrl.split(',')
  428. this.length=JSON.parse(JSON.stringify(this.detailData.addressUrl.split(',').length))
  429. }
  430. })
  431. },
  432. },
  433. }
  434. </script>
  435. <style lang='scss' scoped>
  436. page {
  437. background: #F5F6FA;
  438. }
  439. .delete_img {
  440. position: absolute;
  441. z-index: 100;
  442. left: 84px;
  443. color: #ffffff;
  444. font-size: 28rpx;
  445. border: 1px;
  446. border-radius: 5rpx;
  447. width: 32rpx;
  448. height: 32rpx;
  449. background-color: #ff0000;
  450. text-align: center;
  451. }
  452. .title_b {
  453. margin: 20rpx 20rpx 0rpx 20rpx;
  454. padding: 20rpx 10rpx 20rpx 10rpx;
  455. font-size: 18px;
  456. font-weight: 550;
  457. }
  458. .xinxi {
  459. padding: 20rpx 30rpx;
  460. }
  461. .tubiao {
  462. margin: 0 auto;
  463. text-align: center;
  464. margin-top: 35rpx;
  465. }
  466. .biankuang {
  467. border: 1px dashed #AFB3BF;
  468. border-radius: 10rpx;
  469. width: 200rpx;
  470. height: 200rpx;
  471. margin-left: 20rpx;
  472. }
  473. .upload {
  474. width: 80rpx;
  475. height: 80rpx;
  476. }
  477. .c-row {
  478. display: -webkit-box;
  479. display: -webkit-flex;
  480. display: flex;
  481. -webkit-box-align: center;
  482. -webkit-align-items: center;
  483. align-items: center;
  484. padding: 20rpx 30rpx;
  485. position: relative;
  486. }
  487. .con-list {
  488. -webkit-box-flex: 1;
  489. flex: 1;
  490. display: flex;
  491. -webkit-box-orient: vertical;
  492. -webkit-box-direction: normal;
  493. flex-direction: column;
  494. color: #303133;
  495. line-height: 20px;
  496. text-align: right;
  497. padding-right: 10px;
  498. justify-content: space-between;
  499. }
  500. .wrap {
  501. padding-bottom: 10px;
  502. font-size: 14px;
  503. background: #fff;
  504. margin: 10px;
  505. border-radius: 10px;
  506. input {
  507. font-size: 14px;
  508. }
  509. >.title {
  510. padding: 10px 16px;
  511. }
  512. }
  513. .buns_item {
  514. display: flex;
  515. padding: 80rpx 0 50rpx 0;
  516. justify-content: space-around;
  517. }
  518. .but_css {
  519. background: #22C572;
  520. width: 40%;
  521. padding: 20rpx;
  522. color: #fff;
  523. text-align: center;
  524. border-radius: 20rpx;
  525. }
  526. /deep/.u-radio-group {
  527. flex-direction: row-reverse;
  528. }
  529. .no-boder {
  530. border: 0;
  531. }
  532. .textarea {
  533. background: #F9F9FA;
  534. border: 1px solid #EEEEEE;
  535. }
  536. .remark {
  537. position: absolute;
  538. right: 10px;
  539. bottom: 20px;
  540. color: #AFB3BF;
  541. }
  542. .submit {
  543. width: 100%;
  544. background: #2c8ac5;
  545. border-radius: 10rpx;
  546. }
  547. .bottom-btn {
  548. padding: 30rpx;
  549. background: #FFFFFF;
  550. width: 100%;
  551. position: fixed;
  552. bottom: 0rpx;
  553. display: flex;
  554. z-index: 9999;
  555. }
  556. .content {
  557. overflow: hidden;
  558. }
  559. .btn {
  560. border-radius: 50rpx;
  561. padding: 20rpx 0;
  562. background: #22C572;
  563. color: #fff;
  564. font-size: 32rpx;
  565. width: 100%;
  566. box-sizing: border-box;
  567. display: flex;
  568. justify-content: center;
  569. }
  570. .margin-bottom{
  571. margin-bottom:84px;
  572. }
  573. </style>