123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226 |
- <template>
- <div class="balanceSheetData">
- <div class="box">
- <div class="box-top">
- <el-form
- style="overflow: hidden;"
- :style="filterForm.show ? null : { height: '0px' }"
- size="mini"
- label-width="70px"
- >
- <el-row>
- <el-col :span="6">
- <el-form-item label="排产日期">
- <zj-timegran-date
- v-model="filterForm.data.clock"
- style="width: 100%;"
- :type="'daterange'"
- :oneFoo="getTableData"
- :custom ="1"
- ></zj-timegran-date>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="编号">
- <el-input
- v-model="filterForm.data.Gmid"
- style="width: 100%;"
- refcous="true"
- ></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div class="box-top-gjl">
- <el-button
- class="button"
- type="primary"
- size="mini"
- icon="el-icon-plus"
- v-privilege="activeMenu + 'ADD'"
- @click="but_addNBJH()"
- >新增内部计划</el-button>
- <el-button
- class="button"
- type="primary"
- size="mini"
- icon="el-icon-plus"
- v-privilege="activeMenu + 'ADD'"
- @click="but_add(1)"
- >新增子计划</el-button>
- <div style="float:right; text-align: right;">
- <el-radio-group v-model="radio" @change="radioChange()">
- <el-radio :label="0">
- 展开编辑
- </el-radio>
- <el-radio :label="1">
- 取消展开
- </el-radio>
- </el-radio-group>
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-add-outline"
- @click="edit_plural()"
- >强制修改</el-button>
- <el-button
- type="primary"
- size="mini"
- icon="el-icon-search"
- v-privilege="activeMenu + 'QUERY'"
- @click="getTableData(1)"
- >查询</el-button>
- <el-button
- type="primary"
- size="mini"
- icon="el-icon-add-outline"
- @click="but_edit_plural()"
- >保存</el-button>
- <el-button
- type="primary"
- size="mini"
- icon="el-icon-add-outline"
- @click="issue()"
- >下发</el-button>
- <!-- <el-button
- type="primary"
- size="mini"
- icon="el-icon-add-outline"
- @click="audit()"
- >审核</el-button> -->
- <el-button
- type="primary"
- size="mini"
- icon="el-icon-add-outline"
- @click="offissue()"
- >取消下发</el-button>
- <el-button
- class="button"
- type="danger"
- size="mini"
- icon="el-icon-delete"
- @click="but_del_plural()"
- >删除</el-button>
- <el-button
- size="mini"
- :icon="filterForm.show ? 'el-icon-caret-top' : 'el-icon-caret-bottom'"
- :title="filterForm.show ? '收起搜索区' : '展开搜索区'"
- @click="filterForm.show = !filterForm.show;
- $nextTick(() => {
- singleTableHeight = getRoleHeight($refs['boxBottom']) - 45;
- }
- );"
- >{{ filterForm.show ? '收起' : '展开' }}</el-button>
- </div>
- </div>
- </div>
- <div class="box-bottom" ref="boxBottom">
- <div class="table-box" ref="table_box">
- <div class="table-left" :style="{ width: leftTableWidth + 'px' }" v-if="leftTableShow">
- <el-form
- size="mini"
- ref="dialog_form_arr_1"
- label-width="0px"
- :model="tableFormDataObj"
- >
- <el-table stripe
- id="singleTable1"
- ref="singleTable1"
- :data="leftTableData"
- v-loading="leftTableLoading"
- style="width: 100%;"
- :height="singleTableHeight"
- border
- size="mini"
- highlight-current-row
- show-summary
- :summary-method="getSummaries"
- @current-change="getTableDetailData"
- @selection-change="handleSelectionChangeAsleft"
- @row-click="openDetails"
- >
- <el-table-column
- sortable
- type="selection"
- width="40"
- prop="seq"
- label="序号"
- align="center"
- :selectable="checkboxTLeft"
- fixed="left"
- class-name="cnspicuous"
- ></el-table-column>
- <el-table-column
- sortable
- prop="id"
- label="编号"
- fixed="left"
- width="141px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="jhTime"
- label="排产日期"
- align="center"
- width="95px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="deliveryDate"
- label="交货日期"
- align="center"
- width="80px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="grades"
- align="center"
- label="钢种"
- width="71px"
- :show-overflow-tooltip="true"
- >
- </el-table-column>
- <el-table-column
- sortable
- prop="specifications"
- label="规格"
- align="center"
- width="84px"
- :show-overflow-tooltip="true"
- >
- </el-table-column>
- <el-table-column
- sortable
- prop="planweight"
- label="计划量"
- width="80px"
- align="center"
- :show-overflow-tooltip="true"
- >
- </el-table-column>
- <el-table-column
- sortable
- prop="kxf_weight"
- label="可下发量"
- min-width="80px"
- align="center"
- :show-overflow-tooltip="true"
- >
- </el-table-column>
- <el-table-column
- sortable
- prop="yxf_weight"
- label="已下发量"
- min-width="80px"
- align="center"
- :show-overflow-tooltip="true"
- >
- </el-table-column>
- <el-table-column
- sortable
- prop="workprocType"
- label="工序"
- min-width="100px"
- align="center"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <span>{{ nameObj.workprocid.obj[scope.row.workprocType] ? nameObj.workprocid.obj[scope.row.workprocType].name : scope.row.workprocType }}</span>
- </template>
- </el-table-column>
- </el-table>
- </el-form>
- </div>
- <div class="table-tuodong" :style="{ height: singleTableHeight + 'px' }"
- @mousedown="tableTDMousedown"
- ></div>
- <div class="table-right" :style="{ 'margin-left': (leftTableWidth + 7) + 'px' }">
- <el-form
- size="mini"
- ref="dialog_form_arr_2"
- label-width="0px"
- :model="rightTableObj"
- >
- <el-table stripe
- id="singleTable2"
- ref="singleTable2"
- :data="rightTableData"
- v-loading="tableLoading"
- style="width: 100%;"
- :height="singleTableHeight"
- border
- size="mini"
- highlight-current-row
- show-summary
- :summary-method="getSummaries"
- @selection-change="handleSelectionChange"
- :row-class-name="tableRowClassName"
- @cell-click="cellClick"
- >
- <el-table-column
- sortable
- type="selection"
- width="40"
- align="center"
- :selectable='checkboxT'
- fixed="left"
- class-name="cnspicuous"
- ></el-table-column>
- <el-table-column
- sortable
- prop="roundid"
- label="编号"
- fixed="left"
- min-width="141px"
- v-model="filterForm.data.sqno"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="describe"
- label="轮次描述"
- align="center"
- min-width="160px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <el-form-item
- :prop="scope.row.seq + '.describe'"
- v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '3'"
- :rules="tableFormRules.describe"
- >
- <el-input
- style="width: 100%;"
- v-model="rightTableObj[scope.row.seq].describe"
- @keydown.native="keyDown" :id="scope.$index + scope.column.id"
- refcous="true"
- ></el-input>
- </el-form-item>
- <span v-else>{{scope.row.describe}}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="may"
- label="排产日期"
- align="center"
- min-width="134px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <el-form-item
- :prop="scope.row.seq + '.describe'"
- v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '3'"
- :rules="tableFormRules.describe"
- >
- <el-date-picker
- value-format="yyyy-MM-dd"
- type="date"
- v-model="rightTableObj[scope.row.seq].may"
- placeholder=""
- style="width: 100%;"
- @keydown.native="keyDown"
- ></el-date-picker>
- </el-form-item>
- <span v-else>{{scope.row.may}}</span>
- </template>
- </el-table-column>
- <!-- <el-table-column
- sortable
- prop="deliveryDate"
- label="交货日期"
- align="center"
- width="80px"
- :show-overflow-tooltip="true"
- ></el-table-column> -->
- <el-table-column
- sortable
- prop="state"
- label="状态"
- align="center"
- min-width="70px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <span
- :style="{color: nameObj.state.obj[scope.row.state] ? nameObj.state.obj[scope.row.state].color : ''}"
- >{{ nameObj.state.obj[scope.row.state] ? nameObj.state.obj[scope.row.state].name : scope.row.state }}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="grades"
- label="钢种"
- align="center"
- min-width="126px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <el-form-item
- :prop="scope.row.seq + '.grades'"
- v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '3'"
- :rules="tableFormRules.grades"
- >
- <el-select
- allow-create
- filterable
- clearable
- v-model="rightTableObj[scope.row.seq].grades"
- @keydown.native="keyDown" :id="scope.$index + scope.column.id"
- placeholder=""
- >
- <el-option
- v-for="item of nameObj.grades.arr"
- :key="item.id"
- :value="item.name"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- <span v-else>{{ nameObj.grades.obj[scope.row.grades] ? nameObj.grades.obj[scope.row.grades].name : scope.row.grades }}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="specifications"
- label="规格"
- align="center"
- min-width="109px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <el-form-item
- :prop="scope.row.seq + '.specifications'"
- v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '3'"
- :rules="tableFormRules.specifications"
- >
- <el-select
- allow-create
- filterable
- clearable
- v-model="rightTableObj[scope.row.seq].specifications"
- @keydown.native="keyDown" :id="scope.$index + scope.column.id"
- placeholder=""
- >
- <el-option
- v-for="item of nameObj.specifications.arr"
- :key="item.id"
- :value="item.name"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- <span v-else>{{ nameObj.specifications.obj[scope.row.specifications] ? nameObj.specifications.obj[scope.row.specifications].name : scope.row.specifications }}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="planWeight"
- label="计划量"
- align="center"
- min-width="75px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <el-form-item
- :prop="scope.row.seq + '.planWeight'"
- v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '3'"
- :rules="tableFormRules.planWeight"
- >
- <el-input
- style="width: 100%;"
- v-model="rightTableObj[scope.row.seq].planWeight"
- @keydown.native="keyDown" :id="scope.$index + scope.column.id"
- refcous="true"
- ></el-input>
- </el-form-item>
- <span v-else>{{scope.row.planWeight}}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="transportType"
- label="运输方式"
- align="center"
- min-width="100px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <el-form-item
- :prop="scope.row.seq + '.transportType'"
- v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '3'"
- :rules="tableFormRules.transportType"
- >
- <el-select
- allow-create
- filterable
- clearable
- v-model="rightTableObj[scope.row.seq].transportType"
- @keydown.native="keyDown" :id="scope.$index + scope.column.id"
- placeholder=""
- >
- <el-option
- v-for="item of nameObj.transportType.arr"
- :key="item.id"
- :value="item.name"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- <span v-else>{{ nameObj.transportType.obj[scope.row.transportType] ? nameObj.transportType.obj[scope.row.transportType].name : scope.row.transportType }}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="purpose"
- label="用途"
- align="center"
- min-width="100px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <el-form-item
- :prop="scope.row.seq + '.purpose'"
- :rules="tableFormRules.purpose"
- v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '3'"
- >
- <el-select
- allow-create
- filterable
- clearable
- v-model="rightTableObj[scope.row.seq].purpose"
- @keydown.native="keyDown" :id="scope.$index + scope.column.id"
- placeholder=""
- >
- <el-option
- v-for="item of nameObj.purpose.arr"
- :key="item.id"
- :value="item.name"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- <span v-else>{{ nameObj.purpose.obj[scope.row.purpose] ? nameObj.purpose.obj[scope.row.purpose].name : scope.row.purpose }}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="chemicalStandard"
- label="化学成份执行标准"
- align="center"
- min-width="126px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <el-form-item
- :prop="scope.row.seq + '.chemicalStandard'"
- :rules="tableFormRules.chemicalStandard"
- v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '3'"
- >
- <el-select
- filterable
- clearable
- v-model="rightTableObj[scope.row.seq].chemicalStandard"
- @keydown.native="keyDown" :id="scope.$index + scope.column.id"
- placeholder=""
- >
- <el-option
- v-for="item of nameObj.chemicalStandard.arr"
- :key="item.id"
- :value="item.name"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- <span v-else>{{ nameObj.chemicalStandard.obj[scope.row.chemicalStandard] ? nameObj.chemicalStandard.obj[scope.row.chemicalStandard].name : scope.row.chemicalStandard }}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="issuedTime"
- label="下发时间"
- align="center"
- min-width="130px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="createman"
- label="创建人"
- align="center"
- min-width="75px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="createtime"
- label="创建时间"
- align="center"
- min-width="130px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="updateman"
- label="修改人"
- align="center"
- min-width="75px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="updatetime"
- label="修改时间"
- align="center"
- min-width="130px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="memo"
- label="备注"
- align="center"
- min-width="100px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <el-form-item
- :prop="scope.row.seq + '.memo'"
- v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '3'"
- :rules="tableFormRules.memo"
- >
- <el-input
- style="width: 100%;"
- v-model="rightTableObj[scope.row.seq].memo"
- @keydown.native="keyDown" :id="scope.$index + scope.column.id"
- refcous="true"
- ></el-input>
- </el-form-item>
- <span v-else>{{scope.row.memo}}</span>
- </template>
- </el-table-column>
- <el-table-column
- prop="roundid"
- label="轮次序号"
- min-width="100px"
- :show-overflow-tooltip="true"
- v-if="filterForm.data.show"
- ></el-table-column>
- <el-table-column
- prop="parentid"
- label="月序号"
- min-width="100px"
- :show-overflow-tooltip="true"
- v-if="filterForm.data.show"
- ></el-table-column>
- <el-table-column
- prop="workprocType"
- label="工序类别"
- min-width="100px"
- :show-overflow-tooltip="true"
- v-if="filterForm.data.show"
- ></el-table-column>
- </el-table>
- </el-form>
- </div>
- </div>
- <el-row>
- <el-col :span="10" v-if="leftTableShow">
- <el-pagination
- layout="total, sizes, prev, pager, next, jumper"
- :total="total1"
- :page-sizes="[10, 20, 50, 100, 500, 1000]"
- :page-size="pageSize1"
- :current-page.sync="pageNum1"
- @size-change="LftetableSizeChange"
- @current-change="getTableData"
- style="text-align: left;margin-top: 10px;"
- ></el-pagination>
- </el-col>
- <el-col :span="14">
- <el-pagination
- layout="total, sizes, prev, pager, next, jumper"
- :total="total"
- :page-sizes="[10, 20, 50, 100, 500, 1000]"
- :page-size="pageSize"
- :current-page.sync="pageNum"
- @size-change="tableSizeChange"
- @current-change="chageMethod()"
- style="text-align: right;margin-top: 10px;"
- ></el-pagination>
- </el-col>
- </el-row>
- </div>
- </div>
- <el-dialog
- title="内部计划 新增"
- :visible.sync="dialog.editorBox.show"
- width="600px"
- :close-on-click-modal="false"
- :show-close="!loading"
- >
- <div>
- <el-form
- ref="dialog_form"
- :model="dialog.editorBox.form.data"
- :rules="dialog.editorBox.form.rules"
- size="mini"
- label-width="95px"
- >
- <el-row>
- <el-col :span="12">
- <el-form-item
- label="排产日期"
- prop="may"
- :rules="dialog.editorBox.form.may"
- >
- <zj-timegran-date
- v-model="dialog.editorBox.form.data.may"
- style="width: 100%;"
- :timegranId="'DAY'"
- :oneFoo="getTableData"
- ></zj-timegran-date>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item
- label="计划量"
- >
- <el-input
- clearable
- style="width: 100%;"
- v-model="dialog.editorBox.form.data.planWeight"
- >
- </el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col>
- <el-form-item
- label="工序"
- prop="workprocid"
- :rules="dialog.editorBox.form.workprocid"
- >
- <el-select
- filterable
- clearable
- v-model="dialog.editorBox.form.data.workprocid"
- placeholder=""
- style="width: 40%;"
- >
- <el-option
- v-for="item of nameObj.workprocid.arr"
- :key="item.id"
- :value="item.id"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </div>
- <span
- slot="footer"
- class="dialog-footer"
- >
- <el-button
- @click="dialog.editorBox.show = false"
- :loading="loading"
- >取 消</el-button>
- <el-button
- type="primary"
- @click="dataSave"
- :loading="loading"
- >保 存</el-button>
- </span>
- </el-dialog>
- <zj-formulaEditor :equationEditing="dialog.equationEditing"></zj-formulaEditor>
- </div>
- </template>
- <script>
- import { zCheckNumber1 } from '~/utils/validator.js';
- import timegranDate from '~/components/zg/timegranDate.vue';
- import formulaEditor from '@/components/zg/formulaEditor.vue';
- import {formatDate, XtcommonSummaries} from '@/utils/util.js';
- export default {
- name: 'balanceSheetData',
- components: {
- 'zj-timegran-date': timegranDate,
- 'zj-formulaEditor': formulaEditor
- },
- data () {
- return {
- activeMenu: '',
- isCheck: false, // 是否为审核人
- radio: '1',
- leftTableShow: true,
- filterForm: {
- show: true,
- data: {
- id: '',
- Gmid: '',
- timegranid: '',
- clock: '',
- workprocid: '',
- workprocType: '',
- workproc_type: '',
- energyid: '',
- propertyid: '',
- itemid: '',
- itemname: '',
- itemdesc: '',
- may: '',
- canissue: '',
- weightMonth: '',
- issue: '',
- yxf_weight: '',
- kxf_weight: '',
- describe: '',
- state: '',
- grades: '',
- specifications: '',
- lengths: '',
- chemicalStandard: '',
- surfaceStandard: '',
- transportType: '',
- parentid: '',
- purpose: '',
- sqno: '',
- show: false
- }
- },
- rules: {
- },
- pageNum: 1,
- pageSize: 20,
- total: 0,
- pageNum1: 1,
- pageSize1: 20,
- total1: 0,
- singleTableHeight: 100,
- leftTableData: [],
- leftTableLoading: false,
- leftTableWidth: 550,
- difference: 0,
- rightTableData: [],
- rightTableObj: {
- },
- leftData: {
- },
- multipleSelection: [],
- multipleSelectionAscLeft: [],
- tableFormDataObj: {},
- tableFormRules: {
- planWeight: [
- { required: true, message: '该项不能为空', trigger: 'change' },
- { validator: zCheckNumber1, trigger: 'change' }
- ],
- grades: [
- { required: true, message: '该项不能为空', trigger: 'change' }
- ],
- specifications: [
- { required: true, message: '该项不能为空', trigger: 'change' }
- ],
- transportType: [
- { required: true, message: '该项不能为空', trigger: 'change' }
- ],
- purpose: [
- { required: true, message: '该项不能为空', trigger: 'change' }
- ],
- chemicalStandard: [
- { required: true, message: '该项不能为空', trigger: 'change' }
- ]
- },
- nameObj: {
- timegranid: {
- obj: {},
- arr: []
- },
- workprocid: {
- obj: {
- 'AT2005': {
- id: 'AT2005',
- name: '一高线'
- },
- 'AT2006': {
- id: 'AT2006',
- name: '二高线'
- }
- },
- arr: [{
- id: 'AT2005',
- name: '一高线'
- },
- {
- id: 'AT2006',
- name: '二高线'
- }]
- },
- energyid: {
- obj: {},
- arr: []
- },
- propertyid: {
- obj: {},
- arr: []
- },
- unit: {
- obj: {},
- arr: []
- },
- state: {
- obj: {
- '0': {
- name: '已编制',
- color: '#7a7a7a'
- },
- '1': {
- name: '已下发',
- color: 'rgb(28, 111, 217)'
- },
- '2': {
- name: '已接收',
- color: 'red'
- },
- arr: [
- {
- id: '0',
- name: '已编制'
- },
- {
- id: '1',
- name: '已下发'
- },
- {
- id: '2',
- name: '已接收'
- }
- ]
- }
- },
- grades: {
- obj: {},
- arr: []
- },
- specifications: {
- obj: {},
- arr: []
- },
- transportType: {
- obj: {'0': {name: '火运'}, '1': {name: '汽运'}, '2': {name: '火运或者汽运'}},
- arr: [
- {
- id: '0',
- name: '火运'
- },
- {
- id: '1',
- name: '汽运'
- },
- {
- id: '2',
- name: '火运或者汽运'
- }
- ]
- },
- chemicalStandard: {
- obj: {},
- arr: []
- },
- purpose: {
- obj: {
- '0': {name: '标准件'},
- '1': {name: '铁丝'},
- '2': {name: '钢丝、弹簧'}
- },
- arr: [
- {
- id: '0',
- name: '标准件'
- },
- {
- id: '1',
- name: '铁丝'
- },
- {
- id: '2',
- name: '钢丝、弹簧'
- }
- ]
- }
- },
- loading: false,
- tableLoading: false,
- dialog: {
- fRow: null,
- editorBox: {
- show: false,
- type: '',
- form: {
- default: {
- workprocid: ''
- },
- data: {
- itemid: '',
- materialid: '',
- workprocid: '',
- unitid: '',
- seqno: '',
- mes_prodline: '',
- code: '',
- digits: '',
- may: '',
- canissue: '',
- weightMonth: '',
- issue: '',
- yxf_weight: '',
- kxf_weight: '',
- describe: '',
- state: '',
- grades: '',
- specifications: '',
- lengths: '',
- chemicalStandard: '',
- surfaceStandard: '',
- transportType: '',
- workprocType: '',
- purpose: '',
- planWeight: ''
- },
- rules: {
- planWeight: [
- { required: true, message: '该项不能为空', trigger: 'change' },
- { validator: zCheckNumber1, trigger: 'change' }
- ],
- grades: [
- { required: true, message: '该项不能为空', trigger: 'change' }
- ],
- specifications: [
- { required: true, message: '该项不能为空', trigger: 'change' }
- ],
- transportType: [
- { required: true, message: '该项不能为空', trigger: 'change' }
- ],
- purpose: [
- { required: true, message: '该项不能为空', trigger: 'change' }
- ],
- chemicalStandard: [
- { required: true, message: '该项不能为空', trigger: 'change' }
- ],
- may: [
- { required: true, message: '该项不能为空', trigger: 'change' }
- ],
- workprocid: [
- { required: true, message: '该项不能为空', trigger: 'change' }
- ]
- }
- }
- }
- }
- }
- },
- created () {
- this.activeMenu = window.localStorage.getItem('activeMenu');
- },
- mounted () {
- let that = this;
- window.PEDataObj = {
- // 将数据绑定到window上,供main页面使用
- vm: that,
- // tableArr:用于导出成Excel的表格的信息
- tableArr: [
- {
- name: '左表格',
- id: 'singleTable1'
- },
- {
- name: '右表格',
- id: 'singleTable2'
- }
- ]
- };
- // 接收路由参数
- if (that.$route.query.workproc_type) {
- that.filterForm.data.workproc_type = that.$route.query.workproc_type;
- }
- that.$nextTick(() => {
- // 立即获取的height有一定偏差,通过setTimeout延迟来解决
- setTimeout(() => {
- that.singleTableHeight = that.getRoleHeight(that.$refs['boxBottom']) - 45;
- }, 1);
- });
- that.getTimeGranData();
- that.getEnergyIdData();
- that.getPropertyIdData();
- that.getGrades();
- that.getSpecifications();
- that.getStandards();
- that.getUnitIdData();
- },
- methods: {
- // 计算树区域高度
- getRoleHeight (dom) {
- return window.innerHeight - dom.offsetTop;
- },
- // 自定义的表格合计方法:只给指定列进行合计
- getSummaries (param) {
- const prop = ['kxf_weight', 'planweight', 'yxf_weight', 'planWeight']; // 合计列绑定的prop
- return XtcommonSummaries(param, prop);
- },
- // 获取时间粒度(平衡表数据维护)
- getTimeGranData () {
- let that = this
- let url = 'pass/ems/v1/tcmdatasourcetimegrans/getTimegranRmBalanceValue';
- that.axios.get(url)
- .then(function (res) {
- if (res.code === '0') {
- let arr = [];
- let obj = {};
- for (let item of res.data) {
- arr.push({
- id: item.ID,
- name: item.NAME
- })
- obj[item.ID] = item.NAME;
- that.filterForm.data.timegranid = that.filterForm.data.timegranid ? that.filterForm.data.timegranid : item.ID;
- }
- that.nameObj.timegranid.arr = arr;
- that.nameObj.timegranid.obj = obj;
- } else {
- that.$message.error(res.message);
- }
- });
- },
- checkboxT (row, index) {
- if (row.state === '3' && !this.isCheck) {
- return false;
- } else {
- return true;
- }
- },
- checkboxTLeft (row, index) {
- return true;
- },
- // 获取能介(平衡表)
- getEnergyIdData () {
- let that = this
- let url = 'pass/ems/v1/trmenergys/selectNameAndId/?isbalance=1';
- that.axios.get(url)
- .then(function (res) {
- if (res.code === '0') {
- let arr = [];
- let obj = {};
- for (let item of res.data) {
- arr.push({
- id: item.id,
- name: item.name
- })
- obj[item.id] = item.name;
- }
- that.nameObj.energyid.arr = arr;
- that.nameObj.energyid.obj = obj;
- } else {
- that.$message.error(res.message);
- }
- });
- },
- // 获取属性
- getPropertyIdData () {
- let that = this
- let url = 'pass/ems/v1/trmenergypropertys/getidandname/';
- that.axios.get(url)
- .then(function (res) {
- if (res.code === '0') {
- let arr = [];
- let obj = {};
- for (let item of res.data) {
- arr.push({
- id: item.id,
- name: item.name
- })
- obj[item.id] = item.name;
- }
- that.nameObj.propertyid.arr = arr;
- that.nameObj.propertyid.obj = obj;
- } else {
- that.$message.error(res.message);
- }
- });
- },
- // 获取标准计量单位
- getUnitIdData () {
- let that = this
- let url = 'pass/ems/v1/trmunits/getIdAndName';
- that.axios.get(url)
- .then(function (res) {
- if (res.code === '0') {
- let arr = [];
- let obj = {};
- for (let item of res.data) {
- arr.push({
- id: item.id,
- name: item.name
- })
- obj[item.id] = item.name;
- if (item.name === '吨') {
- that.nameObj.unit.defaults = that.nameObj.unit.defaults ? that.nameObj.unit.defaults : item.id;
- }
- }
- that.nameObj.unit.arr = arr;
- that.nameObj.unit.obj = obj;
- } else {
- that.$message.error(res.message);
- }
- });
- },
- // 获取表格中的数据
- getTableData (pageNum1) {
- let that = this,
- params = {
- workprocType: that.filterForm.data.workproc_type,
- startTime: that.filterForm.data.clock[0],
- endTime: that.filterForm.data.clock[1],
- id: that.filterForm.data.Gmid
- };
- that.pageNum1 = pageNum1 || that.pageNum1;
- that.leftTableLoading = true;
- let url = 'pass/ems/v1/emsgmpcjhs/getGmDates/?pageNum=' + that.pageNum1 + '&pageSize=' + that.pageSize1;
- that.axios.get(url, {
- params: params
- })
- .then(function (res) {
- if (res.code === '0') {
- let arr = [];
- for (let i = 0; i < res.data.list.length; i++) {
- let item = res.data.list[i];
- arr.push({
- seq: i,
- id: item.ID,
- jhTime: item.JHTIME,
- state: item.STATE,
- grades: item.GRADES,
- specifications: item.SPECIFICATIONS,
- lengths: item.LENGTHS,
- chemicalStandard: item.CHEMICALSTANDARD,
- surfacestandard: item.SURFACESTANDARD,
- workprocType: item.WORKPROCTYPE,
- iateralarea: item.IATERALAREA,
- lengthtimeswidth: item.LENGTHTIMESWIDTH,
- transportType: item.TRANSPORTTYPE,
- receivetime: item.RECEIVETIME,
- createman: item.CREATEMAN,
- createtime: item.CREATETIME,
- updateman: item.UPDATEMAN,
- purpose: item.PURPOSE,
- updatetime: item.UPDATETIME,
- memo: item.MEMO,
- deliveryDate: item.DELIVERYDATE,
- planweight: item.PLANWEIGHT,
- dimension: item.DIMENSION,
- kxf_weight: item.PLANWEIGHT - item.YXF_WEIGHT,
- yxf_weight: item.YXF_WEIGHT
- })
- }
- that.leftTableData = arr;
- that.total1 = res.data.total;
- that.dialog.fRow = null;
- } else {
- that.$message.error(res.message);
- }
- that.leftTableLoading = false;
- }).catch(function () {
- that.leftTableLoading = false;
- });
- },
- //切换查询方法
- chageMethod(){
- let that = this;
- if (that.leftTableShow == true){
- that.getTableDetailDatas(that.pageNum);
- } else {
- that.getTableDetailAsRadio(that.pageNum)
- }
- },
- // 改变表格显示条数
- tableSizeChange (val) {
- let that = this;
- that.pageSize = val;
- that.chageMethod();
- },
- LftetableSizeChange (val) {
- let that = this;
- that.pageSize1 = val;
- that.getTableData(1);
- },
- // 点击查询
- getTableDetailData (row) {
- let that = this;
- if (row) {
- that.tableLoading = true;
- that.filterForm.data.workprocid = row.workprocType;
- let url = 'pass/ems/v1/emsprodplanrounds/';
- that.axios.get(url, {
- params: {parentid: row.id}
- })
- .then(function (res) {
- if (res.code === '0') {
- let arr = [];
- for (let i = 0; i < res.data.list.length; i++) {
- let item = res.data.list[i];
- arr.push({
- seq: i,
- parentid: item.parentid,
- may: item.may,
- roundid: item.id,
- describe: item.describe,
- state: item.state,
- grades: item.grades,
- planWeight: item.planWeight,
- specifications: item.specifications,
- transportType: item.transportType,
- purpose: item.purpose,
- chemicalStandard: item.chemicalStandard,
- memo: item.memo,
- issuedTime: item.issuedTime,
- createman: item.createman,
- createtime: item.createtime,
- updateman: item.updateman,
- updatetime: item.updatetime,
- deliveryDate: item.deliveryDate,
- sqno: item.sqno,
- workprocType: item.workprocType,
- auditState: item.auditState
- });
- }
- that.rightTableData = arr;
- that.total = res.data.total;
- } else {
- that.$message.error(res.message);
- }
- that.tableLoading = false;
- }).catch(function () {
- that.tableLoading = false;
- });
- }
- },
- //展开自动查询
- getTableDetailAsRadio(pageNum){
- let that = this;
- let ids = [];
- that.leftTableData.forEach((element) => {
- ids.push(element.id);
- });
- that.pageNum = pageNum || that.pageNum;
- let url = 'pass/ems/v1/emsprodplanrounds/getTableDetailAsRadio/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
- that.axios.get(url, {
- params: {
- id: ids.join(',')
- }
- }).then(function (res) {
- if (res.code == '0') {
- let arr = [];
- for (let i = 0; i < res.data.list.length; i++) {
- let item = res.data.list[i];
- arr.push({
- seq: i,
- parentid: item.parentid,
- may: item.may,
- roundid: item.id,
- describe: item.describe,
- state: item.state,
- grades: item.grades,
- planWeight: item.planWeight,
- specifications: item.specifications,
- transportType: item.transportType,
- purpose: item.purpose,
- chemicalStandard: item.chemicalStandard,
- memo: item.memo,
- issuedTime: item.issuedTime,
- createman: item.createman,
- createtime: item.createtime,
- updateman: item.updateman,
- deliveryDate: item.deliveryDate,
- sqno: item.sqno,
- updatetime: item.updatetime,
- workprocType: item.workprocType,
- auditState: item.auditState
- });
- }
- that.rightTableData = arr;
- that.total = res.data.total;
- } else {
- that.$message.error(res.message);
- }
- that.tableLoading = false;
- }).catch(function () {
- that.tableLoading = false;
- });
- },
- getTableDetailDatas (pageNum, type) {
- let that = this;
- let params = {};
- if (type === 'Add') {
- params = {
- parentid: that.multipleSelectionAscLeft[0].id
- };
- } else {
- params = {
- parentid: that.rightTableData[0].parentid,
- workprocType: that.filterForm.data.workprocid
- };
- }
- that.pageNum = pageNum || that.pageNum;
- that.tableLoading = true;
- let url = 'pass/ems/v1/emsprodplanrounds/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
- that.axios.get(url, {
- params: params
- })
- .then(function (res) {
- if (res.code === '0') {
- let arr = [];
- for (let i = 0; i < res.data.list.length; i++) {
- let item = res.data.list[i];
- arr.push({
- seq: i,
- parentid: item.parentid,
- may: item.may,
- roundid: item.id,
- describe: item.describe,
- state: item.state,
- grades: item.grades,
- planWeight: item.planWeight,
- specifications: item.specifications,
- transportType: item.transportType,
- purpose: item.purpose,
- chemicalStandard: item.chemicalStandard,
- memo: item.memo,
- issuedTime: item.issuedTime,
- createman: item.createman,
- createtime: item.createtime,
- updateman: item.updateman,
- deliveryDate: item.deliveryDate,
- sqno: item.sqno,
- updatetime: item.updatetime,
- workprocType: item.workprocType,
- auditState: item.auditState
- });
- }
- that.rightTableData = arr;
- that.total = res.data.total;
- } else {
- that.$message.error(res.message);
- }
- that.tableLoading = false;
- }).catch(function () {
- that.tableLoading = false;
- });
- },
- jsDifference () {
- let that = this;
- let fV = that.dialog.fRow.apportvalue,
- zV = 0;
- let xId = that.dialog.fRow.itemid + '-' + that.dialog.fRow.timegranid + '-' + that.dialog.fRow.clock;
- if (that.tableFormDataObj[xId]) {
- fV = that.tableFormDataObj[xId].apportvalue;
- }
- for (let item of that.rightTableObj.tableData) {
- zV = that.floatComputed(zV, item.apportvalue, '+');
- }
- that.difference = +that.floatComputed(fV, zV, '-').toFixed(3);
- },
- upTableFormDataObj () {
- // 更新右侧表格编辑模式绑定的数据
- let that = this;
- let fRow = that.dialog.fRow;
- if (fRow) {
- if (!fRow.tableFormDataArr || !fRow.isSelection) {
- // 当前选中行被勾选时不更新tableFormDataObj
- fRow.tableFormDataArr = JSON.parse(JSON.stringify(fRow.childrenArr));
- }
- if (fRow.isSelection) {
- that.rightTableObj.tableData = fRow.tableFormDataArr;
- } else {
- that.rightTableObj.tableData = fRow.childrenArr;
- }
- that.jsDifference();
- }
- },
- // 左边菜单选中
- handleSelectionChangeAsleft (val) {
- let that = this;
- let tableFormDataObj = {};
- let arr = [];
- for (let item of val) {
- arr.push(item.seq);
- }
- this.seqArr = arr.sort(sortNumber);
- for (let item of that.leftTableData) {
- item.isSelection = false;
- }
- for (let item of val) {
- let obj = {};
- let xId = item.seq;
- if (that.tableFormDataObj[xId]) {
- // 如果已存在该数据则使用该数据
- tableFormDataObj[xId] = that.tableFormDataObj[xId];
- } else {
- // 负责则从对应行中获取行内原数据
- for (let key in item) {
- obj[key] = item[key];
- }
- tableFormDataObj[xId] = obj;
- }
- item.isSelection = true;
- }
- that.tableFormDataObj = tableFormDataObj;
- that.multipleSelectionAscLeft = val;
- },
- // 右边菜单选中
- handleSelectionChange (val) {
- let that = this;
- let rightTableObj = {};
- let arr = [];
- for (let item of val) {
- arr.push(item.seq);
- }
- this.seqArr = arr.sort(sortNumber);
- for (let item of that.rightTableData) {
- item.isSelection = false;
- }
- for (let item of val) {
- let obj = {};
- let xId = item.seq;
- if (that.rightTableObj[xId]) {
- // 如果已存在该数据则使用该数据
- rightTableObj[xId] = that.rightTableObj[xId];
- } else {
- // 负责则从对应行中获取行内原数据
- for (let key in item) {
- obj[key] = item[key];
- }
- item.realvalue = (!isNaN(Number(item.apportvalue)) && !isNaN(Number(item.wastage))) ? Number(item.apportvalue) + Number(item.wastage) - Number(item.secondVal) : item.realvalue;
- rightTableObj[xId] = obj;
- }
- item.isSelection = true;
- }
- for (let item of that.rightTableData) {
- if (item.isSelection === false) {
- item.realvalue = (!isNaN(Number(item.apportvalue)) && !isNaN(Number(item.wastage))) ? Number(item.apportvalue) + Number(item.wastage) - Number(item.secondVal) : item.realvalue;
- }
- }
- that.rightTableObj = rightTableObj;
- that.multipleSelection = val;
- },
- but_edit_plural () {
- let that = this;
- if (that.multipleSelection.length > 0) {
- that.$refs['dialog_form_arr_2'].validate((valid) => {
- if (valid) {
- let SubmitData = [];
- for (let key in that.rightTableObj) {
- SubmitData.push({
- parentid: that.rightTableObj[key].parentid,
- may: that.rightTableObj[key].may,
- describe: that.rightTableObj[key].describe,
- state: that.rightTableObj[key].state,
- grades: that.rightTableObj[key].grades,
- planWeight: that.rightTableObj[key].planWeight,
- specifications: that.rightTableObj[key].specifications,
- transportType: that.rightTableObj[key].transportType,
- workprocType: that.rightTableObj[key].workprocType,
- purpose: that.rightTableObj[key].purpose,
- chemicalStandard: that.rightTableObj[key].chemicalStandard,
- memo: that.rightTableObj[key].memo,
- id: that.rightTableObj[key].roundid,
- sqno: that.rightTableObj[key].sqno,
- createman: that.rightTableObj[key].createman,
- createtime: that.rightTableObj[key].createtime
- });
- }
- that.loading = true;
- that.axios.put('pass/ems/v1/emsprodplanrounds/batchUpdate', SubmitData)
- .then(function (res) {
- if (res.code === '0') {
- that.$message({
- message: '保存成功',
- type: 'success'
- });
- that.chageMethod();
- that.getStandards();
- } else {
- that.$message.error(res.message);
- }
- that.loading = false;
- }).catch(function () {
- that.loading = false;
- });
- } else {
- }
- });
- } else {
- this.$message.error('至少要选择一条数据');
- }
- },
- edit_plural () {
- let that = this;
- if (that.multipleSelection.length > 0) {
- let SubmitData = [];
- for (let key in that.rightTableObj) {
- SubmitData.push({
- parentid: that.rightTableObj[key].parentid,
- may: that.rightTableObj[key].may,
- describe: that.rightTableObj[key].describe,
- state: that.rightTableObj[key].state,
- grades: that.rightTableObj[key].grades,
- planWeight: that.rightTableObj[key].planWeight,
- specifications: that.rightTableObj[key].specifications,
- transportType: that.rightTableObj[key].transportType,
- workprocType: that.rightTableObj[key].workprocType,
- purpose: that.rightTableObj[key].purpose,
- chemicalStandard: that.rightTableObj[key].chemicalStandard,
- memo: that.rightTableObj[key].memo,
- id: that.rightTableObj[key].roundid,
- sqno: that.rightTableObj[key].sqno,
- createman: that.rightTableObj[key].createman,
- createtime: that.rightTableObj[key].createtime,
- issuedTime: that.rightTableObj[key].issuedTime,
- updateman: that.rightTableObj[key].updateman,
- updatetime: that.rightTableObj[key].updatetime
- });
- }
- that.loading = true;
- that.$confirm('确定要强制修改数据吗?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- state: 'warning'
- }).then(() => {
- that.axios.put('pass/ems/v1/emsprodplanrounds/ForcedUpdate', SubmitData)
- .then(function (res) {
- if (res.code === '0') {
- that.$message({
- message: '保存成功',
- type: 'success'
- });
- that.chageMethod();
- } else {
- that.$message.error(res.message);
- }
- that.loading = false;
- }).catch(function () {
- that.loading = false;
- });
- });
- } else {
- this.$message.error('至少要选择一条数据');
- }
- },
- getGrades () {
- let that = this
- let url = 'pass/product/v1/emssteel/getGrades/?type=' + '高线';
- that.axios.get(url)
- .then(function (res) {
- if (res.code === '0') {
- let arr = [];
- let obj = {};
- for (let item of res.data) {
- arr.push({
- id: item.id,
- name: item.steelName
- })
- }
- that.nameObj.grades.arr = arr;
- that.nameObj.grades.obj = obj;
- } else {
- that.$message.error(res.message);
- }
- });
- },
- getSpecifications () {
- let that = this
- let url = 'pass/product/v1/emssteel/getSpecifications/?type=' + '高线';
- that.axios.get(url)
- .then(function (res) {
- if (res.code === '0') {
- let arr = [];
- let obj = {};
- for (let item of res.data) {
- arr.push({
- id: item.id,
- name: item.specName
- })
- }
- that.nameObj.specifications.arr = arr;
- that.nameObj.specifications.obj = obj;
- } else {
- that.$message.error(res.message);
- }
- });
- },
- getStandards () {
- let that = this
- let url = 'pass/product/v1/emsstandard/getStandards?type=线材';
- that.axios.get(url)
- .then(function (res) {
- if (res.code === '0') {
- let arr = [];
- let obj = {};
- for (let item of res.data) {
- arr.push({
- id: item.basecode,
- name: item.basename
- })
- }
- that.nameObj.chemicalStandard.arr = arr;
- that.nameObj.chemicalStandard.obj = obj;
- } else {
- that.$message.error(res.message);
- }
- });
- },
- issue () {
- let that = this;
- if (that.multipleSelection.length > 0) {
- that.$refs['dialog_form_arr_2'].validate((valid, obj) => {
- if (valid) {
- let SubmitData = [];
- let auditStates = [];
- for (let key in that.rightTableObj) {
- SubmitData.push({
- parentid: that.rightTableObj[key].parentid,
- may: that.rightTableObj[key].may,
- roundid: that.rightTableObj[key].roundid,
- describe: that.rightTableObj[key].describe,
- grades: that.rightTableObj[key].grades,
- planWeight: that.rightTableObj[key].planWeight,
- specifications: that.rightTableObj[key].specifications,
- transportType: that.rightTableObj[key].transportType,
- workprocType: that.rightTableObj[key].workprocType,
- purpose: that.rightTableObj[key].purpose,
- chemicalStandard: that.rightTableObj[key].chemicalStandard,
- memo: that.rightTableObj[key].memo,
- issuedTime: that.rightTableObj[key].issuedTime,
- createman: that.rightTableObj[key].createman,
- auditState: that.rightTableObj[key].auditState,
- createtime: that.rightTableObj[key].createtime,
- updateman: that.rightTableObj[key].updateman,
- updatetime: that.rightTableObj[key].updatetime,
- id: that.rightTableObj[key].roundid,
- state: that.rightTableObj[key].state,
- sqno: that.rightTableObj[key].sqno
- });
- }
- that.loading = true;
- that.axios.post('pass/ems/v1/emsprodplanrounds/issue', SubmitData, {
- contentType: 'application/json'
- })
- .then(function (res) {
- if (res.code === '0') {
- that.$message({
- message: '操作成功',
- type: 'success'
- });
- that.getTableData();
- that.chageMethod();
- } else {
- that.$message.error(res.message);
- }
- that.loading = false;
- }).catch(function () {
- that.loading = false;
- });
- }
- });
- } else {
- this.$message.error('至少要选择一条数据');
- }
- },
- offissue () {
- let that = this;
- if (that.multipleSelection.length > 0) {
- that.$refs['dialog_form_arr_2'].validate((valid, obj) => {
- if (valid) {
- let SubmitData = [];
- for (let key in that.rightTableObj) {
- SubmitData.push({
- parentid: that.rightTableObj[key].parentid,
- may: that.rightTableObj[key].may,
- roundid: that.rightTableObj[key].roundid,
- describe: that.rightTableObj[key].describe,
- grades: that.rightTableObj[key].grades,
- planWeight: that.rightTableObj[key].planWeight,
- specifications: that.rightTableObj[key].specifications,
- transportType: that.rightTableObj[key].transportType,
- workprocType: that.rightTableObj[key].workprocType,
- purpose: that.rightTableObj[key].purpose,
- chemicalStandard: that.rightTableObj[key].chemicalStandard,
- memo: that.rightTableObj[key].memo,
- issuedTime: that.rightTableObj[key].issuedTime,
- createman: that.rightTableObj[key].createman,
- createtime: that.rightTableObj[key].createtime,
- updateman: that.rightTableObj[key].updateman,
- updatetime: that.rightTableObj[key].updatetime,
- id: that.rightTableObj[key].roundid,
- state: that.rightTableObj[key].state,
- sqno: that.rightTableObj[key].sqno
- });
- }
- that.loading = true;
- that.axios.post('pass/ems/v1/emsprodplanrounds/offissue', SubmitData, {
- contentType: 'application/json'
- })
- .then(function (res) {
- if (res.code === '0') {
- that.$message({
- message: '操作成功',
- type: 'success'
- });
- that.getTableData();
- that.chageMethod();
- } else {
- that.$message.error(res.message);
- }
- that.loading = false;
- }).catch(function () {
- that.loading = false;
- });
- }
- });
- } else {
- this.$message.error('至少要选择一条数据');
- }
- },
- but_del_plural () {
- let that = this;
- if (that.multipleSelection.length > 0) {
- let SubmitData = [];
- for (let key in that.rightTableObj) {
- SubmitData.push({
- id: that.rightTableObj[key].roundid,
- state: that.rightTableObj[key].state,
- parentid: that.rightTableObj[key].parentid
- });
- }
- that.$confirm('是否删除已选数据?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- state: 'warning'
- }).then(() => {
- that.axios.post('pass/ems/v1/emsprodplanrounds/delete', SubmitData, {
- contentType: 'application/json'
- })
- .then(function (res) {
- if (res.code === '0') {
- that.$message({
- message: '删除成功',
- type: 'success'
- });
- that.chageMethod();
- that.getTableData();
- that.dialog.editorBox.show = false;
- } else {
- that.$message.error(res.message);
- }
- that.loading = false;
- }).catch(function () {
- that.loading = false;
- });
- });
- } else {
- this.$message.error('至少要选择一条数据');
- }
- },
- dataSave () {
- let that = this;
- let SubmitData = {
- jhTime: that.dialog.editorBox.form.data.may,
- planWeight: that.dialog.editorBox.form.data.planWeight,
- workprocType: that.dialog.editorBox.form.data.workprocid
- };
- that.$refs['dialog_form'].validate((valid) => {
- if (valid) {
- that.loading = true;
- that.axios.post('pass/ems/v1/emsgmpcjhs/addNbJH', SubmitData, {
- contentType: 'application/json'
- })
- .then(function (res) {
- if (res.code === '0') {
- that.$message({
- message: '新增成功',
- type: 'success'
- });
- that.dialog.editorBox.show = false;
- that.getTableData();
- } else {
- that.$message.error(res.message);
- }
- that.loading = false;
- }).catch(function () {
- that.loading = false;
- });
- }
- });
- },
- correctvalueUpFoo (row) {
- let that = this;
- // 防止数据为无效值
- if (row.correctvalue === '' || !isFinite(row.correctvalue)) {
- row.correctvalue = 0;
- row.apportvalue = row.actualvalue;
- } else {
- row.apportvalue = that.floatComputed(row.actualvalue, row.correctvalue, '+');
- }
- that.jsDifference();
- },
- apportvalueUpFoo (row) {
- let that = this;
- if (row.apportvalue === '' || !isFinite(row.apportvalue)) {
- row.correctvalue = 0;
- row.apportvalue = row.actualvalue;
- } else {
- row.correctvalue = that.floatComputed(row.apportvalue, row.actualvalue, '-');
- }
- that.jsDifference();
- },
- tableTDMousedown (e) {
- let that = this;
- let nowPageX = e.pageX,
- nowWidth = that.leftTableWidth,
- minWidth = 200,
- maxWidth = window.innerWidth - 200;
- that.$refs.table_box.style.userSelect = 'none';
- that.$refs.table_box.style.cursor = 'col-resize';
- that.$refs.table_box.onmousemove = function (e) {
- let bh = e.pageX - nowPageX;
- if (nowWidth + bh > maxWidth) {
- that.leftTableWidth = maxWidth;
- } else if (nowWidth + bh < minWidth) {
- that.leftTableWidth = minWidth;
- } else {
- that.leftTableWidth = nowWidth + bh;
- }
- }
- that.$refs.table_box.onmouseup = function () {
- that.$refs.table_box.onmousemove = false;
- that.$refs.table_box.onmouseup = false;
- that.$refs.table_box.style.userSelect = '';
- that.$refs.table_box.style.cursor = ''
- }
- },
- // 对proportion的值进行处理,使其符合要求
- proportionFormat (row) {
- let that = this;
- if (row.proportion === '' || !isFinite(row.proportion)) {
- row.proportion = 0;
- }
- },
- // 重新计算,根据自定义的分配比例来自动调整最终值
- againCount () {
- let that = this;
- if (that.multipleSelection.length > 0) {
- for (let item of that.multipleSelection) {
- let xId = item.itemid + '-' + item.timegranid + '-' + item.clock;
- let objItem = that.tableFormDataObj[xId];
- let bl = 0;
- for (let dataObj of item.tableFormDataArr) {
- bl = +that.floatComputed(bl, dataObj.proportion, '+');
- }
- if (bl !== 100) {
- this.$message.error('所有比例之和不为100%,请调整比例后再执行计算。');
- continue;
- }
- let sum = objItem.apportvalue;
- for (let i = 0, ilength = item.tableFormDataArr.length; i < ilength; i++) {
- if (i === (ilength - 1)) {
- item.tableFormDataArr[i].apportvalue = sum;
- } else {
- let z = that.floatComputed(objItem.apportvalue, item.tableFormDataArr[i].proportion, '*');
- item.tableFormDataArr[i].apportvalue = that.floatComputed(z, 100, '/');
- sum = that.floatComputed(sum, item.tableFormDataArr[i].apportvalue, '-');
- }
- item.tableFormDataArr[i].correctvalue = that.floatComputed(item.tableFormDataArr[i].apportvalue, item.tableFormDataArr[i].actualvalue, '-');
- }
- that.jsDifference();
- }
- } else {
- this.$message.error('请勾选一条数据');
- }
- },
- but_add (type) {
- let that = this;
- let SubmitData = [];
- if(that.multipleSelectionAscLeft.length >0 ) {
- for(let key in that.tableFormDataObj) {
- SubmitData.push({
- parentid: that.tableFormDataObj[key].id,
- may: that.tableFormDataObj[key].jhTime,
- describe: that.tableFormDataObj[key].describe,
- state: that.tableFormDataObj[key].state,
- grades: that.tableFormDataObj[key].grades,
- specifications: that.tableFormDataObj[key].specifications,
- transportType: that.tableFormDataObj[key].transportType,
- workprocType: that.tableFormDataObj[key].workprocType,
- purpose: that.tableFormDataObj[key].purpose,
- chemicalStandard: that.tableFormDataObj[key].chemicalStandard,
- memo: that.tableFormDataObj[key].memo,
- createMan: that.tableFormDataObj[key].createman,
- planweight: that.tableFormDataObj[key].planweight,
- createTime: that.tableFormDataObj[key].createtime,
- deliveryDate: that.tableFormDataObj[key].deliveryDate,
- auditState: '0'
- })
- }
- that.loading = true;
- that.axios.post('pass/ems/v1/emsprodplanrounds/', SubmitData, {
- contentType: 'application/json'
- })
- .then(function (res) {
- if (res.code === '0') {
- that.$message({
- message: '新增成功',
- type: 'success'
- });
- that.dialog.editorBox.show = false;
- that.getTableDetailDatas(1, 'Add');
- } else {
- that.$message.error(res.message);
- }
- that.loading = false;
- }).catch(function () {
- that.loading = false;
- });
- } else {
- this.$message.error('至少要选择一条数据');
- }
- },
- // 审核
- audit () {
- let that = this;
- if (that.multipleSelection.length > 0) {
- let SubmitData = [];
- for (let key in that.rightTableObj) {
- SubmitData.push({
- parentid: that.rightTableObj[key].parentid,
- auditState: that.rightTableObj[key].auditState,
- id: that.rightTableObj[key].roundid,
- state: that.rightTableObj[key].state
- });
- }
- that.loading = true;
- that.axios.put('pass/ems/v1/emsprodplanrounds/updateAuditState', SubmitData, {
- contentType: 'application/json'
- })
- .then(function (res) {
- if (res.code === '0') {
- that.$message({
- message: '操作成功',
- type: 'success'
- });
- that.getTableData();
- that.getTableDetailDatas();
- } else {
- that.$message.error(res.message);
- }
- that.loading = false;
- }).catch(function () {
- that.loading = false;
- });
- } else {
- this.$message.error('至少要选择一条数据');
- }
- },
- but_addNBJH () {
- let that = this;
- that.dialog.editorBox.form.data.planWeight = '';
- that.dialog.editorBox.show = true;
- setTimeout(() => {
- that.$refs['dialog_form'].clearValidate();
- }, 100);
- },
- getChildTable (row, expandedRows) {
- let that = this;
- if (!row.getTable) {
- let params = {
- clock: row.clock,
- energyid: row.energyid
- };
- row.tableLoading = true;
- let url = 'pass/ems/v1/trmbalancevalues/getitem';
- that.axios.get(url, {
- params: params
- })
- .then(function (res) {
- if (res.code === '0') {
- let arr = [];
- for (let item of res.data) {
- arr.push({
- clock: item.CLOCK,
- itemname: item.ITEMNAME,
- timegranid: item.TIMEGRANID,
- apportvalue: item.APPORTVALUE
- })
- }
- row.tableData = arr;
- row.getTable = true;
- } else {
- that.$message.error(res.message);
- }
- row.tableLoading = false;
- }).catch(function () {
- row.tableLoading = false;
- });
- }
- },
- radioChange(){
- let that = this;
- let leftwith = 0;
- let rightwith = 550;
- if(that.radio == 0){
- that.leftTableWidth = leftwith;
- that.leftTableShow = false;
- that.getTableDetailAsRadio(1);
- }
- if(that.radio == 1){
- that.leftTableWidth = rightwith;
- that.leftTableShow = true;
- that.rightTableData = [];
- }
- },
- keyDown (event1, disabledFlag) {
- let tdTarget = event1.target;
- let _this = this;
- while (tdTarget.tagName !== 'TD') {
- tdTarget = tdTarget.parentElement;
- }
- // 如果按下键盘下键或者回车键
- if (event.keyCode === 40 || event.keyCode === 13) {
- let index = parseInt(this.rowIndex);
- // index++;
- if (index !== this.seqArr[this.seqArr.length - 1]) {
- for (let i = 0; i < this.seqArr.length; i++) {
- if (index === this.seqArr[i]) {
- index = this.seqArr[i + 1];
- break;
- }
- }
- }
- this.editSetFlag = index + this.columnId;
- let id = '#' + this.editSetFlag;
- this.$nextTick(() => {
- $(id).click();
- });
- console.log('下键')
- } else if (event.keyCode === 38) { // 键盘上键
- let index = parseInt(this.rowIndex);
- if (index !== this.seqArr[0]) {
- for (let i = 0; i < this.seqArr.length; i++) {
- if (index === this.seqArr[i]) {
- index = this.seqArr[i - 1];
- break;
- }
- }
- }
- console.log('上键')
- this.editSetFlag = index + this.columnId;
- let id = '#' + this.editSetFlag;
- this.$nextTick(() => {
- $(id).click();
- });
- } else if (event.keyCode === 37) { // 键盘左键
- console.log('左键')
- $(tdTarget).prevAll().find('input:text').last().click();
- } else if (event.keyCode === 39) { // 键盘右键
- $(tdTarget).nextAll().find('input').eq(0).click();
- console.log('右键')
- }
- },
- cellClick (row, column, cell, event) {
- let _this = this;
- this.rowIndex = row.index;
- this.columnId = column.id;
- _this.editSetFlag = row.index + column.id;
- _this.focusTarget = event.target;
- while (_this.focusTarget.tagName !== 'TD') {
- _this.focusTarget = _this.focusTarget.parentElement;
- }
- _this.$nextTick(() => {
- let target = this.focusTarget;
- $(target).find('input').focus();
- });
- },
- tableRowClassName ({row, rowIndex}) {
- // 把每一行的索引放进row
- row.index = rowIndex;
- },
- openDetails (row) {
- let that = this;
- that.leftData = row;
- }
- }
- }
- function sortNumber (a, b) {
- return a - b
- }
- </script>
- <style lang="less">
- .balanceSheetData {
- min-width: 700px;
- height: 100%;
- .box {
- height: 100%;
- padding: 15px 15px 0 15px;
- .box-top {
- .el-form-item {
- margin-bottom: 7px;
- }
- .box-top-gjl {
- overflow: hidden;
- // margin-top: -7px;
- padding: 7px 0;
- border-top: 1px solid #ccc;
- // border-bottom: 1px solid #ccc;
- // margin-bottom: 6px;
- }
- }
- .table-box {
- .table-left {
- float: left;
- width: 550px;
- }
- .table-tuodong {
- float: left;
- width: 5px;
- margin: 0 1px 0 1px;
- cursor: col-resize;
- }
- .table-right {
- margin-left: 557px;
- }
- }
- .el-table .el-table__row {
- height: 35px;
- }
- .el-table__body .el-form-item--mini.el-form-item {
- margin: 0px;
- .error {
- overflow: hidden;
- color: #f56c6c;
- font-size: 12px;
- line-height: 1;
- }
- }
- // 隐藏全选按钮
- thead .el-table-column--selection .cell {
- display: none;
- }
- }
- }
- </style>
|