| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887 |
- <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="deviceTabRef"
- :columns="standardCol"
- :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="danger" @click="handleDel(row, $index)"
- >删除</el-link
- >
- </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="standard"
- :columns="standardCol"
- :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="danger" @click="handleDel(row, $index)"
- >删除</el-link
- >
- </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>
- <standardOutput
- ref="standardOutputRefs"
- @selection="chooseStandardList"
- ></standardOutput>
- <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';
- import standardOutput from './standardOutput.vue';
- export default {
- components: {
- userSearch,
- ParamModal,
- fileUpload,
- ProductModal,
- jobDialog,
- ProductModalMultiple,
- standardOutput
- },
- 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
- }
- ],
- standardCol: [
- {
- prop: 'code',
- label: '编码'
- },
- {
- prop: 'name',
- label: '名称',
- showOverflowTooltip: true
- },
- {
- prop: 'brandNum',
- label: '牌号'
- },
- {
- prop: 'modelType',
- label: '型号',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'specification',
- label: '规格',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'measuringUnit',
- label: '计量单位',
- showOverflowTooltip: true,
- minWidth: 90
- },
- {
- columnKey: 'action',
- label: '操作',
- 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';
- } else if (this.activeName === '标准产出') {
- type = 'standardOutput';
- } else if (this.activeName === '关键设备') {
- type = 'standardDevice';
- }
- 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 === '标准产出') {
- this.$refs.standardOutputRefs.open(9);
- return;
- } else if (this.activeName === '关键设备') {
- this.$refs.standardOutputRefs.open(4);
- 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
- );
- }
- } else if (this.activeName === '标准产出') {
- this.$refs.standard.setData(
- this.tableData.taskParam[this.currentIndex].standardOutput || []
- );
- } else if (this.activeName === '关键设备') {
- this.$refs.deviceTabRef.setData(
- this.tableData.taskParam[this.currentIndex].standardDevice || []
- );
- }
- },
- 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()
- );
- },
- chooseStandardList(type, data) {
- let dom = null;
- if (type == 9) {
- dom = this.$refs.standard;
- dom.setData([data[0]]);
- this.$set(
- this.tableData.taskParam[this.currentIndex],
- 'standardOutput',
- dom.getData()
- );
- } else if (type == 4) {
- dom = this.$refs.deviceTabRef;
- dom.setData([data[0]]);
- this.$set(
- this.tableData.taskParam[this.currentIndex],
- 'standardDevice',
- 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>
|