12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327 |
- <template>
- <div class="BidSystemProductDeOrderDeorderdetail">
- <Toptitle :title="type == 1 ? '拆单编辑' : '拆单详情'">
- <slot name="titleButton">
- <Button
- @click="goback()"
- type="primary"
- ghost
- style="margin-right: 10px"
- >返回</Button
- >
- <Button
- @click="postData()"
- type="primary"
- v-if="type == 1"
- ghost
- style="margin-right: 10px"
- >保存</Button
- >
- </slot>
- </Toptitle>
- <div class="top_info">
- <div><span>产品名称:</span>{{ formData.title }}</div>
- <div><span>计量单位:</span>{{ formData.unit }}</div>
- <div><span>数量:</span>{{ formData.num }}</div>
- <div><span>价格:</span>{{ formData.price }}</div>
- <div><span>规格:</span>{{ formData.measure }}</div>
- <div><span>工艺属性:</span>{{ formData.process_property }}</div>
- <div>
- <span>图纸:</span>
- <div>
- <span
- v-for="item in formData.url"
- :key="item"
- @click="checkImg(formData.url)"
- >
- <img :src="$store.state.ip + item" alt="" />
- </span>
- </div>
- </div>
- <div><span>图号:</span>{{ formData.url_number }}</div>
- <div><span>备注:</span>{{ formData.remark }}</div>
- </div>
- <div class="similar_product">
- <div>
- <span>价格:</span>
- <Input
- type="text"
- size="small"
- :disabled="type == 2"
- v-model="formData.real_price"
- style="width: 150px; margin-right: 10px"
- placeholder="请输入价格"
- />
- </div>
- <div>
- <span>型号:</span>
- <Input
- type="text"
- size="small"
- :disabled="type == 2"
- v-model="formData.model"
- style="width: 150px; margin-right: 10px"
- placeholder="请输入型号"
- />
- </div>
- <div>
- <div
- style="
- display: flex;
- align-items: center;
- width: 100%;
- margin-right: 10px;
- "
- >
- <Dropdown>
- <a :disabled="type == 3">选择产品分类</a>
- <DropdownMenu slot="list">
- <Downtree
- @childByValue="handleClick"
- :parent="productTypes"
- ></Downtree>
- </DropdownMenu>
- </Dropdown>
- <a
- :disabled="type == 2"
- style="margin-left: 20px"
- v-if="nowSelectObj.title"
- >{{ nowSelectObj.title || "" }}</a
- >
- </div>
- </div>
- <Button
- @click="handleSimilarProductShow"
- type="primary"
- :disabled="type == 2"
- style="margin-right: 10px"
- >选择相似产品</Button
- >
- </div>
- <div
- class="parts"
- v-for="(partsItem, partsIndex) in formData.parts"
- :key="partsIndex"
- >
- <div class="parts_title">
- <h2>部件{{ partsIndex + 1 }}</h2>
- <div>
- <Button
- @click="handlePartAdd(partsItem, partsIndex)"
- type="success"
- size="small"
- :disabled="type == 2"
- style="margin-right: 10px"
- >新增部件</Button
- >
- <Button
- @click="handlePartCopy(partsItem, partsIndex)"
- type="primary"
- :disabled="type == 2"
- size="small"
- style="margin-right: 10px"
- >复制部件</Button
- >
- <Button
- @click="handlePartDele(partsItem, partsIndex)"
- v-show="formData.parts.length > 1"
- type="error"
- :disabled="type == 2"
- size="small"
- style="margin-right: 10px"
- >删除部件</Button
- >
- </div>
- </div>
- <div class="parts_top">
- <Form :model="partsItem" :label-width="100">
- <FormItem label="部件分类名称:">
- <Select
- v-model="partsItem.parts_type"
- size="small"
- clearable
- filterable
- :disabled="type == 2"
- @on-change="(e) => handlePartsSelect(e, partsItem)"
- style="width: 150px"
- >
- <Option
- v-for="sitem in partsList"
- :key="sitem.id"
- :label="sitem.title"
- :value="sitem.id"
- >
- </Option>
- </Select>
- </FormItem>
- <FormItem label="标签:">
- <RadioGroup v-model="partsItem.pay_state" size="small">
- <Radio :label="1" :disabled="type == 2">是</Radio>
- <Radio :label="0" :disabled="type == 2">否</Radio>
- </RadioGroup>
- </FormItem>
- <FormItem label="部件名称:">
- <Select
- v-model="partsItem.part_id"
- size="small"
- clearable
- filterable
- allow-create
- label-in-value
- :disabled="type == 2"
- @on-create="(e) => handlePartTitleCreate(partsItem, e)"
- @on-change="(e) => handlePartsNameSelect(partsItem, e)"
- style="width: 150px"
- >
- <Option
- v-for="sitem in partsItem.partsNameList"
- :key="sitem.id"
- :label="sitem.title"
- :value="sitem.id"
- >
- </Option>
- </Select>
- </FormItem>
- <FormItem label="单位:">
- <Input
- type="text"
- size="small"
- :disabled="type == 2"
- v-model="partsItem.company"
- style="width: 150px"
- placeholder="请输入单位"
- />
- </FormItem>
- <FormItem label="工艺组合名称:">
- <Select
- v-model="partsItem.processCombination"
- size="small"
- clearable
- filterable
- allow-create
- label-in-value
- :disabled="type == 2"
- @on-create="(e) => handleProcessRouteCreate(partsItem, e)"
- @on-change="(e) => handleProcessRouteSelect(partsItem, e)"
- style="width: 150px"
- >
- <Option
- v-for="sitem in partsItem.partsProcessRouteList"
- :key="sitem.id"
- :label="sitem.title"
- :value="sitem.id"
- >
- </Option>
- </Select>
- </FormItem>
- <FormItem label="工艺价格:">
- <Input
- type="text"
- size="small"
- :disabled="!partsItem.isAddProcessRoute || type == 2"
- v-model="partsItem.process_price"
- style="width: 150px"
- placeholder="请输入工艺价格"
- />
- </FormItem>
- <FormItem label="长:">
- <Input
- type="text"
- size="small"
- @on-focus="openKey(partsIndex, -1, 'long', partsItem)"
- :disabled="type == 2"
- v-model="partsItem.long"
- style="width: 150px"
- placeholder="请输入长"
- />
- </FormItem>
- <FormItem label="宽:">
- <Input
- type="text"
- size="small"
- @on-focus="openKey(partsIndex, -1, 'wide', partsItem)"
- :disabled="type == 2"
- v-model="partsItem.wide"
- style="width: 150px"
- placeholder="请输入宽"
- />
- </FormItem>
- <FormItem label="厚:">
- <Input
- type="text"
- size="small"
- @on-focus="openKey(partsIndex, -1, 'thick', partsItem)"
- :disabled="type == 2"
- v-model="partsItem.thick"
- style="width: 150px"
- placeholder="请输入厚"
- />
- </FormItem>
- <FormItem label="产值比例(%):">
- <Input
- type="text"
- size="small"
- :disabled="type == 2"
- @on-blur="(e) => handleProportionEdit(e, partsItem, partsIndex)"
- v-model="partsItem.proportion"
- style="width: 150px"
- placeholder="请输入产值比"
- />
- </FormItem>
- </Form>
- </div>
- <div class="parts_content">
- <span>工艺属性:</span>
- <div
- class="hierarchy"
- v-for="(item, index) of partsItem.ProcessAttrList"
- :key="item.id"
- >
- <span>{{ item.name || item.title }}(单选):</span>
- <div
- v-for="_item in item.cld"
- class="radio-g"
- :key="_item.type_title"
- >
- <!-- v-show="_item.display" -->
- <span
- :class="['box-us', _item.show ? 'box-us-foc' : '']"
- @click="setBoxChange(item, _item)"
- >{{ _item.type_title }}</span
- >
- <div
- :class="['radio-us', __item.show ? 'radio-us-foc' : '']"
- v-for="__item in _item.list"
- @click="setRadioChange(_item, __item, index, partsItem, item.cld)"
- v-show="__item.display"
- :key="__item.id"
- >
- {{ __item.title }}
- </div>
- </div>
- <!-- <div class="radio-g">
- <div @click="setRadioChange(item, _item, index, partsItem)"
- :class="[
- 'radio-us',
- _item.show ? 'radio-us-foc' : '',
- _item.display ? 'radio-us-none' : '',
- ]"
- v-for="_item of item.cld"
- :key="_item.id">
- {{ _item.title }}
- </div>
- </div> -->
- </div>
- <div style="padding: 10px 0">
- <span>工艺路线:</span>
- <Button
- :disabled="!partsItem.isAddProcessRoute || type == 2"
- @click="editRouter(partsItem, partsIndex)"
- >选择工艺路线</Button
- >
- </div>
- <div class="parts_content_lineTable">
- <Table
- :columns="partsProcessLineColumns"
- border
- :data="partsItem.partsProcessLineTableData"
- >
- <template slot="processLineSet" slot-scope="{ row, index }">
- <a
- style="margin: 0 5px; color: red"
- :disabled="!partsItem.isAddProcessRoute || type == 2"
- @click="handleProcessLineDele(row, index, partsIndex)"
- >删除</a
- >
- </template>
- </Table>
- </div>
- <div class="parts_content_part">
- <span>零部件添加</span>
- <Button
- @click="handlePartWoodAdd(partsIndex)"
- type="primary"
- size="small"
- ghost
- :disabled="!partsItem.isAddPart || type == 2"
- style="margin-right: 10px"
- >新增木板</Button
- >
- </div>
- <div class="parts_content_partTable">
- <Table
- :columns="partsPartColumns"
- border
- :data="partsItem.partsWoodTableData"
- >
- <template slot-scope="{ index }" slot="partNameSet">
- <Input
- placeholder="名称"
- :disabled="!partsItem.isAddPart || type == 2"
- v-model="partsItem.partsWoodTableData[index].spare_parts"
- />
- </template>
- <template slot-scope="{ row, index }" slot="partSpare_partsSet">
- <div>
- <Select
- filterable
- clearable
- :disabled="!partsItem.isAddPart || type == 2"
- label-in-value
- @on-change="changeSe($event, index, partsIndex, row)"
- v-model="partsItem.partsWoodTableData[index].material_id"
- >
- <Option
- :data-unit="item.unit"
- :tag="item.high"
- v-for="item of materialWoodList"
- :key="item.id"
- :value="item.id"
- :label="item.title"
- ></Option>
- </Select>
- </div>
- </template>
- <template slot-scope="{ index }" slot="partNumberSet">
- <Input
- placeholder="数量"
- :disabled="!partsItem.isAddPart || type == 2"
- v-model="partsItem.partsWoodTableData[index].number"
- />
- </template>
- <template slot-scope="{ index }" slot="partLongSet">
- <Input
- @on-focus="openKey(partsIndex, index, 'long', partsItem)"
- :disabled="!partsItem.isAddPart || type == 2"
- placeholder="长"
- v-model="partsItem.partsWoodTableData[index].long"
- />
- </template>
- <template slot-scope="{ index }" slot="partWideSet">
- <Input
- @on-focus="openKey(partsIndex, index, 'wide', partsItem)"
- :disabled="!partsItem.isAddPart || type == 2"
- placeholder="宽"
- v-model="partsItem.partsWoodTableData[index].wide"
- />
- </template>
- <template slot-scope="{ index }" slot="partRequirementSet">
- <Select
- placeholder="工艺要求"
- filterable
- clearable
- :disabled="!partsItem.isAddPart || type == 2"
- v-model="
- partsItem.partsWoodTableData[index]
- .technological_requirement_id
- "
- >
- <Option
- v-for="item in processRequireList"
- :key="item.id"
- :value="item.id"
- :label="item.title"
- ></Option>
- </Select>
- </template>
- <template slot-scope="{ index }" slot="partSub_numSet">
- <Select
- placeholder="贴面数"
- filterable
- clearable
- :disabled="!partsItem.isAddPart || type == 2"
- v-model="partsItem.partsWoodTableData[index].sub_num"
- >
- <Option :value="0" label="0"></Option>
- <Option :value="1" label="1"></Option>
- <Option :value="2" label="2"></Option>
- </Select>
- </template>
- <template slot-scope="{ index }" slot="partVeneer_idSet">
- <Select
- placeholder="贴木皮"
- filterable
- clearable
- :disabled="!partsItem.isAddPart || type == 2"
- v-model="partsItem.partsWoodTableData[index].veneer_id"
- >
- <Option
- v-for="item in materialWoodSkinList"
- :key="item.id"
- :value="item.id"
- :label="item.title"
- ></Option>
- </Select>
- </template>
- <template slot-scope="{ index }" slot="partPaint_idSet">
- <Select
- placeholder="油漆"
- filterable
- clearable
- :disabled="!partsItem.isAddPart || type == 2"
- v-model="partsItem.partsWoodTableData[index].paint_id"
- >
- <Option
- v-for="item in materialPaintList"
- :key="item.id"
- :value="item.id"
- :label="item.title"
- ></Option>
- </Select>
- </template>
- <template slot-scope="{ index }" slot="partLabelSet">
- <Select
- placeholder="标签"
- filterable
- clearable
- :disabled="!partsItem.isAddPart || type == 2"
- v-model="partsItem.partsWoodTableData[index].label"
- >
- <Option :value="1" label="小芯片"></Option>
- <Option :value="2" label="大芯片"></Option>
- <Option :value="3" label="否"></Option>
- <Option :value="4" label="标签"></Option>
- </Select>
- </template>
- <template slot-scope="{ index }" slot="partPrint_numSet">
- <Input
- placeholder="打印数量"
- :disabled="!partsItem.isAddPart || type == 2"
- v-model="partsItem.partsWoodTableData[index].print_num"
- />
- </template>
- <template slot="partSet" slot-scope="{ row, index }">
- <a
- style="margin: 0 5px"
- :disabled="!partsItem.isAddPart || type == 2"
- @click="handlePartWoodCopy(row, index, partsIndex)"
- >复制</a
- >
- <a
- style="margin: 0 5px; color: red"
- :disabled="!partsItem.isAddPart || type == 2"
- @click="handlePartWoodDele(row, index, partsIndex)"
- >删除</a
- >
- </template>
- </Table>
- </div>
- <div class="parts_content_metals">
- <Button
- @click="handlePartMetalsAdd(partsIndex)"
- type="primary"
- size="small"
- :disabled="!partsItem.isAddPart || type == 2"
- ghost
- style="margin-right: 10px"
- >新增五金</Button
- >
- </div>
- <div class="parts_content_metalsTable">
- <Table
- :columns="partsMetalseColunms"
- border
- :data="partsItem.partsMetalseData"
- >
- <template slot="metalSpare_partsSet" slot-scope="{ index }">
- <Select
- filterable
- clearable
- :disabled="!partsItem.isAddPart || type == 2"
- @on-change="changeMetal($event, index, partsIndex)"
- label-in-value
- placeholder="请选择"
- v-model="partsItem.partsMetalseData[index].material_id"
- >
- <Option
- v-for="item in metalsList"
- :key="item.id"
- :data-unit="item.unit"
- :value="item.id"
- :label="item.title"
- ></Option>
- </Select>
- </template>
- <template slot-scope="{ index }" slot="metalNumberSet">
- <Input
- placeholder="数量"
- :disabled="!partsItem.isAddPart || type == 2"
- v-model="partsItem.partsMetalseData[index].number"
- />
- </template>
- <template slot-scope="{ index }" slot="metalPriceSet">
- <Input
- placeholder="单价"
- :disabled="!partsItem.isAddPart || type == 2"
- v-model="partsItem.partsMetalseData[index].price"
- />
- </template>
- <template slot="metalTotal_priceSet" slot-scope="{ row }">
- {{ row.number * row.price }}
- </template>
- <template slot="metalsSet" slot-scope="{ row, index }">
- <a
- style="margin: 0 5px"
- :disabled="!partsItem.isAddPart || type == 2"
- @click="handlePartMetalsCopy(row, index, partsIndex)"
- >复制</a
- >
- <a
- style="margin: 0 5px; color: red"
- :disabled="!partsItem.isAddPart || type == 2"
- @click="handlePartMetalsDele(row, index, partsIndex)"
- >删除</a
- >
- </template>
- </Table>
- </div>
- </div>
- </div>
- <li v-for="item in formData.parts" v-show="false" :key="item.id"></li>
- <!-- 相似产品弹窗 -->
- <Modal
- title="选择相似产品"
- v-model="showSimilarProductModal"
- :mask-closable="false"
- class="similarProductModal"
- :width="1000"
- >
- <Form :label-width="100" :model="similarProductData">
- <FormItem label="产品分类">
- <Select
- v-model="similarProductData.type_name"
- placeholder="请选择"
- style="width: 120px"
- size="small"
- >
- <Option
- v-for="item in PDTTypeList"
- :value="item.title"
- :key="item.title"
- :label="item.title"
- ></Option>
- </Select>
- </FormItem>
- <FormItem label="产品名称:">
- <Input
- type="text"
- size="small"
- v-model="similarProductData.title"
- style="width: 120px"
- />
- </FormItem>
- <FormItem label="产品型号">
- <Input
- type="text"
- size="small"
- v-model="similarProductData.model"
- placeholder="请输入"
- style="width: 120px"
- />
- </FormItem>
- <FormItem label="图号:">
- <Input
- type="text"
- size="small"
- v-model="similarProductData.url_number"
- style="width: 120px"
- />
- </FormItem>
- <Button
- type="primary"
- style="margin: 0 10px"
- @click="handleSimilarProductSearch"
- >搜索</Button
- >
- </Form>
- <Table
- :columns="similarProductColunms"
- border
- highlight-row
- :disabled-hover="true"
- @on-current-change="handleSimilarProductSelected"
- :loading="similarProductLoading"
- :data="similarProductData.similarProductList"
- >
- </Table>
- <div class="page">
- <Page
- @on-change="changeSimilarProductPage"
- :current="similarProductData.page_index"
- show-total
- :total="similarProductData.total"
- size="small"
- :page_size="similarProductData.page_size"
- />
- </div>
- <div class="modal-footer" slot="footer">
- <Button @click="showSimilarProductModal = false">取消</Button>
- <Button
- type="primary"
- @click="handleSimilarProductConfirm(tempSimilarProductData.id)"
- >确认</Button
- >
- </div>
- </Modal>
- <!-- 选择工艺路线弹窗 -->
- <Modal
- class-name="vertical-center-modal"
- v-model="showProcessLineModal"
- title="选择工艺路线"
- >
- <div class="modal_process_route">
- <div class="modal_process_route_top">
- <div>
- <span>工艺路线名称:</span>
- <Input
- v-model="tempProcessLine.title"
- style="width: 120px"
- placeholder="请输入"
- >
- </Input>
- </div>
- <Button
- type="primary"
- @click="handleSearchProcessLine(tempProcessLine.title)"
- >搜索</Button
- >
- </div>
- <div class="modal_process_route_content">
- <Table
- border
- :columns="processLineColumns"
- :data="processLineTableData"
- >
- <template slot="processLineSet" slot-scope="{ row, index }">
- <a style="margin: 0 5px" @click="handleProcessLineSet(row, index)"
- >选择</a
- >
- </template>
- </Table>
- </div>
- </div>
- </Modal>
- <Modal
- class-name="vertical-center-modal"
- v-model="showProcessLineDetailModal"
- title="工艺路线"
- @on-ok="saveTableData()"
- >
- <span>已选:</span>
- <Form>
- <FormItem>
- <SlickList
- :distance="10"
- :lockToContainerEdges="true"
- axis="x,y,xy"
- lockAxis="xy"
- v-model="selectTags"
- class="SortableList"
- @input="getChangeLists"
- >
- <SlickItem
- style="z-index: 9999"
- v-for="(item, key) of selectTags"
- :key="key"
- class="SortableItem"
- :index="key"
- >
- <div class="tag-modal">
- <div class="before">{{ key + 1 }}</div>
- <Tag
- @on-close="closeTag(key, selectTags, item)"
- color="primary"
- type="border"
- closable
- >{{ item.title }}</Tag
- >
- </div>
- </SlickItem>
- </SlickList>
- </FormItem>
- <FormItem
- v-for="(item, index) of info.bps"
- :key="index"
- :label="item.title"
- >
- <Tooltip v-for="(_item, _index) of item.cld" :key="_index">
- <div slot="content">
- <p>工时:{{ _item.time }}</p>
- <p>工价:{{ _item.wages }}</p>
- <p>产能:{{ _item.capacity }}</p>
- </div>
- <Checkbox
- @on-change="changeCheck($event, _item, selectTags)"
- v-model="_item.show"
- style="padding: 0px 5px"
- >{{ _item.title }}</Checkbox
- >
- </Tooltip>
- </FormItem>
- </Form>
- </Modal>
- <!-- 输入框弹窗 -->
- <Modal
- v-model="showKey"
- :width="1250"
- :mask-closable="false"
- :closable="false"
- >
- <div>
- <KeyBoard
- :rightData="measureList"
- @cancel="cancelKey"
- @success="successKey"
- class="key-co"
- />
- </div>
- <div slot="footer"></div>
- </Modal>
- </div>
- </template>
- <script>
- // 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
- // 例如:import 《组件名称》 from '《组件路径》';
- import { SlickList, SlickItem } from "vue-slicksort";
- import KeyBoard from "../../../components/keyboard/index";
- import Downtree from "../../../components/drowDown/index";
- export default {
- name: "BidSystemProductDeOrderDeorderdetail",
- components: {
- SlickList,
- SlickItem,
- KeyBoard,
- Downtree,
- },
- props: {},
- // import引入的组件需要注入到对象中才能使用
- data() {
- // 这里存放数据
- return {
- // 1拆单 2详情
- type: this.$route.query.type,
- formData: {
- title: "", //产品名称
- num: "", //数量
- price: "", //价格
- measure: "", //规格
- process_property: "", //工艺属性
- url: [], //图纸
- url_number: "", //图号
- remark: "", //备注
- parts: [
- //产品列表
- {
- isAddPart: true, //是否为新增部件
- isAddProcessRoute: true, //是否为新增工艺组合
- long: "",
- width: "",
- thick: "",
- parts_type: "", //部件分类名称
- pay_state: "", //标签
- part_id: "", //部件名称
- company: "", //单位
- processCombination: "", //工艺组合名称
- process_price: "", //工艺价格
- proportion: "", //产值比例
- properties: [], //工艺属性
- ProcessAttrList: [
- {
- id: "",
- cld: [{ id: "", title: "" }],
- },
- ], //工艺属性列表
- partsProcessLineTableData: [
- // {
- // id: '',
- // type: '',
- // title: '',
- // time: '',
- // wages: '',
- // capacity: '',
- // }
- ], //工艺路线表格
- partsWoodTableData: [
- {
- title: "",
- spare_parts: "",
- number: "",
- company: "",
- long: "",
- wide: "",
- thick: "",
- technological_requirement_id: "",
- sub_num: "",
- veneer_id: "",
- paint_id: "",
- label: "",
- print_num: "",
- },
- ], //木板表格
- partsMetalseData: [
- {
- spare_parts: "",
- number: "",
- company: "",
- price: "",
- total_price: "",
- },
- ], //五金表格
- partsNameList: [{ id: "", title: "" }], //部件名称列表
- partsProcessRouteList: [{ id: "", title: "" }], //工艺组合名称列表
- checkBox: [],
- },
- ],
- },
- tempProcessLine: {
- title: "",
- },
- processLineTableData: [],
- processRouteId: "",
- processRouteName: "",
- partsProcessLineColumns: [
- { type: "index", minWidth: 30, align: "center" },
- // { title: "工序分类", key: "type", align: "center" },
- { title: "工序名称", key: "title", align: "center" },
- { title: "工时", key: "time", align: "center" },
- { title: "工价", key: "wages", align: "center" },
- { title: "产能", key: "capacity", align: "center" },
- { title: "操作", key: "set", align: "center", slot: "processLineSet" },
- ], //工艺路线表头
- partsPartColumns: [
- {
- title: "名称",
- key: "spare_parts",
- align: "center",
- minWidth: 120,
- slot: "partNameSet",
- },
- {
- title: "木板",
- key: "title",
- align: "center",
- minWidth: 120,
- slot: "partSpare_partsSet",
- },
- {
- title: "数量",
- key: "number",
- align: "center",
- minWidth: 100,
- slot: "partNumberSet",
- },
- { title: "单位", key: "company", align: "center", minWidth: 80 },
- {
- title: "长",
- key: "long",
- align: "center",
- minWidth: 120,
- slot: "partLongSet",
- },
- {
- title: "宽",
- key: "wide",
- align: "center",
- minWidth: 120,
- slot: "partWideSet",
- },
- { title: "厚", key: "thick", align: "center", minWidth: 120 },
- {
- title: "工艺要求",
- key: "technological_requirement_id",
- align: "center",
- minWidth: 140,
- slot: "partRequirementSet",
- },
- {
- title: "贴面数",
- key: "sub_num",
- align: "center",
- minWidth: 120,
- slot: "partSub_numSet",
- },
- {
- title: "贴木皮名称",
- key: "veneer_id",
- align: "center",
- minWidth: 140,
- slot: "partVeneer_idSet",
- },
- {
- title: "油漆",
- key: "paint_id",
- align: "center",
- minWidth: 140,
- slot: "partPaint_idSet",
- },
- {
- title: "标签",
- key: "label",
- align: "center",
- minWidth: 120,
- slot: "partLabelSet",
- },
- {
- title: "打印数量",
- key: "print_num",
- align: "center",
- minWidth: 100,
- slot: "partPrint_numSet",
- },
- {
- title: "操作",
- key: "name",
- align: "center",
- slot: "partSet",
- fixed: "right",
- minWidth: 140,
- },
- ], //零部件表头
- processLineColumns: [
- { title: "ID", align: "center", key: "id" },
- { title: "工艺路线名称", align: "center", key: "title" },
- { title: "操作", align: "center", key: "id", slot: "processLineSet" },
- ],
- partsMetalseColunms: [
- {
- title: "五金",
- key: "material_id",
- align: "center",
- minWidth: 80,
- slot: "metalSpare_partsSet",
- },
- {
- title: "数量",
- key: "number",
- align: "center",
- minWidth: 80,
- slot: "metalNumberSet",
- },
- { title: "单位", key: "company", align: "center", minWidth: 80 },
- {
- title: "单价",
- key: "price",
- align: "center",
- minWidth: 80,
- slot: "metalPriceSet",
- },
- {
- title: "总价",
- key: "total_price",
- align: "center",
- minWidth: 80,
- slot: "metalTotal_priceSet",
- },
- {
- title: "操作",
- key: "name",
- align: "center",
- minWidth: 80,
- slot: "metalsSet",
- },
- ], //五金表头
- showSimilarProductModal: false,
- similarProductLoading: false,
- PDTTypeList: [{ id: "", title: "" }], //产品分类列表
- ProcessAttrList: [], //工艺属性列表
- partsList: [{ id: "", title: "" }], //部件分类名称列表
- similarProductData: {
- type_name: "",
- title: "",
- model: "",
- url_number: "",
- similarProductList: [
- {
- type: "",
- title: "",
- model: "",
- url_number: "",
- },
- ],
- page_index: 1,
- page_size: 10,
- total: 0,
- },
- similarProductColunms: [
- {
- title: "选择",
- key: "",
- align: "center",
- minWidth: 60,
- render: (h, params) => {
- let id = params.row.id;
- let flag = false;
- if (this.tempSimilarProductData.id == id) {
- flag = true;
- } else {
- flag = false;
- }
- let self = this;
- return h("div", [
- h("Radio", {
- props: {
- value: flag,
- },
- on: {
- "on-change": () => {
- self.tempSimilarProductData = params.row;
- },
- },
- }),
- ]);
- },
- },
- { title: "产品分类", key: "type_name", align: "center", minWidth: 80 },
- { title: "产品名称", key: "title", align: "center", minWidth: 80 },
- { title: "产品型号", key: "model", align: "center", minWidth: 80 },
- { title: "图号", key: "url_number", align: "center", minWidth: 80 },
- ],
- processLineData: {
- title: "",
- processLineList: [
- {
- id: "",
- title: "",
- },
- ],
- page_index: 1,
- page_size: 10,
- total: 0,
- },
- processLineColunms: [
- { title: "ID", key: "name", align: "center", minWidth: 80 },
- { title: "工艺路线名称", key: "name", align: "center", minWidth: 80 },
- {
- title: "操作",
- key: "name",
- align: "center",
- minWidth: 80,
- slot: "processLineSet",
- },
- ],
- showProcessLineModal: false,
- showProcessLineDetailModal: false,
- showKey: false,
- processLineLoading: false,
- tempSimilarProductData: {},
- tempProcessLineData: {},
- order_no: this.$route.query.order_no,
- orders_area_product_detail_id:
- this.$route.query.orders_area_product_detail_id,
- selectTags: [], //已选列表
- info: {
- title: "",
- price: "",
- parts_id: "",
- id: null,
- properties: [], //工序号
- procedure: [], //工艺属性id
- ProcessAttrList: [],
- bps: [],
- },
- tempSelectedPartIndex: 0,
- // 工艺属性暂存
- tempProcessAttrList: [],
- // 输入框弹窗
- measureList: [
- // { e_title: 'H', title: '高', id: 1, sort: 0 },
- // { e_title: 'W', title: '宽', id: 1, sort: 0 },
- // { e_title: 'D', title: '深', id: 1, sort: 0 },
- ],
- attrIndex: "",
- attrName: "",
- materialWoodList: [], // 木板列表
- processRequireList: [], // 工艺要求列表
- materialWoodSkinList: [], // 木皮列表
- materialPaintList: [], // 油漆列表
- metalsList: [], // 五金列表
- productTypes: [],
- nowSelectObj: {},
- };
- },
- // 生命周期 - 创建完成(可以访问当前this实例)
- created() {
- // 获取产品分类
- this.axios("/api/parts_product_list").then((res) => {
- this.productTypes = res.data;
- });
- this.axios("/api/bp_list").then((res) => {
- this.info.bps = res.data;
- });
- this.axios("/api/bpp_list_new").then((res) => {
- res.data.map((v) => {
- if (v.select) {
- v.cld.map((z) => {
- v.select.map((k) => {
- z.show = k == z.id ? true : false;
- });
- });
- } else {
- v.cld.map((v) => (v.show = false));
- }
- });
- this.tempProcessAttrList = res.data;
- this.formData.parts.forEach((element) => {
- element.ProcessAttrList = res.data;
- });
- });
- },
- // 生命周期 - 挂载完成(可以访问DOM元素)
- mounted() {
- // 获取产品分类列表
- this.axios("/api/parts_product_list").then((res) => {
- this.PDTTypeList = res.data;
- });
- // 获取工艺要求列表
- this.axios("/api/technological_requirement").then((res) => {
- this.processRequireList = res.data.data;
- });
- // 获取贴木皮列表
- this.axios("/api/material", { params: { sub_type_id: 2 } }).then((res) => {
- this.materialWoodSkinList = res.data.data;
- });
- // 获取油漆列表
- this.axios("/api/material", { params: { sub_type_id: 6 } }).then((res) => {
- this.materialPaintList = res.data.data;
- });
- // 获取五金列表
- this.axios("/api/material", { params: { sub_type_id: 5 } }).then((res) => {
- this.metalsList = res.data.data;
- });
- // 获取部件分类列表
- this.axios("/api/basics_parts_index").then((res) => {
- this.partsList = res.data.data;
- });
- // 获取木板列表
- this.axios("/api/material", { params: { sub_type_id: 1 } }).then((res) => {
- this.materialWoodList = res.data.data;
- });
- this.initData(this.order_no, this.orders_area_product_detail_id);
- },
- methods: {
- initData(order_no, orders_area_product_detail_id) {
- this.axios({
- method: "get",
- url: "/api/order_area_explode_detail",
- params: {
- order_no,
- orders_area_product_detail_id,
- },
- })
- .then((res) => {
- this.formData = res.data;
- this.formData.basic_product_id = 8;
- // 获取产品分类、测量字段
- this.handleMatchBP(this.productTypes, this.formData.basic_product_id);
- this.handleClick(JSON.stringify(this.nowSelectObj));
- if (this.formData.parts.length == 0) {
- this.formData.parts = [
- {
- isAddPart: true, //是否为新增部件
- isAddProcessRoute: true, //是否为新增工艺组合
- long: "",
- width: "",
- thick: "",
- parts_type: "", //部件分类名称
- pay_state: "", //标签
- part_id: "", //部件名称
- company: "", //单位
- processCombination: "", //工艺组合名称
- process_price: "", //工艺价格
- proportion: "", //产值比例
- properties: [], //工艺属性
- ProcessAttrList: JSON.parse(
- JSON.stringify(this.tempProcessAttrList)
- ), //工艺属性列表
- partsProcessLineTableData: [], //工艺路线表格
- partsWoodTableData: [
- {
- title: "",
- spare_parts: "",
- number: "",
- company: "",
- long: "",
- wide: "",
- thick: "",
- technological_requirement_id: "",
- sub_num: "",
- veneer_id: "",
- paint_id: "",
- label: "",
- print_num: "",
- },
- ], //木板表格
- partsMetalseData: [
- {
- spare_parts: "",
- number: "",
- company: "",
- price: "",
- total_price: "",
- },
- ], //五金表格
- partsNameList: [{ id: "", title: "" }], //部件名称列表
- partsProcessRouteList: [{ id: "", title: "" }], //工艺组合名称列表
- checkBox: [],
- },
- ];
- } else {
- this.handleSimilarProductConfirm(
- res.data.product_id,
- this.formData
- );
- // this.formData.parts.map((element) => {
- // console.log('element :>> ', element);
- // element.partsProcessLineTableData = [];
- // element.wide = element.formula_w;
- // element.proportion = element.ratio;
- // element.thick = element.formula_h;
- // element.long = element.formula_l;
- // (element.ProcessAttrList = this.tempProcessAttrList), //工艺属性列表
- // this.axios("/api/parts_detail", {
- // params: { id: element.part_id },
- // })
- // .then((re) => {
- // // element.company = re.data.company
- // element.isAddPart = true;
- // element.isAddProcessRoute = true;
- // element.parts_type = re.data.p_id;
- // // element.part_id = re.data.title
- // this.axios({
- // method: "get",
- // url: "/api/parts_index",
- // params: {
- // bp_id: element.parts_type,
- // },
- // })
- // .then((r) => {
- // element.partsNameList = r.data.data;
- // if (isEditItem) {
- // let item = isEditItem;
- // // let item = JSON.parse(JSON.stringify(isEditItem));
- // item.parts.forEach((element) => {
- // element.processCombination = element.route_id;
- // let obj = { value: element.route_id, label: "" };
- // this.handleProcessRouteSelect(element, obj);
- // });
- // isEditItem = item;
- // }
- // this.$forceUpdate()
- // })
- // .catch((err) => { });
- // element.company = re.data.company;
- // // element.partsNameList = [{ id: re.data.id, title: re.data.title }]
- // element.pay_state = re.data.label;
- // // element.partsWoodTableData = re.data.detail;
- // this.showSimilarProductModal = false;
- // })
- // .catch((err) => { });
- // let obj = { value: element.part_id };
- // this.handlePartsNameSelect(element, obj);
- // });
- this.formData.parts.map((element) => {
- // element.properties = element.process_ids;
- // 1 木板 2 木皮 3 实木 4 辅料 5 五金 6 油漆
- // if (element.type_id == 0 || element.type_id == 1) {
- // this.tableData.push(element)
- // } else if (element.type_id == 5) {
- // this.metalsTableData.push(element)
- // }
- // process_ids: "1,3"
- // route_id: 10
- });
- }
- })
- .catch((err) => {});
- },
- handleMatchBP(array, id) {
- array.forEach((element, index) => {
- if (element.id != id) {
- if (element.child && element.child.length > 0) {
- return this.handleMatchBP(element.child, id);
- }
- } else {
- this.nowSelectObj = element;
- }
- });
- },
- getChangeLists(e) {},
- saveTableData(row, index) {
- this.formData.parts[
- this.tempSelectedPartIndex
- ].partsProcessLineTableData = this.formData.parts[
- this.tempSelectedPartIndex
- ].partsProcessLineTableData.concat(this.selectTags);
- },
- // 删除工艺路线列表项
- handleProcessLineDele(row, i, index) {
- let formData = JSON.parse(JSON.stringify(this.formData));
- formData.parts[index].partsProcessLineTableData.splice(i, 1);
- this.formData = formData;
- },
- //选择相似产品
- handleSimilarProductShow() {
- this.showSimilarProductModal = true;
- this.similarProductLoading = true;
- this.axios("/api/product", {
- params: {
- type_name: this.similarProductData.type_name,
- title: this.similarProductData.title,
- model: this.similarProductData.model,
- url_number: this.similarProductData.url_number,
- page_size: this.similarProductData.page_size,
- page_index: this.similarProductData.page_index,
- },
- }).then((res) => {
- this.similarProductLoading = false;
- this.similarProductData.similarProductList = res.data.data;
- this.similarProductData.total = res.data.total;
- });
- },
- changeSimilarProductPage(e) {
- this.similarProductLoading = true;
- this.axios("/api/product", {
- params: {
- type_name: this.similarProductData.type_name,
- title: this.similarProductData.title,
- model: this.similarProductData.model,
- url_number: this.similarProductData.url_number,
- page_size: this.similarProductData.page_size,
- page_index: e,
- },
- }).then((res) => {
- this.similarProductLoading = false;
- this.similarProductData.similarProductList = res.data.data;
- this.similarProductData.similarProductList.forEach((el) => {
- el.selected = false;
- });
- this.similarProductData.total = res.data.total;
- });
- },
- handleSimilarProductSearch() {
- this.similarProductLoading = true;
- this.axios("/api/product", {
- params: {
- type_name: this.similarProductData.type_name,
- title: this.similarProductData.title,
- model: this.similarProductData.model,
- url_number: this.similarProductData.url_number,
- page_size: this.similarProductData.page_size,
- page_index: this.similarProductData.page_index,
- },
- }).then((res) => {
- this.similarProductLoading = false;
- this.similarProductData.similarProductList = res.data.data;
- this.similarProductData.similarProductList.forEach((el) => {
- el.selected = false;
- });
- this.similarProductData.total = res.data.total;
- });
- },
- // 产值比校验
- handleProportionEdit(e, row, index) {
- // e.target.value
- },
- handleSimilarProductSelected(row, oldrow) {
- this.tempSimilarProductData = row;
- },
- handleSimilarProductConfirm(id, isEditItem) {
- if (id) {
- this.axios({
- method: "get",
- url: "/api/product",
- params: {
- id,
- },
- }).then((res) => {
- if (res.code == 200) {
- res.data.part.forEach((element) => {
- this.formData.parts.forEach((ele) => {
- if (element.part_id == ele.part_id) {
- element.process_ids = ele.process_ids;
- element.route_id = ele.route_id;
- }
- });
- });
- this.formData.parts = res.data.part;
- //label
- // this.formData.title = res.data.title;
- // this.formData.unit = res.data.unit;
- // this.formData.remark = res.data.remark;
- // this.formData.url = res.data.url;
- // this.formData.url_number = res.data.url_number;
- // this.formData.measure = res.data.measure_id
- // if (isEditItem) {
- // res.data.part.forEach((element, index) => {
- // Object.assign(element, this.formData.parts[index]);
- // });
- // }
- this.formData.parts.map((element) => {
- element.partsProcessLineTableData = [];
- element.wide = element.formula_w;
- element.proportion = element.ratio;
- element.thick = element.formula_h;
- element.long = element.formula_l;
- element.ProcessAttrList = JSON.parse(JSON.stringify(this.tempProcessAttrList)); //工艺属性列表
- this.axios("/api/parts_detail", {
- params: { id: element.part_id },
- })
- .then((re) => {
- // element.company = re.data.company
- element.isAddPart = true;
- element.isAddProcessRoute = true;
- element.parts_type = re.data.p_id;
- // element.part_id = re.data.title
- this.axios({
- method: "get",
- url: "/api/parts_index",
- params: {
- bp_id: element.parts_type,
- },
- })
- .then((r) => {
- element.partsNameList = r.data.data;
- if (isEditItem) {
- let item = isEditItem;
- // let item = JSON.parse(JSON.stringify(isEditItem));
- item.parts.forEach((element) => {
- element.processCombination = element.route_id;
- let obj = { value: element.route_id, label: "" };
- this.handleProcessRouteSelect(element, obj);
- });
- isEditItem = item;
- }
- this.$forceUpdate();
- })
- .catch((err) => {});
- element.company = re.data.company;
- // element.partsNameList = [{ id: re.data.id, title: re.data.title }]
- element.pay_state = re.data.label;
- // element.partsWoodTableData = re.data.detail;
- this.showSimilarProductModal = false;
- })
- .catch((err) => {});
- let obj = { value: element.part_id };
- this.handlePartsNameSelect(element, obj);
- });
- }
- });
- } else {
- this.showSimilarProductModal = false;
- }
- },
- //选择部件分类名称
- handlePartsSelect(e, item) {
- this.axios({
- method: "get",
- url: "/api/parts_index",
- params: {
- bp_id: e,
- },
- })
- .then((res) => {
- this.$nextTick(() => {
- item.part_id = "";
- item.partsNameList = res.data.data;
- this.$forceUpdate();
- });
- })
- .catch((err) => {});
- },
- //新增部件名称
- handlePartTitleCreate(item, val) {
- item.partsNameList.push({
- id: val,
- title: val,
- });
- item.processCombination = "";
- this.$forceUpdate();
- },
- //新增工艺组合名称
- handleProcessRouteCreate(item, val) {
- item.ProcessAttrList = JSON.parse(JSON.stringify(this.tempProcessAttrList));
- item.partsProcessRouteList.push({
- id: val,
- title: val,
- });
- },
- // 部件名称
- handlePartsNameSelect(item, val) {
- if (val) {
- item.processCombination = "";
- if (val.label != val.value) {
- item.isAddPart = false;
- this.axios({
- method: "get",
- url: "/api/parts_detail",
- params: {
- id: val.value,
- },
- }).then((res) => {
- item.pay_state = res.data.label;
- item.company = res.data.company;
- item.partsWoodTableData ? "" : (item.partsWoodTableData = []);
- item.partsMetalseData ? "" : (item.partsMetalseData = []);
- item.partsWoodTableData = res.data.detail.filter(
- (v) => v.type_id == 1 || v.type_id == 2
- );
- item.partsMetalseData = res.data.detail.filter(
- (v) => v.type_id == 5
- );
- this.axios({
- method: "get",
- url: "/api/process_route_index",
- params: {
- part_id: val.value,
- },
- })
- .then((re) => {
- this.$nextTick(() => {
- item.partsProcessRouteList = re.data.detail;
- this.$forceUpdate();
- });
- })
- .catch((err) => {});
- });
- } else {
- item.isAddPart = true;
- }
- }
- },
- // 选择工艺组合名称
- handleProcessRouteSelect(item, val) {
- if (val) {
- item.ProcessAttrList.forEach((v) => {
- v.cld.forEach((z) => {
- z.list.forEach((element) => {
- element.display = true;
- });
- });
- });
- if (val.label != val.value) {
- item.isAddProcessRoute = false;
- this.axios({
- method: "get",
- url: "/api/process_route_detail",
- params: {
- id: val.value,
- },
- }).then((res) => {
- this.$nextTick(() => {
- this.info = res.data;
- item.process_price = res.data.price;
- this.selectTags = res.data.produce_list;
- const selectTagsId = this.selectTags.map((item) => item.id);
- item.ProcessAttrList = res.data.list;
- item.properties = res.data.pp_id.split(","); ///存在问题
- item.ProcessAttrList.forEach((v) => {
- v.cld.forEach((z) => {
- // z.show = selectTagsId.includes(z.id)
- ///////
- z.display = !z.show;
- // z.display = !selectTagsId.includes(z.id)
- z.list.forEach((element) => {
- element.display = JSON.parse(JSON.stringify(element.show));
- element.show = false;
- });
- console.log("z :>> ", z);
- });
- });
- item.partsProcessLineTableData = this.selectTags;
- });
- });
- } else {
- item.isAddProcessRoute = true;
- }
- }
- },
- //选择工艺路线
- editRouter(item, index) {
- this.showProcessLineModal = true;
- this.tempSelectedPartIndex = index;
- this.handleSearchProcessLine(this.tempProcessLine.title);
- },
- handleSearchProcessLine(title) {
- this.axios({
- method: "get",
- url: "/api/technological_route",
- params: {
- title,
- },
- })
- .then((res) => {
- this.processLineTableData = res.data.data;
- })
- .catch((err) => {});
- },
- changeCheck(e, item, selectArray) {
- //复选框选中与非选中同时同步tag标签跟随操作
- item.show = e;
- if (e) {
- selectArray.push(item);
- } else {
- let id = item.id;
- let id_index = selectArray.findIndex((v) => v.id == id);
- selectArray.splice(id_index, 1);
- }
- },
- closeTag(key, arr, row) {
- //取消tag标签展示操作并同步下方的复选框ui同步
- arr.splice(key, 1);
- this.info.bps.map((v) => {
- v.cld.map((p) => {
- p.id == row.id ? (p.show = false) : "";
- });
- });
- },
- setBoxChange(parent, child) {
- return;
- // const { type } = this.$route.query;
- // if (type == 3) {
- // return;
- // }
- // child.show = !child.show;
- // child.list.forEach((element) => {
- // element.show = child.show;
- // });
- },
- setRadioChange(parent, child, index, parts, cld) {
- console.log("parent :>> ", parent);
- console.log("parts :>> ", parts);
- console.log("cld :>> ", cld);
- if (this.type == 1) {
- cld.forEach((element) => {
- element.list.forEach((elem) => {
- elem.id != child.id && (elem.show = false);
- });
- });
- child.show = !child.show;
- parts.properties[index] = child.id;
- this.$forceUpdate();
- }
- },
- // setRadioChange(parent, child) {
- // const { type } = this.$route.query;
- // if (type == 3) {
- // return;
- // }
- // // let flag = true;
- // parent.list.forEach((element) => {
- // element.show = false
- // if (!element.show) {
- // // flag = false;
- // }
- // });
- // child.show = !child.show;
- // console.log('child.show :>> ', child.show);
- // // parent.show = flag;
- // this.$forceUpdate();
- // },
- handleProcessLineSet(row, index) {
- this.info.id = row.id;
- // this.info.title = row.title;
- this.info.procedure_id = row.procedure_id;
- this.selectTags = [];
- const arr = this.info.procedure_id
- ? this.info.procedure_id.split(",")
- : [];
- for (const key in this.info.bps) {
- const element = this.info.bps[key];
- element.cld.forEach((z) => {
- z.show = arr.includes(z.id + "");
- if (arr.includes(z.id + "")) {
- this.selectTags.push(z);
- }
- });
- }
- this.showProcessLineDetailModal = true;
- this.showProcessLineModal = false;
- },
- changeProcessLineSize() {},
- changeProcessLinePage() {},
- handleProcessLineConfirm() {},
- handleProcessLineSearch() {},
- handlePartAdd(item, index) {
- let obj = {
- isAddPart: true,
- isAddProcessRoute: true,
- long: "",
- width: "",
- thick: "",
- parts_type: "", //部件分类名称
- pay_state: "", //标签
- part_id: "", //部件名称
- company: "", //单位
- processCombination: "", //工艺组合名称
- process_price: "", //工艺价格
- ProcessAttrList: JSON.parse(JSON.stringify(this.tempProcessAttrList)), //工艺属性列表
- partsProcessLineTableData: [
- {
- id: "",
- type: "",
- title: "",
- time: "",
- wages: "",
- capacity: "",
- },
- ], //工艺路线表格
- partsWoodTableData: [
- {
- title: "",
- spare_parts: "",
- number: "",
- company: "",
- long: "",
- wide: "",
- thick: "",
- technological_requirement_id: "",
- sub_num: "",
- veneer_id: "",
- paint_id: "",
- label: "",
- print_num: "",
- },
- ], //零部件表格
- partsMetalseData: [
- {
- spare_parts: "",
- number: "",
- company: "",
- price: "",
- total_price: "",
- },
- ], //五金表格
- partsNameList: [{ id: "", title: "" }], //部件名称列表
- checkBox: [],
- keyUseType: 0,
- };
- this.formData.parts.splice(index + 1, 0, obj);
- },
- handlePartCopy(item, index) {
- let obj = JSON.parse(JSON.stringify(item));
- // this.formData.parts.splice(index, 0, obj);
- this.formData.parts.push(obj);
- },
- handlePartDele(item, index) {
- this.formData.parts.splice(index, 1);
- },
- handlePartWoodAdd(index) {
- let formData = JSON.parse(JSON.stringify(this.formData));
- formData.parts[index].partsWoodTableData.push({
- type_id: 1,
- title: "",
- spare_parts: "",
- number: "",
- company: "",
- long: "",
- wide: "",
- thick: "",
- technological_requirement_id: "",
- sub_num: "",
- veneer_id: "",
- paint_id: "",
- label: "",
- print_num: "",
- });
- this.formData = formData;
- },
- handlePartWoodCopy(row, index, parentIndex) {
- this.$nextTick(() => {
- let obj = JSON.parse(
- JSON.stringify(
- this.formData.parts[parentIndex].partsWoodTableData[index]
- )
- );
- this.formData.parts[parentIndex].partsWoodTableData.splice(
- index + 1,
- 0,
- obj
- );
- // this.formData.parts[parentIndex].partsWoodTableData.push(obj)
- this.$forceUpdate();
- });
- },
- handlePartWoodDele(row, index, parentIndex) {
- this.formData.parts[parentIndex].partsWoodTableData.splice(index, 1);
- },
- handlePartMetalsAdd(index) {
- let formData = JSON.parse(JSON.stringify(this.formData));
- if (formData.parts[index].partsMetalseData == undefined) {
- formData.parts[index].partsMetalseData = [];
- }
- formData.parts[index].partsMetalseData.push({
- type_id: 2,
- spare_parts: "",
- number: "",
- company: "",
- price: "",
- total_price: "",
- });
- this.formData = formData;
- },
- handlePartMetalsCopy(row, index, parentIndex) {
- let obj = JSON.parse(JSON.stringify(row));
- this.formData.parts[parentIndex].partsMetalseData.splice(
- index + 1,
- 0,
- obj
- );
- },
- handlePartMetalsDele(row, index, parentIndex) {
- this.formData.parts[parentIndex].partsMetalseData.splice(index, 1);
- },
- handleProcessLineSelected() {},
- async postData() {
- let sum = 0;
- this.formData.parts.forEach((element) => {
- sum += element.proportion * 1;
- });
- if (sum != 100) {
- this.$Message.error("产值比之和须为100");
- } else {
- // 部件保存
- let save_sucess = true;
- for (let i in this.formData.parts) {
- let element = this.formData.parts[i];
- let flag = false;
- element.partsNameList.forEach((ele) => {
- if (element.part_id == ele.id && ele.id == ele.title) {
- flag = true;
- }
- });
- if (flag) {
- let result = await this.axios({
- method: "post",
- url: "/api/order_area_explode_part",
- data: {
- top: {
- p_id: element.parts_type,
- bp_id: this.nowSelectObj.id, //相似产品
- company: element.company,
- label: element.pay_state,
- title: element.part_id,
- },
- op: "add",
- detail: [
- ...element.partsWoodTableData,
- ...element.partsMetalseData,
- ],
- },
- });
- if (result.code == 200) {
- element.part_id = result.data.id;
- // 工艺路线保存 partsProcessLineTableData
- let procedure = "";
- let bool = false;
- element.partsProcessRouteList.forEach((ele) => {
- if (
- element.processCombination == ele.id &&
- ele.id == ele.title
- ) {
- bool = true;
- }
- });
- element.partsProcessLineTableData.forEach(async (el, idx) => {
- if (idx == element.length - 1) {
- procedure += el.id + "";
- } else {
- procedure += el.id + ",";
- }
- });
- if (bool) {
- let res = await this.axios({
- method: "post",
- url: "/api/order_area_explode_process",
- data: {
- parts_id: element.part_id, /////
- price: element.process_price,
- properties:
- typeof element.properties == "string"
- ? [element.properties]
- : element.properties,
- // properties: element.properties,
- title: element.processCombination,
- procedure,
- op: "add",
- },
- });
- element.route_id = res.data.id;
- element.part_id = result.data.id;
- }
- } else {
- save_sucess = false;
- }
- } else {
- // 工艺路线保存 partsProcessLineTableData
- let procedure = "";
- let bool = false;
- element.partsProcessRouteList.forEach((ele) => {
- if (element.processCombination == ele.id && ele.id == ele.title) {
- bool = true;
- }
- });
- element.partsProcessLineTableData.forEach(async (el, idx) => {
- if (idx == element.length - 1) {
- procedure += el.id + "";
- } else {
- procedure += el.id + ",";
- }
- });
- if (bool) {
- let res = await this.axios({
- method: "post",
- url: "/api/order_area_explode_process",
- data: {
- parts_id: element.part_id, /////
- price: element.process_price,
- properties:
- typeof element.properties == "string"
- ? [element.properties]
- : element.properties,
- // properties: element.properties,
- title: element.processCombination,
- procedure,
- op: "add",
- },
- });
- if (res.code == 200) {
- element.route_id = res.data.id;
- } else {
- save_sucess = false;
- }
- }
- }
- }
- this.formData.parts.forEach((element) => {
- element.detail = [
- ...element.partsWoodTableData,
- ...element.partsMetalseData,
- ];
- });
- // 产品编辑保存
- if (save_sucess) {
- await this.axios({
- method: "post",
- url: "/api/order_area_explode_save",
- data: {
- ...this.formData,
- order_no: this.$route.query.order_no,
- orders_area_product_detail_id:
- this.$route.query.orders_area_product_detail_id,
- },
- }).then((res) => {
- if (res.code == 200) {
- this.$Message.success(res.msg);
- this.goback();
- }
- });
- }
- }
- },
- goback() {
- this.$router.go(-1);
- },
- successKey(str) {
- if (this.keyUseType == 1) {
- this.formData.parts[this.attrParentindex].partsWoodTableData[
- this.attrIndex
- ][this.attrName] = str;
- // this.$set(this.formData.parts[this.attrParentindex].partsWoodTableData[this.attrIndex],[this.attrName], str)
- } else {
- this.formData.parts[this.attrParentindex][this.attrName] = str;
- }
- this.showKey = false;
- },
- cancelKey() {
- this.showKey = false;
- },
- openKey(partsIndex, index, attr, partsItem) {
- // this.axios({
- // method: "get",
- // url: "/api/basics_product_list",
- // params: {
- // id: partsItem.part_id,
- // },
- // })
- // .then((res) => {
- // res.data.forEach((element) => {
- // if (element.id == partsItem.part_id) {
- // this.measureList = element.measure;
- // }
- // });
- this.showKey = true;
- this.attrParentindex = partsIndex;
- if (index != -1) {
- this.attrIndex = index;
- this.keyUseType = 1;
- } else {
- this.keyUseType = 2;
- }
- this.attrName = attr;
- // })
- },
- changeSe(e, n, partsIndex, row) {
- let event = window.event;
- let unit = event.target.dataset.unit;
- // row.company = unit ? unit : ''
- // row.thick = e.tag
- // row.title = e.title
- this.formData.parts[partsIndex].partsWoodTableData[n].company = unit
- ? unit
- : "";
- this.formData.parts[partsIndex].partsWoodTableData[n].thick = e.tag;
- this.formData.parts[partsIndex].partsWoodTableData[n].title = e.title;
- },
- changeMetal(e, n, partsIndex) {
- let event = window.event;
- let unit = event.target.dataset.unit;
- this.formData.parts[partsIndex].partsMetalseData[n].company = unit
- ? unit
- : "";
- },
- handleMetalTotalPriceChange(row) {
- row.total_price = 1 * row.price * row.number;
- },
- handleClick(e) {
- let data = JSON.parse(e);
- this.nowSelectObj = data;
- this.info.bp_id = this.nowSelectObj.id;
- this.axios("/api/basics_product_list", {
- params: { id: this.nowSelectObj.id },
- }).then((res) => {
- res.data.forEach((element) => {
- if (element.id == this.nowSelectObj.id) {
- this.measureList = element.measure;
- }
- });
- });
- },
- checkImg(item) {
- let list = [];
- item.forEach((el) => {
- list.push({ img_url: el });
- });
- // this.axios('/api/orders_img', { params: { id: this.order_area_product_id, type: 1 } }).then(res => {
- // if (res.code == 200) {
- this.$previewImg({
- list,
- baseUrl: this.$store.state.ip,
- baseImgField: "img_url",
- baseTitleField: "",
- });
- // }
- // })
- },
- },
- // 监听属性 类似于data概念
- computed: {},
- // 监控data中的数据变化
- watch: {},
- beforeCreate() {}, // 生命周期 - 创建之前
- beforeMount() {}, // 生命周期 - 挂载之前
- beforeUpdate() {}, // 生命周期 - 更新之前
- updated() {}, // 生命周期 - 更新之后
- beforeDestroy() {}, // 生命周期 - 销毁之前
- destroyed() {}, // 生命周期 - 销毁完成
- activated() {}, // 如果页面有keep-alive缓存功能,这个函数会触发
- };
- </script>
- <style lang='scss' scoped>
- .BidSystemProductDeOrderDeorderdetail {
- position: relative;
- overflow: hidden;
- overflow-y: auto;
- .top_info {
- display: flex;
- justify-content: flex-start;
- align-items: center;
- flex-wrap: wrap;
- padding: 10px;
- span {
- min-width: 40px;
- margin-right: 5px;
- }
- div {
- display: flex;
- justify-content: flex-start;
- align-items: center;
- width: 200px;
- padding: 10px;
- img {
- max-width: 60px;
- }
- }
- }
- .similar_product {
- position: relative;
- padding: 15px;
- margin-bottom: 30px;
- border-radius: 5px;
- box-shadow: 1px 1px 5px 1px #999;
- display: flex;
- justify-content: flex-start;
- align-items: center;
- }
- .parts {
- position: relative;
- padding: 15px;
- margin-bottom: 30px;
- border-radius: 5px;
- box-shadow: 1px 1px 5px 1px #999;
- /deep/ .ivu-form-item {
- display: inline-block;
- width: 350px;
- }
- .parts_title {
- display: flex;
- justify-content: space-between;
- }
- .parts_content {
- font-size: 14px;
- .parts_content_attr {
- display: flex;
- justify-content: flex-start;
- align-items: center;
- flex-wrap: wrap;
- // width: 350px;
- span {
- width: 80px;
- text-align: center;
- }
- div {
- display: flex;
- width: 100%;
- justify-content: flex-start;
- align-items: center;
- margin: 5px 0;
- span {
- margin: 0 5px;
- }
- }
- }
- .parts_content_line {
- // width: 350px;
- padding-left: 17px;
- span {
- margin-right: 5px;
- }
- }
- .parts_content_lineTable,
- .parts_content_partTable,
- .parts_content_metalsTable {
- margin: 10px 0;
- }
- .parts_content_part {
- span {
- margin-right: 5px;
- }
- }
- }
- }
- }
- .similarProductModal,
- .ProcessLineModal {
- /deep/ .ivu-form-item {
- display: inline-block;
- width: 220px;
- }
- }
- .page {
- display: flex;
- justify-content: center;
- margin-top: 10px;
- }
- .hierarchy {
- .radio-g {
- padding: 10px 0;
- display: flex;
- justify-content: flex-start;
- align-items: center;
- flex-wrap: wrap;
- .radio-us {
- background: #f4f5f7;
- padding: 5px 20px;
- margin: 5px;
- margin-right: 18px;
- color: #999999;
- border-radius: 15px;
- border: 1px solid #dedede;
- cursor: pointer;
- }
- .radio-us-foc {
- color: #3764ff;
- background: #fff;
- border: 1px solid #3764ff;
- }
- .box-us {
- background: #f4f5f7;
- padding: 5px 20px;
- margin: 5px;
- margin-right: 18px;
- color: #999999;
- border-radius: 5px;
- border: 1px solid #dedede;
- cursor: pointer;
- }
- .box-us-foc {
- color: #3764ff;
- background: #fff;
- border: 1px solid #3764ff;
- }
- .radio-us-none {
- display: none;
- }
- }
- }
- .modal_process_route {
- .modal_process_route_top {
- display: flex;
- justify-content: space-around;
- padding: 10px 0;
- }
- }
- /deep/ .ivu-table-wrapper {
- overflow: visible;
- }
- /deep/ .ivu-modal {
- .modal_process_route_content {
- max-height: 500px;
- position: relative;
- overflow: hidden;
- overflow-y: auto;
- }
- }
- .SortableList {
- // display: flex;
- // justify-content: flex-start;
- // align-items: center;
- // flex-wrap: wrap;
- .SortableItem {
- .tag-modal {
- display: flex;
- align-items: center;
- .before {
- width: 20px;
- background: #3764ff;
- height: 24px;
- border-radius: 5px 0 0 5px;
- display: flex;
- justify-content: center;
- align-items: center;
- color: #fff;
- }
- }
- }
- }
- /deep/.ivu-modal-body {
- height: 700px;
- overflow: auto;
- }
- </style>
|