123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538 |
- <template>
- <div class="app-container">
- <div v-if="isPercentage" class="percentage" style="width: 210px;height: 90px;background: #fff;position: fixed;bottom: 0;left: 0;z-index: 9999999999999;">
- <h4 style="padding-left: 10px;line-height: 0;">导出进度:</h4>
- <el-progress style="padding-left: 10px;" :text-inside="true" :stroke-width="26" :percentage="percentage" />
- </div>
- <el-tabs v-model="activeName" @tab-click="handleClick">
- <el-tab-pane v-if="isDistributionSheet" label="采购配单" name="first">
- <div class="purchaseDistributionSheet">
- <div class="filter-container">
- <el-select v-model="getdataListParm1.parammaps.departmentId" style="width: 140px;" placeholder="部门" class="filter-item" @change = "change_dept">
- <el-option v-for="item in deptNameList" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
-
- </div>
- <el-table
- :key="tableKey1"
- v-loading="listLoading1"
- element-loading-text="给我一点时间"
- :data="list1"
- border
- fit
- :row-style="tableRowStyle"
- :cell-style="tableCellStyle"
- highlight-current-row
- style="width: 100%;"
- class="elTable table-fixed"
- @cell-click="cellClick"
- @sort-change="tableSort"
- :max-height="myHeight"
- >
- <el-table-column label="序号" align="center" type="index" width="50px">
- <template slot-scope="scope">
- <span>{{ scope.$index + (pageNum1-1) * pageSize1 + 1 }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件编号" align="center" min-width="150px">
- <template slot-scope="scope">
- <span>{{ scope.row.partCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件名称" align="center" min-width="120px">
- <template slot-scope="scope">
- <span>{{ scope.row.partName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件规格" align="center" min-width="120px">
- <template slot-scope="scope">
- <span>{{ scope.row.specification }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件品牌" min-width="100px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brand }}</span>
- </template>
- </el-table-column>
- <el-table-column label="计量单位" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.unit }}</span>
- </template>
- </el-table-column>
- <el-table-column label="图片" min-width="110px" align="center">
- <template slot-scope="scope">
- <el-popover placement="right" title="" trigger="hover">
- <img v-if="scope.row.picpath !==''" :src="scope.row.picpath">
- <img v-if="scope.row.picpath !==''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
- </el-popover>
- </template>
- </el-table-column>
- <el-table-column label="供应商" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.providerName }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="price" label="单价" min-width="70px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.price }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="sumAmount" label="申购数量" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.sumAmount }}</span>
- </template>
- </el-table-column>
- <el-table-column label="采购数量" min-width="110px" align="center">
- <template slot-scope="scope">
- <el-form :model="scope.row" :rules="rules">
- <el-form-item prop="amount">
- <el-input
- v-model="scope.row.amount"
- style="width:80px;margin-top:25px;height:10px"
- />
- </el-form-item>
- </el-form>
- </template>
- </el-table-column>
- </el-table>
- <el-button :disabled="confirmationSheetDisabled" type="primary" style="float: right;margin-top: 10px;" @click="confirmationSheet()">确认配单</el-button>
- <el-dialog :title="textMap[dialogStatusConfirmation]" :visible.sync="dialogFormVisibleConfirmation" :close-on-click-modal="false" style="width:100%;margin: 0 auto;overflow:auto">
- <div class="app-contentConfirmationSheet">
- <el-form ref="temp1" :rules="rules" :model="temp1" label-position="right" label-width="90px" style="width:100%;margin-bottom:50px">
- <el-row>
- <el-col :span="8">
- <el-form-item label="配单号:" prop="matchCode">
- <el-input ref="matchCode" v-model="temp1.matchCode" disabled />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="提交日期:" prop="buyerDate">
- <el-date-picker
- v-model="temp1.buyerDate"
- :picker-options="pickerOptions"
- type="date"
- placeholder="提交日期"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd"
- style="width:170px;"
- />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="采购员:" prop="buyerPerson">
- <el-select v-model="temp1.buyerPerson" placeholder="采购员" class="filter-item">
- <el-option
- v-for="item in findAllEmploye"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div v-for="(item,index) in listConfirmationSheet" :key="index" class="app-content">
- <div class="title">
- <div>
- <b>采购单号:</b>
- <span>{{ item.orderNumber }}</span>
- </div>
- <div>
- <b>供应商:</b>
- <span>{{ item.providerName }}</span>
- </div>
- </div>
- <el-table
- :key="tableKey1"
- v-loading="listLoading1"
- element-loading-text="给我一点时间"
- :data="item.list"
- border
- fit
- highlight-current-row
- style="width: 97%;margin:0 auto"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- >
- <!-- table表格 -->
- <el-table-column label="序号" align="center" type="index" width="50px">
- <template slot-scope="scope">
- <span>{{ scope.$index + (pageNum1-1) * pageSize1 + 1 }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件编号" align="center" min-width="150px">
- <template slot-scope="scope">
- <span>{{ scope.row.partCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件名称" align="center" min-width="120px">
- <template slot-scope="scope">
- <span>{{ scope.row.partName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件规格" align="center" min-width="120px">
- <template slot-scope="scope">
- <span>{{ scope.row.specification }}</span>
- </template>
- </el-table-column>
- <el-table-column label="图片" min-width="110px" align="center">
- <template slot-scope="scope">
- <el-popover placement="right" title="" trigger="hover">
- <img v-if="scope.row.picpath !==''" :src="scope.row.picpath">
- <img v-if="scope.row.picpath !==''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
- </el-popover>
- </template>
- </el-table-column>
- <el-table-column label="备件品牌" min-width="100px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brand }}</span>
- </template>
- </el-table-column>
- <el-table-column label="计量单位" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.unit }}</span>
- </template>
- </el-table-column>
- <el-table-column label="单价" min-width="70px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row. price }}</span>
- </template>
- </el-table-column>
- <el-table-column label="申购数量" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.sumAmount }}</span>
- </template>
- </el-table-column>
- <el-table-column label="合计采购数量" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.amount }}</span>
- </template>
- </el-table-column>
- <el-table-column label="总价" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ (scope.row.sumPrice = scope.row.price * parseFloat(scope.row.amount))| keepTwoNum }}</span>
- </template>
- </el-table-column>
- </el-table>
- <div ref="total" class="total">
- 合计:
- <span>{{ item.Sum }}</span>
- </div>
- </div>
- <div slot="footer" class="dialog-footer" style="bottom:10px">
- <el-button type="primary" :disabled="isokDisable" @click="confirmationSheetData()">确认</el-button>
- <el-button @click="dialogFormVisibleConfirmation= false;get_table_data1();">取消</el-button>
- </div>
- </div>
- </el-dialog>
- </div>
- </el-tab-pane>
- <el-tab-pane v-if="isDistributionManagement" label="配单管理" name="fouth">
- <div class="DistributionManagement">
- <div class="filter-container">
- <el-select v-model="getdataListParm4.parammaps.pastureName" style="width: 140px;" placeholder="牧场" class="filter-item">
- <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
- </el-select>
- <el-input v-model="getdataListParm4.parammaps.matchCode" placeholder="配单号" clearable style="width: 200px;" class="filter-item" />
- <el-select v-model="getdataListParm4.parammaps.statue" clearable placeholder="审核状态" class="filter-item" style="width: 120px;">
- <el-option v-for="item in status2" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- <el-date-picker ref="inputDatetime4" v-model="getdataListParm4.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 270px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始提交日期" end-placeholder="结束提交日期" />
- <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search4">搜索</el-button>
-
-
- </div>
- <el-table
- :key="tableKey4"
- v-loading="listLoading4"
- element-loading-text="给我一点时间"
- :data="list4"
- border
- fit
- highlight-current-row
- style="width: 100%;"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- @sort-change="tableSort"
- @current-change="handleCurrentChange"
- :max-height="myHeight"
- >
-
- <el-table-column label="序号" align="center" type="index" width="50px">
- <template slot-scope="scope">
- <span>{{ scope.$index + (pageNum2-1) * pageSize2 + 1 }}</span>
- </template>
- </el-table-column>
- <el-table-column label="牧场" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.pastureName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="配单号" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.matchCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="采购员" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.empname }}</span>
- </template>
- </el-table-column>
- <el-table-column label="提交日期" sortable prop="dealTime" min-width="110px" align="center" />
- <el-table-column sortable prop="cou" label="采购单数" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.cou }}</span>
- </template>
- </el-table-column>
- <el-table-column label="审核状态" min-width="80px" align="center" :formatter="statue" />
-
- <el-table-column label="操作" align="center" width="250px" class-name="small-padding fixed-width" fixed="right">
- <template slot-scope="{row}">
- <el-button v-if="isPurchaseSee" type="primary" size="mini" @click="form_see4(row)">查看</el-button>
- <el-button v-if="parseFloat(row.statue) === 0 && isExamineDM" style="display:inline-block" type="success" size="mini" @click="handleExamine(row)">审核</el-button>
- <el-button v-else style="display:none;" type="success" size="mini" @click="handleExamine(row)">审核</el-button>
- <el-button v-if="parseFloat(row.statue) === 2" type="success" style="display:inline-block" size="mini" @click="form_edit(row)">编辑</el-button>
- <el-button v-else style="display:none;" type="success" size="mini" @click="form_edit(row)">编辑</el-button>
- </template>
- </el-table-column>
- </el-table>
- <pagination v-show="total4>0" :total="total4" :page.sync="getdataListParm4.offset" :limit.sync="getdataListParm4.pagecount" @pagination="get_table_data4" />
- <el-dialog :title="textMap[dialogStatusSee4]" :visible.sync="dialogFormVisibleSee4" :close-on-click-modal="false">
- <div class="app-contentSee">
- <el-form ref="temp4" :rules="rules" :model="temp4" label-position="right" label-width="80px" style="width: 800px;margin-bottom:30px">
- <el-row>
- <el-col :span="8">
- <el-form-item label="配单号:" prop="matchCode">
- <span>{{ temp4.matchCode }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="采购员:" prop="empname">
- <span>{{ temp4.empname }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="配单日期:" prop="dealTime">
- <span>{{ temp4.dealTime }}</span>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <el-table
- :key="tableKeySee4"
- v-loading="listLoadingSee4"
- element-loading-text="给我一点时间"
- :data="listSee4"
- border
- fit
- highlight-current-row
- style="width: 100%;margin-bottom:100px"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- :max-height="myHeight"
- >
-
- <el-table-column label="序号" align="center" type="index" width="50px" />
- <el-table-column label="采购单号" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.buyeCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件编号" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件名称" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件规格" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.specification }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件品牌" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brand }}</span>
- </template>
- </el-table-column>
- <el-table-column label="计量单位" min-width="60px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.unit }}</span>
- </template>
- </el-table-column>
- <el-table-column label="供应商" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.providerName }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="price" label="单价" min-width="60px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.price }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="sumAmount" label="申购数量" min-width="60px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.sumAmount }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="amount" label="采购数量" min-width="60px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.amount }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="sumPrice" label="总价" min-width="60px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.sumPrice }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件图片" min-width="110px" align="center">
- <template slot-scope="scope">
- <el-popover placement="right" title="" trigger="hover">
- <img v-if="scope.row.picpath !==''" :src="scope.row.picpath">
- <img v-if="scope.row.picpath !==''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
- </el-popover>
- </template>
- </el-table-column>
- <el-table-column prop="SGremark" label="备注" min-width="60px" align="center" />
- </el-table>
- <el-form ref="temp4" :rules="rules" :model="temp4" label-position="right" label-width="120px" style="width: 90%;margin:0 auto;">
- <el-row>
- <el-col>
- <el-form-item label="流程进度" />
- <el-steps :active="active" align-center finish-status="success">
- <el-step
- v-for="(item,index) in activeList"
- :key="index"
- :title="item.title"
- :status="item.status"
- >
- <template slot="description">
- <div class="step-row">
- <div>{{ item.name }} {{ item.date }}</div>
- <div>{{ item.reason }}</div>
- </div>
- </template>
- </el-step>
- </el-steps>
- </el-col>
- </el-row>
- <el-row>
- <el-col>
- <el-form-item label="操作:">
- <!-- 审核 -->
- <el-button v-if="isExamineDM && temp4.statue == 0" type="success" style="display:inline-block" @click="handleExamine()">审核</el-button>
- <el-button v-else type="success" style="display:none" @click="handleExamine()">审核</el-button>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:10px">
- <el-button @click="dialogFormVisibleSee4 = false;">关闭</el-button>
- </div>
- </div>
- </el-dialog>
- <el-dialog :title="textMap[dialogStatusUpdate4]" width="90%" :visible.sync="dialogFormVisibleUpdate4" :close-on-click-modal="false">
- <div class="app-contentUpdate">
- <el-form
- ref="updateTemp4"
- :rules="rules"
- :model="updateTemp4"
- label-position="right"
- label-width="80px"
- style="width:80%;margin-bottom:30px"
- >
- <el-row>
- <el-col :span="8">
- <el-form-item label="配单号:" prop="matchCode">
- <span>{{ updateTemp4.matchCode }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="采购员:" prop="empname">
- <span>{{ updateTemp4.empname }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="配单日期:" prop="dealTime">
- <span>{{ updateTemp4.dealTime }}</span>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <el-table
- :key="tableKeyUpdate4"
- v-loading="listLoadingUpdate4"
- element-loading-text="给我一点时间"
- :data="listUpdate4"
- border
- fit
- highlight-current-row
- style="width: 100%;margin-bottom:100px"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- >
- <!-- table表格 -->
- <el-table-column label="序号" align="center" type="index" width="50px" />
- <el-table-column label="采购单号" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.buyeCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件编号" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件名称" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件规格" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.specification }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件品牌" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brand }}</span>
- </template>
- </el-table-column>
- <el-table-column label="计量单位" min-width="60px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.unit }}</span>
- </template>
- </el-table-column>
- <el-table-column label="供应商" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.providerName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="单价" min-width="60px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.price }}</span>
- </template>
- </el-table-column>
- <el-table-column label="申购数量" min-width="60px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.sumAmount }}</span>
- </template>
- </el-table-column>
- <el-table-column label="采购数量" min-width="100px" align="center">
- <template slot-scope="scope">
- <el-form :model="scope.row" :rules="rules">
- <el-form-item prop="amount">
- <el-input
- v-model="scope.row.amount"
- style="width:80px;margin-top:25px;height:10px"
- />
- </el-form-item>
- </el-form>
- </template>
- </el-table-column>
- <el-table-column label="总价" min-width="60px" align="center">
- <template slot-scope="scope">
- <span>{{ (parseFloat(scope.row.price) * parseFloat(scope.row.amount)) | keepTwoNum2 }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件图片" min-width="110px" align="center">
- <template slot-scope="scope">
- <el-popover placement="right" title="" trigger="hover">
- <img v-if="scope.row.picpath !==''" :src="scope.row.picpath">
- <img v-if="scope.row.picpath !==''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
- </el-popover>
- </template>
- </el-table-column>
- </el-table>
- <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:10px">
- <el-button type="primary" :disabled="isokDisable" @click="edit_dialog_save()">确认</el-button>
- <el-button @click="dialogFormVisibleUpdate4 = false;">关闭</el-button>
- </div>
- </div>
- </el-dialog>
- <el-dialog :title="textMap[dialogStatus_Examine]" :visible.sync="dialogFormVisible_Examine" :close-on-click-modal="false" width="30%">
- <div class="app-examine">
- <h3 style="width: 100%;margin:0 0 0 5%;line-height:50px;">请确认审核结果:</h3>
- <el-form ref="examineTemp" :rules="rules" :model="examineTemp" label-position="right" style="width: 50%;margin:0 auto;">
- <el-row style="width:88%;height:150px;margin:0 auto;">
- <el-col :span="20">
- <el-form-item>
- <el-radio-group v-model="examineTemp.SHstatue" @change="changeSHStatue">
- <el-radio :label="1" checked>通过</el-radio>
- <el-radio :label="2">不通过</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-col>
- <el-col v-if="statueReason" :span="20">
- <el-input v-model="examineTemp.workflowNote" type="textarea" :autosize="{ minRows: 2, maxRows: 4}" placeholder="请输入不通过原因" />
- </el-col>
- </el-row>
- </el-form>
- </div>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" :disabled="isokDisable" @click="dialogStatus_Examine==='examine'?createExamineData():createExamineData()">确认</el-button>
- <el-button @click="dialogFormVisible_Examine = false;">关闭</el-button>
- </div>
- </el-dialog>
- </div>
- </el-tab-pane>
- <el-tab-pane label="采购单管理" name="second">
- <div class="purchaseOrderManagement">
- <div class="filter-container">
- <el-select v-model="getdataListParm2.parammaps.pastureName" style="width: 140px;" placeholder="牧场" class="filter-item">
- <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
- </el-select>
- <el-input v-model="getdataListParm2.parammaps.buyeCode" placeholder="采购单号" clearable style="width: 200px;" class="filter-item" />
- <el-select v-model="getdataListParm2.parammaps.statu" clearable placeholder="单据状态" class="filter-item" style="width: 120px;">
- <el-option v-for="item in status" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- <el-autocomplete v-model="getdataListParm2.parammaps.providerName" value-key="providerName" class="inline-input" :fetch-suggestions="providerSearch" placeholder="供应商" style="width:150px;top:-3px;" @select="handleSelectProvider" />
- <el-date-picker ref="inputDatetime2" v-model="getdataListParm2.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 270px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始提交日期" end-placeholder="结束提交日期" />
- <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search2">搜索</el-button>
- <el-button v-waves v-if="isPurchaseSap" class="filter-item" type="primary" @click="sapUpload">SAP上传</el-button>
- <el-button v-waves v-if="isPurchaseSrm" class="filter-item" type="primary" @click="srmUpload">SRM上传</el-button>
- </div>
- <el-table
- :key="tableKey2"
- v-loading="listLoading2"
- element-loading-text="给我一点时间"
- :data="list2"
- border
- fit
- highlight-current-row
- style="width: 100%;"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- @sort-change="tableSort"
- @selection-change="change_table_selection"
- :max-height="myHeight"
- >
- <el-table-column type="selection" :selectable="checkboxInit" align="center" width="50" />
- <el-table-column label="序号" align="center" type="index" width="50px">
- <template slot-scope="scope">
- <span>{{ scope.$index + (pageNum2-1) * pageSize2 + 1 }}</span>
- </template>
- </el-table-column>
- <el-table-column label="牧场" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.pastureName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="采购单号" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.buyeCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="供应商" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.providerName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="采购员" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.empname }}</span>
- </template>
- </el-table-column>
- <el-table-column label="提交日期" sortable prop="buyerDate" min-width="110px" align="center" />
- <el-table-column label="最近到货日期" sortable prop="DoneDate" min-width="110px" align="center" />
- <el-table-column label="单据状态" min-width="80px" align="center" :formatter="statu" />
- <el-table-column prop="sapNumber" label="sap编码" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{scope.row.sapNumber}}</span>
- </template>
- </el-table-column>
- <el-table-column prop
- <el-table-column prop="sapstatus" label="sap上传状态" min-width="80px" align="center">
- <template slot-scope="scope">
- <span v-show="scope.row.sapstatus == 1">上传失败</span>
- <span v-show="scope.row.sapstatus == -1">未上传</span>
- <span v-show="scope.row.sapstatus == 0">上传成功</span>
- </template>
- </el-table-column>
- <el-table-column prop="srmstatus" label="srm上传状态" min-width="80px" align="center">
- <template slot-scope="scope">
- <span v-show="scope.row.srmstatus == 1">上传失败</span>
- <span v-show="scope.row.srmstatus == -1">未上传</span>
- <span v-show="scope.row.srmstatus == 0">上传成功</span>
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center" width="250px" class-name="small-padding fixed-width" fixed="right">
- <template slot-scope="{row}">
- <el-button v-if="isPurchaseSee" type="primary" size="mini" @click="form_see2(row)">查看</el-button>
- <el-button v-if="(row.statu === 2 || row.statu === 4) && isPurchaseClose" style="display:none" type="danger" size="mini" @click="handleClose2(row)">关闭</el-button>
- <el-button v-else-if="isPurchaseClose" style="display:inline-block" type="danger" size="mini" @click="handleClose2(row)">关闭</el-button>
- </template>
- </el-table-column>
- </el-table>
- <pagination v-show="total2>0" :total="total2" :page.sync="getdataListParm2.offset" :limit.sync="getdataListParm2.pagecount" @pagination="get_table_data2" />
- <el-dialog :title="textMap[dialogStatusSee2]" :visible.sync="dialogFormVisibleSee2" :close-on-click-modal="false">
- <div class="app-contentSee">
- <el-form
- ref="temp2"
- :rules="rules"
- :model="temp2"
- label-position="right"
- label-width="80px"
- style="width: 800px;margin-bottom:30px"
- >
- <el-row>
- <el-col :span="8">
- <el-form-item label="采购单号:" prop="buyeCode">
- <span>{{ temp2.buyeCode }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="供应商:" prop="providerName">
- <span>{{ temp2.providerName }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="5">
- <el-form-item label="采购员:" prop="empname">
- <span>{{ temp2.empname }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="5">
- <el-form-item label="提交日期:" prop="buyerDate">
- <span>{{ temp2.buyerDate }}</span>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <el-table
- :key="tableKeySee2"
- v-loading="listLoadingSee2"
- element-loading-text="给我一点时间"
- :data="listSee2"
- border
- fit
- highlight-current-row
- style="width: 100%;margin-bottom:100px"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- @sort-change="tableSort2"
- >
- <el-table-column label="序号" align="center" type="index" width="50px" />
- <el-table-column label="备件编号" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件名称" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件规格" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.specification }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件图片" min-width="110px" align="center">
- <template slot-scope="scope">
- <el-popover placement="right" title="" trigger="hover">
- <img v-if="scope.row.picpath !==''" :src="scope.row.picpath">
- <img v-if="scope.row.picpath !==''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
- </el-popover>
- </template>
- </el-table-column>
- <el-table-column label="备件品牌" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brand }}</span>
- </template>
- </el-table-column>
- <el-table-column label="计量单位" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.unit }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="price" label="单价(元)" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.price }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="sumAmount" label="申购数量" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.sumAmount }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="amount" label="采购数量" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.amount }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="sumPrice" label="总价(元)" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.sumPrice }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="receiveAmount" label="入库数" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.receiveAmount }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="SGremark" label="备注" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.SGremark }}</span>
- </template>
- </el-table-column>
- </el-table>
- <div class="sum" style="right:30px;position:absolute;bottom:90px">
- <b>总计:{{ temp2.sumPrices }}元</b>
- </div>
- <div class="stuts" style="left:30px;position:absolute;bottom:70px">
- <b>单据状态:{{ temp2.statu }}</b>
- <b v-if="isStatu">关闭原因:{{ temp2.note }}</b>
- <div v-if="isExtensionDays">延期天数:{{ temp2.extensionDays }}</div>
- </div>
- <div
- slot="footer"
- class="dialog-footer"
- style="right:30px;position:absolute;bottom:10px"
- >
- <el-button @click="dialogFormVisibleSee2 = false;get_table_data2()">关闭</el-button>
- </div>
- </div>
- </el-dialog>
- <el-dialog :title="textMap[dialogStatusClose]" :visible.sync="dialogFormVisibleClose" :close-on-click-modal="false" style="width:70%;margin: 0 auto">
- <div class="app-contentClose">
- <el-form
- ref="temp2"
- :rules="rules"
- :model="temp2"
- label-position="right"
- label-width="80px"
- style="width: 300px;margin-bottom:30px"
- >
- <el-row>
- <el-col :span="24">
- <el-form-item label="采购单号:" prop="orderNo">
- <span>{{ temp2.buyeCode }}</span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="24">
- <el-form-item label="" prop="note">
- <el-input ref="note" v-model="temp2.note" type="textarea" placeholder="请输入关闭该采购单原因" />
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div
- slot="footer"
- class="dialog-footer"
- style="right:30px;position:absolute;bottom:10px"
- >
- <el-button @click="dialogFormVisibleClose = false;get_table_data2();">取消</el-button>
- <el-button type="primary" :disabled="isokDisable" @click="closeData()">确认关闭</el-button>
- </div>
- </div>
- </el-dialog>
- </div>
- </el-tab-pane>
- <el-tab-pane label="采购明细" name="third">
- <div class="procurementDetails">
- <div class="filter-container">
- <el-select v-model="getdataListParm3.parammaps.pastureName" style="width: 140px;" placeholder="牧场" class="filter-item">
- <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
- </el-select>
- <el-input v-model="getdataListParm3.parammaps.partCode" placeholder="备件编号" style="width: 200px;" class="filter-item" />
- <el-input v-model="getdataListParm3.parammaps.partName" placeholder="备件名称" style="width: 140px;" class="filter-item" />
- <el-autocomplete v-model="getdataListParm3.parammaps.providerName" value-key="providerName" class="inline-input" :fetch-suggestions="providerSearch" placeholder="供应商" style="width:150px;top:-3px;" @select="handleSelectProvider" />
- <el-input v-model="getdataListParm3.parammaps.matchCode" placeholder="配单号" style="width: 140px;" class="filter-item" />
- <el-input v-model="getdataListParm3.parammaps.buyeCode" placeholder="采购单号" style="width: 140px;" class="filter-item" />
- <el-select v-model="getdataListParm3.parammaps.isStorage" clearable placeholder="到货情况" class="filter-item" style="width: 120px;">
- <el-option v-for="item in isStorages" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- <el-date-picker ref="inputDatetime3" v-model="getdataListParm3.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 270px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
- <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search3">搜索</el-button>
- <el-button v-if="isPurchaseExport" class="filter-item" style="margin-left: 10px;" type="success" icon="el-icon-edit" @click="handleDownload3">导出</el-button>
- </div>
- <el-table
- :key="tableKey3"
- v-loading="listLoading3"
- element-loading-text="给我一点时间"
- :data="list3"
- border
- fit
- highlight-current-row
- style="width: 100%;"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- @sort-change="tableSort"
- :max-height="myHeight"
- >
- <el-table-column label="序号" align="center" type="index" width="50px">
- <template slot-scope="scope">
- <span>{{ scope.$index + (pageNum3-1) * pageSize3 + 1 }}</span>
- </template>
- </el-table-column>
- <el-table-column label="牧场" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.pastureName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="配单号" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.matchCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="采购单号" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.buyeCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件编号" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件名称" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件规格" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.specification }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件品牌" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brand }}</span>
- </template>
- </el-table-column>
- <el-table-column label="计量单位" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.unit }}</span>
- </template>
- </el-table-column>
- <el-table-column label="供应商" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.providerName }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="price" label="单价" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.price }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="sumAmount" label="申购数量" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.sumAmount }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="amount" label="采购数量" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.amount }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="receiveAmount" label="入库数" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.receiveAmount }}</span>
- </template>
- </el-table-column>
- <el-table-column label="申购部门" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.departmentName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="采购人" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.empname }}</span>
- </template>
- </el-table-column>
- <el-table-column label="配单日期" sortable prop="buyerDate" min-width="110px" align="center" />
- <!-- <el-table-column label="备注" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.note }}</span>
- </template>
- </el-table-column> -->
- </el-table>
- <pagination v-show="total3>=0" :total="total3" :page.sync="getdataListParm3.offset" :limit.sync="getdataListParm3.pagecount" @pagination="get_table_data3" />
- </div>
- </el-tab-pane>
- </el-tabs>
- </div>
- </template>
- <script>
- // 引入
- import { GetDataByName, GetDataByNames, ExecDataByConfig, PostDataByName, failproccess, checkButtons, GetAccount,SapOrder,SrmOrder } from '@/api/common'
- import waves from '@/directive/waves' // waves directive
- import Pagination from '@/components/Pagination' // secondary package based on el-pagination
- import Cookies from 'js-cookie'
- import { parseTime, sortChange, json2excel } from '@/utils/index.js'
- export default {
- name: 'Purchase',
- components: { Pagination },
- directives: { waves },
- filters: {
- keepTwoNum(value) {
- value = Number(value)
- return value.toFixed(3)
- },
- keepTwoNum2(value) {
- value = Number(value)
- return value.toFixed(2)
- }
- },
- data() {
- return {
- myHeight:document.documentElement.clientHeight - 85- 150,
- isSap:1,
- isSrm:1,
- selectList: [],
- isPurchaseSap: [],isPurchaseSrm: [],
- isPurchaseSee: [], isPurchaseClose: [], isPurchaseExport: [], isDistributionSheet: [], isDistributionManagement: [], isExamineDM: [],
- stripe: true,
- activeName: 'first',
- listLoading1: false,
- tableKey1: 0,
- list1: [],
- confirmationSheetDisabled: false,
- isokDisable: false,
- pickerOptions: {
- disabledDate(time) {
- return time.getTime() > Date.now() // 当天之前的时间可选
- }
- },
- temp: {},
- total: 0,
- total1: 0,
- listParmConfirmation: [],
- listConfirmationSheet: null,
- getParmPurchaseOrderNumber: {
- name: 'autoCreatCode',
- page: 1,
- offset: 1,
- returntype: 'Map',
- parammaps: {
- pastureId: Cookies.get('pastureid'),
- codeType: 'CG'
- }
- },
- postDataPramas: {},
- requestProvider: {
- name: 'getProviderList',
- page: 1,
- offset: 1,
- pagecount: 10,
- returntype: 'Map',
- parammaps: {}
- },
- listLoading2: false,
- tableKey2: 0,
- list2: [],
- status2: [
- { id: '0', name: '审核中' },
- { id: '1', name: '审核通过' },
- { id: '2', name: '审核驳回' }
- ],
- status: [
- { id: '0', name: '未到货' },
- { id: '1', name: '部分到货' },
- { id: '2', name: '按时到货' },
- { id: '3', name: '已延期' },
- { id: '4', name: '已关闭' },
- { id: '5', name: '部分到货-延期' },
- { id: '6', name: '全部到货-延期' }
- ],
- isStorages: [
- { id: '0', name: '未入库' },
- { id: '1', name: '已入库' }
- ],
- isStatu: false,
- listLoadingSee2: false,
- tableKeySee2: 0,
- total2: 0,
- total3: 0,
- listLoading3: false,
- tableKey3: 0,
- list3: [],
- findAllEmploye: [],
- findAllPasture: [],
- requestParams: [
- { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
- { name: 'getDepartmentNY', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
- { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }}
- ],
- getdataListParm1: {
- name: 'getbuydetailParts',
- page: 1,
- // offset: 1,
- // pagecount: 10,
- returntype: 'Map',
- parammaps: {
- pastureId: Cookies.get('pastureid'),
- departmentId:0,
- }
- },
- getdataListPart: {
- name: 'getpartpurchasebg',
- page: 1,
- // offset: 1,
- // pagecount: 10,
- returntype: 'Map',
- parammaps: {
- id: Cookies.get('pastureid'),
- departmentId:0,
- }
- },
- partData: [],
- getParmCreateNumber: {
- name: 'autoCreatCode',
- page: 1,
- offset: 1,
- returntype: 'Map',
- parammaps: {
- pastureId: Cookies.get('pastureid'),
- codeType: 'PD'
- }
- },
- pageNum1: 0,
- pageSize1: 0,
- temp1: {
- pastureId: Cookies.get('pastureid'),
- buyerPerson: this.$store.state.user.employeid,
- buyerDate: parseTime(new Date(), '{y}-{m}-{d}')
- },
- getdataListParm2: {
- name: 'getBigbuydetailList',
- page: 1,
- offset: 1,
- pagecount: 10,
- returntype: 'Map',
- parammaps: {
- providerName: '',
- buyeCode: '',
- inputDatetime: '',
- // pastureId: Cookies.get('pastureid'),
- pastureName: Cookies.get('pasturename')
- }
- },
- dialogFormVisibleConfirmation: false,
- dialogStatusConfirmation: '',
- pageNum2: 0,
- pageSize2: 0,
- temp2: {
- note: ''
- },
- getdataListParm3: {
- name: 'getbuydetailList',
- page: 1,
- offset: 1,
- pagecount: 10,
- returntype: 'Map',
- parammaps: {
- pastureName: Cookies.get('pasturename'),
- providerName: '',
- partCode: '',
- partName: '',
- matchCode: '',
- buyeCode: '',
- isStorage: '',
- startTime: '',
- stopTime: '',
- inputDatetime: ''
- }
- },
- isExtensionDays: false,
- listSee2: [],
- getdataListSee2: {
- name: 'getbuydetailListbyBig',
- returntype: 'Map',
- parammaps: {}
- },
- requestParamStute: {
- name: 'updateBigbuydetailStatu',
- returntype: 'Map',
- parammaps: {}
- },
- pageNum3: 0,
- pageSize3: 0,
- temp3: {},
- dialogFormVisibleSee2: false,
- dialogStatusSee2: '',
- // 配单管理
- listLoading4: false,
- tableKey4: 0,
- list4: [],
- pageNum4: 0,
- pageSize4: 0,
- total4: 0,
- getdataListParm4: {
- name: 'getbigpartdeallist',
- page: 1,
- offset: 1,
- pagecount: 10,
- returntype: 'Map',
- parammaps: {
- pastureName: Cookies.get('pasturename'),
- matchCode: '',
- statue: '',
- inputDatetime: '',
- startTime: '',
- stopTime: ''
- }
- },
- dialogFormVisibleSee4: false,
- dialogStatusSee4: '',
- temp4: {},
- listSee4: [],
- tableKeySee4: 0,
- listLoadingSee4: false,
- getdataListSee4: {
- name: 'getbigpartdealdetiallist',
- returntype: 'Map',
- parammaps: {}
- },
- activeList: [],
- deptNameList: [],
- active: 3,
- currentRow:{},
- dialogStatusUpdate4: '',
- dialogFormVisibleUpdate4: false,
- updateTemp4: {},
- listUpdate4: [],
- tableKeyUpdate4: 0,
- listLoadingUpdate4: false,
- dialogFormVisible_Examine: false,
- dialogStatus_Examine: '',
- examineTemp: {
- SHstatue: 1,
- workflowNote: ''
- },
- statueReason: false,
- dialogFormVisibleClose: false,
- dialogStatusClose: '',
- textMap: {
- confirmation: '确认配单',
- see: '查看详情',
- close: '关闭提示',
- examine: '审核',
- update: '编辑'
- },
- // 校验规则
- rules: {
- equipmentName: [{ required: true, message: '必填', trigger: 'blur' }],
- note: [{ required: true, message: '必填', trigger: 'blur' }]
- },
- rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
- cellStyle: { padding: 0 + 'px' },
- buttons: [],
- downloadListParm3: {},
- downloadList3: [],
- isPercentage: false,
- percentage: 1
- }
- },
- created() {
- const that = this
- GetDataByName({ 'name': 'getUserPCButtons', 'parammaps': { 'jwt_username': Cookies.get('name') }}).then(response => {
- that.buttons = response.data.list
- that.get_auto_buttons()
- if (this.isDistributionSheet == true) {
- this.activeName = 'first'
- console.log(1, this.isDistributionSheet, this.isDistributionManagement)
- } else if (this.isDistributionManagement == true) {
- this.activeName = 'fouth'
- console.log(2, this.isDistributionSheet, this.isDistributionManagement)
- } else if (this.isDistributionSheet == false && this.isDistributionManagement == false) {
- this.activeName = 'second'
- console.log(3, this.isDistributionSheet, this.isDistributionManagement)
- }
- })
- this.get_select_list()
- this.get_table_data1()
- this.get_table_data2()
- this.get_table_data3()
- this.get_table_data4()
- if (this.$route.query.activeName !== undefined) {
- this.activeName = this.$route.query.activeName
- }
- },
- methods: {
- change_dept(e){
- console.log(e)
- this.getdataListParm1.parammaps.departmentId = e
- this.getdataListPart.parammaps.departmentId = e
- this.get_table_data1()
- },
- tableSort(column) {
- if (this.activeName == 'first') {
- sortChange(column, this.list1)
- } else if (this.activeName == 'second') {
- sortChange(column, this.list2)
- } else if (this.activeName == 'third') {
- sortChange(column, this.list3)
- } else if (this.activeName == 'fouth') {
- sortChange(column, this.list4)
- }
- },
- tableSort2(column) {
- sortChange(column, this.listSee2)
- },
- get_auto_buttons() {
- const DistributionSheet = 'customs:purchase:distributionSheet'
- const isDistributionSheet = checkButtons(this.$store.state.user.buttons, DistributionSheet)
- this.isDistributionSheet = isDistributionSheet
- const PurchaseSee = 'customs:purchase:see'
- const isPurchaseSee = checkButtons(this.$store.state.user.buttons, PurchaseSee)
- this.isPurchaseSee = isPurchaseSee
- const PurchaseClose = 'customs:purchase:close'
- const isPurchaseClose = checkButtons(this.$store.state.user.buttons, PurchaseClose)
- this.isPurchaseClose = isPurchaseClose
- const PurchaseSap = 'customs:purchase:sap'
- const isPurchaseSap = checkButtons(this.$store.state.user.buttons, PurchaseSap)
- this.isPurchaseSap = isPurchaseSap
- const PurchaseSrm = 'customs:purchase:srm'
- const isPurchaseSrm = checkButtons(this.$store.state.user.buttons, PurchaseSrm)
- this.isPurchaseSrm = isPurchaseSrm
- const PurchaseExport = 'customs:purchase:export'
- const isPurchaseExport = checkButtons(this.$store.state.user.buttons, PurchaseExport)
- this.isPurchaseExport = isPurchaseExport
- const ExamineDM = 'customs:purchase:shenhe'
- const isExamineDM = checkButtons(this.$store.state.user.buttons, ExamineDM)
- this.isExamineDM = isExamineDM
- const DistributionManagement = 'customs:purchase:peidanjiemian'
- const isDistributionManagement = checkButtons(this.$store.state.user.buttons, DistributionManagement)
- this.isDistributionManagement = isDistributionManagement
- },
- cellClick(row, column, cell, event) {
- console.log(cell)
- console.log('column', column)
- console.log('行索引', row.id)
- console.log('列索引', column.id)
- return {
- background: '#eceb3c'
- }
- // console.log('event',event)
- },
- tableRowStyle({ row, rowIndex }) {
- console.log(row, row)
- console.log(' row.isParity', row.isParity)
- console.log(parseInt(row.isParity) % 2 == 0)
- if (parseInt(row.isParity) % 2 == 0) {
- return {
- background: '#eee'
- }
- }
- return {
- background: ''
- }
- },
- tableCellStyle({ row, column, rowIndex, columnIndex }) {
- if (row.isNo == 'No' && columnIndex === 10) {
- return {
- background: 'red'
- }
- }
- return {
- background: ''
- }
- },
- handleClick(tab, event) {
- console.log(tab, event)
- if (tab.name === 'first') {
- this.get_table_data1()
- } else if (tab.name === 'fouth') {
- this.get_table_data4()
- } else if (tab.name === 'second') {
- this.get_table_data2()
- } else if (tab.name === 'third') {
- this.get_table_data3()
- }
- },
- get_select_list() {
- GetDataByNames(this.requestParams).then(response => {
- this.findAllEmploye = response.data.findAllEmploye.list
- this.findAllPasture = response.data.findAllPasture.list
- this.deptNameList = response.data.getDepartmentNY.list
- console.log(this.deptNameList)
- })
- },
- providerSearch(queryString, cb) {
- console.log('供应商模糊查询输入值', queryString)
- this.requestProvider.parammaps['providerName'] = queryString
- GetDataByName(this.requestProvider).then(response => {
- console.log('供应商模糊查询搜索data', response.data.list)
- cb(response.data.list)
- })
- },
- handleSelectProvider(item) {
- console.log('供应商模糊查询选中值', item)
- },
- get_table_data1() {
- this.listLoading1 = true
- GetDataByName(this.getdataListPart).then(response => {
- console.log(response)
- this.partData = response.data.list
- })
- GetDataByName(this.getdataListParm1).then(response => {
- console.log('this.list1', response.data.list)
- if (response.data.list === null) {
- this.list1 = []
- this.confirmationSheetDisabled = true
- } else {
- // eslint-disable-next-line no-unused-vars
- var list1
- list1 = response.data.list
- var result = []
- list1.forEach((i, j) => {
- // eslint-disable-next-line no-irregular-whitespace
- Array.from(new Set(list1.map(function(item) { return item.partCode }))).forEach((x, y) => {
- if (i.partCode === x) {
- result.push({
- 'amount': i.amount,
- 'amountPre': i.amountPre,
- 'bigId': i.bigId,
- 'brand': i.brand,
- 'brandId': i.brandId,
- 'contractCode': i.contractCode,
- 'count': i.count,
- 'enable': i.enable,
- 'id': i.id,
- 'inventoryType': i.inventoryType,
- 'isZeroStock': i.isZeroStock,
- 'orderNumber': i.orderNumber,
- 'partCode': i.partCode,
- 'partId': i.partId,
- 'partName': i.partName,
- 'pastureId': i.pastureId,
- 'pastureName': i.pastureName,
- 'planAmount': i.planAmount,
- 'price': i.price,
- 'providerId': i.providerId,
- 'providerName': i.providerName,
- 'purpose': i.purpose,
- 'remark': i.remark,
- 'specification': i.specification,
- 'sumAmount': i.sumAmount,
- 'unit': i.unit,
- 'isNo': i.isNo,
- 'srcpath': i.srcpath,
- 'picpath': i.picpath,
- 'departmentName': i.departmentName,
- 'isParity': y
- })
- }
- })
- })
- console.log(result)
- if (result !== null) {
- for (let i = 0; i < result.length; i++) {
- console.log(result[i].srcpath)
- if (result[i].srcpath !== null && result[i].picpath !== null && result[i].srcpath !== undefined && result[i].picpath !== undefined) {
- result[i].srcpath = process.env.VUE_APP_BASE_API + result[i].srcpath
- result[i].picpath = process.env.VUE_APP_BASE_API + result[i].picpath
- } else {
- // this.$set(result[i], 'srcpath', '')
- // this.$set(result[i], 'picpath', '')
- result[i].srcpath = ''
- result[i].picpath = ''
- }
- }
- }
- // console.log(result)
- this.list1 = result
- console.log('处理后table数', this.list1)
- this.confirmationSheetDisabled = false
- }
- var tem = ''
- for (var i = 0; i < this.list1.length; i++) {
- if (tem !== this.list1[i].partCode) {
- this.list1[i].amount = this.list1[i].sumAmount
- tem = this.list1[i].partCode
- } else {
- this.list1[i].amount = 0
- }
- }
- // var a = 0
- // var b = 0
- // for (var i = 0; i < this.list1.length; i++) {
- // if (parseInt(this.list1[i].amountPre) !== 0) {
- // console.log(parseInt(this.list1[i].amountPre))
- // if (a <= 0) {
- // a = this.list1[i].count - 1
- // if (b === 0) {
- // b = parseInt(this.list1[i].amountPre)
- // }
- // } else {
- // a--
- // }
- // if (b > 0) {
- // this.list1[i].amount = this.list1[i].amount + 1
- // b--
- // }
- // }
- // }
- if (response.data.total) {
- this.total1 = response.data.total
- }
- // Just to simulate the time of the request
- setTimeout(() => {
- this.listLoading1 = false
- }, 300)
- })
- },
- confirmationSheet() {
- console.log('点击立确认配单')
- this.temp1.matchCode = ''
- console.log(this.list1) // table表格数据
- // -------------------------------------------
- function groupBy1(array, f) {
- var groups1 = {}
- array.forEach(function(o) {
- var group2 = JSON.stringify(f(o))
- console.log("group2",group2)
- groups1[group2] = groups1[group2] || []
- groups1[group2].push(o)
- })
- return Object.keys(groups1).map(function(group2) {
- return groups1[group2]
- })
- }
- var sorted1 = groupBy1(this.list1, function(item) {
- return [item.partCode]
- })
- console.log('表格数据根据供应商分划', sorted1)
- for (var i = 0; i < sorted1.length; i++) {
- var b = 0
- var c = 0
- for (var j = 0; j < sorted1[i].length; j++) {
- // eslint-disable-next-line no-self-compare
- if (sorted1[i][j].partCode === sorted1[i][j].partCode) {
- // console.log(sorted1[i][j])
- var element = sorted1[i][j]
- b += parseInt(element.amount)
- c = parseInt(element.sumAmount)
- // console.log("amount", element.amount);
- }
- }
- if (b > c || b < c) {
- console.log('No')
- console.log(element.id)
- for (var a = 0; a < this.list1.length; a++) {
- if (element.id === this.list1[a].id) {
- console.log(this.list1[a].partCode)
- for (var b = 0; b < this.list1.length; b++) {
- if (this.list1[b].partCode === this.list1[a].partCode) {
- console.log(this.list1[b])
- this.$set(this.list1[b], 'isNo', 'No')
- } else {
- this.$set(this.list1[b], 'isNo', 'Yes')
- }
- }
- } else {
- this.$set(this.list1[a], 'isNo', 'Yes')
- }
- }
- console.log(b)
- this.$message({
- type: 'warning',
- message: '同一备件多个供应商合计采购数量总和等于申购数量'
- })
- return
- } else {
- for (var a = 0; a < this.list1.length; a++) {
- this.$set(this.list1[a], 'isNo', 'Yes')
- var rulesAmount = /^[0-9]\d*$/
- if (!rulesAmount.test(this.list1[a].amount)) {
- this.$message({
- type: 'error',
- message: '采购数量请输入正整数',
- duration: 2000
- })
- return false
- }
- }
- // console.log('Yes')
- }
- }
- this.getCreateNumber()
- // -------------------------------------------
- this.dialogStatusConfirmation = 'confirmation'
- this.dialogFormVisibleConfirmation = true
- console.log('确认配单data------', this.list1)
- // this.list1 = this.list1.filter(i => parseFloat(i.amount) !== 0)
- console.log(this.list1)
- console.log('根据供应商分类', sorted1)
- console.log('根据供应商分类表格listConfirmationSheet', this.listConfirmationSheet)
- // 处理渲染数据
- var providerNameMap = {}
- var providerNameDest = []
-
- // eslint-disable-next-line no-redeclare
- for (var i = 0; i < this.list1.length; i++) {
- console.log(this.list1[i])
- var ai = this.list1[i]
- var price = this.list1[i].price
- var amount = this.list1[i].amount
- // console.log(price, amount)
- var sumPrice = 0
- sumPrice = parseFloat(price) * parseFloat(amount)
- if (!providerNameMap[ai.providerName]) {
- providerNameDest.push({
- price: [price],
- amount: [amount],
- sumPrice: [sumPrice],
- providerId: ai.providerId,
- providerName: ai.providerName,
- purpose: ai.purpose,
- list: [ai]
- })
- providerNameMap[ai.providerName] = ai
- providerNameMap[ai.providerId] = ai
- } else {
- // eslint-disable-next-line no-redeclare
- for (var j = 0; j < providerNameDest.length; j++) {
- console.log(providerNameDest[j])
- var dj = providerNameDest[j]
- if (dj.providerName === ai.providerName) {
- dj.sumPrice.push(sumPrice)
- dj.price.push(price)
- // eslint-disable-next-line no-mixed-spaces-and-tabs
- dj.amount.push(amount)
- dj.list.push(ai)
- break
- }
- }
- }
- }
- var providerNameArray = []
- // eslint-disable-next-line no-redeclare
- for (var i = 0; i < this.list1.length; i++) {
- providerNameArray.push(this.list1[i].providerName)
- }
- // console.log('原供应商', providerNameArray)
- function unique(providerNameArray) {
- return Array.from(new Set(providerNameArray))
- }
- var uniqueProviderNameArray = unique(providerNameArray)
- console.log('去重后供应商', uniqueProviderNameArray) // ["泰森机电", "浩祥晟机电", "国宇商贸", "赛娜牧业"]
- // ------------------------------------------
- var OrderNumberArray = []
- this.postDataPramas.common = { 'returnmap': '0' }
- this.postDataPramas.data = []
- for (var i = 0; i < uniqueProviderNameArray.length; i++) {
- this.postDataPramas.data[i] = { 'name': 'autoCreatCode', 'type': 'sm', 'parammaps': {
- pastureId: Cookies.get('pastureid'),
- codeType: 'CG'
- }}
- }
- ExecDataByConfig(this.postDataPramas).then(response => {
- console.log('采购单请求发送参数', this.postDataPramas)
- for (var i = 0; i < response.data.length; i++) {
- // console.log(response.data[i].resultmaps[0].orderCode)
- OrderNumberArray.push(response.data[i].resultmaps[0].orderCode)
- }
- console.log(OrderNumberArray)
- this.listConfirmationSheet.map((item, index) => {
- item.orderNumber = OrderNumberArray[index]
- return item
- })
- this.$forceUpdate()
- })
- console.log(OrderNumberArray)
- this.listConfirmationSheet = providerNameDest
- // console.log(JSON.stringify(this.listConfirmationSheet))
- console.log('根据供应商分类表格listConfirmationSheet', this.listConfirmationSheet)
- var SumArray = []
- this.listConfirmationSheet.forEach((item, index) => {
- console.log(item.sumPrice)
- // console.log(item.sumPrice.reduce((count, v) => count + v, 0))
- SumArray.push(item.sumPrice.reduce((count, v) => count + v, 0).toFixed(3))
- })
- this.listConfirmationSheet.map((item, index) => {
- // console.log(item, index)
- item.Sum = SumArray[index]
- return item
- })
- console.log('根据供应商分类表格listConfirmationSheet', this.listConfirmationSheet)
- // -------------------------------------------
- },
- getCreateNumber() {
- GetDataByName(this.getParmCreateNumber).then(response => {
- this.$nextTick(() => {
- this.show = false
- console.log('配单号', response.data.list[0].orderCode)
- this.temp1.matchCode = response.data.list[0].orderCode
- this.$forceUpdate()
- })
- })
- },
- confirmationSheetData() {
- this.isokDisable = true
- setTimeout(() => {
- this.isokDisable = false
- }, 1000)
- console.log('点击了确认配单提交')
- this.$refs['temp1'].validate(valid => {
- if (valid) {
- // orderNumber
- if (this.temp1.matchCode == '' || this.temp1.matchCode == null || this.temp1.matchCode == undefined) {
- this.getCreateNumber()
- }
- this.postDataPramas.common = { 'returnmap': '0' }
- this.postDataPramas.data = []
- console.log(this.listConfirmationSheet)
- for (let i = 0; i < this.listConfirmationSheet.length; i++) {
- if (this.listConfirmationSheet[i].orderNumber == null || this.listConfirmationSheet[i].orderNumber == undefined) {
- this.$notify({
- title: '保存失败',
- message: '网络异常未生成采购单,请刷新后重新进行配单',
- type: 'warning',
- duration: 2000
- })
- return false
- }
- }
- var a = this.listConfirmationSheet.length
- this.listConfirmationSheet.forEach((item, index) => {
- console.log(item)
- this.postDataPramas.data[index] = { 'name': 'insertBigbuydetail', 'resultname': 'insertBigbuydetail' + index, 'type': 'e', 'parammaps': {
- pastureId: Cookies.get('pastureid'),
- buyeCode: item.orderNumber,
- providerId: item.providerId,
- buyerPerson: this.temp1.buyerPerson,
- buyerDate: this.temp1.buyerDate,
- matchCode: this.temp1.matchCode
- }}
- this.postDataPramas.data[a] = { 'name': 'insertSpotList', 'resultmaps': { 'list': item.list }}
- this.postDataPramas.data[a].children = []
- this.postDataPramas.data[a].children[0] = { 'name': 'insertbuydetail', 'type': 'e', 'parammaps': {
- bigId: '@insertBigbuydetail' + index + '.LastInsertId',
- pastureId: '@insertSpotList.pastureId',
- contractCode: '@insertSpotList.contractCode',
- amount: '@insertSpotList.amount',
- sumAmount: '@insertSpotList.sumAmount',
- contractId: '@insertSpotList.id',
- departmentName: '@insertSpotList.departmentName',
- remark: '@insertSpotList.purpose'
- }}
- a = a + 1
- })
- this.postDataPramas.data[a] = { 'name': 'insertSpotListbpp', 'resultmaps': { 'list': this.partData }}
- this.postDataPramas.data[a].children = []
- this.postDataPramas.data[a].children[0] = { 'name': 'updateBigpartpurchaseStatu', 'type': 'e', 'parammaps': {
- id: '@insertSpotListbpp.id',
- matchCode: this.temp1.matchCode
- }}
- this.postDataPramas.data.push({ 'name': 'insertbigpartdeal', 'type': 'e', 'parammaps': {
- empId: this.temp1.buyerPerson,
- pastureId: Cookies.get('pastureid'),
- matchCode: this.temp1.matchCode
- }}
- )
- ExecDataByConfig(this.postDataPramas).then(response => {
- if (response.msg === 'fail') {
- var buyeCode = new RegExp('buyeCode')
- if (buyeCode.test(response.data)) {
- this.$notify({
- title: '',
- message: '网络异常未生成采购单,请刷新后重新进行配单',
- type: 'warning',
- duration: 2000
- })
- } else {
- this.$notify({
- title: '保存失败',
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- }
- } else {
- this.dialogFormVisibleConfirmation = false
- this.activeName = 'fouth'
- this.get_table_data4()
- this.$notify({
- title: '',
- message: '保存成功',
- type: 'success',
- duration: 2000
- })
- }
- })
- }
- })
- },
- get_table_data2() {
- this.listLoading2 = true
- if (this.$refs['inputDatetime2'] !== undefined && this.$refs['inputDatetime2'].value !== null) {
- this.getdataListParm2.parammaps.startTime = this.$refs['inputDatetime2'].value[0]
- this.getdataListParm2.parammaps.stopTime = this.$refs['inputDatetime2'].value[1]
- } else {
- this.getdataListParm2.parammaps.startTime = ''
- this.getdataListParm2.parammaps.stopTime = ''
- }
- GetDataByName(this.getdataListParm2).then(response => {
- this.list2 = response.data.list
- this.pageNum2 = response.data.pageNum
- this.pageSize2 = response.data.pageSize
- if (response.data.total) {
- this.total2 = response.data.total
- }
- // Just to simulate the time of the request
- setTimeout(() => {
- this.listLoading2 = false
- }, 300)
- })
- },
- form_search2() {
- this.listLoading = true
- if (this.getdataListParm2.parammaps.inputDatetime === null) {
- this.getdataListParm2.parammaps.inputDatetime = ''
- }
- this.getdataListParm2.offset = 1
- this.get_table_data2()
- },
- statu: function(cellValue) {
- if (cellValue.statu === 0) {
- return '未到货'
- } else if (cellValue.statu === 1) {
- return '部分到货'
- } else if (cellValue.statu === 2) {
- return '按时到货'
- } else if (cellValue.statu === 3) {
- return '已延期'
- } else if (cellValue.statu === 4) {
- return '已关闭'
- } else if (cellValue.statu === 5) {
- return '部分到货-延期'
- } else if (cellValue.statu === 6) {
- return '全部到货-延期'
- }
- },
- statue: function(cellValue) {
- if (cellValue.statue === 0) {
- return '审核中'
- } else if (cellValue.statue === 1) {
- return '审核通过'
- } else if (cellValue.statue === 2) {
- return '未通过'
- }
- },
- form_see2(row) {
- this.temp2 = Object.assign({}, row)
- if (this.temp2.statu === 0) {
- this.isStatu = false
- this.temp2.statu = '未到货'
- this.isExtensionDays = false
- } else if (this.temp2.statu === 1) {
- this.isStatu = false
- this.temp2.statu = '部分到货'
- this.isExtensionDays = false
- } else if (this.temp2.statu === 2) {
- this.isStatu = false
- this.temp2.statu = '按时到货'
- this.isExtensionDays = false
- } else if (this.temp2.statu === 3) {
- this.isStatu = false
- this.temp2.statu = '已延期'
- this.isExtensionDays = true
- } else if (this.temp2.statu === 4) {
- this.temp2.statu = '已关闭'
- this.isStatu = true
- this.isExtensionDays = false
- } else if (this.temp2.statu === 5) {
- this.isStatu = false
- this.temp2.statu = '部分到货-延期'
- this.isExtensionDays = true
- } else if (this.temp2.statu === 6) {
- this.isStatu = false
- this.temp2.statu = '全部到货-延期'
- this.isExtensionDays = true
- }
- this.dialogStatusSee2 = 'see'
- this.dialogFormVisibleSee2 = true
- this.getdataListSee2.parammaps.id = row.id
- this.getSeeList2()
- },
- getSeeList2() {
- GetDataByName(this.getdataListSee2).then(response => {
- this.listSee2 = response.data.list
- if (response.data.list !== null) {
- for (let i = 0; i < response.data.list.length; i++) {
- if (response.data.list[i].srcpath !== null && response.data.list[i].picpath !== null && response.data.list[i].srcpath !== undefined && response.data.list[i].picpath !== undefined) {
- this.listSee2[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
- this.listSee2[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
- } else {
- this.listSee2[i].srcpath = ''
- this.listSee2[i].picpath = ''
- }
- }
- }
- console.log('查看下方table数据', response.data.list)
- // this.pageNum2 = response.data.pageNum
- // this.pageSize2 = response.data.pageSize
- var sumArray = []
- for (var i = 0; i < this.listSee2.length; i++) {
- console.log()
- sumArray.push(
- this.listSee2[i].sumPrice
- )
- }
- console.log('总价', sumArray)
- var arrvalue = 0
- for (var i = 0; i < sumArray.length; i++) {
- console.log('table内总价每一个值', sumArray[i])
- arrvalue += parseFloat(sumArray[i])// 数组的索引是从0开始的
- }
- this.temp2.sumPrices = arrvalue.toFixed(3)
- setTimeout(() => {
- this.listLoadingSee = false
- }, 100)
- })
- },
- resetCloseTemp() {
- this.temp2.note = ''
- },
- handleClose2(row) {
- this.resetCloseTemp()
- this.temp2 = Object.assign({}, row)
- this.dialogStatusClose = 'close'
- this.dialogFormVisibleClose = true
- },
- handleCurrentChange(val) {
- this.currentRow = val;
- console.log("currentRow",this.currentRow)
- },
- sapUpload(){
- const that = this
- console.log("currentRow",this.currentRow.sapstatus)
- var send_data = this.selectList
- if(send_data.length == 0){
- that.$notify({ title: '失败', message: '请勾选数据!' , type: 'error', duration: 2000 })
- return false
- }
- console.log(that.isSap)
- if(that.isSap == 1){
- that.isSap = 0
- SapOrder(send_data).then(response => {
- console.log('response', response)
-
- if (response.msg !== 'fail') {
- that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
- that.selectList = []
- that.get_table_data2()
-
- } else {
- that.$notify({ title: '失败', message: '上传失败' , type: 'error', duration: 2000 })
- }
-
- })
-
-
- } else {
- that.$notify({ title: '失败', message: '正在请求中,请稍等几秒钟后再点击' , type: 'error', duration: 2000 })
- }
- setTimeout(() => {
- that.isSap = 1
- }, 3000)
-
-
-
- // if(this.currentRow.sapstatus){
-
- // if(this.currentRow.sapstatus != 0){
- // const sapArr = this.currentRow.sapbuyeCode.split(",")
- // console.log("sapArr",sapArr)
- // sapArr.forEach(function(item){
- // console.log("sapArr item",item)
- // var send_data = {
-
- // "code":item,
- // "pastureid":Cookies.get('pastureid')
-
- // }
- // SapOrder(send_data).then(response => {
- // console.log('response', response)
-
- // if (response.msg !== 'fail') {
- // that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
- // that.get_table_data()
-
- // } else {
- // that.$notify({ title: '失败', message: '上传失败' , type: 'error', duration: 2000 })
- // }
-
- // })
-
-
- // })
- // }
- // }
- },
- checkboxInit(row,index){
- console.log(row)
- var data1 = new Date(row.buyerDate)
- var data2 = new Date('2022-10-25')
- if(data1 > data2){ return 1 } else {return 0}
- },
- //监听 - 表格 - 勾选
- change_table_selection(val) {
- this.selectList = val
- console.log('勾选数据selectList', this.selectList)
- },
- srmUpload(){
- const that = this
- console.log("currentRow",this.currentRow.srmstatus)
-
- console.log('勾选数据selectList', this.selectList)
- var send_data = this.selectList
- if(send_data.length == 0){
- that.$notify({ title: '失败', message: '请勾选数据!' , type: 'error', duration: 2000 })
- return false
- }
- console.log(that.isSrm)
- if(that.isSrm == 1){
- that.isSrm = 0
- SrmOrder(send_data).then(response => {
- console.log('response', response)
-
- if (response.msg !== 'fail') {
- that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
- that.selectList = []
- that.get_table_data2()
-
-
- } else {
- that.$notify({ title: '失败', message: '上传失败' , type: 'error', duration: 2000 })
- }
-
- })
-
-
- } else {
- that.$notify({ title: '失败', message: '正在请求中,请稍等几秒钟后再点击' , type: 'error', duration: 2000 })
- }
- setTimeout(() => {
- that.isSrm = 1
- }, 3000)
-
- // if(this.currentRow.srmstatus){
- // if(this.currentRow.srmstatus != 0){
- // const srmArr = this.currentRow.srmbuyeCode.split(",")
- // console.log("srmArr",srmArr)
- // srmArr.forEach(function(item){
- // console.log("srmArr item",item)
- // var send_data = {
-
- // "code":item,
- // "pastureid":Cookies.get('pastureid')
- // }
- // SrmOrder(send_data).then(response => {
- // console.log('response', response)
-
- // if (response.msg !== 'fail') {
- // that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
- // that.get_table_data()
-
- // } else {
- // that.$notify({ title: '失败', message: '上传失败' , type: 'error', duration: 2000 })
- // }
-
- // })
-
-
- // })
- // }
- // }
- },
-
- closeData() {
- this.isokDisable = true
- setTimeout(() => {
- this.isokDisable = false
- }, 1000)
- console.log('点击确认关闭', this.temp2)
- this.$refs['temp2'].validate(valid => {
- if (valid) {
- this.requestParamStute.parammaps.id = this.temp2.id
- this.requestParamStute.parammaps.note = this.temp2.note
- PostDataByName(this.requestParamStute).then(response => {
- console.log('新增保存发送参数', this.requestParamStute)
- if (response.msg !== 'fail') {
- this.get_table_data2()
- this.dialogFormVisibleClose = false
- this.$notify({
- title: '成功',
- message: '关闭成功',
- type: 'success',
- duration: 2000
- })
- } else {
- failproccess(response, this.$notify)
- }
- })
- }
- })
- },
- get_table_data3() {
- this.listLoading3 = true
- if (this.$refs['inputDatetime3'] !== undefined && this.$refs['inputDatetime3'].value !== null) {
- this.getdataListParm3.parammaps.startTime = this.$refs['inputDatetime3'].value[0]
- this.getdataListParm3.parammaps.stopTime = this.$refs['inputDatetime3'].value[1]
- } else {
- this.getdataListParm3.parammaps.startTime = ''
- this.getdataListParm3.parammaps.stopTime = ''
- }
- GetDataByName(this.getdataListParm3).then(response => {
- this.list3 = response.data.list
- this.pageNum3 = response.data.pageNum
- this.pageSize3 = response.data.pageSize
- if (response.data.total) {
- this.total3 = response.data.total
- }
- // Just to simulate the time of the request
- setTimeout(() => {
- this.listLoading3 = false
- }, 300)
- })
- },
- form_search3() {
- this.listLoading = true
- if (this.getdataListParm3.parammaps.inputDatetime === null) {
- this.getdataListParm3.parammaps.inputDatetime = ''
- }
- this.getdataListParm3.offset = 1
- this.get_table_data3()
- },
- handleDownload3() {
- console.log('点击了采购明细导出')
- this.$alert('采购明细正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
- this.isPercentage = true
- this.percentage = 1
- var timer = setInterval(() => {
- this.percentage += 5
- if (this.percentage > 95) {
- this.percentage = 99
- clearInterval(timer)
- }
- this.percentage = this.percentage
- }, 1000)
- this.downloadListParm3.name = this.getdataListParm3.name
- this.downloadListParm3.parammaps = this.getdataListParm3.parammaps
- GetAccount(this.downloadListParm3).then(response => {
- if (response.data.list !== '') {
- this.percentage = 99
- setTimeout(() => {
- this.isPercentage = false
- }, 2000)
- }
- this.downloadList3 = response.data.list
- const elecExcelDatas = [
- {
- tHeader: ['配单号', '采购单号', '备件编号', '备件名称', '备件规格', '备件品牌', '计量单位', '供应商', '单价', '申购数量', '采购数量', '入库数', '申购部门', '采购人', '配单日期'],
- filterVal: ['matchCode', 'buyeCode', 'partCode', 'partName', 'specification', 'brand', 'unit', 'providerName', 'price', 'sumAmount', 'amount', 'receiveAmount', 'departmentName', 'empname', 'buyerDate'],
- tableDatas: this.downloadList3,
- sheetName: '采购明细'
- }
- ]
- json2excel(elecExcelDatas, '采购明细', true, 'xlsx')
- })
- },
- get_table_data4() {
- this.listLoading4 = true
- if (this.$refs['inputDatetime4'] !== undefined && this.$refs['inputDatetime4'].value !== null) {
- this.getdataListParm4.parammaps.startTime = this.$refs['inputDatetime4'].value[0]
- this.getdataListParm4.parammaps.stopTime = this.$refs['inputDatetime4'].value[1]
- } else {
- this.getdataListParm4.parammaps.startTime = ''
- this.getdataListParm4.parammaps.stopTime = ''
- }
- GetDataByName(this.getdataListParm4).then(response => {
- this.list4 = response.data.list
- this.pageNum4 = response.data.pageNum
- this.pageSize4 = response.data.pageSize
- if (response.data.total) {
- this.total4 = response.data.total
- }
- // Just to simulate the time of the request
- setTimeout(() => {
- this.listLoading4 = false
- }, 300)
- })
- },
- form_search4() {
- this.listLoading = true
- if (this.getdataListParm4.parammaps.inputDatetime === null) {
- this.getdataListParm4.parammaps.inputDatetime = ''
- }
- this.getdataListParm4.offset = 1
- this.get_table_data4()
- },
- form_see4(row) {
- this.dialogStatusSee4 = 'see'
- this.dialogFormVisibleSee4 = true
- this.temp4 = Object.assign({}, row)
- this.getdataListSee4.parammaps.matchCode = row.matchCode
- this.getSeeList4()
- var reason = '未通过原因:' + this.temp4.workflowNote
- if (this.temp4.statue === 0) {
- this.activeList = [{ title: '配单', date: this.temp4.dealTime, name: this.temp4.empname }, { title: '办公室主任审核' }]
- this.active = 1
- } else if (this.temp4.statue === 1) {
- this.activeList = [{ title: '配单', date: this.temp4.dealTime, name: this.temp4.empname }, { title: '办公室主任审核', date: this.temp4.chargeDate, name: this.temp4.chargeName }]
- this.active = 2
- } else if (this.temp4.statue === 2) {
- this.activeList = [{ title: '配单', date: this.temp4.dealTime, name: this.temp4.empname }, { title: '办公室主任审核', date: this.temp4.chargeDate, name: this.temp4.chargeName, status: 'error', reason: reason }]
- this.active = 2
- }
- },
- getSeeList4() {
- GetDataByName(this.getdataListSee4).then(response => {
- this.listSee4 = response.data.list
- this.listUpdate4 = response.data.list
- if (response.data.list !== null) {
- for (let i = 0; i < response.data.list.length; i++) {
- console.log(response.data.list[i].srcpath)
- console.log(response.data.list[i].picpath)
- console.log(process.env.VUE_APP_BASE_API + response.data.list[i].srcpath)
- if (response.data.list[i].srcpath !== null && response.data.list[i].picpath !== null && response.data.list[i].srcpath !== undefined && response.data.list[i].picpath !== undefined) {
- if (this.dialogStatusSee4 == 'see') {
- this.listSee4[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
- this.listSee4[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
- } else {
- this.listUpdate4[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
- this.listUpdate4[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
- }
- } else {
- this.listSee4[i].srcpath = ''
- this.listSee4[i].picpath = ''
- this.listUpdate4[i].srcpath = ''
- this.listUpdate4[i].picpath = ''
- }
- }
- }
- console.log('查看下方table数据', response.data.list)
- this.pageNum4 = response.data.pageNum
- this.pageSize4 = response.data.pageSize
- })
- },
- handleExamine(row) {
- if (row == undefined) {
- this.examineTemp = this.temp4
- this.$set(this.temp4, 'SHstatue', 1)
- this.$set(this.temp4, 'workflowNote', '')
- } else {
- this.examineTemp = Object.assign({}, row)
- this.$set(this.examineTemp, 'SHstatue', 1)
- this.$set(this.examineTemp, 'workflowNote', '')
- }
- this.dialogStatus_Examine = 'examine'
- this.dialogFormVisible_Examine = true
- this.statueReason = false
- },
- changeSHStatue(val) {
- if (val == 2) {
- this.statueReason = true
- } else {
- this.statueReason = false
- }
- },
- createExamineData() {
- console.log(this.examineTemp)
- this.$refs['examineTemp'].validate(valid => {
- if (valid) {
- if (this.examineTemp.SHstatue == 1) {
- console.log('通过')
- this.postDataPramas.common = { 'returnmap': '0' }
- this.postDataPramas.data = []
- this.postDataPramas.data[0] = { 'name': 'partdealCharge', 'type': 'e', 'parammaps': {
- 'id': this.examineTemp.id,
- 'statue': this.examineTemp.SHstatue,
- 'empId': Cookies.get('employeid'),
- 'workflowNote': this.examineTemp.workflowNote
- }}
- this.postDataPramas.data[1] = { 'name': 'updatebigbuydetailenable', 'type': 'e', 'parammaps': {
- 'matchCode': this.examineTemp.matchCode
- }}
- this.postDataPramas.data[2] = { 'name': 'updatebigbuydetailZero', 'type': 'e', 'parammaps': {
- 'matchCode': this.examineTemp.matchCode
- }}
- ExecDataByConfig(this.postDataPramas).then(response => {
- console.log('审核保存发送参数', this.postDataPramas)
- if (response.msg === 'fail') {
- this.$notify({
- title: '审核失败',
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- } else {
- this.dialogFormVisible_Examine = false
- this.get_table_data4()
- this.$notify({
- title: '',
- message: '审核成功',
- type: 'success',
- duration: 2000
- })
- }
- })
- } else if (this.examineTemp.SHstatue == 2) {
- console.log('不通过')
- this.postDataPramas.common = { 'returnmap': '0' }
- this.postDataPramas.data = []
- this.postDataPramas.data[0] = { 'name': 'partdealCharge', 'type': 'e', 'parammaps': {
- 'id': this.examineTemp.id,
- 'statue': this.examineTemp.SHstatue,
- 'empId': Cookies.get('employeid'),
- 'workflowNote': this.examineTemp.workflowNote
- }}
- // this.postDataPramas.data[1] = { 'name': 'updatepartpurchase', 'type': 'e', 'parammaps': {
- // 'matchCode': this.examineTemp.matchCode
- // }}
- ExecDataByConfig(this.postDataPramas).then(response => {
- console.log('审核保存发送参数', this.postDataPramas)
- if (response.msg === 'fail') {
- this.$notify({
- title: '审核失败',
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- } else {
- this.dialogFormVisible_Examine = false
- this.get_table_data4()
- this.$notify({
- title: '',
- message: '审核成功',
- type: 'success',
- duration: 2000
- })
- }
- })
- }
- }
- })
- },
- form_edit(row) {
- this.dialogStatusUpdate4 = 'update'
- this.dialogFormVisibleUpdate4 = true
- this.getdataListSee4.parammaps.matchCode = row.matchCode
- this.updateTemp4 = Object.assign(row, {})
- this.getSeeList4()
- },
- edit_dialog_save() {
- this.$refs['updateTemp4'].validate(valid => {
- if (valid) {
- // for (let i = 0; i < this.listUpdate4.length; i++) {
- // var rulesAmount = /^\d+$/
- // if ((this.listUpdate4[i].amount == '' || this.listUpdate4[i].amount == undefined) && parseFloat(this.listUpdate4[i].amount) !== 0) {
- // this.$message({
- // type: 'error',
- // message: '采购数量不可为空',
- // duration: 2000
- // })
- // return false
- // } else if (!rulesAmount.test(parseFloat(this.listUpdate4[i].amount))) {
- // this.$message({
- // type: 'error',
- // message: '采购数量不可为空',
- // duration: 2000
- // })
- // return false
- // }
- // }
- for (let i = 0; i < this.listUpdate4.length; i++) {
- console.log(this.listUpdate4[i].amount)
- var rulesAmount = /^\d+$/
- if ((this.listUpdate4[i].amount == '' || this.listUpdate4[i].amount == undefined) && parseFloat(this.listUpdate4[i].amount) !== 0) {
- this.$message({
- type: 'error',
- message: '采购数量不可为空',
- duration: 2000
- })
- return false
- } else if (!rulesAmount.test(parseFloat(this.listUpdate4[i].amount))) {
- this.$message({
- type: 'error',
- message: '采购数量请输入大于等于0的整数',
- duration: 2000
- })
- return false
- } else {
- this.postDataPramas.common = { 'returnmap': '0' }
- this.postDataPramas.data = []
- this.postDataPramas.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listUpdate4 }}
- this.postDataPramas.data[0].children = []
- this.postDataPramas.data[0].children[0] = { 'name': 'updatePDbuydetail', 'type': 'e', 'parammaps': {
- amount: '@insertSpotList.amount',
- id: '@insertSpotList.id'
- }}
- this.postDataPramas.data[1] = { 'name': 'partdealCharge', 'type': 'e', 'parammaps': {
- id: this.updateTemp4.id,
- statue: '0',
- empId: Cookies.get('employeid')
- }}
- }
- }
- ExecDataByConfig(this.postDataPramas).then(response => {
- console.log('新增保存发送参数', this.postDataPramas)
- if (response.msg === 'fail') {
- this.$notify({
- title: '保存失败',
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- } else {
- this.dialogFormVisibleUpdate4 = false
- this.getdataListParm4.parammaps.inputDatetime = ''
- this.get_table_data4()
- this.$notify({
- title: '',
- message: '保存成功',
- type: 'success',
- duration: 2000
- })
- }
- })
- return true
- }
- })
- }
- }
- }
- </script>
- <style lang="scss" >
- .el-table .warning-row {
- background: red;
- }
- .el-table .color-row {
- background: #eee;
- }
- </style>
- <style lang="scss" scoped>
- .app-contentClose .el-form-item__content {
- margin-left: 0 !important;
- }
- </style>
- <style lang="scss" scoped>
- .app-contentConfirmationSheet {
- margin-bottom: 50px;
- }
- .app-content {
- background: #eee;
- margin-bottom: 50px;
- .title {
- line-height: 40px;
- div {
- float: left;
- margin-right: 50px;
- b {
- padding-left: 10px;
- }
- }
- }
- .total {
- margin-left: 80%;
- line-height: 30px;
- }
- }
- </style>
|