edit.vue 92 KB

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