| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850 |
- <template>
- <el-dialog
- :title="title"
- :visible.sync="visible"
- :before-close="handleClose"
- :close-on-click-modal="false"
- :close-on-press-escape="false"
- append-to-body
- width="85%"
- >
- <el-card shadow="never">
- <header-title title="工序信息"></header-title>
- <el-form label-width="100px" ref="form" :model="rowData">
- <el-row>
- <el-col :span="6" label-width="100px">
- <el-form-item label="编码" prop="type">
- <el-input
- disabled
- placeholder="工序编码"
- v-model="rowData.code"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="6" label-width="100px">
- <el-form-item label="名称" prop="type">
- <el-input
- disabled
- placeholder="工序名称"
- v-model="rowData.controlName"
- ></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <el-tabs
- v-model="activeName"
- class="tab-box"
- type="border-card"
- @tab-click="tabsChange"
- >
- <el-tab-pane label="工艺参数" name="工艺参数">
- <ele-pro-table
- ref="table"
- :datasource="datasource"
- :immediate="true"
- :need-page="false"
- :columns="columns"
- >
- <!-- 表头工具栏 -->
- <template v-if="!isView" v-slot:toolbar>
- <el-button
- size="small"
- icon="el-icon-plus"
- class="ele-btn-icon"
- type="primary"
- @click.native="openParam('工艺')"
- >添加参数</el-button
- >
- </template>
- <template v-slot:sort="{ row }">
- <div v-if="isView">{{ row.sort }}</div>
- <el-input v-else v-model="row.sort"></el-input>
- </template>
- <!-- 默认值 -->
- <template v-slot:defaultValue="{ row }">
- <div v-if="isView">
- {{ row.defaultValue }}
- </div>
- <div v-else>
- <el-input
- v-if="
- row.textType == 1 ||
- row.textType == 4 ||
- row.textType == 3 ||
- row.textType == 5
- "
- v-model="row.defaultValue"
- placeholder="请输入"
- ></el-input>
- <el-select
- v-if="row.textType == 2"
- v-model="row.defaultValue"
- placeholder="请选择"
- >
- <el-option label="TRUE" :value="'TRUE'" />
- <el-option label="FALSE" :value="'FALSE'" />
- </el-select>
- </div>
- </template>
- <!-- 上限 -->
- <template v-slot:maxValue="{ row }">
- <div v-if="isView">
- {{ row.maxValue }}
- </div>
- <div v-else>
- <el-input
- v-if="row.textType == 3"
- v-model="row.maxValue"
- placeholder="请输入"
- ></el-input>
- </div>
- </template>
- <!-- 下限 -->
- <template v-slot:minValue="{ row }">
- <div v-if="isView">
- {{ row.minValue }}
- </div>
- <div v-else>
- <el-input
- v-if="row.textType == 3"
- v-model="row.minValue"
- placeholder="请输入"
- ></el-input>
- </div>
- </template>
- <!-- 单位 -->
- <template v-slot:unitName="{ row }">
- <div v-if="isView">
- {{ row.unitName }}
- </div>
- <div v-else>
- <DictSelection
- v-if="row.textType != 2 && row.textType != 5"
- dictName="工艺参数单位"
- clearable
- filterable
- v-model="row.unitName"
- >
- </DictSelection>
- <span v-if="row.textType == 5"> h(小时)</span>
- </div>
- </template>
- <!-- 操作列 -->
- <template v-slot:action="{ row }">
- <el-popconfirm
- class="ele-action"
- title="确定要删除当前参数吗?"
- @confirm="remove(row, '工艺')"
- >
- <template v-slot:reference>
- <el-link
- type="danger"
- :underline="false"
- icon="el-icon-delete"
- >
- 删除
- </el-link>
- </template>
- </el-popconfirm>
- </template>
- </ele-pro-table>
- </el-tab-pane>
- <el-tab-pane label="质检参数" name="质检参数">
- <ele-pro-table
- ref="qualityTable"
- :datasource="datasource"
- :immediate="true"
- :need-page="false"
- :columns="columns"
- >
- <!-- 表头工具栏 -->
- <template v-if="!isView" v-slot:toolbar>
- <el-button
- size="small"
- icon="el-icon-plus"
- class="ele-btn-icon"
- type="primary"
- @click.native="openParam('质检')"
- >添加参数</el-button
- >
- </template>
- <template v-slot:sort="{ row }">
- <div v-if="isView">{{ row.sort }}</div>
- <el-input v-else v-model="row.sort"></el-input>
- </template>
- <!-- 默认值 -->
- <template v-slot:defaultValue="{ row }">
- <div v-if="isView">
- {{ row.defaultValue }}
- </div>
- <div v-else>
- <el-input
- v-if="
- row.textType == 1 ||
- row.textType == 4 ||
- row.textType == 3 ||
- row.textType == 5
- "
- v-model="row.defaultValue"
- placeholder="请输入"
- ></el-input>
- <el-select
- v-if="row.textType == 2"
- v-model="row.defaultValue"
- placeholder="请选择"
- >
- <el-option label="TRUE" :value="'TRUE'" />
- <el-option label="FALSE" :value="'FALSE'" />
- </el-select>
- </div>
- </template>
- <!-- 上限 -->
- <template v-slot:maxValue="{ row }">
- <div v-if="isView">
- {{ row.maxValue }}
- </div>
- <div v-else>
- <el-input
- v-if="row.textType == 3"
- v-model="row.maxValue"
- placeholder="请输入"
- ></el-input>
- </div>
- </template>
- <!-- 下限 -->
- <template v-slot:minValue="{ row }">
- <div v-if="isView">
- {{ row.minValue }}
- </div>
- <div v-else>
- <el-input
- v-if="row.textType == 3"
- v-model="row.minValue"
- placeholder="请输入"
- ></el-input>
- </div>
- </template>
- <!-- 单位 -->
- <template v-slot:unitName="{ row }">
- <div v-if="isView">
- {{ row.unitName }}
- </div>
- <div v-else>
- <DictSelection
- v-if="row.textType != 2 && row.textType != 5"
- dictName="工艺参数单位"
- clearable
- filterable
- v-model="row.unitName"
- >
- </DictSelection>
- <span v-if="row.textType == 5"> h(小时)</span>
- </div>
- </template>
- <!-- 操作列 -->
- <template v-slot:action="{ row }">
- <el-popconfirm
- class="ele-action"
- title="确定要删除当前参数吗?"
- @confirm="remove(row, '工艺')"
- >
- <template v-slot:reference>
- <el-link
- type="danger"
- :underline="false"
- icon="el-icon-delete"
- >
- 删除
- </el-link>
- </template>
- </el-popconfirm>
- </template>
- </ele-pro-table>
- </el-tab-pane>
- <el-tab-pane label="生产节拍" name="生产节拍">
- <el-form label-width="100px" ref="form" :model="beatParam">
- <el-row>
- <el-col :span="16" label-width="100px">
- <el-form-item label="节拍生产数量" prop="beatNum">
- <el-input
- v-if="!isView"
- placeholder=""
- v-model="beatParam.beatNum"
- ></el-input>
- <div v-else>{{ beatParam.beatNum }}</div>
- </el-form-item>
- </el-col>
- <el-col :span="8" label-width="100px">
- <el-form-item label="单位" prop="beatUnit">
- <el-input
- v-if="!isView"
- placeholder=""
- v-model="beatParam.beatUnit"
- ></el-input>
- <div v-else>{{ beatParam.beatUnit }}</div>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="16" label-width="100px">
- <el-form-item label="对应物料数量" prop="materielNum">
- <el-input
- v-if="!isView"
- placeholder=""
- v-model="beatParam.materielNum"
- ></el-input>
- <div v-else>{{ beatParam.materielNum }}</div>
- </el-form-item>
- </el-col>
- <el-col :span="8" label-width="100px">
- <el-form-item label="单位" prop="materielUnit">
- <el-input
- v-if="!isView"
- placeholder=""
- v-model="beatParam.materielUnit"
- ></el-input>
- <div v-else>{{ beatParam.materielUnit }}</div>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="16" label-width="100px">
- <el-form-item label="节拍时间" prop="beatTime">
- <el-input
- v-if="!isView"
- placeholder=""
- v-model="beatParam.beatTime"
- ></el-input>
- <div v-else>{{ beatParam.beatTime }}</div>
- </el-form-item>
- </el-col>
- <el-col :span="8" label-width="100px">
- <el-form-item label="单位" prop="beatTimeUnit">
- <el-input
- v-if="!isView"
- placeholder=""
- v-model="beatParam.beatTimeUnit"
- ></el-input>
- <div v-else>{{ beatParam.beatTimeUnit }}</div>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="16" label-width="100px">
- <el-form-item label="节拍准备时长" prop="name">
- <el-input
- v-if="!isView"
- placeholder=""
- v-model="beatParam.beatPrepareTime"
- ></el-input>
- <div v-else>{{ beatParam.beatPrepareTime }}</div>
- </el-form-item>
- </el-col>
- <el-col :span="8" label-width="100px">
- <el-form-item label="单位" prop="name">
- <el-input
- v-if="!isView"
- placeholder=""
- v-model="beatParam.beatPrepareUnit"
- ></el-input>
- <div v-else>{{ beatParam.beatPrepareUnit }}</div>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="16" label-width="100px">
- <el-form-item label="节拍休息时长" prop="name">
- <el-input
- v-if="!isView"
- placeholder=""
- v-model="beatParam.beatRestTime"
- ></el-input>
- <div v-else>{{ beatParam.beatRestTime }}</div>
- </el-form-item>
- </el-col>
- <el-col :span="8" label-width="100px">
- <el-form-item label="单位" prop="name">
- <el-input
- v-if="!isView"
- placeholder=""
- v-model="beatParam.beatRestUnit"
- ></el-input>
- <div v-else>{{ beatParam.beatRestUnit }}</div>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="24" label-width="100px">
- <el-form-item label="备注" prop="remark">
- <el-input
- v-if="!isView"
- placeholder=""
- v-model="beatParam.remark"
- type="textarea"
- :rows="4"
- ></el-input>
- <div v-else>{{ beatParam.remark }}</div>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8" label-width="100px">
- <el-form-item label="添加人" prop="name">
- <el-input
- v-if="!isView"
- placeholder=""
- disabled
- v-model="beatParam.createName"
- ></el-input>
- <div v-else>{{ beatParam.createName }}</div>
- </el-form-item>
- </el-col>
- <el-col :span="8" label-width="100px">
- <el-form-item label="添加时间" prop="name">
- <el-input
- v-if="!isView"
- placeholder=""
- disabled
- v-model="beatParam.createTime"
- ></el-input>
- <div v-else>{{ beatParam.createTime }}</div>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8" label-width="100px">
- <el-form-item label="修改人" prop="name">
- <el-input
- v-if="!isView"
- placeholder=""
- disabled
- v-model="beatParam.updateName"
- ></el-input>
- <div v-else>{{ beatParam.updateName }}</div>
- </el-form-item>
- </el-col>
- <el-col :span="8" label-width="100px">
- <el-form-item label="最后修改时间" prop="name">
- <el-input
- v-if="!isView"
- placeholder=""
- disabled
- v-model="beatParam.updateTime"
- ></el-input>
- <div v-else>{{ beatParam.updateTime }}</div>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </el-tab-pane>
- <el-tab-pane label="标准工时" name="标准工时">
- <el-form label-width="100px" ref="form" :model="normalHours">
- <el-row>
- <el-col :span="16" label-width="100px">
- <el-form-item label="标准时长" prop="type">
- <el-input
- v-if="!isView"
- placeholder="标准时长"
- v-model="normalHours.time"
- ></el-input>
- <div v-else>{{ normalHours.time }}</div>
- </el-form-item>
- </el-col>
- <el-col :span="8" label-width="100px">
- <el-form-item label="单位" prop="type">
- <el-input
- v-if="!isView"
- placeholder="单位"
- v-model="normalHours.unit"
- ></el-input>
- <div v-else>{{ normalHours.unit }}</div>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="24" label-width="100px">
- <el-form-item label="备注" prop="remark">
- <el-input
- v-if="!isView"
- placeholder=""
- v-model="normalHours.remark"
- type="textarea"
- :rows="4"
- ></el-input>
- <div v-else>{{ normalHours.remark }}</div>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </el-tab-pane>
- <el-tab-pane label="材料定额" name="材料定额">
- <ele-pro-table
- ref="materialTable"
- :columns="columns1"
- :datasource="datasource"
- :need-page="false"
- :immediate="true"
- >
- <!-- 表头工具栏 -->
- <template v-if="!isView" v-slot:toolbar>
- <el-button type="primary" @click="add">添加</el-button>
- <div class="toolbar_box">
- <div
- ><span>基本数量</span>
- <el-input placeholder="请输入" v-model.number="baseCount">
- </el-input>
- <DictSelection dictName="计量单位" v-model="baseCountUnit"
- /></div>
- </div>
- </template>
- <template v-slot:action="{ row, $index }">
- <el-link type="primary" @click="handleDel(row, $index)"
- >删除</el-link
- >
- </template>
- <template v-slot:subCode="{ row }">
- <div v-if="isView">{{ row.subCode }}</div>
- <el-input
- v-else
- v-model="row.subCode"
- placeholder="请输入"
- ></el-input>
- </template>
- <template v-slot:isReworkBom="{ row }">
- <div v-if="isView">{{ isReworkBom[row.isReworkBom] }}</div>
- <div v-else>
- <el-select v-model="row.isReworkBom">
- <el-option
- v-for="item in isReworkBomList"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </div>
- </template>
- <template v-slot:unit="{ row }">
- <div v-if="isView">{{ row.unit }}</div>
- <div v-else>
- <DictSelection
- dictName="计量单位"
- v-model="row.unit"
- ></DictSelection>
- </div>
- </template>
- <template v-slot:count="{ row }">
- <div v-if="isView">{{ row.count }}</div>
- <el-input
- v-else
- v-model="row.count"
- placeholder="请输入"
- @input="
- (value) =>
- (row.count = value.replace(
- /^(-)*(\d+)\.(\d\d\d\d\d\d).*$/,
- '$1$2.$3'
- ))
- "
- ></el-input>
- </template>
- <template v-slot:categoryName="{ row, $index }">
- <div v-if="isView">{{ row.categoryName }}</div>
- <div v-else
- ><el-input
- :value="row.categoryName"
- placeholder="请选择"
- @click.native="categorySelect(row, $index)"
- ></el-input
- ></div>
- </template>
- <template v-slot:bomArtFiles="{ row }">
- <div v-if="isView">附件</div>
- <div v-else
- ><div class="downLoad">
- <fileUpload
- v-model="filedList"
- :show-file-list="false"
- module="main"
- @input="uploadedSuccess($event, row)"
- :showLib="false"
- :limit="1"
- />
- <div v-if="row.bomArtFiles">
- <el-button
- style="margin-left: 10px"
- size="mini"
- type="primary"
- @click="downloadFile(row.bomArtFiles)"
- >下载</el-button
- >
- </div></div
- >
- </div>
- </template>
- <template v-slot:remark="{ row }">
- <div v-if="isView">{{ row.remark }}</div>
- <el-input
- v-else
- v-model="row.remark"
- placeholder="请输入"
- ></el-input>
- </template>
- </ele-pro-table>
- </el-tab-pane>
- <el-tab-pane label="制造资源" name="制造资源">
- <ele-pro-table
- ref="resourceTable"
- :columns="columns1"
- :datasource="datasource"
- :need-page="false"
- :immediate="true"
- >
- <!-- 表头工具栏 -->
- <template v-if="!isView" v-slot:toolbar>
- <el-button type="primary" @click="add">添加</el-button>
- </template>
- <template v-slot:action="{ row, $index }">
- <el-link type="primary" @click="handleDel(row, $index)"
- >删除</el-link
- >
- </template>
- <template v-slot:subCode="{ row }">
- <div v-if="isView">{{ row.subCode }}</div>
- <el-input
- v-else
- v-model="row.subCode"
- placeholder="请输入"
- ></el-input>
- </template>
- <template v-slot:isReworkBom="{ row }">
- <div v-if="isView">{{ isReworkBom[row.isReworkBom] }}</div>
- <div v-else>
- <el-select v-model="row.isReworkBom">
- <el-option
- v-for="item in isReworkBomList"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </div>
- </template>
- <template v-slot:unit="{ row }">
- <div v-if="isView">{{ row.unit }}</div>
- <div v-else>
- <DictSelection
- dictName="计量单位"
- v-model="row.unit"
- ></DictSelection>
- </div>
- </template>
- <template v-slot:count="{ row }">
- <div v-if="isView">{{ row.count }}</div>
- <el-input
- v-else
- v-model="row.count"
- placeholder="请输入"
- @input="
- (value) =>
- (row.count = value.replace(
- /^(-)*(\d+)\.(\d\d\d\d\d\d).*$/,
- '$1$2.$3'
- ))
- "
- ></el-input>
- </template>
- <template v-slot:categoryName="{ row, $index }">
- <div v-if="isView">{{ row.categoryName }}</div>
- <div v-else
- ><el-input
- :value="row.categoryName"
- placeholder="请选择"
- @click.native="categorySelect(row, $index)"
- ></el-input
- ></div>
- </template>
- <template v-slot:bomArtFiles="{ row }">
- <div v-if="isView">附件</div>
- <div v-else
- ><div class="downLoad">
- <fileUpload
- v-model="filedList"
- :show-file-list="false"
- module="main"
- @input="uploadedSuccess($event, row)"
- :showLib="false"
- :limit="1"
- />
- <div v-if="row.bomArtFiles">
- <el-button
- style="margin-left: 10px"
- size="mini"
- type="primary"
- @click="downloadFile(row.bomArtFiles)"
- >下载</el-button
- >
- </div></div
- >
- </div>
- </template>
- <template v-slot:remark="{ row }">
- <div v-if="isView">{{ row.remark }}</div>
- <el-input
- v-else
- v-model="row.remark"
- placeholder="请输入"
- ></el-input>
- </template>
- </ele-pro-table>
- </el-tab-pane>
- <el-tab-pane label="替代料" name="替代料">
- <ele-pro-table
- ref="replaceMaterialTable"
- :columns="columns1"
- :datasource="datasource"
- :need-page="false"
- :immediate="true"
- >
- <!-- 表头工具栏 -->
- <template v-if="!isView" v-slot:toolbar>
- <el-button type="primary" @click="add">添加</el-button>
- </template>
- <template v-slot:action="{ row, $index }">
- <el-link type="primary" @click="handleDel(row, $index)"
- >删除</el-link
- >
- </template>
- <template v-slot:subCode="{ row }">
- <div v-if="isView">{{ row.subCode }}</div>
- <el-input
- v-else
- v-model="row.subCode"
- placeholder="请输入"
- ></el-input>
- </template>
- <template v-slot:isReworkBom="{ row }">
- <div v-if="isView">{{ isReworkBom[row.isReworkBom] }}</div>
- <div v-else>
- <el-select v-model="row.isReworkBom">
- <el-option
- v-for="item in isReworkBomList"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </div>
- </template>
- <template v-slot:unit="{ row }">
- <div v-if="isView">{{ row.unit }}</div>
- <div v-else>
- <DictSelection
- dictName="计量单位"
- v-model="row.unit"
- ></DictSelection>
- </div>
- </template>
- <template v-slot:count="{ row }">
- <div v-if="isView">{{ row.count }}</div>
- <el-input
- v-else
- v-model="row.count"
- placeholder="请输入"
- @input="
- (value) =>
- (row.count = value.replace(
- /^(-)*(\d+)\.(\d\d\d\d\d\d).*$/,
- '$1$2.$3'
- ))
- "
- ></el-input>
- </template>
- <template v-slot:categoryName="{ row, $index }">
- <div v-if="isView">{{ row.categoryName }}</div>
- <div v-else
- ><el-input
- :value="row.categoryName"
- placeholder="请选择"
- @click.native="categorySelect(row, $index)"
- ></el-input
- ></div>
- </template>
- <template v-slot:bomArtFiles="{ row }">
- <div v-if="isView">附件</div>
- <div v-else
- ><div class="downLoad">
- <fileUpload
- v-model="filedList"
- :show-file-list="false"
- module="main"
- @input="uploadedSuccess($event, row)"
- :showLib="false"
- :limit="1"
- />
- <div v-if="row.bomArtFiles">
- <el-button
- style="margin-left: 10px"
- size="mini"
- type="primary"
- @click="downloadFile(row.bomArtFiles)"
- >下载</el-button
- >
- </div></div
- >
- </div>
- </template>
- <template v-slot:remark="{ row }">
- <div v-if="isView">{{ row.remark }}</div>
- <el-input
- v-else
- v-model="row.remark"
- placeholder="请输入"
- ></el-input>
- </template>
- </ele-pro-table>
- </el-tab-pane>
- <el-tab-pane label="工种" name="工种">
- <ele-pro-table
- ref="jobTable"
- :columns="jobColumns"
- :datasource="datasource"
- row-key="id"
- >
- <!-- 表头工具栏 -->
- <template v-slot:toolbar>
- <el-button
- size="small"
- type="primary"
- icon="el-icon-plus"
- class="ele-btn-icon"
- @click="addJob"
- >新增</el-button
- >
- </template>
- <template v-slot:action="{ row, $index }">
- <el-link type="primary" @click="handleDel(row, $index)"
- >删除</el-link
- >
- </template>
- </ele-pro-table>
- </el-tab-pane>
- <el-tab-pane label="工艺文件" name="工艺文件">
- <ele-pro-table
- ref="fileTable"
- :columns="jobColumns1"
- :datasource="datasource"
- :need-page="false"
- :immediate="true"
- >
- <!-- 表头工具栏 -->
- <template v-if="!isView" v-slot:toolbar>
- <el-button type="primary" @click="addFile">添加</el-button>
- </template>
- <template v-slot:action="{ row, $index }">
- <el-link type="primary" @click="handleDel(row, $index)"
- >删除</el-link
- >
- </template>
- <template v-slot:type="{ row }">
- <div v-if="isView">{{ row.type }}</div>
- <el-input
- v-else
- v-model="row.type"
- placeholder="请输入"
- ></el-input>
- </template>
- <template v-slot:code="{ row }">
- <div v-if="isView">{{ row.code }}</div>
- <el-input
- v-else
- v-model="row.code"
- placeholder="请输入"
- ></el-input>
- </template>
- <template v-slot:versions="{ row }">
- <div v-if="isView">{{ row.versions }}</div>
- <el-input
- v-else
- v-model="row.versions"
- placeholder="请输入"
- ></el-input>
- </template>
- <template v-slot:status="{ row }">
- <div v-if="isView">{{
- statusOption.filter((item) => item.value == row.status)[0].label
- }}</div>
- <div v-else>
- <template>
- <el-select v-model="row.status" placeholder="请选择">
- <el-option
- v-for="item in statusOption"
- :label="item.label"
- :value="item.value"
- :key="item.value"
- >
- </el-option>
- </el-select>
- </template>
- </div>
- </template>
- <template v-slot:path="{ row }">
- <div v-if="isView">附件</div>
- <div v-else
- ><div class="downLoad">
- <fileUpload
- v-model="jobFiledList"
- :show-file-list="false"
- module="main"
- @input="uploadedJobSuccess($event, row)"
- :showLib="false"
- :limit="1"
- />
- <div v-if="row.path">
- <el-button
- style="margin-left: 10px"
- size="mini"
- type="primary"
- @click="downloadFile(row.path)"
- >下载</el-button
- >
- </div></div
- >
- </div>
- </template>
- <template v-slot:remark="{ row }">
- <div v-if="isView">{{ row.remark }}</div>
- <el-input
- v-else
- v-model="row.remark"
- placeholder="请输入"
- ></el-input>
- </template>
- </ele-pro-table>
- </el-tab-pane>
- <el-tab-pane label="标准产出" name="标准产出">
- <ele-pro-table
- ref="fileTable"
- :columns="jobColumns1"
- :datasource="datasource"
- :need-page="false"
- :immediate="true"
- >
- <!-- 表头工具栏 -->
- <template v-if="!isView" v-slot:toolbar>
- <el-button type="primary" @click="addFile">添加</el-button>
- </template>
- <template v-slot:action="{ row, $index }">
- <el-link type="primary" @click="handleDel(row, $index)"
- >删除</el-link
- >
- </template>
- <template v-slot:type="{ row }">
- <div v-if="isView">{{ row.type }}</div>
- <el-input
- v-else
- v-model="row.type"
- placeholder="请输入"
- ></el-input>
- </template>
- <template v-slot:code="{ row }">
- <div v-if="isView">{{ row.code }}</div>
- <el-input
- v-else
- v-model="row.code"
- placeholder="请输入"
- ></el-input>
- </template>
- <template v-slot:versions="{ row }">
- <div v-if="isView">{{ row.versions }}</div>
- <el-input
- v-else
- v-model="row.versions"
- placeholder="请输入"
- ></el-input>
- </template>
- <template v-slot:status="{ row }">
- <div v-if="isView">{{
- statusOption.filter((item) => item.value == row.status)[0].label
- }}</div>
- <div v-else>
- <template>
- <el-select v-model="row.status" placeholder="请选择">
- <el-option
- v-for="item in statusOption"
- :label="item.label"
- :value="item.value"
- :key="item.value"
- >
- </el-option>
- </el-select>
- </template>
- </div>
- </template>
- <template v-slot:path="{ row }">
- <div v-if="isView">附件</div>
- <div v-else
- ><div class="downLoad">
- <fileUpload
- v-model="jobFiledList"
- :show-file-list="false"
- module="main"
- @input="uploadedJobSuccess($event, row)"
- :showLib="false"
- :limit="1"
- />
- <div v-if="row.path">
- <el-button
- style="margin-left: 10px"
- size="mini"
- type="primary"
- @click="downloadFile(row.path)"
- >下载</el-button
- >
- </div></div
- >
- </div>
- </template>
- <template v-slot:remark="{ row }">
- <div v-if="isView">{{ row.remark }}</div>
- <el-input
- v-else
- v-model="row.remark"
- placeholder="请输入"
- ></el-input>
- </template>
- </ele-pro-table>
- </el-tab-pane>
- </el-tabs>
- </el-card>
- <!-- 选择工艺参数 -->
- <jobDialog ref="jobRef" @chooseModal="chooseJob"></jobDialog>
- <ParamModal ref="paramRefs" @chooseModal="chooseModal"></ParamModal>
- <ProductModal ref="productRefs" @changeProduct="determineChoose" />
- <ProductModalMultiple
- ref="productMultipleRefs"
- @selection="addProductList"
- ></ProductModalMultiple>
- <div class="btns">
- <el-button type="primary" size="small" @click="save">{{
- isView ? '确定' : '保存'
- }}</el-button>
- <el-button size="small" @click="handleClose">关闭</el-button>
- </div>
- </el-dialog>
- </template>
- <script>
- import dictMixins from '@/mixins/dictMixins';
- import * as dayjs from 'dayjs';
- import { getFile } from '@/api/system/file';
- import fileUpload from '@/components/upload/fileUpload';
- import { workingProcedureUpdate } from '@/api/material/BOM';
- import ParamModal from '@/views/technology/productParam/components/ParamModal.vue';
- import ProductModal from '@/components/select/bom/ProductModal.vue';
- import ProductModalMultiple from './ProductModalMultiple.vue';
- import userSearch from './user-search.vue';
- import jobDialog from './jobDialog.vue';
- export default {
- components: {
- userSearch,
- ParamModal,
- fileUpload,
- ProductModal,
- jobDialog,
- ProductModalMultiple
- },
- mixins: [dictMixins],
- data() {
- return {
- baseCount: '',
- baseCountUnit: '',
- isView: false,
- filedList: [],
- jobFiledList: [],
- activeName: '工艺参数',
- attributeData: {},
- visible: false,
- title: '配置',
- form: {},
- statusOption: [
- {
- label: '启用',
- value: 1
- },
- {
- label: '停用',
- value: 0
- }
- ],
- isReworkBom: ['否', '是'],
- isReworkBomList: [
- { label: '否', value: 0 },
- { label: '是', value: 1 }
- ],
- // 表格列配置
- columns1: [],
- defaultColumns1: [
- {
- type: 'index',
- width: 55,
- align: 'center'
- },
- {
- label: '子项编号',
- prop: 'subCode',
- slot: 'subCode',
- action: 'subCode'
- },
- {
- label: '物料名称',
- prop: 'categoryName',
- slot: 'categoryName',
- action: 'categoryName'
- },
- {
- label: '是否回收料',
- prop: 'isReworkBom',
- slot: 'isReworkBom',
- action: 'isReworkBom'
- },
- {
- label: '编码',
- prop: 'categoryCode'
- },
- {
- label: '牌号',
- prop: 'brandNum'
- },
- {
- label: '型号',
- prop: 'modelType'
- },
- {
- label: '数量',
- slot: 'count',
- action: 'count'
- },
- {
- label: '单位',
- slot: 'unit',
- action: 'unit'
- },
- {
- label: '附件',
- slot: 'bomArtFiles',
- action: 'bomArtFiles',
- minWidth: 150
- },
- {
- label: '备注',
- slot: 'remark',
- action: 'remark'
- }
- ],
- columns: [],
- // 表格列配置
- defaultColumns: [
- {
- prop: 'sort',
- slot: 'sort',
- label: '排序',
- minWidth: 60
- },
- {
- prop: 'code',
- label: '参数编码',
- showOverflowTooltip: true,
- align: 'center',
- minWidth: 110
- },
- {
- prop: 'name',
- label: '参数名称',
- showOverflowTooltip: true,
- align: 'center',
- minWidth: 110
- },
- {
- align: 'center',
- prop: 'description',
- label: '文本描述',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'maxValue',
- slot: 'maxValue',
- label: '参数上限',
- align: 'center'
- },
- {
- prop: 'minValue',
- slot: 'minValue',
- label: '参数下限',
- align: 'center'
- },
- {
- prop: 'defaultValue',
- slot: 'defaultValue',
- label: '默认值',
- align: 'center'
- }
- ],
- levelOptions: [
- {
- label: '初级',
- value: '1'
- },
- {
- label: '中级',
- value: '2'
- },
- {
- label: '高级',
- value: '3'
- }
- ],
- // 表格列配置
- jobColumns: [
- {
- label: '序号',
- type: 'index',
- width: 55,
- align: 'center'
- },
- {
- slot: 'type',
- label: '类型',
- showOverflowTooltip: true,
- align: 'center',
- minWidth: 110,
- formatter: (_row) => {
- return this.getDictValue('工种类型', _row.type);
- }
- },
- {
- align: 'center',
- prop: 'code',
- label: '编码',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- slot: 'name',
- prop: 'name',
- label: '名称',
- showOverflowTooltip: true,
- align: 'center',
- minWidth: 110
- },
- {
- slot: 'level',
- prop: 'level',
- label: '等级',
- showOverflowTooltip: true,
- align: 'center',
- minWidth: 110,
- formatter: (_row) => {
- return this.levelOptions.filter(
- (item) => _row.level == item.value
- )[0].label;
- }
- },
- {
- slot: 'hourCost',
- prop: 'hourCost',
- label: '标准工时费',
- showOverflowTooltip: true,
- align: 'center',
- minWidth: 110
- },
- {
- columnKey: 'action',
- label: '操作',
- width: 260,
- align: 'center',
- resizable: false,
- slot: 'action',
- showOverflowTooltip: true
- }
- ],
- // 表格选中数据
- jobColumns1: [
- {
- label: '序号',
- type: 'index',
- width: 55,
- align: 'center'
- },
- {
- slot: 'type',
- prop: 'type',
- label: '类型',
- showOverflowTooltip: true,
- align: 'center',
- minWidth: 110
- },
- {
- slot: 'code',
- prop: 'code',
- label: '编码',
- showOverflowTooltip: true,
- align: 'center',
- minWidth: 110
- },
- {
- slot: 'name',
- prop: 'name',
- label: '名称',
- showOverflowTooltip: true,
- align: 'center',
- minWidth: 110
- },
- {
- slot: 'path',
- prop: 'path',
- label: '附件',
- showOverflowTooltip: true,
- align: 'center',
- minWidth: 200
- },
- {
- slot: 'versions',
- prop: 'versions',
- label: '版本',
- showOverflowTooltip: true,
- align: 'center',
- minWidth: 110
- },
- {
- slot: 'status',
- prop: 'status',
- label: '状态',
- showOverflowTooltip: true,
- align: 'center',
- minWidth: 110
- },
- {
- prop: 'createName',
- label: '创建人',
- showOverflowTooltip: true,
- align: 'center',
- minWidth: 110
- },
- {
- prop: 'createTime',
- label: '创建时间',
- showOverflowTooltip: true,
- align: 'center',
- minWidth: 110
- },
- {
- columnKey: 'action',
- label: '操作',
- width: 260,
- align: 'center',
- resizable: false,
- slot: 'action',
- showOverflowTooltip: true
- }
- ],
- rowData: {},
- treeData: {},
- currentIndex: 0,
- tableData: {},
- beatParam: {},
- normalHours: {}
- };
- },
- created() {
- this.requestDict('工种类型');
- },
- methods: {
- addFile() {
- let userInfo = JSON.parse(localStorage.getItem('info'));
- this.tableData.taskParam[this.currentIndex]['fileParam'].push({
- code: '',
- type: '',
- name: '',
- versions: '',
- name: '',
- status: 1,
- createName: userInfo.name,
- createTime: dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss')
- });
- this.$refs.fileTable.setData(
- this.tableData.taskParam[this.currentIndex]['fileParam']
- );
- },
- addJob() {
- this.$refs.jobRef.open();
- },
- chooseJob(data) {
- this.$refs.jobTable.setData([
- ...data,
- ...this.$refs.jobTable.getData()
- ]);
- this.$set(
- this.tableData.taskParam[this.currentIndex],
- 'aptitudeParam',
- this.$refs.jobTable.getData()
- );
- },
- determineChoose(title, row, idx) {
- let type = '';
- if (this.activeName === '材料定额') {
- type = 'materialQuota';
- } else if (this.activeName === '制造资源') {
- type = 'resource';
- } else if (this.activeName === '替代料') {
- type = 'replaceMaterial';
- }
- if (title == '选择物料') {
- this.$set(
- this.tableData.taskParam[this.currentIndex][type][idx],
- 'categoryName',
- row.name
- );
- this.$set(
- this.tableData.taskParam[this.currentIndex][type][idx],
- 'categoryId',
- row.id
- );
- this.$set(
- this.tableData.taskParam[this.currentIndex][type][idx],
- 'categoryCode',
- row.code
- );
- this.$set(
- this.tableData.taskParam[this.currentIndex][type][idx],
- 'unit',
- row.measuringUnit
- );
- this.$set(
- this.tableData.taskParam[this.currentIndex][type][idx],
- 'weightUnit',
- row.weightUnit
- );
- this.$set(
- this.tableData.taskParam[this.currentIndex][type][idx],
- 'brandNum',
- row.brandNum
- );
- this.$set(
- this.tableData.taskParam[this.currentIndex][type][idx],
- 'modelType',
- row.modelType
- );
- }
- },
- uploadedSuccess(data, row) {
- row.bomArtFiles = data[0].storePath;
- this.filedList = [];
- },
- uploadedJobSuccess(data, row) {
- row.path = data[0].storePath;
- row.name = data[0].name;
- this.jobFiledList = [];
- },
- downloadFile(url) {
- getFile({ objectName: url }, '附件');
- },
- categorySelect(row, idx) {
- this.$refs.productRefs.open(row, '选择物料', '1', idx);
- },
- handleDel(row, index) {
- let type = '';
- if (this.activeName === '材料定额') {
- type = 'materialQuota';
- } else if (this.activeName === '制造资源') {
- type = 'resource';
- } else if (this.activeName === '替代料') {
- type = 'replaceMaterial';
- } else if (this.activeName === '工种') {
- type = 'aptitudeParam';
- } else if (this.activeName === '工艺文件') {
- type = 'fileParam';
- }
- this.tableData.taskParam[this.currentIndex][type].splice(index, 1);
- },
- addProductList(list) {
- console.log(list);
- let subCode = 0;
- let array = [];
- list.map((item, index) => {
- // let max = '';
- // if (
- // this.tableData.taskParam[this.currentIndex]['materialQuota']
- // .length > 0
- // ) {
- // max = Number(
- // Math.max(
- // ...this.tableData.taskParam[this.currentIndex][
- // 'materialQuota'
- // ].map((i) => i.subCode)
- // )
- // );
- // subCode = max + index + 1;
- // } else {
- // max = 1;
- // subCode = max + index;
- // }
- let max = '';
- if (
- this.tableData.taskParam[this.currentIndex]['materialQuota']
- .length > 0
- ) {
- max =
- Math.max(
- ...this.tableData.taskParam[this.currentIndex][
- 'materialQuota'
- ].map((i) => i.subCode)
- ) +
- 10 * ++index +
- '';
- console.log(max);
- if (max.length < 4) {
- max = new Array(4 - max.length).fill('0').join('') + max;
- }
- } else {
- max = 10 * ++index + '';
- if (max.length < 4) {
- max = new Array(4 - max.length).fill('0').join('') + max;
- }
- }
- subCode = max.substring(0, max.length - 1) + '0';
- array.push({
- subCode,
- categoryId: item.categoryId,
- categoryName: item.name,
- categoryCode: item.categoryCode,
- isReworkBom: 0,
- brandNum: item.brandNum,
- weightUnit: item.weightUnit,
- count: '',
- modelType: item.modelType,
- unit: item.measuringUnit
- });
- });
- console.log(array);
- this.tableData.taskParam[this.currentIndex].materialQuota =
- this.tableData.taskParam[this.currentIndex].materialQuota.concat(
- array
- );
- console.log(this.tableData.taskParam[this.currentIndex].materialQuota);
- this.$refs.materialTable.setData(
- this.tableData.taskParam[this.currentIndex].materialQuota
- );
- },
- add() {
- let subCode = '0010';
- let type = '';
- if (this.activeName === '材料定额') {
- this.$refs.productMultipleRefs.open(1);
- return;
- } else if (this.activeName === '制造资源') {
- type = 'resource';
- } else if (this.activeName === '替代料') {
- type = 'replaceMaterial';
- }
- console.log(this.tableData.taskParam[this.currentIndex]);
- if (this.tableData.taskParam[this.currentIndex][type].length) {
- let max =
- Math.max(
- ...this.tableData.taskParam[this.currentIndex][type].map(
- (i) => i.subCode
- )
- ) +
- 10 +
- '';
- if (max.length < 4) {
- max = new Array(4 - max.length).fill('0').join('') + max;
- }
- subCode = max.substring(0, max.length - 1) + '0';
- }
- this.tableData.taskParam[this.currentIndex][type].push({
- subCode,
- categoryId: '',
- categoryName: '',
- isReworkBom: 0,
- brandNum: '',
- count: '',
- modelType: '',
- unit: ''
- });
- },
- /* 表格数据源 */
- async datasource() {
- return [];
- },
- tabsChange() {
- console.log(this.activeName);
- console.log(this.tableData.taskParam[this.currentIndex]);
- if (this.activeName === '工艺参数') {
- // 工艺参数
- this.$refs.table.setData(
- this.tableData.taskParam[this.currentIndex].produceList || []
- );
- } else if (this.activeName === '质检参数') {
- // 质检参数
- this.$refs.qualityTable.setData(
- this.tableData.taskParam[this.currentIndex].qualityParam || []
- );
- } else if (this.activeName === '生产节拍') {
- console.log(this.tableData.taskParam[this.currentIndex].beatParam);
- this.beatParam =
- this.tableData.taskParam[this.currentIndex].beatParam || {};
- } else if (this.activeName === '标准工时') {
- this.normalHours =
- this.tableData.taskParam[this.currentIndex].normalHours || {};
- } else if (this.activeName === '材料定额') {
- this.$refs.materialTable.setData(
- this.tableData.taskParam[this.currentIndex].materialQuota || []
- );
- } else if (this.activeName === '制造资源') {
- this.$refs.resourceTable.setData(
- this.tableData.taskParam[this.currentIndex].resource || []
- );
- } else if (this.activeName === '替代料') {
- this.$refs.replaceMaterialTable.setData(
- this.tableData.taskParam[this.currentIndex].replaceMaterial || []
- );
- } else if (this.activeName === '工种') {
- if (
- JSON.stringify(
- this.tableData.taskParam[this.currentIndex].aptitudeParam
- ) == '{}'
- ) {
- this.tableData.taskParam[this.currentIndex].aptitudeParam = [];
- this.$refs.jobTable.setData([]);
- } else {
- this.$refs.jobTable.setData(
- this.tableData.taskParam[this.currentIndex].aptitudeParam
- );
- }
- } else if (this.activeName === '工艺文件') {
- if (
- JSON.stringify(
- this.tableData.taskParam[this.currentIndex].fileParam
- ) == '{}'
- ) {
- this.tableData.taskParam[this.currentIndex].fileParam = [];
- this.$refs.fileTable.setData([]);
- } else {
- this.$refs.fileTable.setData(
- this.tableData.taskParam[this.currentIndex].fileParam
- );
- }
- }
- },
- openParam(type) {
- let tableData = [];
- if (type === '工艺') {
- tableData = this.$refs.table.getData();
- } else {
- tableData = this.$refs.qualityTable.getData();
- }
- this.$refs.paramRefs.open(tableData);
- },
- chooseModal(data) {
- let dom = null;
- if (this.activeName === '工艺参数') {
- dom = this.$refs.table;
- } else if (this.activeName === '质检参数') {
- dom = this.$refs.qualityTable;
- }
- dom.setData([...data, ...dom.getData()]);
- this.$set(
- this.tableData.taskParam[this.currentIndex],
- this.activeName === '工艺参数' ? 'produceList' : 'qualityParam',
- dom.getData()
- );
- },
- remove(row, type) {
- let dom = null;
- if (type === '工艺') {
- dom = this.$refs.table;
- } else {
- dom = this.$refs.qualityTable;
- }
- const data = dom.getData();
- if (row.id) {
- dom.setData(data.filter((d) => d.id !== row.id));
- } else {
- dom.setData(data.filter((d) => d.paramId !== row.paramId));
- }
- this.$set(
- this.tableData.taskParam[this.currentIndex],
- type === '工艺' ? 'produceList' : 'qualityParam',
- dom.getData()
- );
- },
- open(rowData, treeData, tableData, isView) {
- this.columns = [];
- this.columns1 = [];
- this.isView = isView;
- if (!this.isView) {
- this.columns = this.defaultColumns.concat({
- columnKey: 'action',
- label: '操作',
- align: 'center',
- resizable: false,
- slot: 'action',
- showOverflowTooltip: true
- });
- this.columns1 = this.defaultColumns1.concat({
- action: 'action',
- slot: 'action',
- label: '操作'
- });
- } else {
- this.columns = this.defaultColumns;
- this.columns1 = this.defaultColumns1;
- }
- this.rowData = JSON.parse(JSON.stringify(rowData));
- this.treeData = JSON.parse(JSON.stringify(treeData));
- this.tableData = JSON.parse(JSON.stringify(tableData));
- this.currentIndex = tableData.taskParam.findIndex(
- (item) => item.id === rowData.id
- );
- this.activeName = '工艺参数';
- this.visible = true;
- setTimeout(() => {
- console.log(this.$refs);
- // 工艺参数
- this.$refs.table.setData(
- this.tableData.taskParam[this.currentIndex].produceList
- );
- }, 500);
- },
- handleClose() {
- this.visible = false;
- this.$refs.table.setSelectedRows([]);
- this.selection = [];
- },
- save() {
- if (this.isView) {
- this.handleClose();
- } else {
- // 保存生产节拍
- let userInfo = JSON.parse(localStorage.getItem('info'));
- this.beatParam.createName = userInfo.name;
- this.beatParam.createTime = dayjs(new Date()).format(
- 'YYYY-MM-DD HH:mm:ss'
- );
- this.beatParam.updateName = userInfo.name;
- this.beatParam.updateTime = dayjs(new Date()).format(
- 'YYYY-MM-DD HH:mm:ss'
- );
- this.tableData.taskParam[this.currentIndex].beatParam =
- this.beatParam;
- // 保存标准工时
- this.tableData.taskParam[this.currentIndex].normalHours =
- this.normalHours;
- // 保存材料定额
- this.tableData.taskParam[this.currentIndex].baseCount =
- this.baseCount;
- this.tableData.taskParam[this.currentIndex].baseCountUnit =
- this.baseCountUnit;
- workingProcedureUpdate({
- id: this.tableData.id,
- categoryId: this.treeData.categoryId,
- bomCategoryId: this.treeData.id,
- categoryCode: this.treeData.categoryCode,
- taskParam: this.tableData.taskParam
- }).then(() => {
- this.$message.success('保存成功');
- this.$emit('chooseProcess');
- this.handleClose();
- });
- }
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .btns {
- text-align: center;
- padding: 10px 0;
- }
- .downLoad {
- display: flex;
- }
- .toolbar_box {
- float: right;
- margin-right: 10px;
- > div {
- display: flex;
- align-items: center;
- justify-content: center;
- > span {
- width: 150px;
- }
- > div {
- margin-left: 10px;
- }
- }
- }
- </style>
|