addStoreVisitd.vue 68 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807
  1. <template>
  2. <div>
  3. <!-- 顶部条-->
  4. <div class="navBarTOP">
  5. <van-nav-bar
  6. class="navBar"
  7. left-arrow
  8. title="拜访任务"
  9. @click-left="onClickLeft"
  10. />
  11. </div>
  12. <!-- 主体内容-->
  13. <div class="lineGrey"></div>
  14. <div class="lineGrey"></div>
  15. <div class="lineGrey"></div>
  16. <div class="lineGrey"></div>
  17. <div class="lineGrey"></div>
  18. <div class="lineGrey"></div>
  19. <div v-if="taskType == 2" class="container" style="width: 100%; margin: 0 auto; padding: 10px 0">
  20. <p v-if="infoShow == 0 && unManage != 0" class="isTableMust">
  21. <van-icon name="info-o" />&nbsp;以下产品列表全部必填!
  22. </p>
  23. <p v-if="infoShow == 2 && unManage != 0" class="isTableMust">
  24. <van-icon name="info-o" />&nbsp;以下产品列表至少填一条!
  25. </p>
  26. <p v-if="unManage == 0" class="isTableMust">
  27. <van-icon name="info-o" />&nbsp;请根据本店实际经营的竞品产品,反馈价格信息!
  28. </p>
  29. <el-table :data="tableData1" border class="table-headermd" style="width: 100%">
  30. <el-table-column label="产品名称" prop="collectionName">
  31. <template slot-scope="scope">
  32. <span class="tipTitle" @click="tipTitle(scope.row.collectionName)">{{ scope.row.collectionName }}</span>
  33. </template>
  34. </el-table-column>
  35. <el-table-column prop="name">
  36. <template slot="header"> <span>进货原价</span><span class="xing">*</span> </template>
  37. <template slot-scope="scope">
  38. <van-field
  39. v-model="scope.row.xdjhyj"
  40. placeholder="请输入"
  41. type="number"
  42. @blur="inputblur(scope.row.xdjhyj, scope.$index, '0')"
  43. />
  44. </template>
  45. </el-table-column>
  46. <!--<el-table-column-->
  47. <!--prop="checked"-->
  48. <!--align="center"-->
  49. <!--width="74">-->
  50. <!--<template slot="header">-->
  51. <!--<span>不经营</span ><span style="color:red;padding-left: 4px;">*</span>-->
  52. <!--</template>-->
  53. <!--<template slot-scope="scope">-->
  54. <!--<el-checkbox v-model="scope.row.checked"></el-checkbox>-->
  55. <!--</template>-->
  56. <!--</el-table-column>-->
  57. <el-table-column class="t-center" prop="address">
  58. <template slot="header"> <span>促后净价</span><span class="xing">*</span> </template>
  59. <template slot-scope="scope">
  60. <van-field
  61. v-model="scope.row.xdjhchjj"
  62. placeholder="请输入"
  63. type="number"
  64. @input="inputblurs(scope.row.xdjhchjj, scope.$index, '1')"
  65. />
  66. </template>
  67. </el-table-column>
  68. <el-table-column class="t-center" prop="address">
  69. <template slot="header" class="t-center"> <span>油工拿货价</span><span class="xing">*</span> </template>
  70. <template slot-scope="scope">
  71. <van-field
  72. v-model="scope.row.ygnhj"
  73. placeholder="请输入"
  74. type="number"
  75. @blur="inputblur(scope.row.ygnhj, scope.$index, '2')"
  76. />
  77. </template>
  78. </el-table-column>
  79. </el-table>
  80. <div v-if="unManage == 0" style="margin: 10px">
  81. <van-checkbox v-model="checked" shape="square">全部不经营</van-checkbox>
  82. </div>
  83. </div>
  84. <div v-if="taskType == 1" class="container" style="width: 94%; margin: 0 auto; border-radius: 6px">
  85. <van-form ref="tabstoreVal" >
  86. <div v-for="(item, index) in collectionItemList" :key="index">
  87. <div v-if="item.answerType == 'sz'" class="formLabel z-cell">
  88. <van-cell>
  89. <template #title>
  90. <span v-if="item.isMust == 0" class="van-f-red">*</span>{{ item.collectionName }}
  91. </template>
  92. </van-cell>
  93. <van-field
  94. v-model="item.answerValue"
  95. :placeholder="item.text"
  96. type="number"
  97. readonly
  98. ></van-field>
  99. <p style="color: #444; font-size: 12px; margin: 0; padding: 10px 0; text-align: right">
  100. <van-field
  101. class="mobile-input"
  102. v-model="item.collectionOptionList[0].collectionOption"
  103. autosize
  104. readonly
  105. type="textarea"
  106. />
  107. </p>
  108. <delete-upload-img :imgs="item.fileInfoList"></delete-upload-img>
  109. </div>
  110. <div v-if="item.answerType == 'date'" class="formLabel z-cell">
  111. <van-cell>
  112. <template #title>
  113. <span v-if="item.isMust == 0" class="van-f-red">*</span>{{ item.collectionName }}
  114. </template>
  115. </van-cell>
  116. <van-field
  117. readonly
  118. clickable
  119. :value="item.answerValue"
  120. />
  121. <p style="color: #444; font-size: 12px; margin: 0; padding: 10px 0; text-align: right">
  122. <van-field
  123. class="mobile-input"
  124. v-model="item.collectionOptionList[0].collectionOption"
  125. autosize
  126. readonly
  127. type="textarea"
  128. />
  129. </p>
  130. <delete-upload-img :imgs="item.fileInfoList"></delete-upload-img>
  131. </div>
  132. <div v-if="item.answerType == 'tel'" class="formLabel z-cell">
  133. <van-cell>
  134. <template #title>
  135. <span v-if="item.isMust == 0" class="van-f-red">*</span>{{ item.collectionName }}
  136. </template>
  137. </van-cell>
  138. <van-field
  139. v-model="item.answerValue"
  140. :placeholder="item.text"
  141. type="tel"
  142. readonly
  143. ></van-field>
  144. <p style="color: #444; font-size: 12px; margin: 0; padding: 10px 0; text-align: right">
  145. <van-field
  146. class="mobile-input"
  147. v-model="item.collectionOptionList[0].collectionOption"
  148. autosize
  149. readonly
  150. type="textarea"
  151. />
  152. </p>
  153. <delete-upload-img :imgs="item.fileInfoList"></delete-upload-img>
  154. </div>
  155. <div v-if="item.answerType == 'zp'" class="formLabel z-cell">
  156. <van-cell>
  157. <template #title>
  158. <span v-if="item.isMust == 0" class="van-f-red">*</span>{{ item.collectionName }}
  159. </template>
  160. </van-cell>
  161. <delete-upload-img :imgs="item.fileInfoList"></delete-upload-img>
  162. </div>
  163. <div v-if="item.answerType == 'wb'" class="formLabel z-cell">
  164. <van-cell>
  165. <template #title>
  166. <span v-if="item.isMust == 0" class="van-f-red">*</span>{{ item.collectionName }}
  167. </template>
  168. </van-cell>
  169. <van-field v-model="item.answerValue" :formatter="formatter" :placeholder="item.text" readonly></van-field>
  170. <p style="color: #444; font-size: 12px; margin: 0; text-align: right; position: relative">
  171. <van-field
  172. class="mobile-input"
  173. v-model="item.collectionOptionList[0].collectionOption"
  174. autosize
  175. readonly
  176. type="textarea"
  177. />
  178. <span
  179. style="color: #00afff; position: absolute; top: 8px; right: 0px"
  180. v-if="item.showHistory == 1"
  181. @click="getCollectionShowHistory(item)"
  182. >回显历史</span
  183. >
  184. </p>
  185. <delete-upload-img :imgs="item.fileInfoList"></delete-upload-img>
  186. </div>
  187. <div v-if="item.answerType == 'duox'" class="formLabel z-cell">
  188. <van-cell>
  189. <template #title>
  190. <span v-if="item.isMust == 0" class="van-f-red">*</span>{{ item.collectionName }}
  191. </template>
  192. </van-cell>
  193. <z-checkbox
  194. :answerType="item.answerType"
  195. :checkboxval="item.answerValue"
  196. :collectionType="item.collectionType"
  197. :textc="item.collectionCode"
  198. :childindex="index"
  199. level="A"
  200. :zCheckboxcolumns="item.collectionOptionList"
  201. @zSelectVal="zSelectVal"
  202. ></z-checkbox>
  203. <delete-upload-img :imgs="item.fileInfoList"></delete-upload-img>
  204. </div>
  205. <div v-if="item.answerType == 'dx'" class="formLabel z-cell">
  206. <div>
  207. <van-cell>
  208. <template #title>
  209. <span v-if="item.isMust == 0" class="van-f-red">*</span>{{ item.collectionName }}
  210. </template>
  211. </van-cell>
  212. <z-radio
  213. :answerType="item.answerType"
  214. :collectionType="item.collectionType"
  215. :radio="item.answerValue"
  216. v-model="item.answerValue"
  217. :textc="item.collectionCode"
  218. childIndex4="B"
  219. :zRadiocolumns="item.collectionOptionList"
  220. :childindex="index"
  221. @zSelectVal="zSelectVal"
  222. ></z-radio>
  223. <delete-upload-img :imgs="item.fileInfoList"></delete-upload-img>
  224. <div v-for="(child, indexc) in item.collectionOptionList" :key="indexc">
  225. <div v-if="child.isCheck == 1">
  226. <div v-for="(childitem, childIndex) in child.collectionItems" :key="childIndex">
  227. <div v-if="childitem.answerType == 'wb'" class="formLabel z-cell">
  228. <van-cell>
  229. <template #title>
  230. <span v-if="childitem.isMust == 0" class="van-f-red">*</span>{{ childitem.collectionName }}
  231. </template>
  232. </van-cell>
  233. <van-field
  234. v-model="childitem.collectionOptionList[0].answerValue"
  235. :formatter="formatter"
  236. :placeholder="childitem.text"
  237. readonly
  238. ></van-field>
  239. <p style="color: #444; font-size: 12px; margin: 0; text-align: right; position: relative">
  240. <van-field
  241. class="mobile-input"
  242. v-model="childitem.collectionOptionList[0].collectionOption"
  243. autosize
  244. readonly
  245. type="textarea"
  246. />
  247. <span
  248. style="color: #00afff; position: absolute; top: 8px; right: 0px"
  249. v-if="childitem.showHistory == 1"
  250. @click="getCollectionShowHistory(childitem)"
  251. >回显历史</span
  252. >
  253. </p>
  254. <delete-upload-img :imgs="childitem.fileInfoList"></delete-upload-img>
  255. </div>
  256. <div v-if="childitem.answerType == 'sz'" class="formLabel z-cell">
  257. <van-cell>
  258. <template #title>
  259. <span v-if="childitem.isMust == 0" class="van-f-red">*</span>{{ childitem.collectionName }}
  260. </template>
  261. </van-cell>
  262. <van-field
  263. v-model="childitem.collectionOptionList[0].answerValue"
  264. :placeholder="item.text"
  265. type="number"
  266. readonly
  267. ></van-field>
  268. <p style="color: #444; font-size: 12px; margin: 0; padding: 10px 0; text-align: right">
  269. <van-field
  270. class="mobile-input"
  271. v-model="childitem.collectionOptionList[0].collectionOption"
  272. autosize
  273. readonly
  274. type="textarea"
  275. />
  276. </p>
  277. <delete-upload-img :imgs="childitem.fileInfoList"></delete-upload-img>
  278. </div>
  279. <div v-if="childitem.answerType == 'date'" class="formLabel z-cell">
  280. <van-cell>
  281. <template #title>
  282. <span v-if="childitem.isMust == 0" class="van-f-red">*</span>{{ childitem.collectionName }}
  283. </template>
  284. </van-cell>
  285. <van-field
  286. readonly
  287. clickable
  288. :value="childitem.collectionOptionList[0].answerValue"
  289. :placeholder="childitem.text"
  290. readonly
  291. />
  292. <p style="color: #444; font-size: 12px; margin: 0; padding: 10px 0; text-align: right">
  293. <van-field
  294. class="mobile-input"
  295. v-model="childitem.collectionOptionList[0].collectionOption"
  296. autosize
  297. readonly
  298. type="textarea"
  299. />
  300. </p>
  301. <delete-upload-img :imgs="childitem.fileInfoList"></delete-upload-img>
  302. </div>
  303. <div v-if="childitem.answerType == 'tel'" class="formLabel z-cell">
  304. <van-cell>
  305. <template #title>
  306. <span v-if="childitem.isMust == 0" class="van-f-red">*</span>{{ childitem.collectionName }}
  307. </template>
  308. </van-cell>
  309. <van-field
  310. v-model="childitem.collectionOptionList[0].answerValue"
  311. :placeholder="item.text"
  312. type="tel"
  313. readonly
  314. ></van-field>
  315. <p style="color: #444; font-size: 12px; margin: 0; padding: 10px 0; text-align: right">
  316. <van-field
  317. class="mobile-input"
  318. v-model="childitem.collectionOptionList[0].collectionOption"
  319. autosize
  320. readonly
  321. type="textarea"
  322. />
  323. </p>
  324. <delete-upload-img :imgs="childitem.fileInfoList"></delete-upload-img>
  325. </div>
  326. <div v-if="childitem.answerType == 'zp'" class="formLabel z-cell">
  327. <van-cell>
  328. <template #title>
  329. <span v-if="childitem.isMust == 0" class="van-f-red">*</span>{{ childitem.collectionName }}
  330. </template>
  331. </van-cell>
  332. <delete-upload-img :imgs="childitem.fileInfoList"></delete-upload-img>
  333. </div>
  334. <div v-if="childitem.answerType == 'duox'" class="formLabel z-cell">
  335. <van-cell>
  336. <template #title>
  337. <span v-if="childitem.isMust == 0" class="van-f-red">*</span>{{ childitem.collectionName }}
  338. </template>
  339. </van-cell>
  340. <z-checkbox
  341. :answerType="childitem.answerType"
  342. :checkboxval="childitem.answerValue"
  343. :collectionType="childitem.collectionType"
  344. :textc="childitem.collectionCode"
  345. :zCheckboxcolumns="childitem.collectionOptionList"
  346. :childindex="index"
  347. :childindex1="indexc"
  348. :childindex2="childIndex"
  349. level="B"
  350. @zSelectVal="zSelectVal"
  351. ></z-checkbox>
  352. <delete-upload-img :imgs="childitem.fileInfoList"></delete-upload-img>
  353. </div>
  354. <div v-if="childitem.answerType == 'dx'" class="formLabel z-cell">
  355. <div>
  356. <van-cell>
  357. <template #title>
  358. <span v-if="childitem.isMust == 0" class="van-f-red">*</span>{{ childitem.collectionName }}
  359. </template>
  360. </van-cell>
  361. <z-radio
  362. :answerType="childitem.answerType"
  363. :collectionType="childitem.collectionType"
  364. :radio="childitem.answerValue"
  365. :textc="childitem.collectionCode"
  366. v-model="childitem.answerValue"
  367. :childindex="index"
  368. :childindex1="indexc"
  369. childIndex4="A"
  370. :childindex2="childIndex"
  371. :zRadiocolumns="childitem.collectionOptionList"
  372. @zSelectVal="zSelectVal"
  373. ></z-radio>
  374. <delete-upload-img :imgs="childitem.fileInfoList"></delete-upload-img>
  375. <div v-for="(child1, indexc1) in childitem.collectionOptionList" :key="indexc1">
  376. <div v-if="child1.isCheck==1">
  377. <div v-for="(childitem1, childIndex1) in child1.collectionItems" :key="childIndex1">
  378. <div v-if="childitem1.answerType == 'wb'" class="formLabel z-cell">
  379. <van-cell>
  380. <template #title>
  381. <span v-if="childitem1.isMust == 0" class="van-f-red">*</span
  382. >{{ childitem1.collectionName }}
  383. </template>
  384. </van-cell>
  385. <van-field
  386. v-model="childitem1.collectionOptionList[0].answerValue"
  387. :placeholder="childitem1.text"
  388. readonly
  389. ></van-field>
  390. <p
  391. style="color: #444; font-size: 12px; margin: 0; text-align: right; position: relative"
  392. >
  393. <van-field
  394. class="mobile-input"
  395. v-model="childitem1.collectionOptionList[0].collectionOption"
  396. autosize
  397. readonly
  398. type="textarea"
  399. />
  400. <span
  401. style="color: #00afff; position: absolute; top: 8px; right: 0px"
  402. v-if="childitem1.showHistory == 1"
  403. @click="getCollectionShowHistory(childitem1)"
  404. >回显历史</span
  405. >
  406. </p>
  407. <delete-upload-img :imgs="childitem1.fileInfoList"></delete-upload-img>
  408. </div>
  409. <div v-if="childitem1.answerType == 'date'" class="formLabel z-cell">
  410. <van-cell>
  411. <template #title>
  412. <span v-if="childitem1.isMust == 0" class="van-f-red">*</span
  413. >{{ childitem1.collectionName }}
  414. </template>
  415. </van-cell>
  416. <van-field
  417. readonly
  418. clickable
  419. :value="childitem1.collectionOptionList[0].answerValue"
  420. :placeholder="childitem1.text"
  421. readonly
  422. />
  423. <p
  424. style="color: #444; font-size: 12px; margin: 0; text-align: right; position: relative"
  425. >
  426. <van-field
  427. class="mobile-input"
  428. v-model="childitem1.collectionOptionList[0].collectionOption"
  429. autosize
  430. readonly
  431. type="textarea"
  432. />
  433. <span
  434. style="color: #00afff; position: absolute; top: 8px; right: 0px"
  435. v-if="childitem1.showHistory == 1"
  436. @click="getCollectionShowHistory(childitem1)"
  437. >回显历史</span
  438. >
  439. </p>
  440. <delete-upload-img :imgs="childitem1.fileInfoList"></delete-upload-img>
  441. </div>
  442. <div v-if="childitem1.answerType == 'duox'" class="formLabel z-cell">
  443. <van-cell>
  444. <template #title>
  445. <span v-if="childitem1.isMust == 0" class="van-f-red">*</span
  446. >{{ childitem1.collectionName }}
  447. </template>
  448. </van-cell>
  449. <z-checkbox
  450. :answerType="childitem1.answerType"
  451. :checkboxval="childitem1.answerValue"
  452. :collectionType="childitem1.collectionType"
  453. :textc="childitem1.collectionCode"
  454. :childindex="index"
  455. :childindex1="indexc"
  456. :childindex2="childIndex"
  457. :childindex3="indexc1"
  458. :childindex4="childIndex1"
  459. level="C"
  460. :zCheckboxcolumns="childitem1.collectionOptionList"
  461. @zSelectVal="zSelectVal"
  462. ></z-checkbox>
  463. <delete-upload-img :imgs="childitem1.fileInfoList"></delete-upload-img>
  464. </div>
  465. <div v-if="childitem1.answerType == 'dx'" class="formLabel z-cell">
  466. <div>
  467. <van-cell>
  468. <template #title>
  469. <span v-if="childitem1.isMust == 0" class="van-f-red">*</span
  470. >{{ childitem1.collectionName }}
  471. </template>
  472. </van-cell>
  473. <z-radio
  474. :answerType="childitem1.answerType"
  475. :collectionType="childitem1.collectionType"
  476. :radio="childitem1.answerValue"
  477. v-model="childitem1.answerValue"
  478. :textc="childitem1.collectionCode"
  479. :childindex="index"
  480. :childindex1="indexc"
  481. :childindex2="childIndex"
  482. :childindex3="indexc1"
  483. :childindex5="childIndex1"
  484. childIndex4="D"
  485. :zRadiocolumns="childitem1.collectionOptionList"
  486. @zSelectVal="zSelectVal"
  487. ></z-radio>
  488. <delete-upload-img :imgs="childitem1.fileInfoList"></delete-upload-img>
  489. </div>
  490. </div>
  491. <div v-if="childitem1.answerType == 'sz'" class="formLabel z-cell">
  492. <van-cell>
  493. <template #title>
  494. <span v-if="childitem1.isMust == 0" class="van-f-red">*</span
  495. >{{ childitem1.collectionName }}
  496. </template>
  497. </van-cell>
  498. <van-field
  499. v-model="childitem1.collectionOptionList[0].answerValue"
  500. :placeholder="item.text"
  501. type="number"
  502. readonly
  503. ></van-field>
  504. <p style="color: #444; font-size: 12px; margin: 0; padding: 10px 0; text-align: right">
  505. <van-field
  506. class="mobile-input"
  507. v-model="childitem1.collectionOptionList[0].collectionOption"
  508. autosize
  509. readonly
  510. type="textarea"
  511. />
  512. </p>
  513. <delete-upload-img :imgs="childitem1.fileInfoList"></delete-upload-img>
  514. </div>
  515. <div v-if="childitem1.answerType == 'tel'" class="formLabel z-cell">
  516. <van-cell>
  517. <template #title>
  518. <span v-if="childitem1.isMust == 0" class="van-f-red">*</span
  519. >{{ childitem1.collectionName }}
  520. </template>
  521. </van-cell>
  522. <van-field
  523. v-model="childitem1.collectionOptionList[0].answerValue"
  524. :placeholder="item.text"
  525. type="tel"
  526. readonly
  527. ></van-field>
  528. <p style="color: #444; font-size: 12px; margin: 0; padding: 10px 0; text-align: right">
  529. <van-field
  530. class="mobile-input"
  531. v-model="childitem1.collectionOptionList[0].collectionOption"
  532. autosize
  533. readonly
  534. type="textarea"
  535. />
  536. </p>
  537. <delete-upload-img :imgs="childitem1.fileInfoList"></delete-upload-img>
  538. </div>
  539. <div v-if="childitem1.answerType == 'zp'" class="formLabel z-cell">
  540. <van-cell>
  541. <template #title>
  542. <span v-if="childitem1.isMust == 0" class="van-f-red">*</span
  543. >{{ childitem1.collectionName }}
  544. </template>
  545. </van-cell>
  546. <delete-upload-img :imgs="childitem1.fileInfoList"></delete-upload-img>
  547. </div>
  548. </div>
  549. </div>
  550. </div>
  551. </div>
  552. </div>
  553. <br />
  554. </div>
  555. </div>
  556. </div>
  557. </div>
  558. </div>
  559. <br />
  560. </div>
  561. </van-form>
  562. </div>
  563. <br />
  564. <van-dialog v-model="show" :show-confirm-button="false" show-cancel-button title="上传图片">
  565. <van-field
  566. v-if="indexselect == '1'"
  567. :value="PhotoTypeText"
  568. clickable
  569. name="picker"
  570. placeholder="选择图片类型"
  571. readonly
  572. @click="showPicker = true"
  573. >
  574. <template #label> <span class="van-f-red">*</span>图片类型 </template>
  575. </van-field>
  576. <van-cell>
  577. <template #title> <span class="van-f-red">*</span>拍照上传 </template>
  578. <template #right-icon>
  579. <upload-img
  580. :collectionId="collectionId"
  581. :parentCollectionId="parentCollectionId"
  582. :secondCollectionId="secondCollectionId"
  583. :firstCollectionId="firstCollectionId"
  584. :imgArr="imgs"
  585. :objectType="PhotoType"
  586. :shouws="true"
  587. :storeGroupId="storeGroupId"
  588. :taskId="taskId"
  589. :uploadid="uploadid2"
  590. :visitModel="1 + ''"
  591. :visitsId="visitId"
  592. :childIndex="childIndex"
  593. @newimgarr="newimgarr1"
  594. @typeshow="typeshow"
  595. ></upload-img>
  596. </template>
  597. </van-cell>
  598. </van-dialog>
  599. <!-- list-->
  600. <van-dialog v-model="listShow" title="历史回显" show-cancel-button :showConfirmButton="false">
  601. <div style="border: 1px solid #eee; margin-top: 18px">
  602. <div class="itenHhistory" v-for="item in list">
  603. <p>内容:{{ item.answerValue }}</p>
  604. <p>拜访人:{{ item.nickName }}</p>
  605. <p>拜访时间:{{ item.createTime }}</p>
  606. </div>
  607. </div>
  608. </van-dialog>
  609. <van-popup v-model="sdsd" position="bottom">
  610. <upload-img
  611. :collectionId="collectionId"
  612. :imgArr="imgs"
  613. :objectType="PhotoType"
  614. :storeGroupId="storeGroupId"
  615. :taskId="taskId"
  616. :uploadid="uploadid2"
  617. :visitsId="visitId"
  618. @newimgarr="newimgarr1"
  619. @typeshow="typeshow"
  620. ></upload-img>
  621. </van-popup>
  622. <van-popup v-model="showPicker" capture position="bottom">
  623. <van-picker :columns="PhotoTypeList" show-toolbar @cancel="showPicker = false" @confirm="onConfirm" />
  624. </van-popup>
  625. <van-dialog v-model="logshow" show-cancel-button title="系统提示"> 是否保存信息? </van-dialog>
  626. <br />
  627. <br />
  628. <br />
  629. <br />
  630. <!-- <div-->
  631. <!-- style="-->
  632. <!-- text-align: center;-->
  633. <!-- padding: 10px;-->
  634. <!-- background-color: #ff976a;-->
  635. <!-- border-radius: 6px;-->
  636. <!-- color: #fff;-->
  637. <!-- position: fixed;-->
  638. <!-- bottom: 16px;-->
  639. <!-- font-size: 14px;-->
  640. <!-- left: 14px;-->
  641. <!-- "-->
  642. <!-- @click="removeFn"-->
  643. <!-- >-->
  644. <!-- <van-icon name="cross" />&nbsp;&nbsp;清空内容-->
  645. <!-- </div>-->
  646. <van-calendar
  647. @confirm="onConfirmTime"
  648. v-model="showPickerTime"
  649. />
  650. </div>
  651. </template>
  652. <script>
  653. import {
  654. getPhotoTypeList,
  655. addCollectionAnswer,
  656. getStoreGroupTask,
  657. editDwellTime,
  658. deleteTaskAnswer,
  659. getCollectionShowHistory
  660. } from '@/api/index';
  661. import zRadio from '@/components/zRadioD';
  662. import zCheckbox from '@/components/zCheckboxD';
  663. import uploadImg from '@/components/uploadVNormal';
  664. import deleteUploadImg from '@/components/deleteUploadImgD';
  665. export default {
  666. name: 'abnormalVisit',
  667. components: { zRadio, zCheckbox, uploadImg, deleteUploadImg },
  668. data() {
  669. return {
  670. value: '',
  671. sdsd: false,
  672. showPicker: false,
  673. showPickerTime:false,
  674. logshow: false,
  675. fromValue: {
  676. select1: '',
  677. select3: '',
  678. checkbox: '1',
  679. radio: '',
  680. input: ''
  681. },
  682. timer: null,
  683. flagclick: true,
  684. listShow: false,
  685. isMust: '0',
  686. imgs: [],
  687. checkboxGroup: [],
  688. radio: '',
  689. uploadid2: 'uploadid2',
  690. collectionItemList: [],
  691. rdId: '',
  692. show: false,
  693. PhotoTypeList: [],
  694. PhotoType: '',
  695. PhotoTypeText: '',
  696. indexselect: 0,
  697. visitId: '',
  698. storeGroupId: '',
  699. taskId: '',
  700. collectionId: '',
  701. parentCollectionId: '',
  702. // form
  703. storeId: '',
  704. collectionAnswerlisd: [],
  705. tableData1: [],
  706. taskType: 1,
  707. flag: false,
  708. indeximg: '',
  709. childIndex: '',
  710. childIndex1:"",
  711. childIndex2:"",
  712. childIndex3:"",
  713. link: '3',
  714. infoShow: '99',
  715. checked: false,
  716. unManage: '1',
  717. pType:"",
  718. RIndex: '',
  719. list: [],
  720. Tindex:"",
  721. Tindex1:"",
  722. Tindex2:"",
  723. Tindex3:"",
  724. Tindex4:"",
  725. Ttype:"",
  726. secondCollectionId:"", firstCollectionId:""
  727. };
  728. },
  729. beforeRouteLeave(to, from, next) {
  730. if (this.visitId != null && this.visitId != '') {
  731. this.editDwellTimes();
  732. }
  733. next();
  734. },
  735. activated() {
  736. this.flag = false;
  737. this.link = '3';
  738. this.taskType = this.$route.query.taskType;
  739. this.PhotoType = this.$route.query.photoType;
  740. this.storeCode = this.$route.query.storeCode;
  741. this.visitId = this.$route.query.visitId + '';
  742. this.taskId = this.$route.query.taskId + '';
  743. this.storeId = this.$route.query.storeId + '';
  744. this.isMust == this.$route.query.isMust + '';
  745. this.storeGroupId = this.$route.query.storeGroupId + '';
  746. if (this.$route.query.photoType != null) {
  747. this.indexselect = 0;
  748. } else {
  749. this.indexselect = 1;
  750. }
  751. this.getPhotoTypeList();
  752. this.info();
  753. },
  754. // watch:{
  755. // $route(to,from){
  756. // console.log(from.path+"opi"+to.path)
  757. // if(from.path=="/storeVisitpage"&&to.path=="/addStoreVisit"){
  758. // this.flag=false
  759. // this.link="3"
  760. // this.info()
  761. // }
  762. // if(from.path=="/outstoreVisit"&&to.path=="/addStoreVisit"){
  763. // this.flag=false
  764. // this.link="3"
  765. // this.info()
  766. // }
  767. // }
  768. // },
  769. created() {
  770. this.taskType = this.$route.query.taskType;
  771. this.PhotoType = this.$route.query.photoType;
  772. this.storeCode = this.$route.query.storeCode;
  773. this.visitId = this.$route.query.visitId + '';
  774. this.taskId = this.$route.query.taskId + '';
  775. this.storeId = this.$route.query.storeId + '';
  776. this.isMust == this.$route.query.isMust + '';
  777. this.storeGroupId = this.$route.query.storeGroupId + '';
  778. if (this.$route.query.photoType != null) {
  779. this.indexselect = 0;
  780. } else {
  781. this.indexselect = 1;
  782. }
  783. this.getPhotoTypeList();
  784. // this.info()
  785. },
  786. methods: {
  787. showPickerTimeFn(index,type,index1,index2,index3,index4){
  788. this.Tindex=index;
  789. this.Tindex1=index1;
  790. this.Tindex2=index2;
  791. this.Tindex3=index3;
  792. this.Tindex4=index4;
  793. this.Ttype=type;
  794. this.showPickerTime = true;
  795. },
  796. onConfirmTime(time) {
  797. if(this.Ttype=="A"){
  798. this.collectionItemList[this.Tindex].answerValue=this.parseTime(time, '{y}-{m}-{d}')
  799. }
  800. if(this.Ttype=="B"){
  801. this.collectionItemList[this.Tindex].collectionOptionList[this.Tindex1].collectionItems[this.Tindex2].collectionOptionList[0].answerValue=this.parseTime(time, '{y}-{m}-{d}')
  802. }
  803. if(this.Ttype=="C"){
  804. this.collectionItemList[this.Tindex].collectionOptionList[this.Tindex1].collectionItems[this.Tindex2].collectionOptionList[this.Tindex3].collectionItems[this.Tindex4].answerValue=this.parseTime(time, '{y}-{m}-{d}')
  805. }
  806. this.showPickerTime = false;
  807. },
  808. // 历史回显
  809. getCollectionShowHistory(id) {
  810. getCollectionShowHistory({
  811. storeId: this.$route.query.storeId,
  812. collectionId: id.collectionId,
  813. visitsId: this.$route.query.visitId,
  814. storeGroupId: this.$route.query.storeGroupId,
  815. taskId: this.$route.query.taskId
  816. }).then(res => {
  817. if(res.data.length>0){
  818. this.list = res.data;
  819. this.listShow = true;
  820. }else{
  821. this.$toast("暂无历史信息");
  822. }
  823. });
  824. },
  825. removeFn() {
  826. var that = this;
  827. this.$dialog
  828. .confirm({
  829. title: '系统提示',
  830. message: '是否清空任务内容?',
  831. confirmButtonText: '确定',
  832. cancelButtonText: '取消'
  833. })
  834. .then(() => {
  835. deleteTaskAnswer({ visitsId: that.$route.query.visitId, taskId: that.$route.query.taskId }).then(res => {
  836. if (res.code == 200) {
  837. that.$dialog
  838. .alert({
  839. title: '系统提示',
  840. message: '内容已清空'
  841. })
  842. .then(res => {
  843. that.info();
  844. });
  845. }
  846. });
  847. });
  848. },
  849. formatter(value) {
  850. return value.replace(
  851. /[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF][\u200D|\uFE0F]|[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF]|[0-9|*|#]\uFE0F\u20E3|[0-9|#]\u20E3|[\u203C-\u3299]\uFE0F\u200D|[\u203C-\u3299]\uFE0F|[\u2122-\u2B55]|\u303D|[\A9|\AE]\u3030|\uA9|\uAE|\u3030/gi,
  852. ''
  853. );
  854. },
  855. editDwellTimes() {
  856. let dwellTime = this.weekend(localStorage.getItem('startTime'), new Date()) + '';
  857. editDwellTime({ dwellTime: dwellTime, visitsId: this.visitId }).then(res => {
  858. if (res.code == 200) {
  859. localStorage.removeItem('startTime');
  860. localStorage.setItem('startTime', new Date());
  861. }
  862. });
  863. },
  864. weekend(time1) {
  865. var arrtime1 = new Date(time1).getTime();
  866. var arrtime2 = new Date().getTime();
  867. return Math.round((arrtime2 - arrtime1) / 1000);
  868. },
  869. telFn(val){
  870. if (!/^1[3456789]\d{9}$/.test(val.answerValue)&&val.answerValue!="") {
  871. this.$toast(val.collectionName+"格式错误");
  872. }
  873. },
  874. numberFn(val,index,type) {
  875. if(type=="A"){
  876. if (!/^[+-]?\d*\.{0,1}\d{0,1}$/.test(this.collectionItemList[index].answerValue)) {
  877. this.collectionItemList[index].answerValue = this.collectionItemList[index].answerValue.replace(
  878. /\.\d{2,}$/,
  879. this.collectionItemList[index].answerValue.substr(this.collectionItemList[index].answerValue.indexOf('.'), 3)
  880. );
  881. }
  882. }else{
  883. if (!/^[+-]?\d*\.{0,1}\d{0,1}$/.test(this.collectionItemList[index].answerValue)) {
  884. this.collectionItemList[index].answerValue = this.collectionItemList[index].answerValue.replace(
  885. /\.\d{2,}$/,
  886. this.collectionItemList[index].answerValue.substr(this.collectionItemList[index].answerValue.indexOf('.'), 3)
  887. );
  888. }
  889. }
  890. },
  891. logshowFN() {
  892. this.logshow = true;
  893. },
  894. info() {
  895. var insert = '';
  896. this.collectionItemList = [];
  897. this.tableData1 = [];
  898. this.collectionAnswerlisd = [];
  899. if (this.$route.query.type == 'edit') {
  900. insert = false;
  901. } else {
  902. insert = true;
  903. }
  904. if (this.$route.query.type == 'edit') {
  905. var params = {
  906. storeId: this.$route.query.storeId,
  907. storeCode: this.$route.query.storeCode,
  908. visitEntry: '0',
  909. lat: '',
  910. lon: '',
  911. visitModel: this.visitModel,
  912. routeDetailsId: '',
  913. storeGroupId: this.$route.query.storeGroupId,
  914. visitSource: '1',
  915. insert: insert,
  916. projectVisit:"1",
  917. locationCity: '',
  918. locationRemark: '',
  919. locationAccuracy: ''
  920. };
  921. } else {
  922. var params = {
  923. storeId: this.storeId,
  924. storeCode: this.$route.query.storeCode,
  925. visitEntry: '0',
  926. lat: this.$route.query.lat,
  927. lon: this.$route.query.lon,
  928. visitModel: this.$route.query.visitModel,
  929. routeDetailsId: this.$route.query.taskId,
  930. locationCity: this.$route.query.locationCity,
  931. insert: insert,
  932. projectVisit:"1",
  933. locationRemark: this.$route.query.locationRemark,
  934. locationAccuracy: this.$route.query.locationAccuracy,
  935. visitSource: this.$route.query.visitSource
  936. };
  937. }
  938. if (this.$route.query.visitId != null) {
  939. params.id = this.$route.query.visitId;
  940. }
  941. getStoreGroupTask(params).then(res => {
  942. var checkUnManage = res.data.sfaTaskList[this.$route.query.ids];
  943. var collectionItemLists = res.data.sfaTaskList[this.$route.query.ids].collectionItemList;
  944. if (checkUnManage.checkUnManage != null && checkUnManage.checkUnManage != 'N') {
  945. this.checked = true;
  946. } else {
  947. this.checked = false;
  948. }
  949. this.unManage = res.data.sfaTaskList[this.$route.query.ids].unManage;
  950. this.infoShow = res.data.sfaTaskList[this.$route.query.ids].isMust;
  951. if (this.$route.query.taskType == 1) {
  952. for (var q = 0; q < collectionItemLists.length; q++) {
  953. if (collectionItemLists[q].answerType == 'sz' || collectionItemLists[q].answerType == 'wb'|| collectionItemLists[q].answerType == 'tel'|| collectionItemLists[q].answerType == 'date') {
  954. collectionItemLists[q].answerValue = collectionItemLists[q].collectionOptionList[0].answerValue;
  955. }
  956. if (collectionItemLists[q].answerType == 'duox' || collectionItemLists[q].answerType == 'dx') {
  957. collectionItemLists[q].answerValue = [];
  958. for (var qq = 0; qq < collectionItemLists[q].collectionOptionList.length; qq++) {
  959. if (collectionItemLists[q].collectionOptionList[qq].isCheck == 1) {
  960. collectionItemLists[q].answerValue.push(
  961. collectionItemLists[q].collectionOptionList[qq].collectionOptionId
  962. );
  963. collectionItemLists[q].collectionOptionList[qq].code = collectionItemLists[q].collectionCode;
  964. collectionItemLists[q].collectionOptionList[qq].answerType = collectionItemLists[q].answerType;
  965. // this.collectionAnswerlisd.push(collectionItemLists[q].collectionOptionList[qq]);
  966. }
  967. if (collectionItemLists[q].answerType == 'dx') {
  968. var listchild = collectionItemLists[q].collectionOptionList[qq].collectionItems;
  969. if (listchild != undefined) {
  970. for (var qq1 = 0; qq1 < listchild.length; qq1++) {
  971. if (listchild[qq1].answerType == 'sz') {
  972. if (listchild[qq1].collectionOptionList[0].answerValue != null) {
  973. listchild[qq1].answerValue = listchild[qq1].collectionOptionList[0].answerValue;
  974. }
  975. }
  976. if (listchild[qq1].answerType == 'wb') {
  977. if (listchild[qq1].collectionOptionList[0].answerValue != null) {
  978. listchild[qq1].answerValue = listchild[qq1].collectionOptionList[0].answerValue;
  979. } else {
  980. listchild[qq1].answerValue = '';
  981. }
  982. }
  983. if (listchild[qq1].answerType == 'tel') {
  984. if (listchild[qq1].collectionOptionList[0].answerValue != null) {
  985. listchild[qq1].answerValue = listchild[qq1].collectionOptionList[0].answerValue;
  986. } else {
  987. listchild[qq1].answerValue = '';
  988. }
  989. }
  990. if (listchild[qq1].answerType == 'date') {
  991. if (listchild[qq1].collectionOptionList[0].answerValue != null) {
  992. listchild[qq1].answerValue = listchild[qq1].collectionOptionList[0].answerValue;
  993. } else {
  994. listchild[qq1].answerValue = '';
  995. }
  996. }
  997. if (listchild[qq1].answerType == 'duox' || listchild[qq1].answerType == 'dx') {
  998. listchild[qq1].answerValue = [];
  999. for (var qq2 = 0; qq2 < listchild[qq1].collectionOptionList.length; qq2++) {
  1000. listchild[qq1].collectionOptionList[qq2].code = listchild[qq1].collectionCode;
  1001. listchild[qq1].collectionOptionList[qq2].answerType = listchild[qq1].answerType;
  1002. listchild[qq1].collectionOptionList[qq2].parentCollectionId =
  1003. listchild[qq1].parentCollectionId;
  1004. listchild[qq1].collectionOptionList[qq2].parentOptionId = listchild[qq1].parentOptionId;
  1005. listchild[qq1].collectionOptionList[qq2].firstCollectionId = listchild[qq1].firstCollectionId;
  1006. listchild[qq1].collectionOptionList[qq2].secondCollectionId = listchild[qq1].secondCollectionId;
  1007. if (listchild[qq1].collectionOptionList[qq2].isCheck == 1) {
  1008. listchild[qq1].answerValue.push(
  1009. listchild[qq1].collectionOptionList[qq2].collectionOptionId
  1010. );
  1011. // this.collectionAnswerlisd.push(listchild[qq1].collectionOptionList[qq2]);
  1012. }
  1013. }
  1014. listchild[qq1].answerValue = listchild[qq1].answerValue.join();
  1015. }
  1016. if (listchild[qq1].answerType == 'dx') {
  1017. let list3 = listchild[qq1].collectionOptionList;
  1018. for (let l3 = 0; l3 < list3.length; l3++) {
  1019. if (list3[l3].answerType == 'sz') {
  1020. // list3[l3].answerValue = list3[l3].collectionOptionList[0].answerValue;
  1021. }
  1022. if (list3[l3].answerType == 'wb') {
  1023. // list3[l3].answerValue = list3[l3].collectionOptionList[0].answerValue;
  1024. }
  1025. if (list3[l3].answerType == 'duox' || list3[l3].answerType == 'dx') {
  1026. let lis4 = list3[l3].collectionItems;
  1027. if (lis4 != null) {
  1028. for (let l4 = 0; l4 < lis4.length; l4++) {
  1029. lis4[l4].answerValue = [];
  1030. let list5 = lis4[l4].collectionOptionList;
  1031. if(list5!=undefined&&list5!=null&&list5!=""){
  1032. for (let l5 = 0; l5 < list5.length; l5++) {
  1033. list5[l5].code = lis4[l4].collectionCode;
  1034. list5[l5].answerType = lis4[l4].answerType;
  1035. list5[l5].parentCollectionId = lis4[l4].parentCollectionId;
  1036. list5[l5].parentOptionId = lis4[l4].parentOptionId;
  1037. list5[l5].firstCollectionId = lis4[l4].firstCollectionId;
  1038. list5[l5].secondCollectionId = lis4[l4].secondCollectionId;
  1039. if (list5[l5].isCheck == 1) {
  1040. lis4[l4].answerValue.push(list5[l5].collectionOptionId);
  1041. // this.collectionAnswerlisd.push(list5[l5]);
  1042. }
  1043. }
  1044. }
  1045. lis4[l4].answerValue = lis4[l4].answerValue.join();
  1046. }
  1047. }
  1048. }
  1049. }
  1050. }
  1051. }
  1052. }
  1053. }
  1054. }
  1055. collectionItemLists[q].answerValue = collectionItemLists[q].answerValue.join();
  1056. }
  1057. }
  1058. this.collectionItemList = collectionItemLists;
  1059. // console.log(this.collectionItemList);
  1060. } else {
  1061. for (var f = 0; f < collectionItemLists.length; f++) {
  1062. var collectionOptionListarr = collectionItemLists[f].collectionOptionList;
  1063. for (var ff = 0; ff < collectionOptionListarr.length; ff++) {
  1064. if (ff == '0') {
  1065. collectionItemLists[f].xdjhyj = collectionOptionListarr[ff].answerValue;
  1066. }
  1067. if (ff == '1') {
  1068. collectionItemLists[f].xdjhchjj = collectionOptionListarr[ff].answerValue;
  1069. if (collectionOptionListarr[ff].answerValue == null) {
  1070. collectionItemLists[f].answerVal = 'T';
  1071. } else {
  1072. collectionItemLists[f].answerVal = '';
  1073. }
  1074. }
  1075. if (ff == '2') {
  1076. collectionItemLists[f].ygnhj = collectionOptionListarr[ff].answerValue;
  1077. }
  1078. }
  1079. }
  1080. this.tableData1 = collectionItemLists;
  1081. }
  1082. });
  1083. },
  1084. tipTitle(val) {
  1085. this.$toast(val);
  1086. },
  1087. inputblurs(val, index, num) {
  1088. // console.log(val);
  1089. if ((val + '').trim() == '') {
  1090. this.tableData1[index].xdjhchjj = '';
  1091. } else {
  1092. if (Number(val) > 10000 || Number(val) <= 0) {
  1093. this.$toast('请输入大于0并且小于10000的两位小数');
  1094. this.tableData1[index].xdjhchjj = '';
  1095. } else if (this.tableData1[index].xdjhyj == '') {
  1096. this.tableData1[index].xdjhchjj = '';
  1097. this.$toast('请输入进货原价');
  1098. } else if (Number(val) > Number(this.tableData1[index].xdjhyj)) {
  1099. this.$toast('请输入小于等于进货原价的数字');
  1100. this.tableData1[index].xdjhchjj = '';
  1101. } else {
  1102. this.tableData1[index].xdjhchjj = val.replace(/[^\d.]/g, ''); //清除"数字"和"."以外的字符
  1103. this.tableData1[index].xdjhchjj = val.replace(/^\./g, ''); //验证第一个字符是数字
  1104. this.tableData1[index].xdjhchjj = val.replace(/\.{2,}/g, '.'); //只保留第一个, 清除多余的
  1105. this.tableData1[index].xdjhchjj = val.replace('.', '$#$').replace(/\./g, '').replace('$#$', '.');
  1106. this.tableData1[index].xdjhchjj = val.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'); //只能输入两个小数
  1107. }
  1108. }
  1109. },
  1110. inputblur(val, index, num) {
  1111. if (val.split('.')[1] == '' || (val + '').trim() == '') {
  1112. this.$toast('请输入正确格式数字');
  1113. if (num == '0') {
  1114. this.tableData1[index].xdjhyj = '';
  1115. }
  1116. if (num == '1') {
  1117. this.tableData1[index].xdjhchjj = '';
  1118. }
  1119. if (num == '2') {
  1120. this.tableData1[index].ygnhj = '';
  1121. }
  1122. } else {
  1123. if (!/^\d+(\.\d{1,2})?$/.test(val) || Number(val) > 10000 || Number(val) <= 0) {
  1124. this.$toast('请输入大于0并且小于10000的两位小数');
  1125. if (num == '0') {
  1126. this.tableData1[index].xdjhyj = '';
  1127. }
  1128. if (num == '1') {
  1129. this.tableData1[index].xdjhchjj = '';
  1130. }
  1131. if (num == '2') {
  1132. this.tableData1[index].ygnhj = '';
  1133. }
  1134. } else {
  1135. if (num == '0') {
  1136. if (this.tableData1[index].xdjhyj < this.tableData1[index].xdjhchjj) {
  1137. this.tableData1[index].xdjhyj = '';
  1138. this.$toast('请输入大于等于促后净价的数字');
  1139. }
  1140. }
  1141. if (num == '1') {
  1142. if (this.tableData1[index].xdjhyj == '') {
  1143. this.tableData1[index].xdjhchjj = '';
  1144. this.$toast('请输入进货原价');
  1145. } else {
  1146. if (Number(val) > Number(this.tableData1[index].xdjhyj)) {
  1147. this.$toast('请输入小于等于进货原价的数字');
  1148. this.tableData1[index].xdjhchjj = '';
  1149. }
  1150. }
  1151. }
  1152. }
  1153. }
  1154. },
  1155. afterRead(file) {
  1156. // 此时可以自行将文件上传至服务器
  1157. // console.log(file);
  1158. },
  1159. typeshow(val) {
  1160. this.show = val;
  1161. // console.log(val);
  1162. },
  1163. onConfirm(val) {
  1164. this.indexselect = '1';
  1165. this.PhotoType = val.dictValue;
  1166. this.PhotoTypeText = val.text;
  1167. this.showPicker = false;
  1168. // console.log(this.indexselect);
  1169. },
  1170. getPhotoTypeList() {
  1171. getPhotoTypeList({}).then(res => {
  1172. var PhotoTypeLists = [];
  1173. for (var p = 0; p < res.data.length; p++) {
  1174. PhotoTypeLists.push({
  1175. dictValue: res.data[p].dictValue,
  1176. text: res.data[p].dictLabel
  1177. });
  1178. }
  1179. this.PhotoTypeList = PhotoTypeLists;
  1180. });
  1181. },
  1182. imgClick(val,type, index, childIndex,childIndex1,childIndex2,childIndex3) {
  1183. this.collectionId = val.collectionId + '';
  1184. this.parentCollectionId = val.parentCollectionId + '';
  1185. this.firstCollectionId = val.firstCollectionId;
  1186. this.secondCollectionId = val.secondCollectionId;
  1187. this.indeximg = index;
  1188. this.childIndex = childIndex;
  1189. this.childIndex1 = childIndex1;
  1190. this.childIndex2=childIndex2
  1191. this.childIndex3=childIndex3
  1192. this.pType=type;
  1193. this.show = true;
  1194. },
  1195. newimgarr1(val) {
  1196. this.show = false;
  1197. if(this.pType=='A'||this.pType=="B"){
  1198. var child = false;
  1199. if (this.collectionItemList[this.indeximg].collectionOptionList != null) {
  1200. for (let p = 0; p < this.collectionItemList[this.indeximg].collectionOptionList.length; p++) {
  1201. if (this.collectionItemList[this.indeximg].collectionOptionList[p].collectionItems != undefined) {
  1202. child = true;
  1203. }
  1204. }
  1205. }
  1206. // if(this.collectionItemList[this.indeximg].answerType=="dx"&&this.collectionItemList[this.indeximg].collectionOptionList!=undefined){
  1207. // if(this.collectionItemList[this.indeximg].collectionOptionList[this.RIndex].collectionItems[this.childIndex].fileInfoList==null||this.collectionItemList[this.indeximg].collectionOptionList[this.RIndex].collectionItems[this.childIndex].fileInfoList==undefined){
  1208. // this.collectionItemList[this.indeximg].collectionOptionList[this.RIndex].collectionItems[this.childIndex].fileInfoList=[]
  1209. // }else{
  1210. // this.collectionItemList[this.indeximg].collectionOptionList[this.RIndex].collectionItems[this.childIndex].fileInfoList.push(val)
  1211. // }
  1212. // }
  1213. if (child) {
  1214. let childIndex = '';
  1215. for (let child = 0; child < this.collectionItemList[this.indeximg].collectionOptionList.length; child++) {
  1216. if (
  1217. this.collectionItemList[this.indeximg].collectionOptionList[child].collectionItems[this.childIndex]
  1218. .fileInfoList == null ||
  1219. this.collectionItemList[this.indeximg].collectionOptionList[child].collectionItems[this.childIndex]
  1220. .fileInfoList == undefined
  1221. ) {
  1222. this.collectionItemList[this.indeximg].collectionOptionList[child].collectionItems[
  1223. this.childIndex
  1224. ].fileInfoList = [];
  1225. } else {
  1226. childIndex = child;
  1227. }
  1228. }
  1229. this.collectionItemList[this.indeximg].collectionOptionList[childIndex].collectionItems[
  1230. this.childIndex
  1231. ].fileInfoList.push(val);
  1232. } else {
  1233. if (
  1234. this.collectionItemList[this.indeximg].fileInfoList == null ||
  1235. this.collectionItemList[this.indeximg].fileInfoList == undefined
  1236. ) {
  1237. this.collectionItemList[this.indeximg].fileInfoList = [];
  1238. }
  1239. this.collectionItemList[this.indeximg].fileInfoList.push(val);
  1240. }
  1241. }else{
  1242. if(this.collectionItemList[this.indeximg].collectionOptionList[this.childIndex1].collectionItems[this.childIndex].collectionOptionList[this.childIndex2].collectionItems[this.childIndex3].fileInfoList==null){
  1243. this.collectionItemList[this.indeximg].collectionOptionList[this.childIndex1].collectionItems[this.childIndex].collectionOptionList[this.childIndex2].collectionItems[this.childIndex3].fileInfoList=[]
  1244. }
  1245. this.collectionItemList[this.indeximg].collectionOptionList[this.childIndex1].collectionItems[this.childIndex].collectionOptionList[this.childIndex2].collectionItems[this.childIndex3].fileInfoList.push(val)
  1246. }
  1247. },
  1248. zSelectVal(value) {
  1249. // for (let aa = 0; aa < this.collectionAnswerlisd.length; aa++) {
  1250. // if (this.collectionAnswerlisd[aa].code == value.type) {
  1251. // this.collectionAnswerlisd.splice(aa, 1);
  1252. // aa--;
  1253. // }
  1254. // }
  1255. // for (var a = 0; a < value.value.length; a++) {
  1256. // value.value[a].code = value.type;
  1257. // value.value[a].answerType = value.answerType;
  1258. // value.value[a].collectionType = value.collectionType;
  1259. // this.collectionAnswerlisd.push(value.value[a]);
  1260. // }
  1261. if (value.answerType == 'dx') {
  1262. if (value.childIndex4 == 'A') {
  1263. for (
  1264. let op = 0;
  1265. op <
  1266. this.collectionItemList[value.childindex].collectionOptionList[value.childindex1].collectionItems[
  1267. value.childindex2
  1268. ].collectionOptionList.length;
  1269. op++
  1270. ) {
  1271. if (value.index != op) {
  1272. this.collectionItemList[value.childindex].collectionOptionList[value.childindex1].collectionItems[
  1273. value.childindex2
  1274. ].collectionOptionList[op].isCheck = 0;
  1275. }
  1276. }
  1277. this.collectionItemList[value.childindex].collectionOptionList[value.childindex1].collectionItems[
  1278. value.childindex2
  1279. ].collectionOptionList[value.index].isCheck = 1;
  1280. }
  1281. if (value.childIndex4 == 'B') {
  1282. // for (let qqw = 0; qqw < this.collectionItemList[value.childindex].collectionOptionList.length; qqw++) {
  1283. // for (let aa = 0; aa < this.collectionAnswerlisd.length; aa++) {
  1284. // if (
  1285. // this.collectionAnswerlisd[aa].parentOptionId ==
  1286. // this.collectionItemList[value.childindex].collectionOptionList[qqw].collectionOptionId
  1287. // ) {
  1288. // this.collectionAnswerlisd.splice(aa, 1);
  1289. // aa--;
  1290. // }
  1291. // }
  1292. // }
  1293. // this.collectionItemList[value.childindex].answerValue = value.value[0].collectionOptionId;
  1294. for (let op = 0; op < this.collectionItemList[value.childindex].collectionOptionList.length; op++) {
  1295. if (value.index != op) {
  1296. this.collectionItemList[value.childindex].collectionOptionList[op].isCheck = 0;
  1297. }
  1298. }
  1299. this.RIndex = value.index;
  1300. this.collectionItemList[value.childindex].collectionOptionList[value.index].isCheck = 1;
  1301. }
  1302. if (value.childIndex4 == 'D') {
  1303. // for (let qqw = 0; qqw < this.collectionItemList[value.childindex].collectionOptionList.length; qqw++) {
  1304. // for (let aa = 0; aa < this.collectionAnswerlisd.length; aa++) {
  1305. // if (
  1306. // this.collectionAnswerlisd[aa].parentOptionId ==
  1307. // this.collectionItemList[value.childindex].collectionOptionList[qqw].collectionOptionId
  1308. // ) {
  1309. // this.collectionAnswerlisd.splice(aa, 1);
  1310. // aa--;
  1311. // }
  1312. // }
  1313. // }
  1314. // this.collectionItemList[value.childindex].answerValue = value.value[0].collectionOptionId;
  1315. let r5=this.collectionItemList[value.childindex].collectionOptionList[value.childindex1].collectionItems[value.childindex2].collectionOptionList[value.childindex3].collectionItems[value.childindex5].collectionOptionList
  1316. for (let op = 0; op < r5.length; op++) {
  1317. if (value.index != op) {
  1318. r5[op].isCheck=0
  1319. }
  1320. }
  1321. // this.RIndex = value.index;
  1322. r5[value.index].isCheck=1
  1323. }
  1324. }else{
  1325. if(value.level=="A"){
  1326. for (let op = 0; op < this.collectionItemList[value.childindex].collectionOptionList.length; op++) {
  1327. if (value.index != op) {
  1328. this.collectionItemList[value.childindex].collectionOptionList[op].isCheck = 0;
  1329. }
  1330. }
  1331. for (let op = 0; op < this.collectionItemList[value.childindex].collectionOptionList.length; op++) {
  1332. for(let opc=0;opc<value.value.length;opc++){
  1333. if (value.value[opc].collectionOptionId == this.collectionItemList[value.childindex].collectionOptionList[op].collectionOptionId) {
  1334. this.collectionItemList[value.childindex].collectionOptionList[op].isCheck = 1
  1335. }
  1336. }
  1337. }
  1338. }
  1339. if(value.level=="B"){
  1340. var listCData=this.collectionItemList[value.childindex].collectionOptionList[value.childindex1].collectionItems[value.childindex2]
  1341. for (let op = 0; op < listCData.collectionOptionList.length; op++) {
  1342. listCData.collectionOptionList[op].isCheck=0
  1343. }
  1344. for (let op = 0; op < listCData.collectionOptionList.length; op++) {
  1345. for(let opc=0;opc<value.value.length;opc++){
  1346. if (value.value[opc].collectionOptionId == listCData.collectionOptionList[op].collectionOptionId) {
  1347. listCData.collectionOptionList[op].isCheck=1
  1348. }
  1349. }
  1350. }
  1351. }
  1352. if(value.level=="C"){
  1353. var listCData2=this.collectionItemList[value.childindex].collectionOptionList[value.childindex1].collectionItems[value.childindex2].collectionOptionList[value.childindex3].collectionItems[value.childindex4]
  1354. for (let op = 0; op < listCData2.collectionOptionList.length; op++) {
  1355. listCData2.collectionOptionList[op].isCheck=0
  1356. }
  1357. for (let op = 0; op < listCData2.collectionOptionList.length; op++) {
  1358. for(let opc=0;opc<value.value.length;opc++){
  1359. if (value.value[opc].collectionOptionId == listCData2.collectionOptionList[op].collectionOptionId) {
  1360. listCData2.collectionOptionList[op].isCheck=1
  1361. }
  1362. }
  1363. }
  1364. }
  1365. }
  1366. },
  1367. onSubmit() {
  1368. var checkUnManage = 'Y';
  1369. if (this.checked) {
  1370. checkUnManage = 'Y';
  1371. } else {
  1372. checkUnManage = 'N';
  1373. }
  1374. var formData = {
  1375. storeId: this.storeId,
  1376. storeCode: this.$route.query.storeCode,
  1377. storeGroupId: this.storeGroupId,
  1378. visitsId: this.visitId,
  1379. taskId: this.taskId,
  1380. collectionAnswers: [],
  1381. checkUnManage: checkUnManage
  1382. };
  1383. if (this.$route.query.taskType == 1) {
  1384. // console.log(this.collectionItemList);
  1385. for (var b = 0; b < this.collectionItemList.length; b++) {
  1386. if (this.collectionItemList[b].answerType == 'sz' || this.collectionItemList[b].answerType == 'wb'|| this.collectionItemList[b].answerType == 'tel'|| this.collectionItemList[b].answerType == 'date') {
  1387. formData.collectionAnswers.push({
  1388. collectionId: this.collectionItemList[b].collectionId,
  1389. itemName: this.collectionItemList[b].collectionName,
  1390. collectionType: this.collectionItemList[b].collectionType,
  1391. collectionOptionId: this.collectionItemList[b].collectionOptionList[0].collectionOptionId,
  1392. secondCollectionId: this.collectionItemList[b].secondCollectionId,
  1393. firstCollectionId: this.collectionItemList[b].firstCollectionId,
  1394. answerType: this.collectionItemList[b].answerType,
  1395. answerValue: this.collectionItemList[b].answerValue
  1396. });
  1397. }
  1398. if (this.collectionItemList[b].answerType == 'dx'||this.collectionItemList[b].answerType == 'duox') {
  1399. let onList= this.collectionItemList[b].collectionOptionList
  1400. onList.forEach(item=>{
  1401. if(item.isCheck==1){
  1402. formData.collectionAnswers.push({
  1403. collectionId: item.collectionId,
  1404. itemName: item.collectionOption,
  1405. collectionType: this.collectionItemList[b].collectionType,
  1406. collectionOptionId: item.collectionOptionId,
  1407. // parentOptionId: this.collectionAnswerlisd[c].parentOptionId,
  1408. // parentCollectionId: this.collectionAnswerlisd[c].parentCollectionId,
  1409. secondCollectionId: item.secondCollectionId,
  1410. firstCollectionId: item.firstCollectionId,
  1411. answerType: this.collectionItemList[b].answerType,
  1412. answerValue: 'Y'
  1413. });
  1414. }
  1415. })
  1416. }
  1417. }
  1418. for (let f = 0; f < this.collectionItemList.length; f++) {
  1419. if (this.collectionItemList[f].answerType == 'dx') {
  1420. var listData = this.collectionItemList[f].collectionOptionList;
  1421. for (let f1 = 0; f1 < listData.length; f1++) {
  1422. var listDatas = listData[f1].collectionItems;
  1423. if (listData[f1].isCheck == '1' && listDatas != undefined&&listDatas!=null) {
  1424. for (let f2 = 0; f2 < listDatas.length; f2++) {
  1425. if (listDatas[f2].answerType == 'sz' || listDatas[f2].answerType == 'wb'|| listDatas[f2].answerType == 'tel'|| listDatas[f2].answerType == 'date') {
  1426. formData.collectionAnswers.push({
  1427. collectionId: listDatas[f2].collectionId,
  1428. itemName: listDatas[f2].collectionName,
  1429. collectionType: listDatas[f2].collectionType,
  1430. collectionOptionId: listDatas[f2].collectionOptionList[0].collectionOptionId,
  1431. answerType: listDatas[f2].answerType,
  1432. answerValue: listDatas[f2].collectionOptionList[0].answerValue,
  1433. parentOptionId: listDatas[f2].parentOptionId,
  1434. parentCollectionId: listDatas[f2].parentCollectionId,
  1435. secondCollectionId: listDatas[f2].secondCollectionId,
  1436. firstCollectionId: listDatas[f2].firstCollectionId,
  1437. });
  1438. }
  1439. if (listDatas[f2].answerType == 'dx'||listDatas[f2].answerType == 'duox') {
  1440. let onList= listDatas[f2].collectionOptionList
  1441. onList.forEach(item=>{
  1442. if(item.isCheck==1){
  1443. formData.collectionAnswers.push({
  1444. collectionId: item.collectionId,
  1445. itemName: item.collectionOption,
  1446. collectionType: listDatas[f2].collectionType,
  1447. collectionOptionId: item.collectionOptionId,
  1448. parentOptionId: item.parentOptionId,
  1449. parentCollectionId: item.parentCollectionId,
  1450. secondCollectionId: item.secondCollectionId,
  1451. firstCollectionId: item.firstCollectionId,
  1452. answerType: listDatas[f2].answerType,
  1453. answerValue: 'Y'
  1454. });
  1455. }
  1456. })
  1457. }
  1458. }
  1459. }
  1460. }
  1461. }
  1462. }
  1463. for (let f = 0; f < this.collectionItemList.length; f++) {
  1464. if (this.collectionItemList[f].answerType == 'dx') {
  1465. let listData = this.collectionItemList[f].collectionOptionList;
  1466. for (let f1 = 0; f1 < listData.length; f1++) {
  1467. let listDatas = listData[f1].collectionItems;
  1468. if (listData[f1].isCheck == '1' && listDatas != undefined&&listDatas!=null) {
  1469. for (let f2 = 0; f2 < listDatas.length; f2++) {
  1470. if (listDatas[f2].answerType == 'dx') {
  1471. let listDatas1 = listDatas[f2].collectionOptionList;
  1472. for (let f11 = 0; f11 < listDatas1.length; f11++) {
  1473. let listDatas2 = listDatas1[f11].collectionItems;
  1474. if (listDatas1[f11].isCheck == '1' && listDatas2 != undefined && listDatas2 != null) {
  1475. for (let f10 = 0; f10 < listDatas2.length; f10++) {
  1476. if (listDatas2[f10].answerType == 'sz' || listDatas2[f10].answerType == 'wb'|| listDatas2[f10].answerType == 'date'|| listDatas2[f10].answerType == 'tel') {
  1477. formData.collectionAnswers.push({
  1478. collectionId: listDatas2[f10].collectionId,
  1479. itemName: listDatas2[f10].collectionName,
  1480. collectionType: listDatas2[f10].collectionType,
  1481. collectionOptionId: listDatas2[f10].collectionOptionList[0].collectionOptionId,
  1482. answerType: listDatas2[f10].answerType,
  1483. answerValue: listDatas2[f10].collectionOptionList[0].answerValue,
  1484. parentOptionId: listDatas2[f10].parentOptionId,
  1485. parentCollectionId: listDatas2[f10].parentCollectionId,
  1486. secondCollectionId: listDatas2[f10].secondCollectionId,
  1487. firstCollectionId: listDatas2[f10].firstCollectionId,
  1488. });
  1489. }
  1490. if (listDatas2[f10].answerType == 'dx'||listDatas2[f10].answerType == 'duox') {
  1491. let onList= listDatas2[f10].collectionOptionList
  1492. onList.forEach(item=>{
  1493. if(item.isCheck==1){
  1494. formData.collectionAnswers.push({
  1495. collectionId: item.collectionId,
  1496. itemName: item.collectionOption,
  1497. collectionType: listDatas2[f10].collectionType,
  1498. collectionOptionId: item.collectionOptionId,
  1499. parentOptionId: item.parentOptionId,
  1500. parentCollectionId: item.parentCollectionId,
  1501. secondCollectionId: item.secondCollectionId,
  1502. firstCollectionId: item.firstCollectionId,
  1503. answerType: listDatas2[f10].answerType,
  1504. answerValue: 'Y'
  1505. });
  1506. }
  1507. })
  1508. }
  1509. }
  1510. }
  1511. }
  1512. }
  1513. }
  1514. }
  1515. }
  1516. }
  1517. }
  1518. // for (var c = 0; c < this.collectionAnswerlisd.length; c++) {
  1519. // formData.collectionAnswers.push({
  1520. // collectionId: this.collectionAnswerlisd[c].collectionId,
  1521. // itemName: this.collectionAnswerlisd[c].collectionOption,
  1522. // collectionType: this.collectionAnswerlisd[c].collectionType,
  1523. // collectionOptionId: this.collectionAnswerlisd[c].collectionOptionId,
  1524. // parentOptionId: this.collectionAnswerlisd[c].parentOptionId,
  1525. // parentCollectionId: this.collectionAnswerlisd[c].parentCollectionId,
  1526. // answerType: this.collectionAnswerlisd[c].answerType,
  1527. // answerValue: 'Y'
  1528. // });
  1529. // }
  1530. } else {
  1531. for (let dy = 0; dy < this.tableData1.length; dy++) {
  1532. if (this.tableData1[dy].xdjhchjj != '') {
  1533. if (
  1534. this.tableData1[dy].xdjhyj == '' ||
  1535. this.tableData1[dy].ygnhj == '' ||
  1536. this.tableData1[dy].xdjhchjj.split('.')[1] == ''
  1537. ) {
  1538. this.$dialog.alert({
  1539. title: '系统提示',
  1540. message: '请完善' + this.tableData1[dy].collectionName + '信息或促后竞价格式不正确'
  1541. });
  1542. return false;
  1543. }
  1544. }
  1545. if (this.tableData1[dy].xdjhyj != '') {
  1546. if (this.tableData1[dy].xdjhchjj == '' || this.tableData1[dy].ygnhj == '') {
  1547. this.$dialog.alert({
  1548. title: '系统提示',
  1549. message: '请完善' + this.tableData1[dy].collectionName + '信息'
  1550. });
  1551. return false;
  1552. }
  1553. }
  1554. if (this.tableData1[dy].ygnhj != '') {
  1555. if (this.tableData1[dy].xdjhchjj == '' || this.tableData1[dy].xdjhyj == '') {
  1556. this.$dialog.alert({
  1557. title: '系统提示',
  1558. message: '请完善' + this.tableData1[dy].collectionName + '信息'
  1559. });
  1560. return false;
  1561. }
  1562. }
  1563. }
  1564. for (var d = 0; d < this.tableData1.length; d++) {
  1565. for (var dd = 0; dd < this.tableData1[d].collectionOptionList.length; dd++) {
  1566. if (dd == 0) {
  1567. formData.collectionAnswers.push({
  1568. collectionId: this.tableData1[d].collectionId,
  1569. itemName: this.tableData1[d].collectionName,
  1570. collectionType: 'chanpin',
  1571. collectionOptionId: this.tableData1[d].collectionOptionList[dd].collectionOptionId,
  1572. answerType: 'sz',
  1573. answerValue: this.tableData1[d].xdjhyj
  1574. });
  1575. }
  1576. if (dd == 1) {
  1577. formData.collectionAnswers.push({
  1578. collectionId: this.tableData1[d].collectionId,
  1579. itemName: this.tableData1[d].collectionName,
  1580. collectionType: 'chanpin',
  1581. collectionOptionId: this.tableData1[d].collectionOptionList[dd].collectionOptionId,
  1582. answerType: 'sz',
  1583. answerValue: this.tableData1[d].xdjhchjj
  1584. });
  1585. }
  1586. if (dd == 2) {
  1587. formData.collectionAnswers.push({
  1588. collectionId: this.tableData1[d].collectionId,
  1589. itemName: this.tableData1[d].collectionName,
  1590. collectionType: 'chanpin',
  1591. collectionOptionId: this.tableData1[d].collectionOptionList[dd].collectionOptionId,
  1592. answerType: 'sz',
  1593. answerValue: this.tableData1[d].ygnhj
  1594. });
  1595. }
  1596. }
  1597. }
  1598. }
  1599. if (this.flagclick) {
  1600. this.flagclick = false;
  1601. this.timer = null;
  1602. this.timer = setTimeout(() => {
  1603. this.flagclick = true;
  1604. }, 2000);
  1605. var telVerify=true
  1606. var telName=""
  1607. formData.collectionAnswers.forEach(item=>{
  1608. if(item.answerType=="tel"&&!/^1[3456789]\d{9}$/.test(item.answerValue)&&item.answerValue!=""){
  1609. telVerify=false
  1610. telName=item.itemName+"格式错误"
  1611. }
  1612. })
  1613. if (!telVerify) {
  1614. this.$toast(telName);
  1615. }else{
  1616. addCollectionAnswer(formData).then(res => {
  1617. if (res.code == 200) {
  1618. this.$router.go(-1);
  1619. }else{
  1620. this.$toast(res.msg);
  1621. }
  1622. });
  1623. }
  1624. }
  1625. },
  1626. onClickLeft() {
  1627. this.$router.go(-1);
  1628. }
  1629. }
  1630. };
  1631. </script>
  1632. <style scoped>
  1633. .container {
  1634. background-color: white;
  1635. }
  1636. .van-f-red {
  1637. color: red;
  1638. width: 8px;
  1639. display: inline-block;
  1640. line-height: 26px;
  1641. }
  1642. .formLabel {
  1643. margin: 0 16px;
  1644. border-bottom: 1px solid #f1f1f1;
  1645. }
  1646. .formLabel .van-cell {
  1647. padding: 10px 0;
  1648. }
  1649. .formLabel .van-cell::after {
  1650. border: 0;
  1651. }
  1652. .formLabel .van-field {
  1653. border: 1px solid #f1f1f1;
  1654. padding: 6px;
  1655. width: 100%;
  1656. border-radius: 4px;
  1657. overflow: hidden;
  1658. }
  1659. .formLabel .van-field__control {
  1660. padding: 0 10px;
  1661. }
  1662. .formLabel .formLabeltitle {
  1663. position: absolute;
  1664. top: 8px;
  1665. }
  1666. .lineGrey {
  1667. height: 10px;
  1668. width: 100%;
  1669. background: #f1f1f1;
  1670. }
  1671. .z-checkbox .van-radio {
  1672. padding: 6px 0;
  1673. }
  1674. .z-cell .van-cell__title {
  1675. font-size: 16px;
  1676. }
  1677. </style>
  1678. <style>
  1679. .table-headermd {
  1680. font-size: 12px;
  1681. text-align: center;
  1682. position: initial;
  1683. width: 98% !important;
  1684. margin: 0 auto;
  1685. border-right: 0;
  1686. }
  1687. .table-headermd .el-table__header,
  1688. .table-headermd .el-table__body {
  1689. width: 100% !important;
  1690. }
  1691. /*.table-headermd col {width: 6.8rem;}*/
  1692. .table-headermd col:nth-child(4) {
  1693. width: 5.6rem;
  1694. }
  1695. .table-headermd col:nth-child(2),
  1696. .table-headermd col:nth-child(3) {
  1697. width: 4.6rem;
  1698. }
  1699. .table-headermd .van-cell {
  1700. padding: 0 4px;
  1701. height: 100%;
  1702. }
  1703. .table-headermd th.el-table__cell > .cell {
  1704. padding: 0 4px;
  1705. text-align: center;
  1706. }
  1707. .table-headermd th.el-table__cell:first-child > .cell {
  1708. text-align: left;
  1709. }
  1710. .table-headermd th.el-table__cell {
  1711. background-color: #1989fa;
  1712. color: #fff;
  1713. }
  1714. .table-headermd .el-table__cell {
  1715. padding: 4px 0;
  1716. }
  1717. .table-headermd.el-table .cell {
  1718. padding: 0;
  1719. }
  1720. .table-headermd .tipTitle {
  1721. overflow: hidden;
  1722. text-overflow: ellipsis;
  1723. display: -webkit-box;
  1724. -webkit-box-orient: vertical;
  1725. -webkit-line-clamp: 2;
  1726. }
  1727. .table-headermd::before {
  1728. height: 0;
  1729. }
  1730. .xing {
  1731. color: red;
  1732. padding-left: 4px;
  1733. }
  1734. .formLabel .van-radio__label,
  1735. .formLabel .van-checkbox__label {
  1736. font-size: 1.4rem;
  1737. }
  1738. .table-headermd .cell,
  1739. .el-table--border .el-table__cell:first-child .cell {
  1740. padding: 0 4px;
  1741. }
  1742. .van-dialog__confirm,
  1743. .van-dialog__confirm:active {
  1744. color: #1989fa;
  1745. }
  1746. .navBarTOP {
  1747. position: fixed;
  1748. width: 100%;
  1749. z-index: 2;
  1750. top: 0;
  1751. }
  1752. .isTableMust {
  1753. padding: 4px;
  1754. color: #999;
  1755. margin: 0;
  1756. margin-top: -10px;
  1757. }
  1758. .mobile-input .van-field__control {
  1759. font-size: 12px;
  1760. color: #999;
  1761. border: 0;
  1762. }
  1763. .formLabel .mobile-input {
  1764. border: 0 !important;
  1765. }
  1766. </style>