addStoreVisitP.vue 95 KB

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