edit.vue 92 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125
  1. <template>
  2. <div class="BidSystemContractEdit">
  3. <Toptitle
  4. :title="
  5. $route.query.type == 1
  6. ? '新增工装订单'
  7. : $route.query.type == 2
  8. ? '编辑工装订单'
  9. : '查看工装订单'
  10. "
  11. >
  12. <slot name="titleButton">
  13. <Upload
  14. style="display:inline"
  15. name="your_file"
  16. :show-upload-list="false"
  17. :headers="headers"
  18. :on-error="uploadError"
  19. :on-success="uploadSuccess"
  20. :action="$store.state.ip + '/api/order_area_simple_import'"
  21. >
  22. <Button type="success" ghost icon="md-exit" style="margin-right:10px;"
  23. >导入</Button
  24. >
  25. </Upload>
  26. <Button
  27. @click="showForms = true"
  28. type="primary"
  29. style="margin-right: 10px"
  30. >表单设置</Button
  31. >
  32. <Button
  33. type="primary"
  34. style="margin-right: 10px"
  35. :disabled="isChecked"
  36. @click="showAddInputModal = true"
  37. >
  38. 添加特殊字段
  39. </Button>
  40. <!-- <Button
  41. @click="showSupModal = true"
  42. type="primary"
  43. style="margin-right: 10px"
  44. >项目辅料</Button
  45. > -->
  46. <Button
  47. @click="goback()"
  48. type="primary"
  49. ghost
  50. style="margin-right: 10px"
  51. >返回</Button
  52. >
  53. <Button
  54. @click="postData()"
  55. type="primary"
  56. :disabled="isChecked"
  57. ghost
  58. style="margin-right: 10px"
  59. >保存</Button
  60. >
  61. </slot>
  62. </Toptitle>
  63. <div class="top_search">
  64. <Form :model="formData" :label-width="100" class="top_search_form">
  65. <FormItem
  66. v-if="formSetTableData.filter((v) => v.key == 'order_no')[0].is_show"
  67. :label="formSetTableData.filter((v) => v.key == 'order_no')[0].title"
  68. >
  69. <Input
  70. type="text"
  71. size="small"
  72. :disabled="$route.query.type == 2"
  73. v-model="formData.order_no"
  74. placeholder="请输入订单编号"
  75. style="width: 200px"
  76. />
  77. </FormItem>
  78. <FormItem
  79. v-if="
  80. formSetTableData.filter((v) => v.key == 'residential_name')[0]
  81. .is_show
  82. "
  83. :label="
  84. formSetTableData.filter((v) => v.key == 'residential_name')[0].title
  85. "
  86. >
  87. <Input
  88. type="text"
  89. :disabled="isChecked"
  90. size="small"
  91. v-model="formData.residential_name"
  92. placeholder="请输入项目名称"
  93. style="width: 200px"
  94. />
  95. </FormItem>
  96. <FormItem
  97. v-if="formSetTableData.filter((v) => v.key == 'custom_id')[0].is_show"
  98. :label="formSetTableData.filter((v) => v.key == 'custom_id')[0].title"
  99. >
  100. <Select
  101. clearable
  102. filterable
  103. size="small"
  104. :disabled="isChecked"
  105. class="auto-width"
  106. @on-change="handleClientChange"
  107. v-model="formData.custom_id"
  108. >
  109. <Option
  110. v-for="item in clientList"
  111. :label="item.title"
  112. :key="item.id"
  113. :value="item.id"
  114. ></Option>
  115. </Select>
  116. </FormItem>
  117. <FormItem
  118. v-if="
  119. formSetTableData.filter((v) => v.key == 'warning_state')[0].is_show
  120. "
  121. :label="
  122. formSetTableData.filter((v) => v.key == 'warning_state')[0].title
  123. "
  124. >
  125. <Select
  126. v-model="formData.warning_state"
  127. :disabled="isChecked"
  128. size="small"
  129. style="width: 200px"
  130. >
  131. <Option
  132. v-for="_item in warningList"
  133. :key="_item.id"
  134. :value="_item.id"
  135. :label="_item.title"
  136. ></Option>
  137. </Select>
  138. </FormItem>
  139. <FormItem
  140. v-if="
  141. formSetTableData.filter((v) => v.key == 'front_money')[0].is_show
  142. "
  143. :label="
  144. formSetTableData.filter((v) => v.key == 'front_money')[0].title
  145. "
  146. >
  147. <Input
  148. type="text"
  149. size="small"
  150. :disabled="isChecked"
  151. v-model="formData.front_money"
  152. placeholder="请输入项目定金"
  153. style="width: 200px"
  154. />
  155. <!-- <RadioGroup v-model="formData.pay_state"
  156. size="small">
  157. <Radio :label=0
  158. :disabled="isChecked">未收款</Radio>
  159. <Radio :label=1
  160. :disabled="isChecked">已收款</Radio>
  161. </RadioGroup> -->
  162. </FormItem>
  163. <FormItem
  164. v-if="
  165. formSetTableData.filter((v) => v.key == 'custom_detail_id')[0]
  166. .is_show
  167. "
  168. :label="
  169. formSetTableData.filter((v) => v.key == 'custom_detail_id')[0].title
  170. "
  171. >
  172. <Select
  173. clearable
  174. filterable
  175. size="small"
  176. :disabled="isChecked"
  177. class="auto-width"
  178. @on-change="handleClientDetailChange"
  179. v-model="formData.custom_detail_id"
  180. >
  181. <Option
  182. v-for="item in clientDetailList"
  183. :label="item.address"
  184. :key="item.id"
  185. :value="item.id"
  186. ></Option>
  187. </Select>
  188. </FormItem>
  189. <FormItem
  190. v-if="
  191. formSetTableData.filter((v) => v.key == 'custom_detail_id')[1]
  192. .is_show
  193. "
  194. :label="
  195. formSetTableData.filter((v) => v.key == 'custom_detail_id')[1].title
  196. "
  197. >
  198. <Select
  199. clearable
  200. filterable
  201. size="small"
  202. :disabled="isChecked"
  203. class="auto-width"
  204. @on-change="handleClientDetailChange"
  205. v-model="formData.custom_detail_id"
  206. >
  207. <Option
  208. v-for="item in clientDetailList"
  209. :label="item.mobile"
  210. :key="item.id"
  211. :value="item.id"
  212. ></Option>
  213. </Select>
  214. </FormItem>
  215. <FormItem
  216. v-if="
  217. formSetTableData.filter((v) => v.key == 'start_time')[0].is_show
  218. "
  219. :label="
  220. formSetTableData.filter((v) => v.key == 'start_time')[0].title
  221. "
  222. >
  223. <DatePicker
  224. type="date"
  225. size="small"
  226. :disabled="isChecked"
  227. :options="options"
  228. @on-change="handleStartTimeChange"
  229. v-model="formData.start_time"
  230. placeholder=" 年/月/日"
  231. style="width: 200px"
  232. ></DatePicker>
  233. </FormItem>
  234. <FormItem
  235. v-if="formSetTableData.filter((v) => v.key == 'end_time')[0].is_show"
  236. :label="formSetTableData.filter((v) => v.key == 'end_time')[0].title"
  237. >
  238. <DatePicker
  239. type="date"
  240. size="small"
  241. :disabled="isChecked"
  242. :options="options"
  243. @on-change="handleEndTimeChange"
  244. v-model="formData.end_time"
  245. placeholder=" 年/月/日"
  246. style="width: 200px"
  247. ></DatePicker>
  248. </FormItem>
  249. <FormItem
  250. v-if="formSetTableData.filter((v) => v.key == 'salesman')[0].is_show"
  251. :label="formSetTableData.filter((v) => v.key == 'salesman')[0].title"
  252. >
  253. <Select
  254. v-model="formData.salesman"
  255. filterable
  256. :disabled="isChecked"
  257. clearable
  258. style="width: 200px"
  259. size="small"
  260. >
  261. <Option
  262. v-for="item in salesmanList"
  263. :value="item.id"
  264. :key="item.id"
  265. >{{ item.nickname }}</Option
  266. >
  267. </Select>
  268. </FormItem>
  269. <!-- <FormItem label="订单类型:">
  270. <Select v-model="formData.type"
  271. :disabled="isChecked"
  272. size="small"
  273. style="width:200px">
  274. <Option label='工装'
  275. :value=1></Option>
  276. <Option label='家装'
  277. :value=2></Option>
  278. </Select>
  279. </FormItem> -->
  280. <FormItem
  281. v-for="item in formData.special"
  282. :key="item.id"
  283. :label="item.key + ':'"
  284. >
  285. <Input
  286. type="text"
  287. size="small"
  288. :disabled="isChecked"
  289. v-model="item.value"
  290. placeholder="请输入"
  291. style="width: 200px"
  292. />
  293. </FormItem>
  294. <FormItem
  295. v-if="formSetTableData.filter((v) => v.key == 'remark')[0].is_show"
  296. :label="formSetTableData.filter((v) => v.key == 'remark')[0].title"
  297. >
  298. <Input
  299. type="textarea"
  300. :disabled="isChecked"
  301. size="small"
  302. v-model="formData.remark"
  303. placeholder="请输入"
  304. style="width: 200px"
  305. />
  306. </FormItem>
  307. </Form>
  308. </div>
  309. <div
  310. class="addArea"
  311. v-for="(areaItem, areaIndex) in formData.list"
  312. :key="areaItem.areaIndex"
  313. >
  314. <div class="addAreaBtn">
  315. <Button
  316. @click="handleAreaAdd(formData.list, areaIndex)"
  317. :disabled="isChecked"
  318. size="small"
  319. type="primary"
  320. style="margin-right: 10px"
  321. >新增区域</Button
  322. >
  323. <Button
  324. @click="handleAreaDele(areaIndex)"
  325. type="error"
  326. size="small"
  327. v-show="formData.list.length > 1"
  328. :disabled="isChecked"
  329. style="margin-right: 10px"
  330. >删除区域</Button
  331. >
  332. <Button
  333. @click="handleAreaAddPDT(areaItem, areaIndex)"
  334. :disabled="isChecked"
  335. size="small"
  336. style="margin-right: 10px"
  337. v-show="
  338. type == 1 ||
  339. (type == 2 && !areaItem.id) ||
  340. (type == 2 && areaItem.isCurrencyArea)
  341. "
  342. type="primary"
  343. >新增产品
  344. </Button>
  345. <Button
  346. @click="handleShowCurrencyArea(areaItem, areaIndex)"
  347. ghost
  348. size="small"
  349. v-show="type != 1 && areaItem.id && !areaItem.isCurrencyArea"
  350. type="primary"
  351. >展示产品
  352. </Button>
  353. </div>
  354. <div class="addAreaForm">
  355. <Form :label-width="100" :model="areaItem" style="width: 60%">
  356. <FormItem
  357. v-if="areaSetTableData.filter((v) => v.key == 'num')[0].is_show"
  358. :label="areaSetTableData.filter((v) => v.key == 'num')[0].title"
  359. >
  360. <Input
  361. type="text"
  362. size="small"
  363. :disabled="isChecked"
  364. v-model="areaItem.num"
  365. :placeholder="
  366. '请输入' +
  367. areaSetTableData.filter((v) => v.key == 'num')[0].title
  368. "
  369. style="width: 120px"
  370. />
  371. </FormItem>
  372. <FormItem
  373. v-if="areaSetTableData.filter((v) => v.key == 'title')[0].is_show"
  374. :label="areaSetTableData.filter((v) => v.key == 'title')[0].title"
  375. >
  376. <Input
  377. type="text"
  378. size="small"
  379. :disabled="isChecked"
  380. v-model="areaItem.title"
  381. :placeholder="
  382. '请输入' +
  383. areaSetTableData.filter((v) => v.key == 'title')[0].title
  384. "
  385. style="width: 120px"
  386. />
  387. </FormItem>
  388. <FormItem
  389. v-if="areaSetTableData.filter((v) => v.key == 'unit')[0].is_show"
  390. :label="areaSetTableData.filter((v) => v.key == 'unit')[0].title"
  391. >
  392. <Input
  393. type="text"
  394. size="small"
  395. :disabled="isChecked"
  396. v-model="areaItem.unit"
  397. :placeholder="
  398. '请输入' +
  399. areaSetTableData.filter((v) => v.key == 'unit')[0].title
  400. "
  401. style="width: 120px"
  402. />
  403. </FormItem>
  404. <FormItem
  405. v-if="
  406. areaSetTableData.filter((v) => v.key == 'quantity')[0].is_show
  407. "
  408. :label="
  409. areaSetTableData.filter((v) => v.key == 'quantity')[0].title
  410. "
  411. >
  412. <Input
  413. type="text"
  414. size="small"
  415. v-model="areaItem.quantity"
  416. :disabled="isChecked"
  417. :placeholder="
  418. '请输入' +
  419. areaSetTableData.filter((v) => v.key == 'quantity')[0].title
  420. "
  421. style="width: 120px"
  422. />
  423. </FormItem>
  424. <FormItem
  425. v-if="
  426. areaSetTableData.filter((v) => v.key == 'house_type')[0].is_show
  427. "
  428. :label="
  429. areaSetTableData.filter((v) => v.key == 'house_type')[0].title
  430. "
  431. >
  432. <Input
  433. type="text"
  434. size="small"
  435. :disabled="isChecked"
  436. v-model="areaItem.house_type"
  437. :placeholder="
  438. '请输入' +
  439. areaSetTableData.filter((v) => v.key == 'house_type')[0].title
  440. "
  441. style="width: 120px"
  442. />
  443. </FormItem>
  444. <FormItem
  445. v-for="item in areaItem.special"
  446. :key="item.id"
  447. :label="item.key + ':'"
  448. >
  449. <Input
  450. type="text"
  451. size="small"
  452. :disabled="isChecked"
  453. v-model="item.value"
  454. placeholder="请输入"
  455. style="width: 120px"
  456. />
  457. </FormItem>
  458. <FormItem
  459. v-if="areaSetTableData.filter((v) => v.key == 'remark')[0].is_show"
  460. :label="areaSetTableData.filter((v) => v.key == 'remark')[0].title"
  461. >
  462. <Input
  463. type="text"
  464. :disabled="isChecked"
  465. size="small"
  466. v-model="areaItem.remark"
  467. :placeholder="
  468. '请输入' +
  469. areaSetTableData.filter((v) => v.key == 'remark')[0].title
  470. "
  471. style="width: 120px"
  472. />
  473. </FormItem>
  474. </Form>
  475. </div>
  476. <div class="addAreaTable">
  477. <Table
  478. v-show="areaItem.product && areaItem.product.length > 0"
  479. :columns="set_tableColumns"
  480. :data="areaItem.product"
  481. max-height="600"
  482. border
  483. >
  484. <template slot="Set" slot-scope="{ row, index }">
  485. <a
  486. style="margin: 0 5px"
  487. v-show="$route.query.type != 3"
  488. @click="handleSet(row, index, 3, areaItem.product, areaIndex)"
  489. >编辑</a
  490. >
  491. <a
  492. style="margin: 0 5px; color: red"
  493. v-show="$route.query.type != 3"
  494. @click="handleSet(row, index, 4, areaItem.product, areaIndex)"
  495. >删除</a
  496. >
  497. </template>
  498. </Table>
  499. </div>
  500. </div>
  501. <li v-show="false" v-for="item in formData.list" :key="item.id"></li>
  502. <!-- 项目辅料弹窗 -->
  503. <Modal title="项目辅料" v-model="showSupModal" :width="400">
  504. <div>
  505. <div class="supModalBtn">
  506. <Button @click="handleAddSup" type="primary">新增</Button>
  507. </div>
  508. <Table :columns="supTableColumns" :data="supTableData" border>
  509. <template slot="combine" slot-scope="{ index }">
  510. <Select
  511. v-model="supTableData[index].id"
  512. @on-change="handlechange"
  513. size="small"
  514. >
  515. <Option
  516. v-for="item in combineList"
  517. :value="item.id"
  518. :key="item.id"
  519. :label="item.title"
  520. ></Option>
  521. </Select>
  522. </template>
  523. <template slot="supSet" slot-scope="{ row, index }">
  524. <a
  525. style="margin: 0 5px; color: red"
  526. v-show="$route.query.type != 3"
  527. @click="handleSupSet(row, index)"
  528. >删除</a
  529. >
  530. </template>
  531. </Table>
  532. </div>
  533. <div class="modal-footer" slot="footer">
  534. <Button @click="showSupModal = false">取消</Button>
  535. <Button type="primary" @click="showSupModal = false">确认</Button>
  536. </div>
  537. </Modal>
  538. <!-- 新增产品弹窗 -->
  539. <!-- v-model="showPDTModal" -->
  540. <!-- :mask-closable="false" -->
  541. <el-dialog
  542. title="新增产品"
  543. :visible.sync="showPDTModal"
  544. :close-on-click-modal="false"
  545. :close-on-press-escape="false"
  546. class="addPDTFormModal"
  547. width="1000px"
  548. >
  549. <div
  550. class="addPDTForm"
  551. v-for="(tempItem, tempIndex) in tempPDTList"
  552. :key="tempItem.id"
  553. >
  554. <Form :label-width="100" :model="tempItem">
  555. <FormItem label="产品名称:">
  556. <Input
  557. type="text"
  558. size="small"
  559. placeholder="请输入"
  560. v-model="tempItem.title"
  561. style="width: 120px"
  562. />
  563. </FormItem>
  564. <FormItem label="数量">
  565. <Input
  566. type="text"
  567. size="small"
  568. v-model="tempItem.num"
  569. placeholder="请输入"
  570. style="width: 120px"
  571. />
  572. </FormItem>
  573. <FormItem label="图号:">
  574. <Input
  575. type="text"
  576. size="small"
  577. placeholder="请输入"
  578. v-model="tempItem.url_number"
  579. style="width: 120px"
  580. />
  581. </FormItem>
  582. <FormItem label="图纸">
  583. <div class="product-img">
  584. <div class="product-add">
  585. <div
  586. class="items"
  587. v-for="(_item, _index) of tempItem.url"
  588. :key="_index"
  589. >
  590. <img
  591. @click="looks(_item)"
  592. :src="$store.state.ip + _item"
  593. alt=""
  594. />
  595. <Icon
  596. size="20"
  597. @click="delItems(_index, tempItem.url)"
  598. class="delete-img"
  599. type="ios-close-circle"
  600. />
  601. </div>
  602. <div class="add-items">
  603. <div class="_item">
  604. <Icon size="50" type="ios-add" />
  605. </div>
  606. <input
  607. @change="changeIpt($event, tempItem.url)"
  608. type="file"
  609. class="ipt"
  610. />
  611. </div>
  612. </div>
  613. </div>
  614. </FormItem>
  615. <FormItem label="左右式">
  616. <Select
  617. v-model="tempItem.left_right_mode"
  618. placeholder="请选择"
  619. style="width: 120px"
  620. size="small"
  621. >
  622. <Option :value="1" label="左式" />
  623. <Option :value="2" label="右式" />
  624. <Option :value="0" label="无" />
  625. </Select>
  626. </FormItem>
  627. <FormItem label="产品分类">
  628. <el-cascader
  629. clearable
  630. v-model="tempItem.type_id"
  631. size="small"
  632. style="width: 120px"
  633. :show-all-levels="false"
  634. :options="PDTTypeList"
  635. :props="{
  636. expandTrigger: 'hover',
  637. children: 'child',
  638. value: 'id',
  639. label: 'title',
  640. checkStrictly: true,
  641. emitPath: false,
  642. }"
  643. @change="(e) => hanndleAddPDTTypeChange(tempItem, e)"
  644. ></el-cascader>
  645. <!-- <Select
  646. v-model="tempItem.type_id"
  647. placeholder="请选择"
  648. style="width: 120px"
  649. @on-change="(e) => hanndleAddPDTTypeChange(tempItem, e)"
  650. size="small"
  651. >
  652. <Option
  653. v-for="item in PDTTypeList"
  654. :value="item.value"
  655. :key="item.value"
  656. >{{ item.label }}</Option
  657. >
  658. </Select> -->
  659. </FormItem>
  660. <div
  661. style="display: contents"
  662. v-for="el in tempItem.tempPDTTypeList"
  663. :key="el"
  664. >
  665. <FormItem
  666. :label="_item.title"
  667. v-for="_item in tempItem.tempMeasureList"
  668. v-show="el == _item.id"
  669. :key="_item.id"
  670. >
  671. <Input
  672. type="text"
  673. size="small"
  674. v-model="tempItem[_item.e_title]"
  675. placeholder="请输入"
  676. style="width: 120px"
  677. />
  678. </FormItem>
  679. </div>
  680. <FormItem label="价格:">
  681. <Input
  682. type="text"
  683. size="small"
  684. v-model="tempItem.price"
  685. placeholder="请输入价格"
  686. style="width: 120px"
  687. />
  688. </FormItem>
  689. <FormItem
  690. :label="item.key + ':'"
  691. v-for="item in productSpecValueList"
  692. :key="item.id"
  693. >
  694. <Input
  695. type="text"
  696. size="small"
  697. v-model="tempItem[item.key]"
  698. placeholder="请输入"
  699. style="width: 120px"
  700. />
  701. </FormItem>
  702. <FormItem label="备注:">
  703. <Input
  704. type="text"
  705. size="small"
  706. v-model="tempItem.remark"
  707. placeholder="请输入备注"
  708. style="width: 120px"
  709. />
  710. </FormItem>
  711. <FormItem label="工艺属性">
  712. <Button
  713. @click="handleProcessAdd(tempItem, tempIndex)"
  714. size="small"
  715. type="text"
  716. style="color: #57a3f3"
  717. >添加属性</Button
  718. >
  719. </FormItem>
  720. </Form>
  721. <div class="addPDTProcess" style="z-index:9999">
  722. <div
  723. v-for="(_item, _index) in tempItem.addPDTProcessAttrList"
  724. :key="_item.id"
  725. >
  726. <span>属性{{ _index + 1 }}</span>
  727. <Select
  728. v-model="_item.id"
  729. size="small"
  730. @on-change="
  731. (value) => handleAddPDTAttrChange(_item, _index, value)
  732. "
  733. style="width: 80px"
  734. >
  735. <Option
  736. v-for="__item in PDTProcessAttrList"
  737. :key="__item.id"
  738. :value="__item.id"
  739. :label="__item.title"
  740. >
  741. </Option>
  742. </Select>
  743. <Select
  744. v-model="_item.process_detail"
  745. filterable
  746. clearable
  747. label-in-value
  748. @on-change="
  749. (value) => handleAddPDTAttrDetailChange(_item, _index, value)
  750. "
  751. size="small"
  752. style="width: 140px"
  753. >
  754. <Option
  755. v-for="__item in _item.PDTProcessAttrDetailList"
  756. :key="__item.id"
  757. :value="__item.id"
  758. :label="__item.title"
  759. />
  760. </Select>
  761. <div class="dele_icon">
  762. <!-- v-show="tempItem.addPDTProcessAttrList.length!=1" -->
  763. <Icon
  764. type="ios-trash"
  765. @click="
  766. handleAddPDTDetailDele(tempItem.addPDTProcessAttrList, _index)
  767. "
  768. />
  769. </div>
  770. </div>
  771. </div>
  772. <div class="addPDTBtn">
  773. <Button
  774. type="primary"
  775. style="margin-right: 10px"
  776. @click="handleAddPDTCopy(tempItem, tempIndex)"
  777. >复制</Button
  778. >
  779. <Button
  780. type="primary"
  781. style="margin-right: 10px"
  782. @click="handleAddPDTAdd(tempIndex, tempItem)"
  783. >添加</Button
  784. >
  785. <Button
  786. type="error"
  787. v-show="tempIndex != 0"
  788. style="margin-right: 10px"
  789. @click="handleAddPDTDele(tempIndex)"
  790. >删除</Button
  791. >
  792. </div>
  793. </div>
  794. <div class="modal-footer" slot="footer">
  795. <Button style="margin-right:10px" @click="showPDTModal = false"
  796. >取消</Button
  797. >
  798. <Button type="primary" @click="handleAddPDTConfirm">确认</Button>
  799. </div>
  800. </el-dialog>
  801. <!-- 编辑产品弹窗 -->
  802. <el-dialog
  803. title="编辑产品"
  804. :visible.sync="showPDTEditModal"
  805. :close-on-click-modal="false"
  806. :close-on-press-escape="false"
  807. class="addPDTFormModal"
  808. width="1000px"
  809. >
  810. <div class="addPDTForm">
  811. <Form :label-width="100" :model="PDTEdit">
  812. <FormItem label="产品名称:">
  813. <Input
  814. type="text"
  815. size="small"
  816. placeholder="请输入"
  817. v-model="PDTEdit.title"
  818. style="width: 120px"
  819. />
  820. </FormItem>
  821. <FormItem label="数量">
  822. <Input
  823. type="text"
  824. size="small"
  825. v-model="PDTEdit.num"
  826. placeholder="请输入"
  827. style="width: 120px"
  828. />
  829. </FormItem>
  830. <FormItem label="图号:">
  831. <Input
  832. type="text"
  833. size="small"
  834. placeholder="请输入"
  835. v-model="PDTEdit.url_number"
  836. style="width: 120px"
  837. />
  838. </FormItem>
  839. <FormItem label="图纸">
  840. <div class="product-img">
  841. <div class="product-add">
  842. <div
  843. class="items"
  844. v-for="(_item, _index) of PDTEdit.url"
  845. :key="_index"
  846. >
  847. <img
  848. @click="looks(_item)"
  849. :src="$store.state.ip + _item"
  850. alt=""
  851. />
  852. <Icon
  853. size="20"
  854. @click="delItems(_index, PDTEdit.url)"
  855. class="delete-img"
  856. type="ios-close-circle"
  857. />
  858. </div>
  859. <div class="add-items">
  860. <div class="_item">
  861. <Icon size="50" type="ios-add" />
  862. </div>
  863. <input
  864. @change="changeIpt($event, PDTEdit.url)"
  865. type="file"
  866. class="ipt"
  867. />
  868. </div>
  869. </div>
  870. </div>
  871. </FormItem>
  872. <FormItem label="左右式">
  873. <Select
  874. v-model="PDTEdit.left_right_mode"
  875. placeholder="请选择"
  876. style="width: 120px"
  877. size="small"
  878. >
  879. <Option :value="1" label="左式" />
  880. <Option :value="2" label="右式" />
  881. <Option :value="0" label="无" />
  882. </Select>
  883. </FormItem>
  884. <FormItem label="产品分类">
  885. <el-cascader
  886. clearable
  887. transfer
  888. v-model="PDTEdit.type_id"
  889. size="small"
  890. style="width: 120px"
  891. :show-all-levels="false"
  892. :options="PDTEditTypeList"
  893. :props="{
  894. expandTrigger: 'hover',
  895. children: 'child',
  896. value: 'id',
  897. label: 'title',
  898. checkStrictly: true,
  899. emitPath: false,
  900. }"
  901. @change="(e) => hanndleAddPDTTypeChange(PDTEdit, e)"
  902. ></el-cascader>
  903. <!-- <Select
  904. v-model="PDTEdit.type_id"
  905. placeholder="请选择"
  906. style="width: 120px"
  907. @on-change="(e) => hanndleAddPDTTypeChange(PDTEdit, e)"
  908. size="small"
  909. >
  910. <Option
  911. v-for="item in PDTEditTypeList"
  912. :value="item.value"
  913. :key="item.value"
  914. >{{ item.label }}</Option
  915. >
  916. </Select> -->
  917. </FormItem>
  918. <div
  919. style="display: contents"
  920. v-for="el in PDTEdit.tempPDTTypeList"
  921. :key="el"
  922. >
  923. <FormItem
  924. :label="_item.title"
  925. v-for="_item in PDTEdit.tempMeasureList"
  926. v-show="el == _item.id"
  927. :key="_item.id"
  928. >
  929. <Input
  930. type="text"
  931. size="small"
  932. v-model="PDTEdit[_item.e_title]"
  933. placeholder="请输入"
  934. style="width: 120px"
  935. />
  936. </FormItem>
  937. </div>
  938. <!-- <div style="display: contents">
  939. <FormItem
  940. :label="_item.title"
  941. v-for="_item in PDTEdit.tempMeasureList"
  942. :key="_item.id"
  943. >
  944. <Input
  945. type="text"
  946. size="small"
  947. v-model="PDTEdit[_item.e_title]"
  948. placeholder="请输入"
  949. style="width: 120px"
  950. />
  951. </FormItem>
  952. </div> -->
  953. <FormItem label="价格:">
  954. <Input
  955. type="text"
  956. size="small"
  957. v-model="PDTEdit.price"
  958. placeholder="请输入价格"
  959. style="width: 120px"
  960. />
  961. </FormItem>
  962. <FormItem
  963. :label="item.key + ':'"
  964. v-for="item in productSpecValueList"
  965. :key="item.id"
  966. >
  967. <Input
  968. type="text"
  969. size="small"
  970. v-model="PDTEdit[item.key]"
  971. placeholder="请输入"
  972. style="width: 120px"
  973. />
  974. </FormItem>
  975. <FormItem label="备注:">
  976. <Input
  977. type="text"
  978. size="small"
  979. v-model="PDTEdit.remark"
  980. placeholder="请输入备注"
  981. style="width: 120px"
  982. />
  983. </FormItem>
  984. <FormItem label="工艺属性">
  985. <Button
  986. @click="handleEditProcessAdd()"
  987. size="small"
  988. type="text"
  989. style="color: #57a3f3"
  990. >添加属性</Button
  991. >
  992. </FormItem>
  993. </Form>
  994. <div class="addPDTProcess">
  995. <div
  996. v-for="(_item, _index) in PDTEdit.addPDTProcessAttrList"
  997. :key="_item.id"
  998. >
  999. <span>属性{{ _index + 1 }}</span>
  1000. <Select
  1001. v-model="_item.id"
  1002. size="small"
  1003. @on-change="
  1004. (value) => handleAddPDTAttrChange(_item, _index, value)
  1005. "
  1006. style="width: 80px"
  1007. >
  1008. <Option
  1009. v-for="__item in PDTProcessAttrList"
  1010. :key="__item.id"
  1011. :value="__item.id"
  1012. :label="__item.title"
  1013. >
  1014. </Option>
  1015. </Select>
  1016. <Select
  1017. v-model="_item.process_detail"
  1018. filterable
  1019. clearable
  1020. label-in-value
  1021. @on-change="
  1022. (value) => handleAddPDTAttrDetailChange(_item, _index, value)
  1023. "
  1024. size="small"
  1025. style="width: 140px"
  1026. >
  1027. <Option
  1028. v-for="__item in _item.PDTProcessAttrDetailList"
  1029. :key="__item.id"
  1030. :value="__item.id"
  1031. :label="__item.title"
  1032. />
  1033. </Select>
  1034. <div class="dele_icon">
  1035. <!-- v-show="PDTEdit.addPDTProcessAttrList.length!=1" -->
  1036. <Icon
  1037. type="ios-trash"
  1038. @click="
  1039. handleAddPDTDetailDele(PDTEdit.addPDTProcessAttrList, _index)
  1040. "
  1041. />
  1042. </div>
  1043. </div>
  1044. </div>
  1045. </div>
  1046. <div class="modal-footer" slot="footer">
  1047. <Button style="margin-right:10px" @click="showPDTEditModal = false"
  1048. >取消</Button
  1049. >
  1050. <Button type="primary" @click="handlePDTEditConfirm">确认</Button>
  1051. </div>
  1052. </el-dialog>
  1053. <!-- 特殊字段弹窗 -->
  1054. <Modal
  1055. title="特殊字段"
  1056. v-model="showAddInputModal"
  1057. :mask-closable="false"
  1058. class="addInputClassModal"
  1059. :width="600"
  1060. >
  1061. <div class="addInputClass">
  1062. <Tabs value="name1">
  1063. <TabPane label="订单特殊字段" name="name1">
  1064. <div style="display: flex; justify-content: center">
  1065. <span
  1066. class="dele_icon"
  1067. @click="handleSpecValueAdd('', 1)"
  1068. style="text-align: center; width: 50px"
  1069. >添加
  1070. </span>
  1071. </div>
  1072. <div class="addInputClassTab">
  1073. <div v-for="(item, index) in contactSpecValueList" :key="index">
  1074. <span>特殊字段名:</span>
  1075. <Input
  1076. type="text"
  1077. size="small"
  1078. v-model="item.key"
  1079. placeholder="请输入"
  1080. style="width: 120px"
  1081. />
  1082. <span class="dele_icon" style="margin-right: 5px">
  1083. <Icon type="md-add" @click="handleSpecValueAdd(item, 1)" />
  1084. </span>
  1085. <span class="dele_icon">
  1086. <Icon
  1087. type="md-remove"
  1088. @click="handleSpecValueDele(index, 1)"
  1089. />
  1090. </span>
  1091. </div>
  1092. </div>
  1093. </TabPane>
  1094. <TabPane label="区域特殊字段" name="name2">
  1095. <div style="display: flex; justify-content: center">
  1096. <span
  1097. class="dele_icon"
  1098. @click="handleSpecValueAdd('', 2)"
  1099. style="text-align: center; width: 50px"
  1100. >添加
  1101. </span>
  1102. </div>
  1103. <div class="addInputClassTab">
  1104. <div v-for="(item, index) in areaSpecValueList" :key="index">
  1105. <span>特殊字段名:</span>
  1106. <Input
  1107. type="text"
  1108. size="small"
  1109. v-model="item.key"
  1110. placeholder="请输入"
  1111. style="width: 120px"
  1112. />
  1113. <span class="dele_icon" style="margin-right: 5px">
  1114. <Icon type="md-add" @click="handleSpecValueAdd(item, 2)" />
  1115. </span>
  1116. <span class="dele_icon">
  1117. <Icon
  1118. type="md-remove"
  1119. @click="handleSpecValueDele(index, 2)"
  1120. />
  1121. </span>
  1122. </div>
  1123. </div>
  1124. </TabPane>
  1125. <TabPane label="产品特殊字段" name="name3">
  1126. <div style="display: flex; justify-content: center">
  1127. <span
  1128. class="dele_icon"
  1129. @click="handleSpecValueAdd('', 3)"
  1130. style="text-align: center; width: 50px"
  1131. >添加
  1132. </span>
  1133. </div>
  1134. <div class="addInputClassTab">
  1135. <div v-for="(item, index) in productSpecValueList" :key="index">
  1136. <span>特殊字段名:</span>
  1137. <Input
  1138. type="text"
  1139. size="small"
  1140. v-model="item.key"
  1141. placeholder="请输入"
  1142. style="width: 120px"
  1143. />
  1144. <span class="dele_icon" style="margin-right: 5px">
  1145. <Icon type="md-add" @click="handleSpecValueAdd(item, 3)" />
  1146. </span>
  1147. <span class="dele_icon">
  1148. <Icon
  1149. type="md-remove"
  1150. @click="handleSpecValueDele(index, 3)"
  1151. />
  1152. </span>
  1153. </div>
  1154. </div>
  1155. </TabPane>
  1156. </Tabs>
  1157. <!-- <Form :label-width="100">
  1158. <FormItem label="请输入字段名:">
  1159. <Input type="text"
  1160. size="small"
  1161. v-model="addInputName"
  1162. placeholder="请输入"
  1163. style="width: 200px" />
  1164. </FormItem>
  1165. </Form> -->
  1166. </div>
  1167. <div class="modal-footer" slot="footer">
  1168. <Button @click="showAddInputModal = false">返回</Button>
  1169. <Button type="primary" @click="handleAddInputConfirm">确认</Button>
  1170. </div>
  1171. </Modal>
  1172. <!-- 表单设置 -->
  1173. <Modal
  1174. v-model="showForms"
  1175. @on-ok="postForms(1)"
  1176. class-name="vertical-center-modal"
  1177. style="max-height: 700px; overflow: hidden; overflow-y: auto"
  1178. title="表单设置"
  1179. >
  1180. <Tabs value="form1">
  1181. <TabPane label="订单表单设置" name="form1">
  1182. <Table
  1183. :max-height="600"
  1184. border
  1185. :columns="formSetTableColumns"
  1186. :data="post_formSetTableData"
  1187. >
  1188. </Table>
  1189. </TabPane>
  1190. <TabPane label="区域表单设置" name="form2">
  1191. <Table
  1192. :max-height="600"
  1193. border
  1194. :columns="areaSetTableColumns"
  1195. :data="post_areaSetTableData"
  1196. >
  1197. </Table>
  1198. </TabPane>
  1199. <TabPane label="产品表头设置" name="form3">
  1200. <Table
  1201. :max-height="600"
  1202. border
  1203. :columns="productSetTableColumns"
  1204. :data="post_productSetTableData"
  1205. >
  1206. </Table>
  1207. </TabPane>
  1208. </Tabs>
  1209. </Modal>
  1210. </div>
  1211. </template>
  1212. <script>
  1213. // 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  1214. // 例如:import 《组件名称》 from '《组件路径》';
  1215. export default {
  1216. name: "BidSystemContractEdit",
  1217. components: {},
  1218. props: {},
  1219. // import引入的组件需要注入到对象中才能使用
  1220. data() {
  1221. // 这里存放数据
  1222. return {
  1223. showSupModal: false,
  1224. showPDTModal: false,
  1225. showPDTEditModal: false,
  1226. options: {
  1227. disabledDate(date) {
  1228. return date && date.valueOf() < Date.now() - 86400000;
  1229. },
  1230. },
  1231. formData: {
  1232. order_no: "",
  1233. residential_name: "",
  1234. client_name: "",
  1235. address: "",
  1236. mobile: "",
  1237. pay_state: "",
  1238. warning_state: "",
  1239. salesman: "",
  1240. remark: "",
  1241. start_time: "",
  1242. end_time: "",
  1243. type: "",
  1244. special: [],
  1245. head: [],
  1246. //区域列表
  1247. list: [
  1248. {
  1249. areaIndex: null,
  1250. num: "",
  1251. title: "",
  1252. unit: "",
  1253. quantity: "",
  1254. house_type: "",
  1255. remark: "",
  1256. order_no: "",
  1257. product: [],
  1258. },
  1259. ],
  1260. },
  1261. tableColumns: [
  1262. { title: "序号", key: "index", align: "center", minWidth: 80 },
  1263. {
  1264. title: "产品名称",
  1265. key: "title",
  1266. align: "center",
  1267. tooltip: true,
  1268. minWidth: 100,
  1269. },
  1270. { title: "数量", key: "num", align: "center", minWidth: 80 },
  1271. { title: "价格", key: "price", align: "center", minWidth: 80 },
  1272. {
  1273. title: "规格",
  1274. key: "measure",
  1275. align: "center",
  1276. tooltip: true,
  1277. minWidth: 140,
  1278. },
  1279. {
  1280. title: "工艺属性",
  1281. key: "process_property",
  1282. align: "center",
  1283. tooltip: true,
  1284. minWidth: 120,
  1285. },
  1286. {
  1287. title: "图纸",
  1288. align: "center",
  1289. key: "url",
  1290. minWidth: 100,
  1291. render: (h, params) => {
  1292. const { row } = params;
  1293. let url = row.url ? row.url : [];
  1294. return h("img", {
  1295. attrs: {
  1296. src: this.$store.state.ip + url[0],
  1297. style:
  1298. "max-width:50px;max-height:50px;position:relative;top:3px;",
  1299. },
  1300. on: {
  1301. click: () => {
  1302. // this.axios('/api/orders_img', { params: { id: row.id, type: 1 } }).then(res => {
  1303. // row.imgs = res.data
  1304. let list = [];
  1305. row.url.forEach((el) => {
  1306. list.push({ img_url: el });
  1307. });
  1308. this.$previewImg({
  1309. list,
  1310. baseUrl: this.$store.state.ip,
  1311. baseImgField: "img_url",
  1312. baseTitleField: "",
  1313. });
  1314. // })
  1315. },
  1316. },
  1317. });
  1318. },
  1319. },
  1320. {
  1321. title: "左右式",
  1322. key: "left_right_mode",
  1323. align: "center",
  1324. tooltip: true,
  1325. minWidth: 80,
  1326. render: (h, params) => {
  1327. return h(
  1328. "span",
  1329. {},
  1330. params.row.left_right_mode == 1
  1331. ? "左式"
  1332. : params.row.left_right_mode == 2
  1333. ? "右式"
  1334. : "无"
  1335. );
  1336. },
  1337. },
  1338. {
  1339. title: "图号",
  1340. key: "url_number",
  1341. align: "center",
  1342. tooltip: true,
  1343. minWidth: 80,
  1344. },
  1345. { title: "备注", key: "remark", align: "center", minWidth: 80 },
  1346. {
  1347. title: "操作",
  1348. key: "set",
  1349. align: "center",
  1350. slot: "Set",
  1351. minWidth: 120,
  1352. },
  1353. ],
  1354. supTableColumns: [
  1355. { title: "序号", type: "index", align: "center", minWidth: 100 },
  1356. {
  1357. title: "辅料名称",
  1358. key: "title",
  1359. align: "center",
  1360. slot: "combine",
  1361. minWidth: 150,
  1362. },
  1363. {
  1364. title: "操作",
  1365. key: "set",
  1366. align: "center",
  1367. slot: "supSet",
  1368. minWidth: 100,
  1369. },
  1370. ],
  1371. supTableData: [], //项目辅料→辅料名称列表
  1372. PDTTypeList: [], // 产品分类列表
  1373. PDTEditTypeList: [], // 产品分类列表
  1374. combineList: [], //业务员列表
  1375. salesmanList: [],
  1376. tempPDTIndex: "", // 新增产品暂存
  1377. tempPDTList: [
  1378. {
  1379. url: [],
  1380. process_property: "",
  1381. process_properties: [],
  1382. tempPDTTypeList: [],
  1383. measure: "",
  1384. //新增产品工艺属性列表
  1385. addPDTProcessAttrList: [
  1386. {
  1387. showValue: "",
  1388. showId: "",
  1389. PDTProcessAttrDetailList: [],
  1390. },
  1391. ],
  1392. },
  1393. ],
  1394. PDTEdit: {
  1395. url: [],
  1396. process_property: "",
  1397. process_properties: [],
  1398. tempPDTTypeList: [],
  1399. measure: "",
  1400. //新增产品工艺属性列表
  1401. addPDTProcessAttrList: [
  1402. {
  1403. showValue: "",
  1404. showId: "",
  1405. PDTProcessAttrDetailList: [],
  1406. },
  1407. ],
  1408. },
  1409. //是否查看
  1410. isChecked: false,
  1411. PDTProcessAttrList: [],
  1412. // 测量字段列表
  1413. measureList: [],
  1414. contactForm: [],
  1415. addInputTitle: "",
  1416. showAddInputModal: false,
  1417. addInputName: "",
  1418. contactSpecValueList: [],
  1419. areaSpecValueList: [],
  1420. productSpecValueList: [],
  1421. warningList: [],
  1422. clientList: [],
  1423. clientDetailList: [],
  1424. type: this.$route.query.type,
  1425. showForms: false,
  1426. formSetTableData: [
  1427. {
  1428. is_show: true,
  1429. key: "order_no",
  1430. value: "订单编号",
  1431. title: "订单编号",
  1432. },
  1433. {
  1434. is_show: true,
  1435. key: "residential_name",
  1436. value: "项目名称",
  1437. title: "项目名称",
  1438. },
  1439. {
  1440. is_show: true,
  1441. key: "custom_id",
  1442. value: "客户姓名",
  1443. title: "客户姓名",
  1444. },
  1445. {
  1446. is_show: true,
  1447. key: "warning_state",
  1448. value: "紧急程度",
  1449. title: "紧急程度",
  1450. },
  1451. {
  1452. is_show: true,
  1453. key: "front_money",
  1454. value: "项目定金",
  1455. title: "项目定金",
  1456. },
  1457. {
  1458. is_show: true,
  1459. key: "custom_detail_id",
  1460. value: "详细地址",
  1461. title: "详细地址",
  1462. },
  1463. {
  1464. is_show: true,
  1465. key: "custom_detail_id",
  1466. value: "手机号",
  1467. title: "手机号",
  1468. },
  1469. {
  1470. is_show: true,
  1471. key: "start_time",
  1472. value: "开始日期",
  1473. title: "开始日期",
  1474. },
  1475. {
  1476. is_show: true,
  1477. key: "end_time",
  1478. value: "结束日期",
  1479. title: "结束日期",
  1480. },
  1481. {
  1482. is_show: true,
  1483. key: "salesman",
  1484. value: "业务员",
  1485. title: "业务员",
  1486. },
  1487. {
  1488. is_show: true,
  1489. key: "remark",
  1490. value: "备注",
  1491. title: "备注",
  1492. },
  1493. ],
  1494. areaSetTableData: [
  1495. {
  1496. is_show: true,
  1497. key: "num",
  1498. value: "区域编码",
  1499. title: "区域编码",
  1500. },
  1501. {
  1502. is_show: true,
  1503. key: "title",
  1504. value: "区域名称",
  1505. title: "区域名称",
  1506. },
  1507. {
  1508. is_show: true,
  1509. key: "unit",
  1510. value: "单位",
  1511. title: "单位",
  1512. },
  1513. {
  1514. is_show: true,
  1515. key: "quantity",
  1516. value: "工程量",
  1517. title: "工程量",
  1518. },
  1519. {
  1520. is_show: true,
  1521. key: "house_type",
  1522. value: "户型",
  1523. title: "户型",
  1524. },
  1525. {
  1526. is_show: true,
  1527. key: "remark",
  1528. value: "备注",
  1529. title: "备注",
  1530. },
  1531. ],
  1532. headers: { Authorization: localStorage.getItem("token") },
  1533. productSetTableData: [
  1534. {
  1535. is_show: true,
  1536. key: "index",
  1537. value: "序号",
  1538. title: "序号",
  1539. },
  1540. {
  1541. is_show: true,
  1542. key: "title",
  1543. value: "产品名称",
  1544. title: "产品名称",
  1545. },
  1546. {
  1547. is_show: true,
  1548. key: "num",
  1549. value: "数量",
  1550. title: "数量",
  1551. },
  1552. {
  1553. is_show: true,
  1554. key: "price",
  1555. value: "价格",
  1556. title: "价格",
  1557. },
  1558. {
  1559. is_show: true,
  1560. key: "measure",
  1561. value: "规格",
  1562. title: "规格",
  1563. },
  1564. {
  1565. is_show: true,
  1566. key: "process_property",
  1567. value: "工艺属性",
  1568. title: "工艺属性",
  1569. },
  1570. {
  1571. is_show: true,
  1572. key: "url",
  1573. value: "图纸",
  1574. title: "图纸",
  1575. },
  1576. {
  1577. is_show: true,
  1578. key: "left_right_mode",
  1579. value: "左右式",
  1580. title: "左右式",
  1581. },
  1582. {
  1583. is_show: true,
  1584. key: "url_number",
  1585. value: "图号",
  1586. title: "图号",
  1587. },
  1588. {
  1589. is_show: true,
  1590. key: "remark",
  1591. value: "备注",
  1592. title: "备注",
  1593. },
  1594. {
  1595. is_show: true,
  1596. key: "set",
  1597. value: "操作",
  1598. title: "操作",
  1599. },
  1600. ],
  1601. formSetTableColumns: [
  1602. {
  1603. title: "是否展示",
  1604. align: "center",
  1605. key: "is_show",
  1606. minWidth: 120,
  1607. render: (h, params) => {
  1608. const { index } = params;
  1609. const currentRow = JSON.parse(
  1610. JSON.stringify(this.post_formSetTableData[index])
  1611. );
  1612. return h("Checkbox", {
  1613. props: {
  1614. value: currentRow.is_show,
  1615. // disabled:
  1616. // currentRow.key == "fax_price" ||
  1617. // currentRow.key == "remark",
  1618. },
  1619. on: {
  1620. "on-change": (e) => {
  1621. currentRow.is_show = e;
  1622. this.post_formSetTableData.splice(index, 1, currentRow);
  1623. },
  1624. },
  1625. });
  1626. },
  1627. },
  1628. {
  1629. title: "字段名",
  1630. align: "center",
  1631. key: "value",
  1632. minWidth: 180,
  1633. },
  1634. {
  1635. title: "展示名称",
  1636. align: "center",
  1637. key: "title",
  1638. minWidth: 180,
  1639. render: (h, params) => {
  1640. const { index } = params;
  1641. const currentRow = JSON.parse(
  1642. JSON.stringify(this.post_formSetTableData[index])
  1643. );
  1644. return h("Input", {
  1645. props: {
  1646. value: currentRow.title,
  1647. type: "text",
  1648. },
  1649. on: {
  1650. "on-change": (e) => {
  1651. currentRow.title = e.target.value;
  1652. this.post_formSetTableData.splice(index, 1, currentRow);
  1653. },
  1654. },
  1655. });
  1656. },
  1657. },
  1658. ],
  1659. areaSetTableColumns: [
  1660. {
  1661. title: "是否展示",
  1662. align: "center",
  1663. key: "is_show",
  1664. minWidth: 120,
  1665. render: (h, params) => {
  1666. const { index } = params;
  1667. const currentRow = JSON.parse(
  1668. JSON.stringify(this.post_areaSetTableData[index])
  1669. );
  1670. return h("Checkbox", {
  1671. props: {
  1672. value: currentRow.is_show,
  1673. // disabled:
  1674. // currentRow.key == "fax_price" ||
  1675. // currentRow.key == "remark",
  1676. },
  1677. on: {
  1678. "on-change": (e) => {
  1679. currentRow.is_show = e;
  1680. this.post_areaSetTableData.splice(index, 1, currentRow);
  1681. },
  1682. },
  1683. });
  1684. },
  1685. },
  1686. {
  1687. title: "字段名",
  1688. align: "center",
  1689. key: "value",
  1690. minWidth: 180,
  1691. },
  1692. {
  1693. title: "展示名称",
  1694. align: "center",
  1695. key: "title",
  1696. minWidth: 180,
  1697. render: (h, params) => {
  1698. const { index } = params;
  1699. const currentRow = JSON.parse(
  1700. JSON.stringify(this.post_areaSetTableData[index])
  1701. );
  1702. return h("Input", {
  1703. props: {
  1704. value: currentRow.title,
  1705. type: "text",
  1706. },
  1707. on: {
  1708. "on-change": (e) => {
  1709. currentRow.title = e.target.value;
  1710. this.post_areaSetTableData.splice(index, 1, currentRow);
  1711. },
  1712. },
  1713. });
  1714. },
  1715. },
  1716. ],
  1717. productSetTableColumns: [
  1718. {
  1719. title: "是否展示",
  1720. align: "center",
  1721. key: "is_show",
  1722. minWidth: 120,
  1723. render: (h, params) => {
  1724. const { index } = params;
  1725. const currentRow = JSON.parse(
  1726. JSON.stringify(this.post_productSetTableData[index])
  1727. );
  1728. return h("Checkbox", {
  1729. props: {
  1730. value: currentRow.is_show,
  1731. // disabled:
  1732. // currentRow.key == "fax_price" ||
  1733. // currentRow.key == "remark",
  1734. },
  1735. on: {
  1736. "on-change": (e) => {
  1737. currentRow.is_show = e;
  1738. this.post_productSetTableData.splice(index, 1, currentRow);
  1739. },
  1740. },
  1741. });
  1742. },
  1743. },
  1744. {
  1745. title: "字段名",
  1746. align: "center",
  1747. key: "value",
  1748. minWidth: 180,
  1749. },
  1750. {
  1751. title: "展示名称",
  1752. align: "center",
  1753. key: "title",
  1754. minWidth: 180,
  1755. render: (h, params) => {
  1756. const { index } = params;
  1757. const currentRow = JSON.parse(
  1758. JSON.stringify(this.post_productSetTableData[index])
  1759. );
  1760. return h("Input", {
  1761. props: {
  1762. value: currentRow.title,
  1763. type: "text",
  1764. },
  1765. on: {
  1766. "on-change": (e) => {
  1767. currentRow.title = e.target.value;
  1768. this.post_productSetTableData.splice(index, 1, currentRow);
  1769. },
  1770. },
  1771. });
  1772. },
  1773. },
  1774. ],
  1775. post_formSetTableData: [],
  1776. post_areaSetTableData: [],
  1777. post_productSetTableData: [],
  1778. };
  1779. },
  1780. // 生命周期 - 创建完成(可以访问当前this实例)
  1781. created() {
  1782. //2编辑 3详情 1新增
  1783. this.$route.query.type == 3 ? (this.isChecked = true) : "";
  1784. this.$route.query.order_no
  1785. ? (this.formData.order_no = this.$route.query.order_no)
  1786. : "";
  1787. // 获取工艺属性
  1788. this.axios("/api/basics_properties_index").then((res) => {
  1789. this.PDTProcessAttrList = res.data.data;
  1790. });
  1791. // 获取紧急程度
  1792. this.axios.get("/api/warning_list").then((res) => {
  1793. this.warningList = res.data.data;
  1794. });
  1795. // 获取客户列表
  1796. this.axios.get("/api/custom_list").then((res) => {
  1797. this.clientList = res.data.data;
  1798. });
  1799. this.get_forms();
  1800. },
  1801. // 生命周期 - 挂载完成(可以访问DOM元素)
  1802. mounted() {
  1803. this.$route.query.type == 3 || this.$route.query.type == 2
  1804. ? this.initData(this.$route.query.order_no)
  1805. : "";
  1806. //获取操作员
  1807. this.axios("/api/user").then((res) => (this.salesmanList = res.data.data));
  1808. //获取产品分类下拉列表
  1809. this.axios("/api/parts_product_list").then((res) => {
  1810. this.PDTTypeList = res.data;
  1811. this.PDTEditTypeList = this.PDTTypeList;
  1812. });
  1813. //获取基础测量字段列表
  1814. this.axios("/api/basics_measure_index").then((res) => {
  1815. this.measureList = res.data.data;
  1816. });
  1817. // 获取项目辅料列表
  1818. this.axios("/api/material_combination").then((res) => {
  1819. this.combineList = res.data.data;
  1820. });
  1821. },
  1822. methods: {
  1823. handlechange(val) {
  1824. console.log("val :>> ", val);
  1825. },
  1826. handleStartTimeChange(value) {
  1827. this.formData.start_time = value;
  1828. },
  1829. handleEndTimeChange(value) {
  1830. this.formData.end_time = value;
  1831. },
  1832. initData(order_no) {
  1833. this.axios({
  1834. method: "get",
  1835. url: "/api/order_area_list",
  1836. params: {
  1837. order_no,
  1838. type: 1,
  1839. },
  1840. }).then((res) => {
  1841. this.formData = res.data;
  1842. this.supTableData = res.data.ext;
  1843. if (this.formData.list.length == 0) {
  1844. this.formData.list.push({
  1845. areaIndex: 1,
  1846. num: "",
  1847. title: "",
  1848. unit: "",
  1849. quantity: "",
  1850. house_type: "",
  1851. remark: "",
  1852. order_no: "",
  1853. special: [],
  1854. head: [],
  1855. // product: [
  1856. // {
  1857. // title: "",
  1858. // num: "",
  1859. // measure: "",
  1860. // process_property: "",
  1861. // special: [],
  1862. // url: [],
  1863. // url_number: "",
  1864. // remark: "",
  1865. // },
  1866. // ],
  1867. });
  1868. }
  1869. this.formData.start_time = this.func.replaceDateNoHMS(
  1870. this.formData.start_time
  1871. );
  1872. this.formData.end_time = this.func.replaceDateNoHMS(
  1873. this.formData.end_time
  1874. );
  1875. // 产品特殊字段→ 弹窗窗口,table表头
  1876. let arr = [];
  1877. res.data.head[3] &&
  1878. res.data.head[3].length > 0 &&
  1879. res.data.head[3].forEach((item) => {
  1880. // ele[key] = item.key
  1881. /////
  1882. arr.push({
  1883. title: item.key,
  1884. key: item.key,
  1885. align: "center",
  1886. minWidth: 80,
  1887. });
  1888. });
  1889. console.log("arr :>> ", arr);
  1890. this.tableColumns = [
  1891. { title: "序号123", key: "index", align: "center", minWidth: 80 },
  1892. {
  1893. title: "产品名称",
  1894. key: "title",
  1895. align: "center",
  1896. tooltip: true,
  1897. minWidth: 100,
  1898. },
  1899. { title: "数量", key: "num", align: "center", minWidth: 80 },
  1900. { title: "价格", key: "price", align: "center", minWidth: 80 },
  1901. {
  1902. title: "规格",
  1903. key: "measure",
  1904. align: "center",
  1905. tooltip: true,
  1906. minWidth: 140,
  1907. },
  1908. {
  1909. title: "工艺属性",
  1910. key: "process_property",
  1911. align: "center",
  1912. tooltip: true,
  1913. minWidth: 120,
  1914. },
  1915. {
  1916. title: "图纸",
  1917. align: "center",
  1918. key: "url",
  1919. minWidth: 100,
  1920. render: (h, params) => {
  1921. const { row } = params;
  1922. let url = row.url ? row.url : [];
  1923. return h("img", {
  1924. attrs: {
  1925. src: this.$store.state.ip + url[0],
  1926. style:
  1927. "max-width:50px;max-height:50px;position:relative;top:3px;",
  1928. },
  1929. on: {
  1930. click: () => {
  1931. // this.axios('/api/orders_img', { params: { id: row.id, type: 1 } }).then(res => {
  1932. // row.imgs = res.data
  1933. let list = [];
  1934. row.url.forEach((el) => {
  1935. list.push({ img_url: el });
  1936. });
  1937. this.$previewImg({
  1938. list,
  1939. baseUrl: this.$store.state.ip,
  1940. baseImgField: "img_url",
  1941. baseTitleField: "",
  1942. });
  1943. // })
  1944. },
  1945. },
  1946. });
  1947. },
  1948. },
  1949. {
  1950. title: "左右式",
  1951. key: "left_right_mode",
  1952. align: "center",
  1953. tooltip: true,
  1954. minWidth: 80,
  1955. render: (h, params) => {
  1956. return h(
  1957. "span",
  1958. {},
  1959. params.row.left_right_mode == 1
  1960. ? "左式"
  1961. : params.row.left_right_mode == 2
  1962. ? "右式"
  1963. : "无"
  1964. );
  1965. },
  1966. },
  1967. {
  1968. title: "图号",
  1969. key: "url_number",
  1970. align: "center",
  1971. tooltip: true,
  1972. minWidth: 80,
  1973. },
  1974. ...arr,
  1975. { title: "备注", key: "remark", align: "center", minWidth: 80 },
  1976. {
  1977. title: "操作",
  1978. key: "set",
  1979. align: "center",
  1980. slot: "Set",
  1981. minWidth: 120,
  1982. },
  1983. ];
  1984. console.log("this.tableColumns :>> ", this.tableColumns);
  1985. // 订单特殊字段
  1986. this.formData.special &&
  1987. this.formData.special.length > 0 &&
  1988. this.formData.special.forEach((element) => {
  1989. this.formData.head[1].forEach((item) => {
  1990. if (element.head_id == item.id) {
  1991. element = Object.assign(element, item);
  1992. this.contactSpecValueList.push(element);
  1993. }
  1994. });
  1995. });
  1996. this.contactForm = this.formData.head[1] ? this.formData.head[1] : [];
  1997. // 区域特殊字段
  1998. this.formData.list.forEach((element, index) => {
  1999. element.special &&
  2000. element.special.length > 0 &&
  2001. element.special.forEach((ele) => {
  2002. this.formData.head[2].forEach((item) => {
  2003. if (ele.head_id == item.id) {
  2004. ele = Object.assign(ele, item);
  2005. this.areaSpecValueList.push(ele);
  2006. }
  2007. });
  2008. });
  2009. if (index == 0) {
  2010. element.isCurrencyArea = true;
  2011. //编辑进入页面是展示第一条区域的产品
  2012. element.id &&
  2013. this.axios
  2014. .get("/api/order_area_list_product", {
  2015. params: {
  2016. order_no: this.$route.query.order_no,
  2017. oa_id: this.$route.query.oa_id,
  2018. area_id: element.id,
  2019. type: 1,
  2020. },
  2021. })
  2022. .then((res) => {
  2023. if (res.code == 200) {
  2024. if (!element.product) {
  2025. element.product = [];
  2026. }
  2027. element.product = res.data;
  2028. element.product.forEach((pdt, index) => {
  2029. if (!pdt.url) {
  2030. pdt.url = [];
  2031. }
  2032. pdt.index = index + 1;
  2033. pdt.special &&
  2034. pdt.special.length > 0 &&
  2035. pdt.special.map((_pdt) => {
  2036. this.formData.head[3].map((v) => {
  2037. if (_pdt.head_id == v.id) {
  2038. _pdt = Object.assign(_pdt, v);
  2039. v = Object.assign(_pdt, v);
  2040. pdt[_pdt.key] = _pdt.value;
  2041. // this.productSpecValueList.push(_pdt);
  2042. }
  2043. });
  2044. });
  2045. });
  2046. this.$forceUpdate();
  2047. }
  2048. });
  2049. } else {
  2050. element.isCurrencyArea = false;
  2051. }
  2052. });
  2053. this.areaSpecValueList = this.formData.head[2]
  2054. ? this.formData.head[2]
  2055. : [];
  2056. console.log("this.formData.head[3] :>> ", this.formData.head[3]);
  2057. this.productSpecValueList = this.formData.head[3]
  2058. ? this.formData.head[3]
  2059. : [];
  2060. //获取客户信息
  2061. this.axios
  2062. .get("/api/custom_detail", { params: { id: res.data.custom_id } })
  2063. .then((res) => {
  2064. this.clientDetailList = res.data.list;
  2065. // this.fax = res.data.detail.fax;
  2066. });
  2067. });
  2068. },
  2069. postData() {
  2070. this.formData.list.map((list) => {
  2071. list.product &&
  2072. list.product.length > 0 &&
  2073. list.product.map((product) => {
  2074. product.special &&
  2075. product.special.map((value) => {
  2076. value.value = product[value.key];
  2077. });
  2078. });
  2079. });
  2080. //1新增 2编辑
  2081. let ip;
  2082. if (this.type == 1) {
  2083. ip = "order_area_add";
  2084. this.axios({
  2085. method: "post",
  2086. url: "/api/" + ip,
  2087. data: {
  2088. ...this.formData,
  2089. ext: this.supTableData,
  2090. head: { 3: this.productSpecValueList },
  2091. },
  2092. }).then((res) => {
  2093. if (res.code == 200) {
  2094. this.$Message.success(res.msg);
  2095. this.goback();
  2096. }
  2097. });
  2098. } else if (this.type == 2) {
  2099. ip = "order_area_edit";
  2100. // const curObj = this.formData.list.filter((item) => item.isCurrencyArea);
  2101. let curObj;
  2102. //去当前展开项区域
  2103. this.formData.list.forEach((element) => {
  2104. if (element.isCurrencyArea) {
  2105. curObj = element;
  2106. }
  2107. });
  2108. curObj.product.forEach((element) => {
  2109. if (!element.url) {
  2110. element.url = [];
  2111. }
  2112. });
  2113. this.axios
  2114. .post("/api/order_area_product_edit", {
  2115. order_no: this.$route.query.order_no,
  2116. area_id: curObj.id || "",
  2117. type: 1,
  2118. // num:curObj.num,
  2119. // title:curObj.title,
  2120. // unit:curObj.unit,
  2121. // quantity:curObj.quantity,
  2122. // house_type:curObj.house_type,
  2123. product: curObj.product,
  2124. })
  2125. .then((res) => {
  2126. if (res.code == 200) {
  2127. curObj.id = res.data.area_id;
  2128. this.axios
  2129. .post("/api/" + ip, {
  2130. ...this.formData,
  2131. ext: this.supTableData,
  2132. head: { 3: this.productSpecValueList },
  2133. })
  2134. .then((re) => {
  2135. if (re.code == 200) {
  2136. this.$Message.success(re.msg);
  2137. this.goback();
  2138. }
  2139. });
  2140. }
  2141. });
  2142. }
  2143. },
  2144. // 操作table数据 3编辑 4删除
  2145. handleSet(row, index, type, table, areaIndex) {
  2146. let newmeasureList;
  2147. switch (type) {
  2148. case 3:
  2149. this.PDTEdit = row;
  2150. if (!this.PDTEdit.url) {
  2151. this.PDTEdit.url = [];
  2152. }
  2153. this.PDTEditAreaIndex = areaIndex;
  2154. this.PDTEditIndex = index;
  2155. this.PDTEdit.addPDTProcessAttrList
  2156. ? this.PDTEdit.addPDTProcessAttrList.forEach((element, index) => {
  2157. element.type_id ? (element.id = element.type_id) : "";
  2158. element.showId
  2159. ? (element.process_detail = element.showId * 1)
  2160. : "";
  2161. this.handleAddPDTAttrChange(element, index, element.type_id);
  2162. })
  2163. : (this.PDTEdit.addPDTProcessAttrList = []);
  2164. this.$route.query.type == 2 &&
  2165. (this.PDTEdit.tempMeasureList = JSON.parse(
  2166. JSON.stringify(this.measureList)
  2167. ));
  2168. //获取属性
  2169. if (row.measure.indexOf("*") != -1) {
  2170. newmeasureList = row.measure.split("*");
  2171. } else {
  2172. newmeasureList = [row.measure];
  2173. }
  2174. // for (let i in newmeasureList) {
  2175. // for (let j in this.measureList) {
  2176. // if (
  2177. // newmeasureList[i].indexOf(this.measureList[j].e_title) != -1
  2178. // ) {
  2179. // this.PDTEdit[this.measureList[j].e_title] = newmeasureList[
  2180. // i
  2181. // ].substring(1);
  2182. // }
  2183. // }
  2184. // }
  2185. if (this.PDTEdit.type_id) {
  2186. this.axios("/api/basics_product_detail", {
  2187. params: { id: this.PDTEdit.type_id },
  2188. }).then((res) => {
  2189. this.PDTEdit.tempPDTTypeList = res.data.measure_id;
  2190. this.PDTEdit.tempMeasureList = JSON.parse(
  2191. JSON.stringify(this.measureList)
  2192. );
  2193. this.PDTEdit.tempMeasureList.forEach((el) => {
  2194. for (const i in newmeasureList) {
  2195. const item = newmeasureList[i];
  2196. if (item.indexOf(el.e_title) != -1) {
  2197. this.PDTEdit[el.e_title] = item.substring(1);
  2198. }
  2199. }
  2200. // this.PDTEdit[el.e_title] = "";
  2201. });
  2202. this.PDTEdit = JSON.parse(JSON.stringify(this.PDTEdit));
  2203. });
  2204. }
  2205. this.showPDTEditModal = true;
  2206. break;
  2207. case 4:
  2208. table.splice(index, 1);
  2209. this.formData.list[areaIndex].product = JSON.parse(
  2210. JSON.stringify(table)
  2211. );
  2212. break;
  2213. }
  2214. this.$forceUpdate();
  2215. },
  2216. //新增产品复制
  2217. handleAddPDTCopy(item, index) {
  2218. const temp = JSON.parse(JSON.stringify(item));
  2219. this.tempPDTList.splice(index + 1, 0, temp);
  2220. },
  2221. //新增产品添加
  2222. handleAddPDTAdd(index, row) {
  2223. this.tempPDTList.splice(index + 1, 0, {
  2224. addPDTProcessAttrList: [],
  2225. measure: "",
  2226. measures: [],
  2227. process_property: "",
  2228. url: [],
  2229. tempPDTTypeList: [],
  2230. process_properties: [],
  2231. });
  2232. },
  2233. //新增产品删除
  2234. handleAddPDTDele(index) {
  2235. this.tempPDTList.splice(index, 1);
  2236. },
  2237. //新增产品→新增区域确认
  2238. handleAddPDTConfirm() {
  2239. this.tempPDTList.forEach((element) => {
  2240. element.addPDTProcessAttrList.forEach((el) => {
  2241. element.process_property += el.showValue ? el.showValue + "," : "";
  2242. element.process_properties += el.showId ? el.showId + "," : "";
  2243. });
  2244. element.process_property = element.process_property.substring(
  2245. 0,
  2246. element.process_property.length - 1
  2247. );
  2248. if (
  2249. element.process_properties &&
  2250. element.process_properties.length > 0
  2251. ) {
  2252. element.process_properties = element.process_properties.substring(
  2253. 0,
  2254. element.process_properties.length - 1
  2255. );
  2256. }
  2257. element.tempMeasureList &&
  2258. element.tempMeasureList.length > 0 &&
  2259. element.tempMeasureList.forEach((el) => {
  2260. element[el.e_title] &&
  2261. (element.measure += `${el.e_title ? el.e_title : 0}${
  2262. element[el.e_title]
  2263. }*`);
  2264. });
  2265. element.measure = element.measure.substring(
  2266. 0,
  2267. element.measure.length - 1
  2268. );
  2269. });
  2270. if (!this.formData.list[this.tempPDTIndex].product) {
  2271. this.formData.list[this.tempPDTIndex].product = [];
  2272. }
  2273. this.formData.list[this.tempPDTIndex].product.push(...this.tempPDTList);
  2274. this.$nextTick(() => {
  2275. //开辟新栈空间,更改指针
  2276. this.formData.list = JSON.parse(JSON.stringify(this.formData.list));
  2277. this.formData.list[this.tempPDTIndex].product.forEach((el, index) => {
  2278. el.index = index + 1;
  2279. });
  2280. // 置空新增产品对象
  2281. this.tempPDTList = [
  2282. {
  2283. url: [],
  2284. process_property: "",
  2285. process_properties: [],
  2286. tempPDTTypeList: [],
  2287. measure: "",
  2288. //新增产品工艺属性列表
  2289. addPDTProcessAttrList: [
  2290. {
  2291. showValue: "",
  2292. showId: "",
  2293. PDTProcessAttrDetailList: [],
  2294. },
  2295. ],
  2296. },
  2297. ];
  2298. this.showPDTModal = false;
  2299. });
  2300. },
  2301. get_forms() {
  2302. this.axios
  2303. .post("/api/update/get_table", { id: "ContractList_edit" })
  2304. .then((res) => {
  2305. if (Array.isArray(res.data)) {
  2306. this.post_formSetTableData = JSON.parse(
  2307. JSON.stringify(this.formSetTableData)
  2308. );
  2309. this.post_areaSetTableData = JSON.parse(
  2310. JSON.stringify(this.areaSetTableData)
  2311. );
  2312. this.post_productSetTableData = JSON.parse(
  2313. JSON.stringify(this.productSetTableData)
  2314. );
  2315. } else {
  2316. if (res.data.table.formSet && res.data.table.formSet.length > 0) {
  2317. this.formSetTableData = JSON.parse(
  2318. JSON.stringify(res.data.table.formSet)
  2319. );
  2320. this.post_formSetTableData = JSON.parse(
  2321. JSON.stringify(res.data.table.formSet)
  2322. );
  2323. } else {
  2324. this.post_formSetTableData = JSON.parse(
  2325. JSON.stringify(this.formSetTableData)
  2326. );
  2327. }
  2328. if (res.data.table.areaSet && res.data.table.areaSet.length > 0) {
  2329. this.areaSetTableData = JSON.parse(
  2330. JSON.stringify(res.data.table.areaSet)
  2331. );
  2332. this.post_areaSetTableData = JSON.parse(
  2333. JSON.stringify(res.data.table.areaSet)
  2334. );
  2335. } else {
  2336. this.post_areaSetTableData = JSON.parse(
  2337. JSON.stringify(this.areaSetTableData)
  2338. );
  2339. }
  2340. if (
  2341. res.data.table.productSet &&
  2342. res.data.table.productSet.length > 0
  2343. ) {
  2344. this.productSetTableData = JSON.parse(
  2345. JSON.stringify(res.data.table.productSet)
  2346. );
  2347. this.post_productSetTableData = JSON.parse(
  2348. JSON.stringify(res.data.table.productSet)
  2349. );
  2350. } else {
  2351. this.post_productSetTableData = JSON.parse(
  2352. JSON.stringify(this.productSetTableData)
  2353. );
  2354. }
  2355. }
  2356. });
  2357. },
  2358. postForms(n) {
  2359. this.post_formSetTableData.forEach((element, index) => {
  2360. element.sort = index;
  2361. });
  2362. this.axios({
  2363. method: "post",
  2364. url: "/api/update/table",
  2365. data: {
  2366. id: "ContractList_edit",
  2367. result: {
  2368. formSet: this.post_formSetTableData,
  2369. areaSet: this.post_areaSetTableData,
  2370. productSet: this.post_productSetTableData,
  2371. },
  2372. },
  2373. }).then((res) => {
  2374. if (res.code == 200) {
  2375. this.$Message.success(res.msg);
  2376. this.get_forms();
  2377. }
  2378. });
  2379. },
  2380. // 编辑产品→确认
  2381. handlePDTEditConfirm() {
  2382. this.PDTEdit.process_property = "";
  2383. this.PDTEdit.process_properties = "";
  2384. this.PDTEdit.measure = "";
  2385. this.PDTEdit.tempMeasureList.forEach((element) => {
  2386. element.value = this.PDTEdit[element.e_title];
  2387. });
  2388. this.PDTEdit.addPDTProcessAttrList.forEach((el) => {
  2389. this.PDTEdit.process_property += el.showValue ? el.showValue + "," : "";
  2390. this.PDTEdit.process_properties += el.showId ? el.showId + "," : "";
  2391. });
  2392. this.PDTEdit.process_property = this.PDTEdit.process_property.substring(
  2393. 0,
  2394. this.PDTEdit.process_property.length - 1
  2395. );
  2396. this.PDTEdit.process_properties = this.PDTEdit.process_properties.substring(
  2397. 0,
  2398. this.PDTEdit.process_properties.length - 1
  2399. );
  2400. this.PDTEdit.tempMeasureList.forEach((el) => {
  2401. this.PDTEdit[el.e_title] &&
  2402. (this.PDTEdit.measure += `${el.e_title}${this.PDTEdit[el.e_title]}*`);
  2403. });
  2404. this.PDTEdit.measure = this.PDTEdit.measure.substring(
  2405. 0,
  2406. this.PDTEdit.measure.length - 1
  2407. );
  2408. this.formData.list[this.PDTEditAreaIndex].product[
  2409. this.PDTEditIndex
  2410. ] = this.PDTEdit;
  2411. //强制更新视图
  2412. this.formData.list = JSON.parse(JSON.stringify(this.formData.list));
  2413. this.showPDTEditModal = false;
  2414. },
  2415. //添加工艺属性
  2416. handleProcessAdd(item, index) {
  2417. this.tempPDTList[index].addPDTProcessAttrList.push({
  2418. PDTProcessAttrDetailList: [],
  2419. });
  2420. },
  2421. // 编辑添加工艺属性
  2422. handleEditProcessAdd() {
  2423. this.$nextTick(() => {
  2424. !this.PDTEdit.addPDTProcessAttrList &&
  2425. (this.PDTEdit.addPDTProcessAttrList = []);
  2426. this.PDTEdit.addPDTProcessAttrList.push({
  2427. PDTProcessAttrDetailList: [],
  2428. });
  2429. this.$forceUpdate();
  2430. });
  2431. },
  2432. //选择工艺属性
  2433. handleAddPDTAttrChange(item, index, value) {
  2434. item.id = value;
  2435. this.axios("/api/properties_index", { params: { id: value } }).then(
  2436. (res) => {
  2437. item.PDTProcessAttrDetailList = res.data.data;
  2438. }
  2439. );
  2440. },
  2441. //选择工艺属性细节
  2442. handleAddPDTAttrDetailChange(item, index, value) {
  2443. item.showValue = value.label;
  2444. item.showId = value.value;
  2445. },
  2446. // 删除工艺属性
  2447. handleAddPDTDetailDele(arr, index) {
  2448. this.$nextTick(() => {
  2449. arr.splice(index, 1);
  2450. this.$forceUpdate();
  2451. });
  2452. },
  2453. //新增产品
  2454. handleAreaAddPDT(item, index) {
  2455. this.showPDTModal = true;
  2456. // this.tempPDTList = item
  2457. this.tempPDTList = [
  2458. {
  2459. url: [],
  2460. process_property: "",
  2461. process_properties: [],
  2462. tempPDTTypeList: [],
  2463. measure: "",
  2464. measures: [],
  2465. //新增产品工艺属性列表
  2466. addPDTProcessAttrList: [
  2467. {
  2468. showValue: "",
  2469. showId: "",
  2470. PDTProcessAttrDetailList: [],
  2471. },
  2472. ],
  2473. },
  2474. ];
  2475. this.tempPDTIndex = index;
  2476. },
  2477. //新增区域
  2478. handleAreaAdd(target, index) {
  2479. const obj = {
  2480. areaIndex: target.length + 1,
  2481. num: "",
  2482. title: "",
  2483. unit: "",
  2484. quantity: "",
  2485. house_type: "",
  2486. remark: "",
  2487. order_no: "",
  2488. special: [...this.areaSpecValueList],
  2489. };
  2490. // target.push(obj)
  2491. // this.$set(this.formData, 'list', [...this.formData.list, obj])
  2492. this.formData.list.splice(index + 1, 0, obj);
  2493. },
  2494. //删除区域
  2495. handleAreaDele(index) {
  2496. this.formData.list.splice(index, 1);
  2497. },
  2498. // 展示区域产品
  2499. handleShowCurrencyArea(item, index) {
  2500. const preObj = this.formData.list.filter((item) => item.isCurrencyArea);
  2501. // 判断当前打开是否与上一个是否一致
  2502. if (preObj[0].id != item.id) {
  2503. // 1.保存上一个展开的区域及产品
  2504. this.axios
  2505. .post("/api/order_area_product_edit", {
  2506. order_no: this.$route.query.order_no,
  2507. area_id: preObj[0].id || "",
  2508. product: preObj[0].product,
  2509. type: 1,
  2510. })
  2511. .then((result) => {
  2512. if (result.code == 200) {
  2513. preObj[0].id = result.data.area_id;
  2514. // 1.1移除上一个展开区域及产品
  2515. this.formData.list.forEach((element) => {
  2516. element.product = [];
  2517. if (element.id == preObj[0].id) {
  2518. element.isCurrencyArea = false;
  2519. }
  2520. });
  2521. // 2.获取当前展开区域及产品
  2522. item.isCurrencyArea = true;
  2523. this.axios
  2524. .get("/api/order_area_list_product", {
  2525. params: {
  2526. order_no: this.$route.query.order_no,
  2527. oa_id: this.$route.query.oa_id,
  2528. area_id: item.id,
  2529. type: 1,
  2530. },
  2531. })
  2532. .then((res) => {
  2533. if (res.code == 200) {
  2534. if (!item.product) {
  2535. item.product = [];
  2536. }
  2537. item.product = res.data;
  2538. item.product.forEach((pdt, index) => {
  2539. pdt.index = index + 1;
  2540. pdt.special &&
  2541. pdt.special.length > 0 &&
  2542. pdt.special.forEach((element) => {
  2543. this.formData.head[3].forEach((item) => {
  2544. if (element.head_id == item.id) {
  2545. element = Object.assign(element, item);
  2546. pdt[element.key] = element.value;
  2547. this.productSpecValueList.push(element);
  2548. }
  2549. });
  2550. });
  2551. });
  2552. this.$forceUpdate();
  2553. }
  2554. });
  2555. }
  2556. });
  2557. } else {
  2558. // 2.获取当前展开区域及产品
  2559. item.isCurrencyArea = true;
  2560. this.axios
  2561. .get("/api/order_area_list_product", {
  2562. params: {
  2563. order_no: this.$route.query.order_no,
  2564. oa_id: this.$route.query.oa_id,
  2565. area_id: item.id,
  2566. type: 1,
  2567. },
  2568. })
  2569. .then((res) => {
  2570. if (res.code == 200) {
  2571. if (!item.product) {
  2572. item.product = [];
  2573. }
  2574. item.product = res.data;
  2575. item.product.forEach((pdt, index) => {
  2576. pdt.index = index + 1;
  2577. pdt.special &&
  2578. pdt.special.length > 0 &&
  2579. pdt.special.forEach((element) => {
  2580. this.formData.head[3].forEach((item) => {
  2581. if (element.head_id == item.id) {
  2582. element = Object.assign(element, item);
  2583. pdt[element.key] = element.value;
  2584. this.productSpecValueList.push(element);
  2585. }
  2586. });
  2587. });
  2588. });
  2589. this.$forceUpdate();
  2590. }
  2591. });
  2592. }
  2593. },
  2594. handleClientChange(id) {
  2595. id &&
  2596. this.axios({
  2597. method: "get",
  2598. url: "/api/custom_detail",
  2599. params: { id },
  2600. }).then((res) => {
  2601. this.clientDetailList = res.data.list;
  2602. this.formData.service_id = res.data.detail.service_id;
  2603. this.formData.custom_detail_id = this.clientDetailList[0].id || 0;
  2604. this.fax = res.data.detail.fax;
  2605. });
  2606. },
  2607. handleClientDetailChange(value) {
  2608. if (value) {
  2609. let row = this.clientDetailList.filter((item) => item.id == value);
  2610. this.formData.address = row[0].address;
  2611. this.formData.mobile = row[0].mobile;
  2612. this.$forceUpdate();
  2613. }
  2614. },
  2615. //项目辅料新增
  2616. handleAddSup() {
  2617. this.supTableData.push({ id: "" });
  2618. // this.supTableData.forEach((element, index) => {
  2619. // element.index = index + 1;
  2620. // });
  2621. },
  2622. //项目辅料删除
  2623. handleSupSet(row, index) {
  2624. this.supTableData.splice(index, 1);
  2625. // this.supTableData.forEach((element, index) => {
  2626. // element.index = index + 1
  2627. // });
  2628. },
  2629. goback() {
  2630. this.$router.go(-1);
  2631. },
  2632. uploadSuccess(res) {
  2633. console.log("res :>> ", res);
  2634. if (res.code == 200) {
  2635. this.$Message.success(res.msg || "上传成功");
  2636. res.data.list.map((item) => {
  2637. item.num = item.area_num;
  2638. item.title = item.area_title;
  2639. item.product.map((p, i) => {
  2640. p.index = i + 1;
  2641. p.title = p.product_title;
  2642. p.num = p.product_num;
  2643. p.remark = p.product_remark;
  2644. // 拼接规格
  2645. p.measure = "";
  2646. p.measure += p.measure_list.map((m) => {
  2647. return m.key + m.value + "*";
  2648. });
  2649. p.measure = p.measure.substring(0, p.measure.length - 1);
  2650. p.measure = p.measure.replace(/,/g, "");
  2651. p.addPDTProcessAttrList = p.process_property_list;
  2652. p.addPDTProcessAttrList.map((v, k) => {
  2653. v.process_detail = v.id;
  2654. });
  2655. // 拼接工艺属性
  2656. p.process_property = "";
  2657. p.process_property += p.process_property_list.map((m) => {
  2658. return m.title + "/";
  2659. });
  2660. p.process_property = p.process_property.substring(
  2661. 0,
  2662. p.process_property.length - 1
  2663. );
  2664. p.process_property = p.process_property.replace(/,/g, "");
  2665. // 拼接工艺属性ID
  2666. p.process_properties = "";
  2667. p.process_properties += p.process_property_list.map((m) => {
  2668. return m.id;
  2669. });
  2670. // p.process_properties = p.process_properties.replace(/,/g, "");
  2671. });
  2672. });
  2673. this.formData.list = [...this.formData.list, ...res.data.list];
  2674. this.areaSpecValueList = res.data.head.area;
  2675. this.productSpecValueList = res.data.head.product;
  2676. this.handleAddInputConfirm();
  2677. this.$forceUpdate();
  2678. } else {
  2679. this.$Message.warning(res.msg || "上传失败");
  2680. }
  2681. },
  2682. uploadError(err) {
  2683. this.$Message.error(err.msg || "上传失败");
  2684. },
  2685. looks(img) {
  2686. const array = [{ img_url: img }];
  2687. this.$previewImg({
  2688. list: array,
  2689. baseUrl: this.$store.state.ip,
  2690. baseImgField: "img_url",
  2691. baseTitleField: "",
  2692. });
  2693. },
  2694. delItems(n, arr) {
  2695. arr.splice(n, 1);
  2696. },
  2697. changeIpt(e, row) {
  2698. let file = e.target.files[0];
  2699. this.postImg(file, row);
  2700. e.target.value = null;
  2701. },
  2702. postImg(file, row) {
  2703. let formData = new FormData();
  2704. formData.append("file", file);
  2705. this.axios.post("/api/upload_pic", formData).then((res) => {
  2706. this.$nextTick(() => {
  2707. row.push(res.data.url);
  2708. this.$forceUpdate();
  2709. });
  2710. });
  2711. },
  2712. // 产品分类选择→对应不同测量字段
  2713. hanndleAddPDTTypeChange(item, e) {
  2714. e &&
  2715. this.axios("/api/basics_product_detail", {
  2716. params: { id: e },
  2717. }).then((res) => {
  2718. if (res.code == 200) {
  2719. if (res.data.measure_id.length > 0) {
  2720. item.tempPDTTypeList = res.data.measure_id;
  2721. item.tempMeasureList = JSON.parse(
  2722. JSON.stringify(this.measureList)
  2723. );
  2724. item.tempMeasureList.forEach((el) => {
  2725. item[el.e_title] = "";
  2726. });
  2727. } else {
  2728. item.tempPDTTypeList = [];
  2729. item.tempMeasureList = [];
  2730. }
  2731. this.$forceUpdate();
  2732. }
  2733. });
  2734. // basics_measure_index
  2735. },
  2736. // 添加特殊字段
  2737. handleAddInputConfirm() {
  2738. this.formData.special = JSON.parse(
  2739. JSON.stringify(this.contactSpecValueList)
  2740. );
  2741. this.formData.list.length > 0 &&
  2742. this.formData.list.forEach((element) => {
  2743. element.special = JSON.parse(JSON.stringify(this.areaSpecValueList));
  2744. element.product &&
  2745. element.product.length > 0 &&
  2746. element.product.forEach((ele) => {
  2747. ele.special = JSON.parse(
  2748. JSON.stringify(this.productSpecValueList)
  2749. );
  2750. });
  2751. });
  2752. let arr = [];
  2753. this.productSpecValueList.length > 0 &&
  2754. this.productSpecValueList.forEach((element) => {
  2755. arr.push({
  2756. title: element.key,
  2757. key: element.key,
  2758. align: "center",
  2759. minWidth: 80,
  2760. });
  2761. });
  2762. this.tableColumns = [
  2763. { title: "序号", key: "index", align: "center", minWidth: 80 },
  2764. {
  2765. title: "产品名称",
  2766. key: "title",
  2767. align: "center",
  2768. tooltip: true,
  2769. minWidth: 100,
  2770. },
  2771. { title: "数量", key: "num", align: "center", minWidth: 80 },
  2772. { title: "价格", key: "price", align: "center", minWidth: 80 },
  2773. {
  2774. title: "规格",
  2775. key: "measure",
  2776. align: "center",
  2777. tooltip: true,
  2778. minWidth: 140,
  2779. },
  2780. {
  2781. title: "工艺属性",
  2782. key: "process_property",
  2783. align: "center",
  2784. tooltip: true,
  2785. minWidth: 120,
  2786. },
  2787. {
  2788. title: "图纸",
  2789. align: "center",
  2790. key: "url",
  2791. minWidth: 100,
  2792. render: (h, params) => {
  2793. const { row } = params;
  2794. let url = row.url ? row.url : [];
  2795. return h("img", {
  2796. attrs: {
  2797. src: this.$store.state.ip + url[0],
  2798. style:
  2799. "max-width:50px;max-height:50px;position:relative;top:3px;",
  2800. },
  2801. on: {
  2802. click: () => {
  2803. // this.axios('/api/orders_img', { params: { id: row.id, type: 1 } }).then(res => {
  2804. // row.imgs = res.data
  2805. let list = [];
  2806. row.url.forEach((el) => {
  2807. list.push({ img_url: el });
  2808. });
  2809. this.$previewImg({
  2810. list,
  2811. baseUrl: this.$store.state.ip,
  2812. baseImgField: "img_url",
  2813. baseTitleField: "",
  2814. });
  2815. // })
  2816. },
  2817. },
  2818. });
  2819. },
  2820. },
  2821. {
  2822. title: "左右式",
  2823. key: "left_right_mode",
  2824. align: "center",
  2825. tooltip: true,
  2826. minWidth: 80,
  2827. render: (h, params) => {
  2828. return h(
  2829. "span",
  2830. {},
  2831. params.row.left_right_mode == 1
  2832. ? "左式"
  2833. : params.row.left_right_mode == 2
  2834. ? "右式"
  2835. : "无"
  2836. );
  2837. },
  2838. },
  2839. {
  2840. title: "图号",
  2841. key: "url_number",
  2842. align: "center",
  2843. tooltip: true,
  2844. minWidth: 80,
  2845. },
  2846. ...arr,
  2847. { title: "备注", key: "remark", align: "center", minWidth: 80 },
  2848. {
  2849. title: "操作",
  2850. key: "set",
  2851. align: "center",
  2852. slot: "Set",
  2853. minWidth: 120,
  2854. },
  2855. ];
  2856. this.showAddInputModal = false;
  2857. },
  2858. // 添加特殊字段
  2859. handleSpecValueAdd(item, type) {
  2860. switch (type) {
  2861. case 1:
  2862. this.contactSpecValueList.push({ key: "", value: "" });
  2863. break;
  2864. case 2:
  2865. this.areaSpecValueList.push({ key: "", value: "" });
  2866. break;
  2867. case 3:
  2868. this.productSpecValueList.push({ key: "", value: "" });
  2869. break;
  2870. }
  2871. },
  2872. // 删除特殊字段
  2873. handleSpecValueDele(index, type) {
  2874. switch (type) {
  2875. case 1:
  2876. this.contactSpecValueList.splice(index, 1);
  2877. break;
  2878. case 2:
  2879. this.areaSpecValueList.splice(index, 1);
  2880. break;
  2881. case 3:
  2882. this.productSpecValueList.splice(index, 1);
  2883. break;
  2884. }
  2885. },
  2886. },
  2887. // 监听属性 类似于data概念
  2888. computed: {
  2889. set_tableColumns() {
  2890. if (this.productSetTableData.length < 1) {
  2891. return this.tableColumns;
  2892. } else {
  2893. return this.func.computedHeader(
  2894. this.productSetTableData,
  2895. this.tableColumns
  2896. );
  2897. }
  2898. },
  2899. },
  2900. // 监控data中的数据变化
  2901. watch: {
  2902. productSpecValueList() {
  2903. let arr = [];
  2904. this.productSpecValueList.length > 0 &&
  2905. this.productSpecValueList.forEach((element) => {
  2906. arr.push({
  2907. title: element.value||element.key,
  2908. key: element.key,
  2909. align: "center",
  2910. minWidth: 80,
  2911. });
  2912. });
  2913. this.set_tableColumns.splice(this.set_tableColumns.length - 1, 0, ...arr);
  2914. },
  2915. },
  2916. beforeCreate() {}, // 生命周期 - 创建之前
  2917. beforeMount() {}, // 生命周期 - 挂载之前
  2918. beforeUpdate() {}, // 生命周期 - 更新之前
  2919. updated() {}, // 生命周期 - 更新之后
  2920. beforeDestroy() {}, // 生命周期 - 销毁之前
  2921. destroyed() {}, // 生命周期 - 销毁完成
  2922. activated() {}, // 如果页面有keep-alive缓存功能,这个函数会触发
  2923. };
  2924. </script>
  2925. <style lang="scss" scoped>
  2926. .BidSystemContractEdit {
  2927. overflow: hidden;
  2928. overflow-y: auto;
  2929. position: relative;
  2930. top: 20px;
  2931. height: 85%;
  2932. padding-bottom: 20px;
  2933. }
  2934. .top_search {
  2935. padding: 20px 0;
  2936. width: 100%;
  2937. .top_search_form {
  2938. // width: 800px;
  2939. // display: flex;
  2940. // justify-content: space-around;
  2941. /deep/ .ivu-form-item {
  2942. display: inline-block;
  2943. width: 300px;
  2944. }
  2945. }
  2946. }
  2947. .addArea {
  2948. position: relative;
  2949. padding: 15px;
  2950. margin-bottom: 30px;
  2951. border-radius: 5px;
  2952. box-shadow: 1px 1px 5px 1px #999;
  2953. .addAreaBtn {
  2954. position: absolute;
  2955. right: 20px;
  2956. top: 20px;
  2957. }
  2958. /deep/ .ivu-form-item {
  2959. display: inline-block;
  2960. width: 220px;
  2961. }
  2962. }
  2963. .addPDTFormModal {
  2964. .addPDTForm {
  2965. width: 100%;
  2966. position: relative;
  2967. border-bottom: 1px solid #e8eaec;
  2968. margin-bottom: 30px;
  2969. /deep/ .ivu-form {
  2970. padding-bottom: 30px;
  2971. }
  2972. /deep/ .ivu-form-item {
  2973. display: inline-block;
  2974. width: 300px;
  2975. }
  2976. .addPDTBtn {
  2977. position: absolute;
  2978. right: 10px;
  2979. bottom: 25px;
  2980. }
  2981. }
  2982. /deep/ .ivu-modal-body {
  2983. display: flex;
  2984. justify-content: center;
  2985. flex-wrap: wrap;
  2986. max-height: 700px;
  2987. overflow: hidden;
  2988. overflow-y: auto;
  2989. }
  2990. }
  2991. .addPDTProcess {
  2992. width: 300px;
  2993. padding-bottom: 15px;
  2994. div {
  2995. display: flex;
  2996. justify-content: space-around;
  2997. padding: 5px 0;
  2998. span {
  2999. padding-top: 6px;
  3000. }
  3001. }
  3002. .dele_icon {
  3003. width: 10px;
  3004. /deep/ .ivu-icon {
  3005. padding-top: 5px;
  3006. }
  3007. }
  3008. }
  3009. .product-img {
  3010. padding-top: 10px;
  3011. }
  3012. .product-add {
  3013. display: flex;
  3014. flex-wrap: wrap;
  3015. .ipt {
  3016. position: absolute;
  3017. width: 100%;
  3018. height: 100%;
  3019. opacity: 0;
  3020. cursor: pointer;
  3021. outline: none;
  3022. top: 0;
  3023. left: 0;
  3024. }
  3025. .add-items {
  3026. width: 40px;
  3027. height: 40px;
  3028. border: 1px dotted #e7e7e7;
  3029. border-radius: 5px;
  3030. display: flex;
  3031. justify-content: center;
  3032. align-items: center;
  3033. overflow: hidden;
  3034. position: relative;
  3035. flex-direction: column;
  3036. background: #f4f5f7;
  3037. .item {
  3038. width: 46px;
  3039. height: 46px;
  3040. background: #3764ff;
  3041. opacity: 0.6;
  3042. display: flex;
  3043. justify-content: center;
  3044. align-items: center;
  3045. border-radius: 50%;
  3046. color: #fff;
  3047. }
  3048. }
  3049. .items {
  3050. width: 40px;
  3051. height: 40px;
  3052. margin-bottom: 10px;
  3053. display: flex;
  3054. justify-content: center;
  3055. align-items: center;
  3056. background: #e7e7e7;
  3057. margin-right: 10px;
  3058. border-radius: 5px;
  3059. position: relative;
  3060. img {
  3061. max-width: 40px;
  3062. max-height: 40px;
  3063. }
  3064. }
  3065. }
  3066. .supModalBtn {
  3067. display: flex;
  3068. justify-content: flex-end;
  3069. margin-bottom: 10px;
  3070. }
  3071. /deep/.ivu-modal-body {
  3072. display: flex;
  3073. justify-content: center;
  3074. .addInputClass {
  3075. display: flex;
  3076. justify-content: center;
  3077. width: 500px;
  3078. .dele_icon {
  3079. cursor: pointer;
  3080. width: 10px;
  3081. /deep/ .ivu-icon {
  3082. padding-top: 5px;
  3083. }
  3084. }
  3085. }
  3086. }
  3087. .addInputClassTab {
  3088. display: flex;
  3089. justify-content: center;
  3090. align-items: center;
  3091. flex-wrap: wrap;
  3092. div {
  3093. display: flex;
  3094. justify-content: center;
  3095. align-items: center;
  3096. width: 100%;
  3097. padding: 5px;
  3098. .dele_icon {
  3099. i {
  3100. font-size: 20px;
  3101. }
  3102. }
  3103. }
  3104. }
  3105. /deep/.ivu-tabs-nav-scroll {
  3106. display: flex;
  3107. justify-content: center;
  3108. }
  3109. /deep/ .ivu-table-wrapper {
  3110. overflow: visible;
  3111. }
  3112. /deep/.ivu-table-fixed-body {
  3113. padding-bottom: 20px;
  3114. }
  3115. /deep/.el-input--small .el-input__inner {
  3116. height: 24px;
  3117. line-height: 24px;
  3118. }
  3119. </style>