fillOutInInfo.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866
  1. <template>
  2. <div class="intro-add">
  3. <nav-bar></nav-bar>
  4. <div class="page-container">
  5. <!-- 基本信息 -->
  6. <div class="card">
  7. <van-panel>
  8. <!-- <template #header>
  9. <van-cell title="出入信息">
  10. <template #extra>
  11. <span :style="{color:getState(outInRequestInfo.status)}">
  12. {{getDictLabel(outInRequestInfo.status,'letter_status') }}
  13. </span>
  14. </template>
  15. </van-cell>
  16. </template> -->
  17. <div class="panel-box">
  18. <van-cell title="出入类型" :value="getDictLabel(outInRequestInfo.letterType,'out_in_type')"></van-cell>
  19. <div v-if="outInRequestInfo.letterType!=3">
  20. <van-cell title="介绍信编号" v-if="outInRequestInfo.letterNo" :value="outInRequestInfo.letterNo"></van-cell>
  21. <van-cell title="有效开始日期" v-if="outInRequestInfo.startTimeStr" :value="outInRequestInfo.startTimeStr"></van-cell>
  22. <van-cell title="有效截止日期" v-if="outInRequestInfo.endTimeStr" :value="outInRequestInfo.endTimeStr"></van-cell>
  23. <!-- <van-cell title="有效天数" v-if="outInRequestInfo.effectiveDays" :value="`${outInRequestInfo.effectiveDays}天`"></van-cell> -->
  24. <van-cell title="介绍信附件" v-if="outInRequestInfo.letterFile && outInRequestInfo.letterFile.length > 0">
  25. <template #right-icon>
  26. <div>
  27. <ImageThumbnail
  28. :image-list="outInRequestInfo.letterFile.map(v => v.url)"
  29. height="80px"
  30. width="90px"
  31. radius="8px"
  32. />
  33. </div>
  34. </template>
  35. </van-cell>
  36. </div>
  37. <div v-else>
  38. <van-cell title="出入事由" :value="outInRequestInfo.letterReasons"></van-cell>
  39. <van-cell style="color:#969799;" title="本次为紧急申请,无需上传介绍信附件,请根据制度要求,审慎提交申请。"></van-cell>
  40. </div>
  41. <!-- <van-cell v-if="outInRequestInfo.description" title="备注信息" :value="outInRequestInfo.description"></van-cell> -->
  42. </div>
  43. </van-panel>
  44. </div>
  45. <div class="flex-box">
  46. <van-button type="info" size="small" plain style="width: 48%" @click="onCanBatchSetTime">{{batchBtnText}}</van-button>
  47. <van-button :disabled="!isShowCheckBox" type="info" size="small" plain style="width: 48%" @click="onBatchSetTime">批量编辑出入时间</van-button>
  48. </div>
  49. <van-form ref="form" scroll-to-error @failed="onFormFailed">
  50. <div class="card" v-for="(v,i) in userInfos" :key="i">
  51. <van-swipe-cell>
  52. <van-panel>
  53. <template #header>
  54. <van-cell :title="'人员' + (i+1)" icon="manager-o" />
  55. </template>
  56. <!-- 人员列表 -->
  57. <div class="card" >
  58. <div class="goods-card">
  59. <div class="card-cell-checkbox" v-if="isShowCheckBox">
  60. <van-checkbox v-model="v.checked" shape="square" @click.native="checkboxClicked(i)"/>
  61. </div>
  62. <div>
  63. <div class="card-img-box" v-if="v.imgFile && v.imgFile.length > 0" @click="preView(v.imgFile)">
  64. <!-- <img :src="imgUrl(v.imgFile[0])" alt=""> -->
  65. <ImageThumbnail
  66. :image-list="v.imgFile[0]"
  67. height="60px"
  68. width="80px"
  69. radius="8px"
  70. />
  71. </div>
  72. <div class="card-img-box" v-if="v.imgFile && v.imgFile.length >= 1" @click="preView(v.imgFile)">
  73. <!-- <img :src="imgUrl(v.imgFile[1])" alt=""> -->
  74. <ImageThumbnail
  75. :image-list="v.imgFile[1]"
  76. height="60px"
  77. width="80px"
  78. radius="8px"
  79. />
  80. </div>
  81. </div>
  82. <div class="card-cell-box">
  83. <van-field required label="申请单位" v-model="v.companyName" rows="1" autosize :maxlength="200"
  84. placeholder="请输入申请单位"
  85. :rules="[{ required: true, message: '申请单位不能为空' }]"
  86. ></van-field>
  87. <van-field required label="出入人员" v-model="v.userName" rows="1" autosize :maxlength="200"
  88. placeholder="请输入出入人员"
  89. :rules="[{ required: true, message: '出入人员不能为空' }]"
  90. ></van-field>
  91. <select-cell
  92. title="证件类型"
  93. is-row
  94. v-model="v.idType"
  95. :data-list="getDictItem('letter_id_type')"
  96. required>
  97. </select-cell>
  98. <van-field
  99. required
  100. v-model="v.idCard"
  101. rows="1"
  102. autosize
  103. :maxlength="20"
  104. label="证件号码"
  105. :rules="[{ required: true, message: '证件号码不能为空' }]"
  106. placeholder="请输入证件号码"/>
  107. <date-cell required title="进入时间" @change="arrivalTimeChangedHandler(v)" :max-date="maxDate" :min-date='minDate' :is-row="true" v-model="v.arrivalTime" date-type="datetime" labeldateType="dateminute" />
  108. <date-cell required title="离开时间" :max-date.sync="maxDate" :updateMaxDateNow="true" :min-date='v.departureTimeMinDate' :is-row="true" v-model="v.departureTime" date-type="datetime" labeldateType="dateminute"/>
  109. </div>
  110. </div>
  111. </div>
  112. </van-panel>
  113. <template #right>
  114. <van-button style="height: 100%;" square text="删除" type="danger" @click="deleteUser(v,i)" class="delete-button" />
  115. </template>
  116. </van-swipe-cell>
  117. </div>
  118. <div class="card">
  119. <!-- <div style="display: flex;justify-content: space-between; align-items: center;">
  120. <div class="van-cell" style="width:50%"><span>出入人数</span><span style="margin-left:20px;">{{userInfos ? userInfos.length:""}}</span></div>
  121. <div class="van-cell" style="width:50%;color: #969799; background-color:#fff;text-align: right;padding-left: 65px;">已核对认证一致</div>
  122. </div> -->
  123. <!-- <div style="display: flex;justify-content: end; align-items: center;">
  124. <van-cell title="核验人" :value="outInRequestInfo.createBy"></van-cell>
  125. </div> -->
  126. <van-cell title="核验人" :value="outInRequestInfo.createBy"></van-cell>
  127. <van-field
  128. v-model="outInRequestInfo.accompanyingPerson"
  129. rows="1"
  130. autosize
  131. required
  132. :maxlength="100"
  133. placeholder="请输入陪同人员姓名"
  134. :rules="[{ required: true, message: '陪同人员不能为空' }]"
  135. label="陪同人员"></van-field>
  136. <van-field
  137. v-if="outInRequestInfo.type!=3"
  138. v-model="outInRequestInfo.letterReasons"
  139. rows="2"
  140. type="textarea"
  141. autosize
  142. required
  143. show-word-limit
  144. :maxlength="28"
  145. :rules="[{ required: true, message: '出入事由不能为空' }]"
  146. placeholder="请输入出入事由"
  147. label="出入事由"></van-field>
  148. <div class="upload-box">
  149. <span >备注</span>
  150. <van-cell>
  151. <uploader :maxCount="2" v-model="outInRequestInfo.remarkImage"/>
  152. </van-cell>
  153. </div>
  154. <van-field label=" "
  155. v-model="outInRequestInfo.remark"
  156. rows="2"
  157. type="textarea"
  158. autosize
  159. :maxlength="150"
  160. placeholder="请输入备注信息"></van-field>
  161. </div>
  162. </van-form>
  163. <div class="flex-box">
  164. <van-button type="danger" plain v-hasPermi="['core:outinrequest:remove']" style="width: 32%" @click="onDeleteOutInRequest">未出入删除</van-button>
  165. <van-button type="default" style="width: 32%" v-hasPermi="['core:outinrequest:edit']" @click="onSave">保存</van-button>
  166. <van-button type="info" style="width: 32%" v-hasPermi="['core:outinrequest:edit']" @click="onSubmit">提交</van-button>
  167. </div>
  168. </div>
  169. <!-- 输入拒绝原因 -->
  170. <!-- <van-popup class="add-picker" round v-model="showRefuseReasonPopup" position="bottom">
  171. <div style="margin:10px;color:red;text-align:center;font-size:20px;">审批说明</div>
  172. <van-field
  173. v-model="approveRemark"
  174. rows="4"
  175. autosize
  176. label=""
  177. type="textarea"
  178. maxlength="200"
  179. placeholder="请输入审批说明"
  180. show-word-limit
  181. />
  182. <div class="header-line">
  183. <div class="cancel" @click="onRefuseReasonCancel">取消</div>
  184. <div class="sure" @click="onRefuseReasonSave">保存</div>
  185. </div>
  186. </van-popup> -->
  187. <!-- 添加人员弹窗 -->
  188. <van-dialog
  189. v-model="showBatchSetTimeDialog"
  190. class="add-picker"
  191. title="批量录入出入信息"
  192. @cancel="closeBatchSetTime()"
  193. @confirm="confirmBatchSetTime()"
  194. show-cancel-button>
  195. <!-- 添加人员信息 -->
  196. <div class="card" >
  197. <div class="panel-box">
  198. <van-form validate-first >
  199. <van-field
  200. v-model="batchSetFormData.companyName"
  201. rows="2"
  202. type="textarea"
  203. autosize
  204. :maxlength="28"
  205. label="申请单位"
  206. :rules="[{ pattern:/^(.+)$/, message: '请输入' }]"
  207. placeholder="请输入申请单位"/>
  208. <date-cell title="进入时间" @change="batchSetTimeArrivalTimeChangedHandler" :max-date="maxDate" :min-date='minDate' :is-row="true" v-model="batchSetFormData.arrivalTime" date-type="datetime" labeldateType="dateminute" />
  209. <date-cell title="离开时间" :max-date.sync="maxDate" :updateMaxDateNow="true" :min-date='batchSetFormData.departureTimeMinDate' :is-row="true" v-model="batchSetFormData.departureTime" date-type="datetime" labeldateType="dateminute"/>
  210. </van-form>
  211. </div>
  212. </div>
  213. </van-dialog>
  214. <van-action-sheet v-model="showSign" title="签名" class="sheet">
  215. <writingPad ref="esign" :old-signature-seal="oldSignatureSeal" @resultImg="resultImg" @cancelSign="cancelSign"></writingPad>
  216. </van-action-sheet>
  217. <van-dialog v-model="confirmShow" title="引入签名" show-cancel-button @confirm="confirmSignImg">
  218. <van-image :src="this_window + oldSignatureSeal" />
  219. </van-dialog>
  220. </div>
  221. </template>
  222. <script>
  223. import ImageThumbnail from '../letter/imageThumbnail.vue';
  224. import DateCell from "@/components/dateCell/index.vue";
  225. import Uploader from "@/components/upload/gxuploader.vue";
  226. import {formatDate} from "@/filters/filter";
  227. import {mapGetters} from "vuex";
  228. import { ref } from 'vue';
  229. import {imgUrl} from "@/utils";
  230. import { Toast,Dialog,ImagePreview } from 'vant'
  231. import { base64ToBlob } from '@/utils/base64TurnImg.js'
  232. import { upload } from '@/api/public'
  233. import writingPad from '@/components/writingPad/index.vue'
  234. import {outInRequestDetail,updateOutInRequest,deleteOutInRequest,deletedOutInRequestUser} from './api'
  235. export default {
  236. components: {Uploader, DateCell,ImageThumbnail,writingPad},
  237. data(){
  238. return {
  239. // go:{
  240. // type:'replace', //参数:go push replace
  241. // path:'/visitCheck',
  242. // },
  243. showBatchSetTimeDialog:false,
  244. // showRefuseReasonPopup:false,
  245. outInRequestId:null,
  246. approveStatus:null,
  247. approveRemark:null,
  248. outInRequestInfo: {},
  249. userInfos:[],
  250. formData:{},
  251. showInput:false,
  252. dicts:['out_in_approve_status','out_in_type','letter_id_type','letter_status'],
  253. showSign:false,
  254. oldSignatureSeal:"",
  255. confirmShow:false,
  256. this_window: process.env.NODE_ENV === 'development' ? '/dev' : window.origin,
  257. batchBtnText:"多选",
  258. isShowCheckBox:false,
  259. batchSetFormData:{
  260. companyName:"",
  261. arrivalTime:null,
  262. departureTime:null,
  263. departureTimeMinDate:null
  264. },
  265. maxDate:new Date(),
  266. minDate:new Date(null),
  267. }
  268. },
  269. computed:{
  270. ...mapGetters(['orgId','id','dictionary'])
  271. },
  272. mounted(){
  273. this.outInRequestId = this.$route.query.outInRequestId;
  274. this.getInfo();
  275. },
  276. methods:{
  277. imgUrl,formatDate,
  278. cancelSign()
  279. {
  280. this.showSign=false;
  281. },
  282. confirmSignImg(){
  283. this.cancelSign();
  284. this.submitHandler(2,this.oldSignatureSeal);
  285. },
  286. //开启批量设置时间
  287. onCanBatchSetTime()
  288. {
  289. this.isShowCheckBox=!this.isShowCheckBox;
  290. if(this.isShowCheckBox)
  291. {
  292. this.batchBtnText="关闭多选";
  293. }
  294. else
  295. {
  296. this.batchBtnText="多选";
  297. this.userInfos.forEach(item=>{
  298. item.checked=false;
  299. })
  300. }
  301. },
  302. //批量设置时间
  303. onBatchSetTime()
  304. {
  305. if(this.userInfos.findIndex(item=>item.checked==true)<0)
  306. {
  307. this.$toast('请先勾选需要批量录入信息的出入人员!');
  308. return;
  309. }
  310. this.showBatchSetTimeDialog=true;
  311. },
  312. closeBatchSetTime(){
  313. this.showBatchSetTimeDialog=false;
  314. this.batchSetFormData={
  315. companyName:"",
  316. arrivalTime:null,
  317. departureTime:null
  318. }
  319. },
  320. confirmBatchSetTime()
  321. {
  322. this.userInfos.forEach(item=>{
  323. if(item.checked)
  324. {
  325. if(this.batchSetFormData.companyName)
  326. {
  327. item.companyName=this.batchSetFormData.companyName;
  328. }
  329. if(this.batchSetFormData.arrivalTime)
  330. {
  331. item.arrivalTime=this.batchSetFormData.arrivalTime;
  332. }
  333. if(this.batchSetFormData.departureTime)
  334. {
  335. item.departureTime=this.batchSetFormData.departureTime;
  336. }
  337. }
  338. });
  339. this.showBatchSetTimeDialog=false;
  340. this.batchSetFormData={
  341. companyName:"",
  342. arrivalTime:null,
  343. departureTime:null
  344. }
  345. this.$nextTick(()=>{
  346. this.$forceUpdate();
  347. })
  348. },
  349. onDeleteOutInRequest()
  350. {
  351. Dialog.confirm({
  352. title: '提示',
  353. message: '是否删除当前未出入的申请?删除后将无法恢复!',
  354. })
  355. .then(() => {
  356. deleteOutInRequest(this.outInRequestId).then(res=>{
  357. this.$toast('操作成功');
  358. this.toPagesFcn();
  359. }).catch(error=>{
  360. if( error === '任务已完成'){
  361. this.toPagesFcn();
  362. }
  363. })
  364. })
  365. .catch(() => {
  366. });
  367. },
  368. deleteUser(user,index){
  369. Dialog.confirm({
  370. title: '',
  371. message: `是否删除 “${user.userName ? user.userName:"人员"+(index+1)}”,删除后将无法再恢复?`
  372. })
  373. .then(async () => {
  374. deletedOutInRequestUser(user.id).then(res=>{
  375. this.userInfos.splice(index,1);
  376. this.$toast('删除成功');
  377. }).catch(error=>{
  378. this.$toast('删除失败');
  379. })
  380. })
  381. .catch((error) => {
  382. // this.$toast('删除失败');
  383. })
  384. },
  385. // 保存
  386. onSave(){
  387. this.submitHandler(1);
  388. },//提交
  389. onSubmit(){
  390. Dialog.confirm({
  391. title: '',
  392. message: `是否提交出入数据,提交后将无法再修改?`
  393. })
  394. .then(async () => {
  395. let validateRes= this.customerValidate() //自定义校验,部分自己封装的组件没有默认的校验
  396. console.log("validateRes",validateRes)
  397. if (!validateRes) {
  398. return;
  399. }
  400. try {
  401. // this.$refs.form.validate().then((res) => {
  402. // this.submitHandler(2);
  403. // })
  404. await this.$refs.form.validate();
  405. // 验证通过
  406. this.submitHandler(2);
  407. } catch (errors) {
  408. // errors 是一个数组,包含所有失败字段
  409. console.log('验证失败字段:', errors);
  410. // 可以提取第一个错误提示
  411. const firstError = errors[0];
  412. this.$toast(firstError.message || '请填写完整信息');
  413. }
  414. })
  415. .catch((error) => {
  416. this.$toast('请填写必填项');
  417. })
  418. },
  419. onFormFailed(data)
  420. {
  421. // this.$toast(`请填写完整信息`)
  422. },
  423. //表单提交前校验
  424. customerValidate() {
  425. for (let i = 0; i < this.userInfos.length; i++) {
  426. if(!this.userInfos[i].arrivalTime){
  427. this.userInfos[i].userName ? this.$toast(`人员 ${this.userInfos[i].userName} 的进入时间不能为空`) :this.$toast(`人员 ${i+1} 的进入时间不能为空`)
  428. return false;
  429. }
  430. if(!this.userInfos[i].departureTime){
  431. this.userInfos[i].userName ? this.$toast(`人员 ${this.userInfos[i].userName} 的离开时间不能为空`) :this.$toast(`人员 ${i+1} 的离开时间不能为空`)
  432. return false;
  433. }
  434. if(!this.userInfos[i].idType){
  435. this.userInfos[i].userName ? this.$toast(`人员 ${this.userInfos[i].userName} 的证件类型不能为空`) :this.$toast(`人员 ${i+1} 的证件类型不能为空`)
  436. return false;
  437. }
  438. }
  439. return true;
  440. },
  441. checkboxClicked(index)
  442. {
  443. this.userInfos[index].checked=!this.userInfos[index].checked;
  444. this.$nextTick(()=>{
  445. this.$forceUpdate();
  446. });
  447. },
  448. arrivalTimeChangedHandler(userInfo)
  449. {
  450. console.log("arrivalTimeChangedHandler",userInfo.arrivalTime)
  451. if(userInfo.arrivalTime)
  452. {
  453. userInfo.departureTimeMinDate = new Date(this.dayjs(userInfo.arrivalTime));
  454. console.log("arrivalTimeChangedHandler",userInfo.departureTimeMinDate)
  455. }
  456. },
  457. batchSetTimeArrivalTimeChangedHandler()
  458. {
  459. if(this.batchSetFormData.arrivalTime)
  460. {
  461. this.batchSetFormData.departureTimeMinDate = new Date(this.dayjs(this.batchSetFormData.arrivalTime));
  462. }
  463. },
  464. //表单提交校验
  465. submitHandler(type,signImgUrl) {
  466. if (type === 1) {
  467. this.submitData(type)
  468. } else {
  469. this.submitData(type)
  470. }
  471. },
  472. submitData(type,signImgUrl) {
  473. let params = {
  474. type: type,
  475. id:this.outInRequestInfo.id,
  476. letterId:this.outInRequestInfo.letterId,
  477. letterReasons:this.outInRequestInfo.letterReasons,
  478. accompanyingPerson:this.outInRequestInfo.accompanyingPerson,
  479. remark:this.outInRequestInfo.remark,
  480. remarkImage: Array.isArray(this.outInRequestInfo.remarkImage)?this.outInRequestInfo.remarkImage.map(v=>{return v.imgPath}).toString(','):this.outInRequestInfo.remarkImage,
  481. userInfos:JSON.parse(JSON.stringify(this.userInfos)),
  482. };
  483. params.userInfos.forEach(item=>{
  484. delete item.departureTimeMinDate;
  485. delete item.imgFile;
  486. if(item.arrivalTime)
  487. {
  488. item.arrivalTime=this.dayjs(item.arrivalTime).format('YYYY-MM-DD HH:mm:ss');
  489. }
  490. if(item.departureTime)
  491. {
  492. item.departureTime=this.dayjs(item.departureTime).format('YYYY-MM-DD HH:mm:ss');
  493. }
  494. })
  495. updateOutInRequest(params).then(res => {
  496. let { code, msg } = res
  497. if (code == 200) {
  498. Toast(`${type == 1 ? '保存' : '提交'}成功`)
  499. if(type != 1)
  500. {
  501. this.toPagesFcn();
  502. }
  503. } else {
  504. Toast(msg)
  505. }
  506. })
  507. },
  508. //上传签名图到服务器
  509. resultImg(img,oldImgUrl) {
  510. if (oldImgUrl !== "" && oldImgUrl !== null && oldImgUrl !== "null"){
  511. //this.submitSign(oldImgUrl)
  512. this.confirmShow =true;
  513. this.oldSignatureSeal = oldImgUrl;
  514. }else {
  515. let obj = base64ToBlob(img)
  516. let formData = new FormData()
  517. obj.name = '签名.jpg'
  518. formData.append('file', base64ToBlob(img))
  519. upload(formData, 'image')
  520. .then(res => {
  521. console.log(process.env.NODE_ENV)
  522. /*上传成功*/
  523. let imgUrl = process.env.NODE_ENV === 'development' ? res.data.url : res.data.url
  524. this.submitHandler(2,imgUrl);
  525. })
  526. .catch(err => {
  527. /*上传失败*/
  528. })
  529. }
  530. },
  531. //页面跳转逻辑
  532. toPagesFcn(){
  533. this.getRouter();
  534. if(this.fromPages.name === "works" || this.fromPages.name==="letter" ){
  535. this.$router.go(-1)
  536. }else {
  537. this.$router.replace({
  538. name:'outInRquest',
  539. path:'/new/outIn',
  540. params:{event:'refresh'}
  541. });
  542. }
  543. },
  544. getState(state){
  545. switch (state){
  546. case 0:
  547. return '#008cd6';
  548. case 1:
  549. return '#009240';
  550. case 2:
  551. return '#bc9f71';
  552. case 3:
  553. return '#D7000F';
  554. }
  555. },
  556. getInfo(){
  557. outInRequestDetail(this.outInRequestId).then(res=>{
  558. this.outInRequestInfo = res.data;
  559. if(res.data.letterFile){
  560. let imgArr = res.data.letterFile.map(v=>{
  561. return JSON.parse(v)
  562. })
  563. this.outInRequestInfo.letterFile = imgArr;
  564. }
  565. if(res.data.remarkImage){
  566. let imgArr = res.data.remarkImage.split(',');
  567. this.outInRequestInfo.remarkImage= imgArr.map(v=>{
  568. return {
  569. imgPath: v,
  570. url: imgUrl(v)
  571. }
  572. })
  573. }
  574. if(res.data.userInfos){
  575. let users = res.data.userInfos.map(v=>{
  576. if(v.imgFile){
  577. v.imgFile = v.imgFile.split(',');
  578. }
  579. v.checked=false;
  580. v.idType = v.idType+'';
  581. //设置最小时间
  582. let minDate = v.arrivalTime;
  583. if(minDate)
  584. {
  585. v.departureTimeMinDate = new Date(this.dayjs(minDate));
  586. }
  587. else{
  588. v.departureTimeMinDate = new Date(null);
  589. }
  590. return v
  591. });
  592. console.log(users,'users')
  593. this.userInfos = users;
  594. }
  595. })
  596. },
  597. preView(val) {
  598. if(Array.isArray(val)){
  599. let arr = val.map(v=>{
  600. return imgUrl(v);
  601. })
  602. ImagePreview({
  603. images:arr,
  604. showIndicators:true
  605. });
  606. }else {
  607. ImagePreview({
  608. images:[imgUrl(val)],
  609. showIndicators:true
  610. });
  611. }
  612. },
  613. }
  614. }
  615. </script>
  616. <style lang="scss">
  617. .intro-add{
  618. .van-card{
  619. padding: 20px;
  620. }
  621. .van-panel__content{
  622. .panel-box{
  623. .van-cell{
  624. align-items: center;
  625. }
  626. }
  627. }
  628. .card-cell-box{
  629. width: 100%;
  630. margin-right: 10px;
  631. // padding: 0 0 0 10px;
  632. .van-cell{
  633. padding: 4px;
  634. &::after{
  635. left:10px;
  636. right:10px;
  637. }
  638. }
  639. .van-cell__title{
  640. flex:.30;
  641. }
  642. .van-cell__value{
  643. flex:.70;
  644. }
  645. .van-cell--required::before{
  646. left:-6px !important;
  647. top: 6px;
  648. position: relative;
  649. }
  650. }
  651. }
  652. </style>
  653. <style scoped lang="scss">
  654. .intro-add{
  655. height: 100%;
  656. overflow: hidden;
  657. // .van-cell
  658. // {
  659. // line-height: 25px;
  660. // }
  661. }
  662. .page-container{
  663. height: calc(100vh - 94px);
  664. overflow: auto;
  665. padding: 20px;
  666. }
  667. .flex-box{
  668. display: flex;
  669. justify-content: space-between;
  670. align-items: center;
  671. margin-top:10px;
  672. margin-bottom: 20px;
  673. >span{
  674. margin: 0 20px;
  675. }
  676. }
  677. .card{
  678. margin-bottom: 20px;
  679. box-shadow: 0 10px 10px #eaeaea;
  680. border-radius: 12px;
  681. overflow: hidden;
  682. }
  683. .card:last-child{
  684. margin-bottom: 0;
  685. }
  686. .panel-box{
  687. padding:0 20px;
  688. }
  689. .panel-box-item{
  690. height: 36px;
  691. line-height: 36px;
  692. }
  693. .item-label{
  694. width: 100%;
  695. display: flex;
  696. justify-content: right;
  697. align-items: center;
  698. }
  699. .item-value{
  700. width: 100%;
  701. display: flex;
  702. justify-content: left;
  703. align-items: center;
  704. }
  705. .upload-box{
  706. padding: 20px 30px;
  707. display: flex;
  708. >span{
  709. display: inline-block;
  710. height: 160px;
  711. width: 200px;
  712. line-height: 160px;
  713. font-size: 28px;
  714. color:#999;
  715. >i{
  716. font-style: normal;
  717. color: #ee0a24;
  718. }
  719. }
  720. }
  721. .goods-card{
  722. width: 100%;
  723. display: flex;
  724. align-items: center;
  725. padding: 10px;
  726. background-color: #fff;
  727. .card-img-box{
  728. width: 150px;
  729. height: 120px;
  730. margin-right: 10px;
  731. margin-top: 25px;
  732. >img{
  733. width: 100%;
  734. height: 100%;
  735. object-fit: cover;
  736. border-radius: 10px;
  737. }
  738. }
  739. .card-cell-checkbox{
  740. margin-right: 10px;
  741. }
  742. }
  743. .big-btn-box{
  744. padding-bottom: 20px;
  745. }
  746. .file-box{
  747. width: 70%;
  748. display: flex;
  749. justify-content: flex-end;
  750. color:#008cd6;
  751. }
  752. .nfc-img {
  753. display: inline-block;
  754. width: 140px;
  755. height: 140px;
  756. margin: 0 10px;
  757. position: relative;
  758. > img {
  759. width: 100%;
  760. height: 100%;
  761. border: none;
  762. }
  763. > span {
  764. position: absolute;
  765. padding: 0 10px;
  766. bottom: 0;
  767. left: 0;
  768. display: block;
  769. width: 100%;
  770. background-color: rgba(0, 0, 0, 0.2);
  771. color: #eaeaea;
  772. font-size: 20px;
  773. overflow: hidden;
  774. text-overflow: ellipsis;
  775. white-space: nowrap;
  776. line-height: 30px;
  777. height: 30px;
  778. }
  779. }
  780. .upload-box{
  781. padding: 20px 30px;
  782. display: flex;
  783. background-color: #fff;
  784. >span{
  785. display: inline-block;
  786. height: 160px;
  787. width: 250px;
  788. line-height: 160px;
  789. font-size: 28px;
  790. color:#999;
  791. >i{
  792. font-style: normal;
  793. color: #ee0a24;
  794. }
  795. }
  796. .required::before{
  797. content: '*';
  798. color: #ee0a24;
  799. position: absolute;
  800. left: 14px;
  801. }
  802. }
  803. .input-box{
  804. margin-bottom: 20px;
  805. }
  806. .checkboxList {
  807. z-index: 999;
  808. }
  809. .add-picker{
  810. .header-line {
  811. display: flex;
  812. justify-content: space-between;
  813. align-items: center;
  814. height: 90px;
  815. }
  816. .header-line .cancel {
  817. padding: 0 30px;
  818. font-size: 28px;
  819. color: #969799;
  820. }
  821. .header-line .title {
  822. font-weight: 500;
  823. font-size: 30px;
  824. color: #343434;
  825. }
  826. .header-line .sure {
  827. padding: 0 30px;
  828. font-size: 28px;
  829. color: #1989fa;
  830. }
  831. .lists {
  832. padding: 10px 20px 20px 20px;
  833. min-height: 300px;
  834. max-height: 700px;
  835. overflow: auto;
  836. touch-action: pan-y;
  837. }
  838. .tip {
  839. color: #666;
  840. padding-bottom: 5px;
  841. }
  842. .van-empty{
  843. padding: 0;
  844. }
  845. }
  846. </style>