edit.vue 88 KB

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