addStoreVisitP.vue 78 KB

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