viseedit.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875
  1. <template>
  2. <view>
  3. <uni-forms ref="form" labelPosition="left" labelAlign="left" @submit="submitForm">
  4. <view class="uni-form-item uni-column">
  5. <view class="title"><text class="uni-form-item__title">签证编号</text></view>
  6. <view class="uni-input-wrapper">
  7. <input class="uni-input" focus placeholder="请填写签证编号" v-model="viseId" />
  8. </view>
  9. </view>
  10. <view class="uni-form-item uni-column">
  11. <view class="title"><text class="uni-form-item__title">签证名称</text></view>
  12. <view class="uni-input-wrapper">
  13. <input class="uni-input" focus placeholder="请填写签证名称" v-model="viseName" />
  14. </view>
  15. </view>
  16. <view class="uni-form-item uni-column">
  17. <view class="title"><text class="uni-form-item__title">申请单</text></view>
  18. <view class="uni-input-wrapper ">
  19. <input class="uni-input-small" v-model="requisitionName" />
  20. <a href='javascript:;' @click='getRequisition' class="uni-icon"><i class="fa fa-search" aria-hidden="true"></i></a>
  21. </view>
  22. </view>
  23. <view class="uni-form-item uni-column">
  24. <view class="title"><text class="uni-form-item__title">关联合同</text></view>
  25. <view class="uni-input-wrapper ">
  26. <input class="uni-input-small" disabled=true v-model="contractName" />
  27. <a href='javascript:;' @click='getRelationContract' class="uni-icon"><i class="fa fa-search" aria-hidden="true"></i></a>
  28. </view>
  29. </view>
  30. <view class="uni-form-item uni-column" v-show="contractName">
  31. <view class="title"><text class="uni-form-item__title">税率</text></view>
  32. <view class="uni-input-wrapper">
  33. {{contract.taxRate+'%'}}
  34. </view>
  35. </view>
  36. <view class="uni-form-item uni-column" v-show="contractName">
  37. <view class="title"><text class="uni-form-item__title">是否可抵扣</text></view>
  38. <view class="uni-input-wrapper">
  39. {{contract.isDeduct==0?'否':'是'}}
  40. </view>
  41. </view>
  42. <view class="uni-form-item uni-column">
  43. <view class="title"><text class="uni-form-item__title">签证日期</text></view>
  44. <view class="uni-input-wrapper" style="justify-content: left;">
  45. <picker mode="date" @change="bindDateChange" v-model="viseDate" style="width: 100%;">
  46. <view class="uni-input">{{viseDate}}</view>
  47. </picker>
  48. </view>
  49. </view>
  50. <view class="uni-form-item uni-column">
  51. <view class="title"><text class="uni-form-item__title">办理期限</text></view>
  52. <view class="uni-input-wrapper" style="justify-content: left;">
  53. <picker mode="date" @change="bindDealDateChange" v-model="endDate" style="width: 100%;">
  54. <view class="uni-input">{{endDate}}</view>
  55. </picker>
  56. </view>
  57. </view>
  58. <view class="uni-form-item uni-column">
  59. <view class="title"><text class="uni-form-item__title">签证类型</text></view>
  60. <view class="uni-input-wrapper" style="justify-content: left;">
  61. <picker mode="selector" :value="index" :range="array" range-key="name" @change="bindPickerChange" v-model="viseType"
  62. style="width: 100%;">
  63. <view class="uni-input">{{array.length>0?array[index]:''}}</view>
  64. </picker>
  65. </view>
  66. </view>
  67. <view class="uni-form-item uni-column">
  68. <view class="title"><text class="uni-form-item__title">暂估金额</text></view>
  69. <view class="uni-input-wrapper">
  70. <input class="uni-input" focus value="0" v-model="estimateCash" type="digit" />
  71. </view>
  72. </view>
  73. <view class="uni-form-item uni-column">
  74. <view class="title"><text class="uni-form-item__title">报送金额</text></view>
  75. <view class="uni-input-wrapper">
  76. <input class="uni-input" focus value="0" v-model="reportCash" type="digit" />
  77. </view>
  78. </view>
  79. <view class="uni-form-item uni-column">
  80. <view class="title"><text class="uni-form-item__title">签证原因</text></view>
  81. <view class="uni-textarea">
  82. <textarea focus placeholder="签证原因" v-model="reason" auto-height="true" />
  83. </view>
  84. </view>
  85. <view class="uni-form-item uni-column">
  86. <view class="title"><text class="uni-form-item__title">备注</text></view>
  87. <view class="uni-textarea">
  88. <textarea focus placeholder="请写备注" v-model="remark" auto-height="true" />
  89. </view>
  90. </view>
  91. <view class="uni-form-item uni-column">
  92. <view class="title" style="background-color: #efefef;"><text class="uni-form-item__title">上传文件</text></view>
  93. <view class="content">
  94. <g-upfile ref='gUpfile' :mode="imgList" @chooseFile='chooseFile' @imgDelete='imgDelete' :control='control'
  95. :columnNum="columnNum" :maxCount="maxCount" @limitFileSizeList='limitFileSizeList' @limitFileTypeList='limitFileTypeList' :maxFileSize="20000"></g-upfile>
  96. </view>
  97. </view>
  98. <uni-section title="费用明细" type="line"></uni-section>
  99. <uni-list>
  100. <uni-list-item v-if="costList" v-for="(item, index) in costList" :key="index">
  101. <view slot="body" class="slot-box">
  102. <view class="row">
  103. <view class="column-left">费用项:</view>
  104. <view class="column-right">{{item.costCodeName}}</view>
  105. </view>
  106. <view class="row">
  107. <view class="column-left">含税金额</view>
  108. <view class="column-right">
  109. <input class="uni-input-small" type="digit" v-model="item.cash" style="width: 240px;text-align: left;" @blur='countTaxtCash(item,index)' />
  110. </view>
  111. </view>
  112. <view class="row">
  113. <view class="column-left">税额</view>
  114. <view class="column-right" >
  115. <input class="uni-input-small" type="digit" disabled="true" v-model="item.rateCash" style="width: 240px;text-align: left;" />
  116. </view>
  117. </view>
  118. <view class="row">
  119. <view class="column-left">金额</view>
  120. <view class="column-right">
  121. <input class="uni-input-small" type="digit" disabled="true" v-model="item.noRateCash" style="width: 240px;text-align: left;" />
  122. </view>
  123. </view>
  124. <view class="row">
  125. <view class="column-left">备注:</view>
  126. <view class="column-right">
  127. <textarea focus v-model="item.remark" auto-height="true" style="width: 240px;text-align: left;" />
  128. </view>
  129. </view>
  130. <view class="row">
  131. <view class="column-left">操作:</view>
  132. <view class="column-right">
  133. <i class="fa fa-window-close" aria-hidden="true" @click="delRow(index)" style="font-size:20px;cursor: pointer;color: #999;margin-left:15px;" title="删除"></i>
  134. </view>
  135. </view>
  136. </view>
  137. </uni-list-item>
  138. </uni-list>
  139. <view style="margin-bottom: 120px;">
  140. </view>
  141. <view class="uni-btn-v uni-column">
  142. <button type="primary" form-type="submit" style="border-radius: 15px;" >提交</button>
  143. </view>
  144. </uni-forms>
  145. <topicon class="topicon" :iconWidth="50" :iconHeight="50" :startPostion="3" iconPath="../../../static/zhiding.png"
  146. :marginBottom="20" :marginTop="60" :marginLeft="5" :marginRight="5" @tapIcon="tapIcon"
  147. ></topicon>
  148. </view>
  149. </template>
  150. <script>
  151. import {GetQianzhengDropDown} from "@/common/api/requisitionApi.js";
  152. import {GetContract} from "@/common/api/commonApi.js";
  153. import {GetContractCostDTOs,UpdateVise,GetViseEdit} from "@/common/api/viseApi.js";
  154. import {Decimal} from 'decimal.js'; //decimal计算
  155. import topicon from '@/components/gwh-backTopIcon/gwh-backTopIcon.vue'
  156. export default {
  157. components:{
  158. topicon
  159. },
  160. data() {
  161. return {
  162. viseCode:'',
  163. viseId:'',
  164. viseName:'',
  165. requisitionCode:'', //申请单编号
  166. requisitionName:'', //申请单名称
  167. contractCode:'',
  168. contractName:'',
  169. contract:{}, //获取的关联合同信息
  170. viseDate:this.$util.getDate({
  171. format: true
  172. }),
  173. endDate:this.$util.getDate({
  174. format: true
  175. }),
  176. viseType:'',
  177. estimateCash:0.00,
  178. reportCash:0.00,
  179. reason:'',
  180. remark:'',
  181. costList:[], //费用明细
  182. imageList: [],
  183. countIndex: 5,
  184. count: [1, 2, 3, 4, 5],
  185. title1: 'picker',
  186. array: [],
  187. index: 0,
  188. date: this.$util.getDate({
  189. format: true
  190. }),
  191. startDate:this.$util.getDate('start'),
  192. endDate:this.$util.getDate('end'),
  193. control: true,
  194. columnNum: 3,
  195. imgList: [],
  196. urlList:[],
  197. maxCount:5
  198. }
  199. },
  200. onLoad(){
  201. //console.info(page.path);
  202. console.info(uni.getStorageSync('storage_state'));
  203. //console.info(this);
  204. this.$util.persistLogin(this);
  205. //console.info(this.$store.state.user);
  206. },
  207. onUnload() {
  208. this.imageList = [],
  209. this.sourceTypeIndex = 2,
  210. this.sourceType = ['拍照', '相册', '拍照或相册'],
  211. this.sizeTypeIndex = 2,
  212. this.sizeType = ['压缩', '原图', '压缩或原图'],
  213. this.countIndex = 5;
  214. },
  215. created: function() {
  216. this.GetDropDown();
  217. this.GetViseEdit();
  218. },
  219. updated:function(){
  220. },
  221. methods: {
  222. /**
  223. * 手动提交
  224. * @param {Object} form
  225. */
  226. submitForm(e) {
  227. console.info('submitForm');
  228. let _this=this;
  229. if(this.viseId==='')
  230. {
  231. uni.showToast({
  232. icon:"none",
  233. title:"请填写签证编号",
  234. duration:3000
  235. });
  236. return;
  237. }
  238. if(this.viseName==='')
  239. {
  240. uni.showToast({
  241. icon:"none",
  242. title:"请填写签证名称",
  243. duration:3000
  244. });
  245. return;
  246. }
  247. if(this.viseName.length>50)
  248. {
  249. uni.showToast({
  250. icon:"none",
  251. title:"签证名称不能多于50字",
  252. duration:3000
  253. });
  254. return;
  255. }
  256. /* if(this.requisitionCode===""){
  257. uni.showToast({
  258. icon:"none",
  259. title:"请选择申请单",
  260. duration:3000
  261. });
  262. return;
  263. } */
  264. if(this.contractCode===""){
  265. uni.showToast({
  266. icon:"none",
  267. title:"请选择关联合同号",
  268. duration:3000
  269. });
  270. return;
  271. }
  272. if(this.viseDate===""){
  273. uni.showToast({
  274. icon:"none",
  275. title:"请选择签证日期",
  276. duration:3000
  277. });
  278. return;
  279. }
  280. if(this.endDate===""){
  281. uni.showToast({
  282. icon:"none",
  283. title:"请选择办理期限",
  284. duration:3000
  285. });
  286. return;
  287. }
  288. if(this.changeType===""){
  289. uni.showToast({
  290. icon:"none",
  291. title:"签证类型不能为空",
  292. duration:3000
  293. });
  294. return;
  295. }
  296. if(this.requisitionReason===""){
  297. uni.showToast({
  298. icon:"none",
  299. title:"原因不能为空",
  300. duration:3000
  301. });
  302. return;
  303. }
  304. if(this.reason!=""){
  305. if(this.reason.length>500){
  306. uni.showToast({
  307. icon:"none",
  308. title:"原因不能超过500字",
  309. duration:3000
  310. });
  311. return;
  312. }
  313. }
  314. if(this.remark!==""){
  315. if(this.remark.length>500){
  316. uni.showToast({
  317. icon:"none",
  318. title:"备注不能超过500字",
  319. duration:3000
  320. });
  321. return;
  322. }
  323. }
  324. if(this.costList.length<=0){
  325. uni.showToast({
  326. icon:"none",
  327. title:"费用明细不能为空",
  328. duration:3000
  329. });
  330. return;
  331. }
  332. let moneyType=this.contract.moneyType;
  333. let exchangeRate=this.contract.exchangeRate;
  334. let taxRate=this.contract.taxRate;
  335. let list1=this.costList; //费用明细
  336. let totalCash=0.00; //总含税金额
  337. let rateTotalCash=0.00; //税收总额
  338. let noRateTotalCash=0.00; //不含税总金额
  339. let viseCosts=[];
  340. list1.forEach(function(item,index,arr){
  341. totalCash+= item.cash-0.00;
  342. rateTotalCash+= item.rateCash;
  343. noRateTotalCash+= item.noRateCash;
  344. viseCosts.push({costCode:item.costCode,costBudgetSetCode:item.costBudgetSetCode,cash:item.cash-0.00,checkCash:0.00,moneyType:moneyType,exchangeRate:exchangeRate,money:item.cash-0.00,checkMoney:0.00,remark:item.remark,rate:taxRate,rateCash:item.rateCash,rateMoney:item.rateCash,noRateCash:item.noRateCash,noRateMoney:item.noRateCash});
  345. });
  346. //vise viseCosts
  347. var vise={viseCode:this.viseCode,viseId:this.viseId,viseName:this.viseName,viseType:this.viseType,person:this.$util.getState(this,'userCode'),unitCode:this.$store.state.departmentCode,viseDate:this.viseDate,endDate:this.endDate,remark:this.remark,reason:this.reason,projectCode:this.$store.state.projectCode,contractCode:this.contractCode,totalCash:totalCash,moneyType:moneyType,exchangeRate:exchangeRate,estimateCash:this.estimateCash-0,reportCash:this.reportCash-0,requisitionCode:this.requisitionCode,rate:taxRate,rateTotalCash:rateTotalCash,noRateTotalCash:noRateTotalCash };
  348. var data={vise:vise,viseCosts:viseCosts};
  349. console.info('data:',data);
  350. //return;
  351. UpdateVise(data).then((res)=>{
  352. console.info("提交应答");
  353. console.info(res);
  354. if(res){
  355. if(res=="-1"){
  356. uni.showToast({
  357. title:'该待审核申请单不存在',
  358. icon:'none',
  359. duration:3000
  360. });
  361. return;
  362. }
  363. if(res=="-2"){
  364. uni.showToast({
  365. title:'该待审核申请单状态非待审,不能修改',
  366. icon:'none',
  367. duration:3000
  368. });
  369. return;
  370. }
  371. //上传图片
  372. _this.uploadFileToServe(res) ;
  373. uni.navigateTo({
  374. url:'/pages/template/GetVises/GetVises'
  375. })
  376. }
  377. else{
  378. uni.showToast({
  379. title:'添加失败,重新操作',
  380. icon:'none',
  381. duration:3000
  382. })
  383. }
  384. });
  385. },
  386. /* 页面初始化 */
  387. GetViseEdit(){
  388. let _this=this;
  389. let id=this.$util.getQuery("id");
  390. GetViseEdit(id).then(res=>{
  391. console.info('GetViseEdit',res);
  392. //let attachments=res.attachments;
  393. let mainEntity=res.mainEntity;
  394. let subList=res.subList;
  395. _this.viseCode=mainEntity.viseCode;
  396. _this.viseId=mainEntity.viseId;
  397. _this.viseName=mainEntity.viseName;
  398. _this.viseType=mainEntity.viseType;
  399. _this.viseDate=mainEntity.viseDate;
  400. _this.requisitionCode=mainEntity.requisitionCode;
  401. _this.requisitionName=mainEntity.requisitionName;
  402. _this.contractCode=mainEntity.contractCode;
  403. _this.contractName=mainEntity.contractName;
  404. _this.endDate=mainEntity.endDate;
  405. _this.estimateCash=mainEntity.estimateCash;
  406. _this.reportCash=mainEntity.reportCash;
  407. _this.reason=mainEntity.reason;
  408. _this.remark=mainEntity.remark;
  409. GetContract(_this.contractCode).then(res=>{
  410. console.info('GetContract',res);
  411. _this.contract=res;
  412. });
  413. if(subList.length>0){
  414. subList.forEach(function(item,index,arr){
  415. _this.$set(_this.costList,index,item);
  416. });
  417. }
  418. if(_this.array.length>0){
  419. _this.array.forEach(function(item,index,arr){
  420. console.info('item',item);
  421. if(item==_this.viseType){
  422. _this.index=index;
  423. }
  424. });
  425. }
  426. });
  427. },
  428. /*
  429. 获取申请单
  430. */
  431. getRequisition() {
  432. let _this = this;
  433. _this.saveTemp(_this);
  434. //创建名字为fire的监听器,监听子页面传值事件
  435. uni.$on('requisition', function(data) {
  436. console.info("监听getRequisition子页面的传值", data);
  437. console.info('监听',_this);
  438. _this.getTemp(_this);
  439. _this.requisitionCode=data[0].requisitionCode;
  440. _this.requisitionName=data[0].requisitionName;
  441. _this.$nextTick(function(){
  442. //更新dom
  443. });
  444. //接收一次监听,一旦监听到回传值,则清除监听事件,若不清除,会占用资源
  445. uni.$off("requisition");
  446. });
  447. uni.navigateTo({
  448. url: '/pages/template/SelectRelationRequision/SelectRelationRequision?type=0'
  449. });
  450. },
  451. /*
  452. 获取关联合同
  453. */
  454. getRelationContract() {
  455. let _this = this;
  456. _this.saveTemp(_this);
  457. //创建名字为fire的监听器,监听子页面传值事件
  458. uni.$on('contract', function(data) {
  459. console.info("监听getRelationContract子页面的传值", data);
  460. //console.info('监听',_this);
  461. _this.getTemp(_this);
  462. _this.contractCode=data[0].contractCode;
  463. _this.contractName=data[0].contractName;
  464. _this.contract=data[0].contract;
  465. _this.getCostList();
  466. /* _this.$nextTick(function(){
  467. //更新dom
  468. }); */
  469. //接收一次监听,一旦监听到回传值,则清除监听事件,若不清除,会占用资源
  470. uni.$off("contract");
  471. });
  472. /* let requisitionCode=_this.requisitionCode;
  473. if(requisitionCode==""){
  474. uni.showToast({
  475. title:'请先选择申请单',
  476. icon:'none',
  477. duration:3000
  478. });
  479. return;
  480. } */
  481. uni.navigateTo({
  482. url: '/pages/template/SelectRelationContract/SelectRelationContract'
  483. });
  484. },
  485. /*
  486. 获取费用明细
  487. */
  488. getCostList() {
  489. let _this = this;
  490. _this.saveTemp(_this);
  491. if(_this.contractCode){
  492. GetContractCostDTOs(_this.contractCode).then(res=>{
  493. console.info('GetContractCostDTOs',res);
  494. if(res.length>0){
  495. res.forEach(function(item,index,arr){
  496. item.cash=0.00;
  497. item.rateCash=0.00;
  498. item.noRateCash=0.00;
  499. _this.costList.push(item);
  500. //_this.$set(_this.costList,index,item);
  501. });
  502. }
  503. });
  504. }
  505. },
  506. delRow: function(index) {
  507. console.info("删除");
  508. console.info(this.costList[index]);
  509. this.costList.splice(index, 1);
  510. },
  511. /* 计算该行的税额 */
  512. countTaxtCash:function(item,index){
  513. let _this=this;
  514. //console.info("countTaxtCash",item);
  515. //console.info("countTaxtCash",index);
  516. //let value=event.detail.value;
  517. let taxRate=_this.contract.taxRate;
  518. item.rateCash=item.cash*taxRate;
  519. item.noRateCash=item.cash-item.rateCash;
  520. },
  521. bindPickerChange: function(e) {
  522. //console.log('picker发送选择改变,携带值为:' + e.detail.value);
  523. //console.info(e.detail);
  524. this.index = e.detail.value;
  525. this.viseType=this.array[this.index];
  526. console.info(this.viseType);
  527. },
  528. bindDateChange: function(e) {
  529. let date = e.detail.value;
  530. this.viseDate=date;
  531. console.info('bindDateChange',this.viseDate);
  532. },
  533. bindDealDateChange: function(e) {
  534. let date = e.detail.value;
  535. this.endDate=date;
  536. console.info('bindDealDateChange',this.endDate);
  537. },
  538. GetDropDown:function(){
  539. let that=this;
  540. GetQianzhengDropDown().then((res)=>{
  541. console.info('GetQianzhengDropDown:',res);
  542. res.forEach(function(item,index,array){
  543. that.$set(that.array,index,item);
  544. });
  545. //赋默认值
  546. that.viseType=that.array[0];
  547. console.info(that.viseType);
  548. });
  549. },
  550. /*
  551. 上传后返回的值:
  552. list:上传后图片数组
  553. v:返回当前上传图片的临时路径
  554. */
  555. chooseFile(list, v) {
  556. console.log("上传图片_list:", list)
  557. console.log("上传图片_v:", v);
  558. this.urlList=list;
  559. console.info("urlList",this.urlList);
  560. },
  561. /*
  562. 删除图片:
  563. list:删除返回删除后剩余的图片数组
  564. eq:返回删除的数组
  565. */
  566. imgDelete(list, eq) {
  567. console.log("删除图片_list:", list);
  568. console.log("删除图片_eq:", eq);
  569. this.urlList=list;
  570. console.info("urlList",this.urlList);
  571. },
  572. /*限制文件大小列表*/
  573. limitFileSizeList(list){
  574. console.info('limitFileSizeList:',list);
  575. if(list){
  576. if(list.length>0){
  577. uni.showModal({
  578. title:'警告',
  579. content: list.join()+' 文件大小超过2000KB',
  580. showCancel:false
  581. });
  582. }
  583. }
  584. },
  585. /*限制文件类型列表*/
  586. limitFileTypeList(list,allowFileType){
  587. console.info('limitFileTypeList:',list);
  588. console.info('limitFileTypeList:',allowFileType);
  589. if(list){
  590. if(list.length>0){
  591. uni.showModal({
  592. title:'警告',
  593. content: list.join()+' 文件类型必须是'+allowFileType.join(),
  594. showCancel:false
  595. });
  596. }
  597. }
  598. },
  599. /*
  600. 执行上传服务:
  601. urlList:要上传的图片:数组类型
  602. */
  603. uploadFileToServe(masterCode) {
  604. let _this=this;
  605. var urlList=_this.urlList;
  606. if (!urlList || urlList.length <= 0) {
  607. return;
  608. };
  609. //console.info(urlList);
  610. //return;
  611. for (let i = 0; i < urlList.length; i++) {
  612. uni.uploadFile({
  613. url: '/api/Common/UploadImage',
  614. filePath: urlList[i],
  615. name: 'file',
  616. formData: {
  617. createPerson:_this.$store.state.user.userCode,
  618. masterCode:masterCode,
  619. attachMentType:'Vise'
  620. },
  621. headers: {
  622. 'Content-Type': 'multipart/form-data; boundary = ' + new Date().getTime()
  623. //这里要把content-type设置为multipard/form-data,同时还要设置boundary
  624. },
  625. success: (uploadFileRes) => {
  626. console.log("图片上传:",uploadFileRes.data);
  627. }
  628. });
  629. }
  630. },
  631. saveTemp(_this){ //临时存
  632. uni.setStorage({
  633. key:'viseId',
  634. data:_this.viseId
  635. });
  636. uni.setStorage({
  637. key:'viseName',
  638. data:_this.viseName
  639. });
  640. uni.setStorage({
  641. key:'requisitionCode',
  642. data:_this.requisitionCode
  643. });
  644. uni.setStorage({
  645. key:'requisitionName',
  646. data:_this.requisitionName
  647. });
  648. uni.setStorage({
  649. key:'contractName',
  650. data:_this.contractName
  651. });
  652. uni.setStorage({
  653. key:'contractCode',
  654. data:_this.contractCode
  655. });
  656. uni.setStorage({
  657. key:'viseDate',
  658. data:_this.viseDate
  659. });
  660. uni.setStorage({
  661. key:'endDate',
  662. data:_this.endDate
  663. });
  664. uni.setStorage({
  665. key:'viseType',
  666. data:_this.viseType
  667. });
  668. uni.setStorage({
  669. key:'estimateCash',
  670. data:_this.estimateCash
  671. });
  672. uni.setStorage({
  673. key:'reportCash',
  674. data:_this.reportCash
  675. });
  676. uni.setStorage({
  677. key:'reason',
  678. data:_this.reason
  679. });
  680. uni.setStorage({
  681. key:'remark',
  682. data:_this.remark
  683. });
  684. },
  685. getTemp(_this){ //获取缓存,重新给表单赋值
  686. _this.viseId=uni.getStorageSync('viseId');
  687. _this.viseName=uni.getStorageSync('viseName');
  688. _this.requisitionCode=uni.getStorageSync('requisitionCode');
  689. _this.requisitionName=uni.getStorageSync('requisitionName');
  690. _this.contractName=uni.getStorageSync('contractName');
  691. _this.contractCode=uni.getStorageSync('contractCode');
  692. _this.viseDate=uni.getStorageSync('viseDate');
  693. _this.endDate=uni.getStorageSync('endDate');
  694. _this.viseType=uni.getStorageSync('viseType');
  695. _this.estimateCash=uni.getStorageSync('estimateCash');
  696. _this.reportCash=uni.getStorageSync('reportCash');
  697. _this.reason=uni.getStorageSync('reason');
  698. _this.remark=uni.getStorageSync('remark');
  699. },
  700. tapIcon(e){
  701. console.log('you tap icon');
  702. document.documentElement.scrollTop = document.body.scrollTop = 0;
  703. }
  704. }
  705. }
  706. </script>
  707. <style scoped>
  708. /* 头条小程序组件内不能引入字体 */
  709. /* #ifdef MP-TOUTIAO */
  710. @font-face {
  711. font-family: uniicons;
  712. font-weight: normal;
  713. font-style: normal;
  714. src: url("~@/static/uni.ttf") format("truetype");
  715. }
  716. /* #endif */
  717. page {
  718. display: flex;
  719. flex-direction: column;
  720. box-sizing: border-box;
  721. background-color: #efeff4;
  722. min-height: 100%;
  723. height: auto;
  724. }
  725. view {
  726. font-size: 14px;
  727. line-height: inherit;
  728. }
  729. .uni-form-item__title {
  730. font-size: 16px;
  731. line-height: 24px;
  732. }
  733. .uni-input-wrapper {
  734. /* #ifndef APP-NVUE */
  735. display: flex;
  736. /* #endif */
  737. padding: 8px 13px;
  738. flex-direction: row;
  739. flex-wrap: nowrap;
  740. background-color: #FFFFFF;
  741. }
  742. .title{
  743. background-color: #efefef;
  744. }
  745. .uni-input {
  746. height: 28px;
  747. line-height: 28px;
  748. font-size: 15px;
  749. padding: 0px;
  750. flex: 1;
  751. background-color: #FFFFFF;
  752. }
  753. .uni-icon {
  754. font-family: uniicons;
  755. font-size: 24px;
  756. font-weight: normal;
  757. font-style: normal;
  758. width: 24px;
  759. height: 24px;
  760. line-height: 24px;
  761. margin-left:15px;
  762. color: #999999;
  763. }
  764. .uni-eye-active {
  765. color: #007AFF;
  766. }
  767. .uni-btn-v{
  768. position: fixed;
  769. bottom: 0;
  770. width:100%;
  771. }
  772. .header-slot-box {
  773. font-size:15px;
  774. margin: 5px 5px;
  775. width:20%;
  776. justify-content: center;
  777. }
  778. .body-slot-box {
  779. font-size:15px;
  780. margin: 5px 5px;
  781. width:40%;
  782. justify-content: center;
  783. }
  784. .footer-slot-box {
  785. font-size:15px;
  786. margin: 5px 5px;
  787. width:40%;
  788. justify-content: center;
  789. }
  790. .uni-textarea textarea{
  791. font-size:15px;
  792. }
  793. .content {
  794. padding: 40rpx;
  795. background-color: #fff;
  796. display: flex;
  797. }
  798. /* 上传控件 */
  799. .uploadControl {
  800. border: 1rpx solid #eee;
  801. border-radius: 10rpx;
  802. width: 130rpx;
  803. display: block;
  804. height: 130rpx;
  805. text-align: center;
  806. line-height: 130rpx;
  807. font-size: 30rpx;
  808. color: #888;
  809. background-color: #eeeeee;
  810. }
  811. .topicon >>> .icon{
  812. border: #4CD964 2upx solid;
  813. }
  814. </style>