warehousingOrder.vue 81 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418
  1. <!--入库单-->
  2. <template>
  3. <div class="container">
  4. <BaseHeaderLayout :leftSpan="16">
  5. <template slot="left">
  6. <div style='width:50%;margin-right:10px;'>
  7. <el-date-picker v-model="value2" type="daterange" align="right" unlink-panels range-separator="至"
  8. start-placeholder="开始日期" value-format='yyyy-MM-dd' end-placeholder="结束日期" @change='datechange'
  9. :picker-options="pickerOptions">
  10. </el-date-picker>
  11. </div>
  12. <div style='width:40%;margin-right:10px;'>
  13. <el-select v-model="warehouseName" filterable placeholder="" @change="warehouseNameChange" :value="searchType"
  14. style="margin: 0 10px">
  15. <el-option key="全部仓库" label="全部仓库" value="" style="color: #8890b1" />
  16. <el-option v-for="item in warehouseList" :key="'cangku' + item.warehouseName" :label="item.warehouseName"
  17. :value="item.warehouseName" style="color: #8890b1" />
  18. </el-select>
  19. </div>
  20. <div style='width:50%;margin-right:10px;display: flex;'>
  21. <el-select v-model="goodsName" filterable placeholder="" @change="goodsNameChange"
  22. style="margin: 0 10px">
  23. <el-option key="全部货名" label="全部货名" value="0" style="color: #8890b1" />
  24. <el-option v-for="(item,index) in goodsList" :key="item.id" :label="item.goodsName"
  25. :value="(index+1)" style="color: #8890b1" />
  26. </el-select>
  27. <span style="width:100px" v-if="warehouseName && goodsName">{{reserves?reserves:0}}吨</span>
  28. </div>
  29. <div style='width:50%;margin-right:10px;display: flex;'>
  30. <el-select v-model="weightGreater" filterable placeholder="" @change="weightGreaterChange"
  31. style="margin: 0 10px">
  32. <el-option key="全部重量" label="全部重量" value="" style="color: #8890b1" />
  33. <el-option key="剩余重量大于0" label="剩余重量大于0" value="1" style="color: #8890b1" />
  34. </el-select>
  35. </div>
  36. </template>
  37. <template slot="right">
  38. <ws-input @keyup.enter.native="find()" class='findValue' v-model="searchKeyWord" placeholder="可按货源查找" clearable
  39. maxlength="300" type="input"></ws-input>
  40. <ws-button class="find" type="primary" @click="lookUp()">
  41. <img width="16" height="16" style="
  42. vertical-align: text-top;
  43. position: relative;
  44. top: 0px;
  45. " src="../../../public/img/sousuo.png" alt />
  46. </ws-button>
  47. </template>
  48. </BaseHeaderLayout>
  49. <el-row style='margin:10px;'>
  50. <el-col :span="12">
  51. <ws-button :type="searchType === '' ? 'primary' : ''" @click="handle('')" v-hasPermission="
  52. `warehouseManagement.warehousingOrder.View`">全部
  53. </ws-button>
  54. <ws-button :type="searchType === '1' ? 'primary' : ''" @click="handle('1')" v-hasPermission="
  55. `warehouseManagement.warehousingOrder.View`">未付款
  56. </ws-button>
  57. <ws-button :type="searchType === '2' ? 'primary' : ''" @click="handle('2')" v-hasPermission="
  58. `warehouseManagement.warehousingOrder.View`">待审核
  59. </ws-button>
  60. </el-col>
  61. <el-col style='text-align:right;' :span="12">
  62. <!-- <ws-button v-hasPermission="
  63. `warehouseManagement.warehousingOrder.yufu`" type="primary" @click="interestrate()" >{{interestratevalue.value}}利率</ws-button> -->
  64. <ws-button type="primary" @click="exportList()">导出</ws-button>
  65. <ws-button v-hasPermission="
  66. `warehouseManagement.warehousingOrder.yufu`" type="primary" @click="fieldrations()">折干</ws-button>
  67. <ws-button v-hasPermission="
  68. `warehouseManagement.warehousingOrder.yufu`" type="primary" @click="distribution()">预付款分配</ws-button>
  69. <ws-button v-hasPermission="
  70. `warehouseManagement.warehousingOrder.bzj`" type="primary" @click="marginAllocation()">保证金分配</ws-button>
  71. <!-- <el-button type="primary" @click="warehousingorder()" v-hasPermission="
  72. `warehouseManagement.warehouse.warehouseInfoTask.add`
  73. ">出单
  74. </el-button> -->
  75. </el-col>
  76. </el-row>
  77. <div v-for="(item, index) in gainList" style='margin:10px;border:1px solid #ccc;padding:10px;'>
  78. <div style='width:100%;justify-content:space-between;align-items:center;margin-bottom:10px;' class="flex">
  79. <div>{{ item.issuingTime }} 合计{{ item.summation }}</div>
  80. <div>{{ item.warehouseName }}入库单<span v-if='item.warehouseType == 2'>(临)</span></div>
  81. <div>
  82. <!-- <ws-button type="primary" @click="distribution(item)" >预付款分配</ws-button>
  83. <ws-button type="primary" @click="marginAllocation(item)">保证金分配</ws-button> -->
  84. <ws-button v-if='item.payshow' type="primary" @click="payout(item)"
  85. v-hasPermission="`warehouseManagement.warehousingOrder.appl`">请款
  86. </ws-button>
  87. <ws-button v-if="item.approveStatus&& item.payshow" type="primary" @click="withdraw(item)"
  88. v-hasPermission="`warehouseManagement.warehousingOrder.appl`">撤回
  89. </ws-button>
  90. <ws-button v-if='!item.payshow' type="primary" @click="cancel(item)" v-hasPermission="
  91. `warehouseManagement.warehousingOrder.appl`
  92. ">取消
  93. </ws-button>
  94. <ws-button v-if='!item.payshow' type="primary" @click="submit(item)" v-hasPermission="
  95. `warehouseManagement.warehousingOrder.appl`
  96. ">提交
  97. </ws-button>
  98. <ws-button type="primary" @click="aduit(item)" v-hasPermission="
  99. `warehouseManagement.warehousingOrder.adiut`
  100. ">审核
  101. </ws-button>
  102. <ws-button type="primary" @click="payment(item)" v-hasPermission="
  103. `warehouseManagement.warehousingOrder.pay`
  104. ">付款
  105. </ws-button>
  106. </div>
  107. </div>
  108. <el-table show-summary :summary-method="getSummaries" class="wenzi" :ref="'multipleTable' + index"
  109. :data="item.warehousingOrderList" style="width: 100%"
  110. @selection-change="handleSelectionChange($event, item, index)">
  111. <el-table-column :selectable='selectInit' type="selection" width="55">
  112. </el-table-column>
  113. <el-table-column type="index" label="序号">
  114. <template scope="scope">
  115. <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
  116. <span v-else>{{ scope.$index + 1 }}</span>
  117. </template>
  118. </el-table-column>
  119. <el-table-column prop="contractNo" label="合同编号" width="190">
  120. <template scope="scope">
  121. <span>
  122. {{ scope.row.contractNo }} ({{ scope.row.inType }})
  123. </span>
  124. </template>
  125. </el-table-column>
  126. <el-table-column prop="buyer" label="买方" width="150"></el-table-column>
  127. <el-table-column prop="goodsSource" label="货源" width="130">
  128. <template scope="scope">
  129. <span style='color:#66b1ff;' @click='lookcustomer(scope.row)'>{{ scope.row.goodsSource }}</span>
  130. </template>
  131. </el-table-column>
  132. <el-table-column prop="deliveryWarehouse" label="发货库" width="130"></el-table-column>
  133. <!-- <el-table-column prop="customer" label="客户" width="100">
  134. <template scope="scope">
  135. <span @click='lookcustomer(scope.row)'>{{scope.row.customer}}</span>
  136. </template>
  137. </el-table-column> -->
  138. <el-table-column prop="goodsName" label="货名" width="120">
  139. </el-table-column>
  140. <el-table-column prop="inWarehouseWeight1" width="130" class="table_td" label="加权水分">
  141. <template scope="scope">
  142. <span v-if='scope.row.edit == false'>{{ scope.row.weightedMoisture }}</span>
  143. <el-input style='width:80%;' v-if='scope.row.edit' v-model='scope.row.weightedMoisture'></el-input>
  144. <i @click="changeMoisture(scope.row)" v-if="
  145. scope.row.edit" class="iconfont icon-dui"></i>
  146. <img v-if="!scope.row.edit" width="17" height="18"
  147. style="vertical-align: text-top; position: relative; top: -1px" src="../../../public/img/edit.png"
  148. @click="editMoisture(scope.row)" alt="" />
  149. </template>
  150. </el-table-column>
  151. <el-table-column prop="inWarehouseWeight1" width="150" class="table_td" label="入库重量">
  152. <template scope="scope">
  153. <span
  154. v-if='scope.row.weightedit == false && scope.row.warehouseType == 2 || scope.row.warehouseType == 1'>{{ scope.row.inWarehouseWeight1 }}</span>
  155. <el-input style='width:80%;' v-if='scope.row.weightedit && scope.row.warehouseType == 2'
  156. v-model='scope.row.inWarehouseWeight1'></el-input>
  157. <i @click="changeWeight(scope.row)" v-if="
  158. scope.row.weightedit && scope.row.warehouseType == 2" class="iconfont icon-dui"></i>
  159. <img v-if="!scope.row.weightedit && scope.row.warehouseType == 2" width="17" height="18"
  160. style="vertical-align: text-top; position: relative; top: -1px" src="../../../public/img/edit.png"
  161. @click="editWeight(scope.row)" alt="" />
  162. </template>
  163. </el-table-column>
  164. <el-table-column prop="outWarehouseWeight" width="80" class="table_td" label="出库重量"></el-table-column>
  165. <el-table-column prop="profitAndLoss" class="table_td" label="盈亏(吨)"></el-table-column>
  166. <el-table-column prop="surplusWeight" width="80" class="table_td" label="剩余重量"></el-table-column>
  167. <el-table-column prop="grainFund" width="80" class="table_td" label="粮款(元)"></el-table-column>
  168. <el-table-column prop="amountEdPayable" width="110" class="table_td" label="已付(元)">
  169. <template scope="scope">
  170. <span>{{ scope.row.amountEdPayable }}</span>
  171. <img v-if='scope.row.addressUrl' width="18" height="20"
  172. style="vertical-align: text-top; position: relative; top: -1px" src="../../../public/img/fujian.png"
  173. @click="fujian(scope.row)" alt="" />
  174. </template>
  175. </el-table-column>
  176. <el-table-column prop="amountNotPayable" width="80" class="table_td" label="未付(元)"></el-table-column>
  177. <el-table-column prop="amountMoney" width="80" class="table_td" label="费用(元)">
  178. <template scope="scope">
  179. <span style='color:#66b1ff;' @click='costclick(scope.row)'>{{ scope.row.amountMoney }}</span>
  180. </template>
  181. </el-table-column>
  182. <el-table-column prop="avgCost" width="90" class="table_td" label="平均成本"></el-table-column>
  183. <el-table-column prop="requestFunds" width="150" class="table_td tablerequestFunds" label="请款">
  184. <template scope="scope">
  185. <span v-if="!scope.row.select">{{ scope.row.requestFunds }}</span>
  186. <el-input @focus="qingkuan(scope.row, item.id)" v-else v-model='scope.row.requestFunds'></el-input>
  187. </template>
  188. </el-table-column>
  189. <el-table-column prop="remark" width="150" class="table_td" label="请款备注">
  190. <template scope="scope">
  191. <div v-if="!scope.row.select" @click.stop="lookRemark(scope.row)">
  192. <span class="text_css">查看</span>
  193. </div>
  194. <el-input @focus="inputremark(scope.row, item.id)" v-else v-model='scope.row.remark'></el-input>
  195. </template>
  196. </el-table-column>
  197. <el-table-column prop="approveStatus" label="请款状态" width="90">
  198. <template slot-scope="scope">
  199. <span v-if='scope.row.approveStatus'>{{ scope.row.approveStatus }}</span>
  200. <span v-else>{{ scope.row.status }}</span>
  201. </template>
  202. </el-table-column>
  203. </el-table>
  204. </div>
  205. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
  206. style="text-align: center" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper"
  207. :total="deptBudgetTotal">
  208. </el-pagination>
  209. <el-dialog title="付款" :visible.sync="aduitshow" width="50%" :before-close="handleClose">
  210. <div style='display:flex;'>
  211. <div style='width:50%;'>
  212. <el-form ref="form" :model="form" label-width="120px">
  213. <el-form-item label="合计金额">
  214. <el-input disabled v-model="form.name"></el-input>
  215. </el-form-item>
  216. <el-form-item label="附件">
  217. <!-- <el-upload ref='uploadfiles' :file-list='dataList' :action="global.uploadPath" list-type="picture-card"
  218. :on-success="handlefujian" :on-remove="handleRemove" class="photo2" accept="image/jpg,image/jpeg,image/png">
  219. <i class="el-icon-plus"></i>
  220. </el-upload> -->
  221. <ws-upload ref="upload" :size-limit="size" @onChange="onChange" :comp-id="compId"
  222. accept=".jpg, .jpeg, .png, .pdf, .doc, .docx, .zip, .rar" />
  223. </el-form-item>
  224. </el-form>
  225. </div>
  226. <div style='width:50%;height:220px;overflow-y:scroll;'>
  227. <div v-for="(item, index) in payeeinfo">
  228. <div style='margin:0 0 10px;width:90%;'>账户信息-{{ index + 1 }}</div>
  229. <el-form label-position="left">
  230. <el-form-item label-width='100px' label="收款方" span="1" prop="purpose" class="readonly">
  231. {{ item.customerName }}
  232. </el-form-item>
  233. <el-form-item label-width='100px' label="账号" span="1" prop="purpose" class="readonly">
  234. {{ item.bankCard }}
  235. </el-form-item>
  236. <el-form-item label-width='100px' label="开户行" span="1" prop="purpose" class="readonly">
  237. {{ item.bankDeposit }}
  238. </el-form-item>
  239. <el-form-item label-width='100px' label="开户支行" span="1" prop="purpose" class="readonly">
  240. {{ item.bankDepositBranch }}
  241. </el-form-item>
  242. </el-form>
  243. </div>
  244. </div>
  245. </div>
  246. <span slot="footer" class="dialog-footer">
  247. <el-button @click="aduitshow = false">取消</el-button>
  248. <el-button type="primary" @click="paymentsubmit">确定</el-button>
  249. </span>
  250. </el-dialog>
  251. <el-dialog title="客户信息" :visible.sync="customershow" width="50%" :before-close="handleClose3">
  252. <div>
  253. <el-form label-position="left">
  254. <el-form-item label-width='100px' label="收款方" span="1" prop="purpose" class="readonly">
  255. {{ customerInfo.customerName }}
  256. </el-form-item>
  257. <el-form-item label-width='100px' label="账号" span="1" prop="purpose" class="readonly">
  258. {{ customerInfo.bankCard }}
  259. </el-form-item>
  260. <el-form-item label-width='100px' label="开户行" span="1" prop="purpose" class="readonly">
  261. {{ customerInfo.bankDeposit }}
  262. </el-form-item>
  263. <el-form-item label-width='100px' label="开户支行" span="1" prop="purpose" class="readonly">
  264. {{ customerInfo.bankDepositBranch }}
  265. </el-form-item>
  266. </el-form>
  267. </div>
  268. </el-dialog>
  269. <el-dialog title="预付款分配" :visible.sync="distributionshow" width="50%" :before-close="handleClose1">
  270. <div>
  271. <!--插槽会替换title显示的内容 -->
  272. <div slot="title" class="header-title">
  273. <span v-show="dialogTitle" class="title-name">{{ dialogTitle }}</span>
  274. </div>
  275. <el-form ref="form" :model="form" label-width="120px">
  276. <el-col class="col1">
  277. <el-form-item label="累计预付(元)">
  278. <el-input disabled v-model="form.accumulatedPrepayment"></el-input>
  279. </el-form-item>
  280. </el-col>
  281. <el-col class="col1">
  282. <el-form-item label="收回预付(元)">
  283. <el-input disabled v-model="form.recoveryPrepayments"></el-input>
  284. </el-form-item>
  285. </el-col>
  286. <el-col class="col1">
  287. <el-form-item label="已分配(元)">
  288. <el-input disabled v-model="form.distributionEd"></el-input>
  289. </el-form-item>
  290. </el-col>
  291. <el-col class="col1">
  292. <el-form-item label="可分配(元)">
  293. <el-input disabled v-model="form.distributionCan"></el-input>
  294. </el-form-item>
  295. </el-col>
  296. <el-row>
  297. <el-col class="col1">
  298. <el-form-item label="未付金额(元)">
  299. <el-input disabled v-model="form.distributionNot"></el-input>
  300. </el-form-item>
  301. </el-col>
  302. </el-row>
  303. <el-row>
  304. <el-form-item label="分配金额(元)">
  305. <el-input v-model="form.distributionIng"></el-input>
  306. </el-form-item>
  307. </el-row>
  308. </el-form>
  309. </div>
  310. <span slot="footer" class="dialog-footer">
  311. <el-button @click="handleClose1">取消</el-button>
  312. <el-button type="primary" @click="distributionsubmit">提交</el-button>
  313. </span>
  314. </el-dialog>
  315. <el-dialog title="保证金分配" :visible.sync="marginshow" width="50%" :before-close="handleClose2">
  316. <div>
  317. <!--插槽会替换title显示的内容 -->
  318. <div slot="title" class="header-title">
  319. <span v-show="dialogTitle" class="title-name">{{ dialogTitle }}</span>
  320. </div>
  321. <el-form ref="form" :model="form" label-width="120px">
  322. <el-col class="col1">
  323. <el-form-item label="累计支付(元)">
  324. <el-input disabled v-model="form.accumulatedPrepayment"></el-input>
  325. </el-form-item>
  326. </el-col>
  327. <el-col class="col1">
  328. <el-form-item label="累计收回(元)">
  329. <el-input disabled v-model="form.recoveryPrepayments"></el-input>
  330. </el-form-item>
  331. </el-col>
  332. <el-col class="col1">
  333. <el-form-item label="已分配(元)">
  334. <el-input disabled v-model="form.distributionEd"></el-input>
  335. </el-form-item>
  336. </el-col>
  337. <el-col class="col1">
  338. <el-form-item label="可分配(元)">
  339. <el-input disabled v-model="form.distributionCan"></el-input>
  340. </el-form-item>
  341. </el-col>
  342. <el-row>
  343. <el-col class="col1">
  344. <el-form-item label="未付金额(元)">
  345. <el-input disabled v-model="form.distributionNot"></el-input>
  346. </el-form-item>
  347. </el-col>
  348. </el-row>
  349. <el-row>
  350. <el-form-item label="分配金额(元)">
  351. <el-input v-model="form.distributionIng"></el-input>
  352. </el-form-item>
  353. </el-row>
  354. </el-form>
  355. </div>
  356. <span slot="footer" class="dialog-footer">
  357. <el-button @click="handleClose2">取消</el-button>
  358. <el-button type="primary" @click="marginsubmit">提交</el-button>
  359. </span>
  360. </el-dialog>
  361. <el-dialog title="折干" :visible.sync="fieldrationsshow" width="50%" :before-close="handleClose4">
  362. <div>
  363. <!--插槽会替换title显示的内容 -->
  364. <div slot="title" class="header-title">
  365. <span v-show="dialogTitle" class="title-name">{{ dialogTitle }}</span>
  366. </div>
  367. <el-form ref="form" :model="form" label-width="140px">
  368. <el-form-item label="折干前重量(吨)">
  369. <el-input v-model="fieldrationsList.beforeWeight" disabled></el-input>
  370. </el-form-item>
  371. <!-- <el-form-item label="折干前成本(元/吨)">
  372. <el-input disabled placeholder="自动计算,不可编辑" v-model="fieldrationsList.beforeCost"></el-input>
  373. </el-form-item>-->
  374. <el-form-item label="折干前仓位">
  375. <el-select @focus="warehousefocus" @change="warehousechange" v-model="fieldrationsList.beforeBinNo"
  376. filterable placeholder="请选择">
  377. <el-option v-for="item in options" :key="item.id" :label="item.binNumber" :value="item.binNumber">
  378. </el-option>
  379. </el-select>
  380. </el-form-item>
  381. <el-form-item label="折干后重量(吨)">
  382. <el-input v-model="fieldrationsList.afterWeight"></el-input>
  383. </el-form-item>
  384. <!-- <el-form-item label="折干后成本(元/吨)">
  385. <el-input disabled placeholder="自动计算,不可编辑" v-model="fieldrationsList.afterCost"></el-input>
  386. </el-form-item> -->
  387. <el-form-item label="折干后仓位">
  388. <el-select @focus="warehousefocus1" @change="warehousechange1" v-model="fieldrationsList.afterBinNo"
  389. filterable placeholder="请选择">
  390. <el-option v-for="item in options1" :key="item.id" :label="item.binNumber" :value="item.binNumber">
  391. </el-option>
  392. </el-select>
  393. </el-form-item>
  394. </el-form>
  395. </div>
  396. <span slot="footer" class="dialog-footer">
  397. <el-button @click="handleClose4">取消</el-button>
  398. <el-button type="primary" @click="fieldrationssubmit">提交</el-button>
  399. </span>
  400. </el-dialog>
  401. <el-dialog :title="'输入' + titletype" :visible.sync="dialogVisiblecontent" width="30%" @close="handleClose5"
  402. :close-on-click-modal="false">
  403. <div>
  404. <el-input type="textarea" :rows="5" maxlength="500" placeholder="请输入内容" v-model="textarea">
  405. </el-input>
  406. <div style="text-align:center;margin-top:10px;">
  407. <ws-button type="primary" @click="handlequeren()" v-hasPermission="
  408. `warehouseManagement.warehouse.warehouseInfoTask.add`
  409. ">确认
  410. </ws-button>
  411. </div>
  412. </div>
  413. </el-dialog>
  414. <div class="mask" v-show="isShowPrintType"></div>
  415. <div class="print-type" v-show="isShowPrintType">
  416. <div class="print-type-content">
  417. <div class="print-type-title">{{headerText}}</div>
  418. <div class="print-type-checkbox">
  419. <el-form ref="form" label-width="110px">
  420. <el-form-item label="起始日期">
  421. <el-date-picker type="datetime" @change="startDataChange" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择起始日期" v-model="parameter.exportStartDate" default-time="00:00:00"></el-date-picker>
  422. </el-form-item>
  423. <el-form-item label="截止日期">
  424. <el-date-picker type="datetime" @change="endDataChange" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择截止日期" v-model="parameter.exportEndDate" default-time="00:00:00">
  425. </el-date-picker>
  426. </el-form-item>
  427. <!--仓库名称-->
  428. <el-form-item label="仓库名称" span="1" prop="warehouseName" >
  429. <el-select v-model="parameter.warehouseName" placeholder="请选择仓库名称" filterable clearable>
  430. <el-option key="" label="全部仓库" value="全部仓库" />
  431. <el-option v-for="item in warehouseList" :key="item.warehouseName" :label="item.warehouseName" :value="item.warehouseName" />
  432. </el-select>
  433. </el-form-item>
  434. </el-form>
  435. </div>
  436. </div>
  437. <div class="bottom-btn">
  438. <el-button @click="submitClick()">确定</el-button>
  439. <el-button @click="removePrint">取消</el-button>
  440. </div>
  441. </div>
  442. <!-- <el-dialog
  443. title="提示"
  444. :visible.sync="dialogVisible"
  445. width="30%"
  446. :before-close="handleClose">
  447. <div>
  448. <el-time-picker
  449. v-model="value1"
  450. format='HH:mm'
  451. value-format="HH:mm"
  452. placeholder="任意时间点"> </el-time-picker>
  453. <ws-button type="primary" @click="handleAdd()" v-hasPermission="
  454. `warehouseManagement.warehouse.warehouseInfoTask.add`
  455. ">修改
  456. </ws-button>
  457. </div>
  458. </el-dialog> -->
  459. <el-dialog width='30%' :visible.sync="remarkList" title="备注" top="20vh">
  460. <span>{{ remark }}</span>
  461. </el-dialog>
  462. <el-dialog width='50%' :visible.sync="interestrateshow" title="修改利率" top="20vh">
  463. <el-input placeholder="" v-model="interestratevalue.value"></el-input>
  464. <span slot="footer" class="dialog-footer">
  465. <el-button type="primary" @click="interestratesubmit">保存</el-button>
  466. </span>
  467. </el-dialog>
  468. <el-dialog width='50%' :visible.sync="accessoryTFs" title="附件" top="20vh">
  469. <div v-if="appendixIdss.length > 0 && appendixIdss[0].indexOf('http') != -1">
  470. <div v-for="(item, index) in appendixIdss" :key="'fujian' + index">
  471. <el-image style="width: 100px; height: 100px" :src="item" :preview-src-list="appendixIdss">
  472. </el-image>
  473. </div>
  474. </div>
  475. <ws-upload v-if="appendixIdss.length > 0 && appendixIdss[0].indexOf('http') == -1" ref="upload" :comp-id="compId"
  476. :appendix-ids="appendixIdss" :editable="false" accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar" />
  477. </el-dialog>
  478. <el-dialog width='30%' :visible.sync="dialogVisible1" title="费用" top="20vh">
  479. <div style="justify-content:space-between;" class="flex">
  480. <div>累计利息</div>
  481. <div>{{interest}}</div>
  482. </div>
  483. <div style="justify-content:space-between;" class="flex">
  484. <div>累计仓储费</div>
  485. <div>{{storageFee}}</div>
  486. </div>
  487. <div style="justify-content:space-between;" class="flex">
  488. <div>烘干费</div>
  489. <div>{{dryingFee?dryingFee:0}}</div>
  490. </div>
  491. <div v-for="(item, index) in costlist" :key="index" class="audit">
  492. <div class="audit_item">
  493. <div class="audit_left">
  494. <span class="audit_name">{{ item.costNo }}</span>
  495. </div>
  496. <div class='audit_date'><span>{{ item.createDate }}</span></div>
  497. </div>
  498. <div class="audit_item">
  499. <div class="audit_left">
  500. <span class="audit_name">{{ item.expenseName }}</span>
  501. </div>
  502. <div class='audit_date'><span>{{ item.distributionMoney }}</span></div>
  503. </div>
  504. </div>
  505. </el-dialog>
  506. <el-dialog
  507. :title="title1"
  508. :visible.sync="rejectshow"
  509. width="30%"
  510. @close="handleClose6">
  511. <span>{{title1=='驳回'?'驳回审核':'通过审核'}}</span>
  512. <div>
  513. <el-input
  514. type="textarea"
  515. :rows="2"
  516. placeholder="请输入审核意见"
  517. v-model="auditMind">
  518. </el-input>
  519. </div>
  520. <span slot="footer" class="dialog-footer">
  521. <el-button @click="rejectshow = false">取 消</el-button>
  522. <el-button type="primary" @click="rejectclick">确 定</el-button>
  523. </span>
  524. </el-dialog>
  525. </div>
  526. </template>
  527. <script>
  528. import {
  529. getoreditoutput,
  530. outdelete,
  531. movestates,
  532. // woekflowhandle
  533. } from '@/model/tasksport/index'
  534. import {
  535. getwarehousingorder,
  536. paymoney,
  537. editwarehousingorder,
  538. getExpense,
  539. workflowhandle,
  540. getposition,
  541. dryout,
  542. xiala,
  543. getenabledinfo,
  544. setenabledinfo,
  545. getbyname,
  546. sponsorWithdraw,
  547. exportOrder,
  548. getdryweight
  549. } from '@/model/warehouse/index'
  550. import {
  551. selectWarehouseSelf,
  552. } from '@/model/houseSelfCollect/index'
  553. import { getpayeeinfo, getbuypayeeinfo } from '@/model/profitable/index'
  554. import {
  555. downloadFile
  556. } from '@/utils/batchDown'
  557. import Pagination from '@/components/Pagination'
  558. import WsUpload from '@/components/WsUpload'
  559. import {
  560. dayjs,
  561. fmoney,
  562. EventBus
  563. } from 'base-core-lib'
  564. import { findLastIndexOfIterate } from 'xe-utils/methods'
  565. export default {
  566. name: 'viewSpareMoney',
  567. components: {
  568. WsUpload,
  569. Pagination,
  570. },
  571. watch: {
  572. vesselId(val) {
  573. this.getList()
  574. },
  575. isShow(val) {
  576. this.showType = val
  577. },
  578. },
  579. data() {
  580. return {
  581. currectdata: {},
  582. //弹出框
  583. dialogViewSpareMoney: false,
  584. dialogApproveFormVisible: false,
  585. interestrateshow: false,
  586. dataList: [],
  587. payeeinfo: [],
  588. title1:'',
  589. StartDate:'',
  590. EndDate:'',
  591. rejectshow:false,
  592. options: [],
  593. isShowPrintType: false,
  594. // warehouseAllXiaLa:[],
  595. textarea: '',
  596. weightGreater:'',
  597. warehouseList:[],
  598. // warehouseXiaLaCopy:[],
  599. headerText: '入库单导出',
  600. dialogVisiblecontent: false,
  601. // 船舶类型
  602. monetaryKey: null,
  603. form: {
  604. accumulatedPrepayment: '',
  605. recoveryPrepayments: '',
  606. distributionEd: '',
  607. distributionCan: '',
  608. distributionNot: '',
  609. distributionIng: ''
  610. },
  611. // 表格显示数据
  612. tableDate: [],
  613. fieldrationsList: {
  614. beforeWeight: '',
  615. beforeCost: '',
  616. afterWeight: '',
  617. afterCost: '',
  618. },
  619. // 是否显示
  620. showType: true,
  621. dialogVisible: false,
  622. // 年
  623. year: '',
  624. title: '',
  625. disabled: false,
  626. gainList: [],
  627. currentPage: 1,
  628. primary: '1',
  629. dialogVisible1: false,
  630. pickerOptions: {
  631. shortcuts: [{
  632. text: '本周',
  633. onClick(picker) {
  634. const end = new Date()
  635. const start = new Date()
  636. var thisDay = start.getDay()
  637. var thisDate = start.getDate()
  638. if (thisDay != 0) {
  639. start.setDate(thisDate - thisDay)
  640. }
  641. picker.$emit('pick', [start, end])
  642. },
  643. },
  644. {
  645. text: '本月',
  646. onClick(picker) {
  647. const end = new Date()
  648. const start = new Date()
  649. start.setDate(1)
  650. picker.$emit('pick', [start, end])
  651. },
  652. },
  653. {
  654. text: '本季度',
  655. onClick(picker) {
  656. var oDate = new Date()
  657. var thisYear = oDate.getFullYear()
  658. var thisMonth = oDate.getMonth() + 1
  659. var n = Math.ceil(thisMonth / 3) // 季度
  660. var Month = n * 3 - 1
  661. var start = new Date(thisYear, Month - 2, 1)
  662. var end = new Date()
  663. picker.$emit('pick', [start, end])
  664. },
  665. },
  666. ],
  667. },
  668. value1: '',
  669. value: '',
  670. value2: '',
  671. deptBudgetTotal: 0,
  672. pageSize: 10,
  673. searchType: '',
  674. searchTypeText: '待审核',
  675. searchKeyWord: '',
  676. inOutType: '',
  677. contractType: 2,
  678. warehouseType:1,
  679. auditdata:[],
  680. fieldrationsshow: false,
  681. // 提交类型
  682. submitType: true,
  683. multipleSelection: [],
  684. size: 10,
  685. spanArr: [],
  686. options1: [],
  687. id: '',
  688. avgCost:'',
  689. customerInfo: {},
  690. appendixIdss: [],
  691. paymentScreenshot: '',
  692. endDate: '',
  693. startDate: '',
  694. warehouseName: '',
  695. goodsName:'0',
  696. reserves:'',
  697. goodsList:[],
  698. compId: localStorage.getItem('ws-pf_compId'),
  699. historyList: [],
  700. money: 0,
  701. interest:'',
  702. storageFee:'',
  703. dryingFee:'',
  704. multipleSelection1: {},
  705. aduitshow: false,
  706. distributionshow: false,
  707. marginshow: false,
  708. costlist: [],
  709. pickerBeginDateBefore: {
  710. disabledDate: (time) => {
  711. return time.getTime() > Date.now()
  712. },
  713. },
  714. parameter:{
  715. startDate:'',
  716. endDate:'',
  717. },
  718. date: {
  719. year: dayjs().format('YYYY'),
  720. month: dayjs().format('MM'),
  721. },
  722. // warehouseList: [],
  723. currectfocusdata: {},
  724. customershow: false,
  725. interestratevalue: {},
  726. accessoryTFs: false,
  727. remarkList: false,
  728. dialogTitle: '',
  729. titletype: '',
  730. remark: '',
  731. baseId:'',
  732. auditMind:''
  733. }
  734. },
  735. // activated() {
  736. // this.getList()
  737. // this.showType = this.isShow
  738. // },
  739. activated() {
  740. if(this.$route.query.status==1){
  741. this.searchType='2'
  742. }
  743. this.value2 = this.getNowTime()
  744. selectWarehouseSelf({
  745. compId: localStorage.getItem('ws-pf_compId'),
  746. })
  747. .toPromise()
  748. .then((response) => {
  749. this.warehouseList = response
  750. })
  751. this.getList()
  752. this.showType = this.isShow
  753. },
  754. methods: {
  755. exportList() {
  756. let date = new Date()
  757. var year = date.getFullYear();
  758. var month = date.getMonth() + 1;
  759. var strDate = date.getDate()
  760. if(strDate<10){
  761. strDate = '0'+strDate
  762. }
  763. var pastdate = new Date(date.getTime() - 24 * 60 * 60 * 1000)
  764. this.StartDate =pastdate.getFullYear() + '-' + (pastdate.getMonth() + 1) + '-' + (pastdate.getDate()>10?pastdate.getDate():'0'+pastdate.getDate())+' 00:00:00'
  765. this.$set(this.parameter,'exportStartDate',this.StartDate)
  766. this.EndDate = '' + year + '-' + month + '-' + strDate+' 00:00:00'
  767. this.$set(this.parameter,'exportEndDate',this.EndDate)
  768. this.$forceUpdate();
  769. this.isShowPrintType = true
  770. },
  771. startDataChange(e){
  772. var d = new Date(e);
  773. let year = d.getFullYear()
  774. let month = (d.getMonth() + 1)
  775. month= month<10?'0'+month:month
  776. let date = d.getDate()<10?'0'+d.getDate():d.getDate()
  777. let hours = d.getHours()<10?'0'+d.getHours():d.getHours()
  778. let minutes = d.getMinutes()<10?'0'+d.getMinutes():d.getMinutes()
  779. let seconds = d.getSeconds()<10?'0'+d.getSeconds():d.getSeconds()
  780. this.parameter.exportStartDate = year + '-' + month+ '-' +date + ' '+hours+':'+minutes+':'+seconds;
  781. },
  782. endDataChange(e){
  783. var d = new Date(e);
  784. let year = d.getFullYear()
  785. let month = (d.getMonth() + 1)
  786. month= month<10?'0'+month:month
  787. let date = d.getDate()<10?'0'+d.getDate():d.getDate()
  788. let hours = d.getHours()<10?'0'+d.getHours():d.getHours()
  789. let minutes = d.getMinutes()<10?'0'+d.getMinutes():d.getMinutes()
  790. let seconds = d.getSeconds()<10?'0'+d.getSeconds():d.getSeconds()
  791. this.parameter.exportEndDate = year + '-' + month+ '-' +date + ' '+hours+':'+minutes+':'+seconds;
  792. },
  793. removePrint() {
  794. this.parameter.warehouseName = ''
  795. this.isShowPrintType = false
  796. },
  797. // warehouseQuery(query){
  798. // if(query){
  799. // this.warehouseList = this.warehouseAllXiaLa
  800. // this.warehouseList = this.warehouseAllXiaLa.filter(item=>item.warehouseName.indexOf(query)>-1)
  801. // }else{
  802. // this.warehouseList = this.warehouseXiaLaCopy
  803. // }
  804. // },
  805. async submitClick() {
  806. if (!this.parameter.exportStartDate) {
  807. this.$message.error('请选择起始日期')
  808. return
  809. }
  810. if (!this.parameter.exportEndDate) {
  811. this.$message.error('请选择截止日期')
  812. return
  813. }
  814. if (new Date(this.parameter.exportEndDate).getTime() < new Date(this.parameter.exportStartDate).getTime()) {
  815. this.$message.error('截止日期输入错误')
  816. return
  817. }
  818. if (this.parameter.warehouseName == '全部仓库') {
  819. this.parameter.warehouseName = ''
  820. }
  821. this.isShowPrintType = false
  822. const {
  823. data
  824. } = await exportOrder({
  825. exportStartDate: this.parameter.exportStartDate,
  826. exportEndDate: this.parameter.exportEndDate,
  827. warehouseName: this.parameter.warehouseName,
  828. }, {}, {
  829. responseType: 'blob'
  830. }).toPromise()
  831. downloadFile({
  832. res: data,
  833. fileName: `${this.date.year + (this.date.month ? `-${this.date.month}` : '')
  834. }导出入库单`,
  835. type: 'xls',
  836. })
  837. this.parameter.warehouseName = ''
  838. },
  839. weightGreaterChange(e){
  840. this.getList()
  841. },
  842. getSummaries(param) {
  843. const { columns, data } = param;
  844. const sums = [];
  845. columns.forEach((column, index) => {
  846. if (index === 0) {
  847. sums[index] = '合计';
  848. return;
  849. }
  850. const values = data.map(item => Number(item[column.property]));
  851. if (!values.every(value => isNaN(value))) {
  852. if (index == 8 || index == 9 || index == 10 || index == 11 || index == 12 || index == 13 || index == 14 || index == 15) {
  853. sums[index] = values.reduce((prev, curr) => {
  854. const value = Number(curr);
  855. if (!isNaN(value)) {
  856. return prev + curr;
  857. } else {
  858. return prev;
  859. }
  860. }, 0).toFixed(3)
  861. }
  862. } else {
  863. sums[index] = '';
  864. }
  865. });
  866. return sums;
  867. },
  868. warehouseNameChange(e) {
  869. if (e == '全部仓库' || e == '') {
  870. this.warehouseName = ''
  871. this.goodsList = []
  872. this.goodsName = '0'
  873. this.baseId = ''
  874. }else{
  875. for(let i =0 ; i<this.warehouseList.length;i++){
  876. if(this.warehouseList[i].warehouseName == e){
  877. console.log(this.warehouseList[i])
  878. if(this.warehouseList[i].goodsNameInfos){
  879. for(let j = 0;j<this.warehouseList[i].goodsNameInfos.length;j++){//构造数据,合并重复货名
  880. if(j==0){
  881. this.goodsList.push(this.warehouseList[i].goodsNameInfos[j])
  882. }else{
  883. //
  884. if(this.goodsList.every((item)=>{return item.goodsName != this.warehouseList[i].goodsNameInfos[j].goodsName}) ){
  885. this.goodsList.push(this.warehouseList[i].goodsNameInfos[j])
  886. }else{
  887. for(let n = 0;n < this.goodsList.length;n++){
  888. if(this.goodsList[n].goodsName == this.warehouseList[i].goodsNameInfos[j].goodsName){
  889. this.goodsList[n].storage += this.warehouseList[i].goodsNameInfos[j].storage
  890. }
  891. }
  892. }
  893. //
  894. }
  895. }
  896. }
  897. this.baseId = this.warehouseList[i].id
  898. break
  899. }
  900. // console.log(this.reserve)
  901. if(this.reserves){
  902. this.reserves=this.reserves.toFixed(3)
  903. }
  904. }
  905. this.goodsName= '0'
  906. this.reserves = ''
  907. }
  908. this.warehouseXiaLaCopy = this.warehouseList
  909. this.warehouseAllXiaLa = this.warehouseList
  910. this.multipleSelection1={}
  911. this.getList()
  912. },
  913. goodsNameChange(e){
  914. if (e == '全部货名' || e == '0') {
  915. this.goodsName = '0'
  916. this.reserves = ''
  917. }else{
  918. this.goodsName = this.goodsList[e-1].goodsName
  919. this.reserves = this.goodsList[e-1].storage
  920. }
  921. this.multipleSelection1={}
  922. this.getList()
  923. },
  924. handleClose5() {
  925. this.dialogVisiblecontent = false
  926. },
  927. qingkuan(item) {
  928. this.titletype = '请款金额'
  929. this.currectfocusdata = item
  930. this.textarea = this.currectfocusdata.requestFunds
  931. this.dialogVisiblecontent = true
  932. },
  933. inputremark(item) {
  934. this.titletype = '备注内容'
  935. this.currectfocusdata = item
  936. this.textarea = this.currectfocusdata.remark
  937. this.dialogVisiblecontent = true
  938. },
  939. handlequeren() {
  940. if (this.titletype == '请款金额') {
  941. this.dialogVisiblecontent = false
  942. this.currectfocusdata.requestFunds = this.textarea
  943. console.log(this.currectfocusdata, textarea)
  944. this.$forceUpdate()
  945. } else {
  946. this.dialogVisiblecontent = false
  947. this.currectfocusdata.remark = this.textarea
  948. this.$forceUpdate()
  949. }
  950. },
  951. interestratesubmit() {
  952. setenabledinfo({ id: this.interestratevalue.id, value: this.interestratevalue.value }).toPromise()
  953. .then((response) => {
  954. this.$message({
  955. message: '修改利率成功',
  956. type: 'success'
  957. });
  958. this.interestrateshow = false
  959. })
  960. },
  961. warehousefocus() {
  962. getposition({ baseId: this.fieldrationsList.baseId, flag: 1 }).toPromise()
  963. .then((response) => {
  964. // row.weightedit=false
  965. this.options = response
  966. })
  967. },
  968. warehousechange(e) {
  969. for (let i = 0; i < this.options.length; i++) {
  970. if (this.options[i].binNumber == e) {
  971. this.fieldrationsList.beforePositionId = this.options[i].id
  972. }
  973. }
  974. },
  975. warehouseweightfocus(){
  976. },
  977. warehousefocus1() {
  978. getposition({ baseId: this.fieldrationsList.baseId }).toPromise()
  979. .then((response) => {
  980. // row.weightedit=false
  981. this.options1 = response
  982. })
  983. },
  984. warehousechange1(e) {
  985. for (let i = 0; i < this.options1.length; i++) {
  986. if (this.options1[i].binNumber == e) {
  987. this.fieldrationsList.afterPositionId = this.options1[i].id
  988. }
  989. }
  990. },
  991. fujian(row) {
  992. this.id = row.id
  993. this.accessoryTFs = true
  994. console.log(row.addressUrl.indexOf('http'))
  995. if (row.addressUrl.indexOf('http') != -1) {
  996. if (row.addressUrl.split(',')) {
  997. var arr = row.addressUrl.split(',')
  998. this.dataList = []
  999. for (var i = 0; i < arr.length; i++) {
  1000. this.dataList.push({ url: arr[i] })
  1001. }
  1002. this.appendixIdss = arr
  1003. this.paymentScreenshot = arr
  1004. }
  1005. } else {
  1006. this.appendixIdss = row.addressUrl
  1007. }
  1008. console.log(this.appendixIdss)
  1009. },
  1010. lookRemark(row) {
  1011. if (row.remark) {
  1012. this.remark = row.remark
  1013. this.remarkList = true
  1014. }
  1015. else {
  1016. this.$message({
  1017. message: '暂无请款备注',
  1018. type: 'warning'
  1019. });
  1020. }
  1021. },
  1022. handle(status) {
  1023. this.searchType = status
  1024. this.getList()
  1025. },
  1026. selectinOutType() {
  1027. this.getList()
  1028. },
  1029. handleSelectionChange(val, item, index) {
  1030. console.log(val, item)
  1031. for (let i = 0; i < this.gainList.length; i++) {
  1032. if (this.gainList[i].warehouseName == item.warehouseName) {
  1033. for (let q = 0; q < this.gainList[i].warehousingOrderList.length; q++) {
  1034. if (!item.payshow) {
  1035. this.gainList[i].warehousingOrderList[q].select = false
  1036. }
  1037. }
  1038. }
  1039. }
  1040. for (let i = 0; i < val.length; i++) {
  1041. if (!item.payshow) {
  1042. if (val[i].amountNotPayable <= 0) {
  1043. this.$message({
  1044. message: '请选择未付大于零的条目!',
  1045. type: 'warning'
  1046. });
  1047. var that = this
  1048. setTimeout(() => {
  1049. that.$refs[`multipleTable${index}`][0].toggleRowSelection(val[i], false);
  1050. }, 1000)
  1051. } else {
  1052. val[i].select = true
  1053. }
  1054. }
  1055. }
  1056. item.summation = 0
  1057. for (let i = 0; i < val.length; i++) {
  1058. if (val[i].surplusWeight) {
  1059. item.summation += Number(val[i].surplusWeight)
  1060. }
  1061. }
  1062. if(item.summation){
  1063. item.summation = item.summation.toFixed(3)
  1064. }
  1065. this.$forceUpdate()
  1066. // console.log(val,item.summation,1111111111)
  1067. this.multipleSelection1[item.id] = val
  1068. // this.multipleSelection=this.noRepeat(this.multipleSelection.concat(val))
  1069. // console.log(this.multipleSelection)
  1070. },
  1071. noRepeat(arr) {
  1072. var newArr = [...new Set(arr)]; //利用了Set结构不能接收重复数据的特点
  1073. return newArr
  1074. },
  1075. editWeight(row) {
  1076. row.weightedit = true
  1077. },
  1078. editMoisture(row) {
  1079. row.edit = true
  1080. this.$forceUpdate()
  1081. },
  1082. changeWeight(row) {
  1083. if (row.inWarehouseWeight1 < row.outWarehouseWeight) {
  1084. this.$message({
  1085. message: '入库量不能小于出库量',
  1086. type: 'warning'
  1087. });
  1088. return
  1089. }
  1090. this.$confirm('确定提交入库重量?', {
  1091. confirmButtonText: '确定',
  1092. cancelButtonText: '取消',
  1093. type: 'warning',
  1094. })
  1095. .then(() => {
  1096. editwarehousingorder({ id: row.id, inWarehouseWeight: row.inWarehouseWeight1 }).toPromise()
  1097. .then((response) => {
  1098. // row.weightedit=false
  1099. this.getList()
  1100. })
  1101. })
  1102. },
  1103. changeMoisture(row) {
  1104. if (row.weightedMoisture < 14 || row.weightedMoisture > 80) {
  1105. this.$message({
  1106. message: '加权水分输入错误',
  1107. type: 'warning'
  1108. });
  1109. return
  1110. }
  1111. this.$confirm('确定提交加权水分?', {
  1112. confirmButtonText: '确定',
  1113. cancelButtonText: '取消',
  1114. type: 'warning',
  1115. })
  1116. .then(() => {
  1117. editwarehousingorder({ id: row.id, weightedMoisture: row.weightedMoisture }).toPromise()
  1118. .then((response) => {
  1119. // row.weightedit=false
  1120. this.getList()
  1121. })
  1122. })
  1123. },
  1124. withdraw(item) {
  1125. if(!this.multipleSelection1[item.id]){
  1126. this.$message({
  1127. message: '至少选择一条请款审核中的条目',
  1128. type: 'error'
  1129. });
  1130. }
  1131. else{
  1132. var arr1 = this.multipleSelection1[item.id]
  1133. for (let i = 0; i < arr1.length; i++) {
  1134. if (!arr1[i].approveStatus || arr1[i].approveStatus == '发起人撤回') {
  1135. this.$message({
  1136. message: '请选择请款审核中的条目进行撤回',
  1137. type: 'warning'
  1138. });
  1139. return
  1140. } else {
  1141. this.$confirm(`撤回成功后,可再次提交,确定撤回该次请款吗?`, {
  1142. cancelButtonText: '取消',
  1143. confirmButtonText: '确定',
  1144. type: 'warning',
  1145. }).then(() => {
  1146. var arr4 = this.unique(arr1)
  1147. for (let j = 0; j < arr4.length; j++) {
  1148. sponsorWithdraw({
  1149. workflowId: arr4[j].workflowId,
  1150. businessKey: arr4[j].batchId,
  1151. }).toPromise()
  1152. .then((response) => {
  1153. this.$message.success('撤回成功')
  1154. })
  1155. // updateApprove({
  1156. // batchId: arr4[j].batchId,
  1157. // }).toPromise()
  1158. // .then((response) => {
  1159. // })
  1160. }
  1161. })
  1162. }
  1163. }
  1164. this.getList()
  1165. }
  1166. },
  1167. unique(arr) {
  1168. const res = new Map();
  1169. return arr.filter((arr) => !res.has(arr.batchId) && res.set(arr.batchId, 1));
  1170. },
  1171. payout(item) {
  1172. console.log(item)
  1173. if (localStorage.getItem('ws-pf_roleName') == '销售内勤' || localStorage.getItem('ws-pf_roleName') == '采购内勤'||localStorage.getItem('ws-pf_roleName').indexOf('专员')> -1) {
  1174. if (Object.keys(this.multipleSelection1).length != 0 && this.multipleSelection1[item.id].length > 0) {
  1175. for (let i = 0; i < this.multipleSelection1[item.id].length; i++) {
  1176. if (item.warehouseName == this.multipleSelection1[item.id][i].warehouseName) {
  1177. if (this.multipleSelection1[item.id][i].inType == '移库入库' || this.multipleSelection1[item.id][i].inType == '退库入库') {
  1178. this.$message({
  1179. message: '请选择收购入库或采购入库的条目!',
  1180. type: 'warning'
  1181. });
  1182. return
  1183. }
  1184. if (this.multipleSelection1[item.id][i].amountNotPayable <= 0) {
  1185. this.$message({
  1186. message: '请选择未付大于零的条目!',
  1187. type: 'warning'
  1188. });
  1189. return
  1190. }
  1191. if (this.multipleSelection1[item.id][i].amountNotPayable > 0 && this.multipleSelection1[item.id][i].approveStatus
  1192. && this.multipleSelection1[item.id][i].approveStatus !='发起人撤回') {
  1193. this.$message({
  1194. message: '请选择未请款的条目!',
  1195. type: 'warning'
  1196. });
  1197. return
  1198. }
  1199. }
  1200. }
  1201. item.payshow = false
  1202. for (let i = 0; i < this.multipleSelection1[item.id].length; i++) {
  1203. if (item.warehouseName == this.multipleSelection1[item.id][i].warehouseName) {
  1204. this.multipleSelection1[item.id][i].requestFunds = this.multipleSelection1[item.id][i].amountNotPayable
  1205. this.multipleSelection1[item.id][i].select = true
  1206. }
  1207. }
  1208. } else {
  1209. this.$message({
  1210. message: '至少选择一条待请款条目!',
  1211. type: 'warning'
  1212. });
  1213. }
  1214. } else {
  1215. this.$message({
  1216. message: '暂无此权限!',
  1217. type: 'warning'
  1218. });
  1219. }
  1220. },
  1221. marginAllocation() {
  1222. let _this = this
  1223. var arr = []
  1224. var currectData = []
  1225. for (const key in this.multipleSelection1) {
  1226. var array = this.multipleSelection1[key]
  1227. for (let i = 0; i < array.length; i++) {
  1228. arr.push(array[i])
  1229. }
  1230. if (array.length > 0) {
  1231. currectData = array
  1232. }
  1233. }
  1234. if (arr.length > 1) {
  1235. this.$message({
  1236. message: '一次只能分配一条入库记录',
  1237. type: 'warning'
  1238. });
  1239. return
  1240. }
  1241. if (currectData.length == 0) {
  1242. this.$message({
  1243. message: '请选择一条数据!',
  1244. type: 'warning'
  1245. });
  1246. return
  1247. }
  1248. // console.log(currectData)
  1249. var arr1 = currectData
  1250. for (let i = 0; i < arr1.length; i++) {
  1251. if (arr1[i].amountNotPayable < 0) {
  1252. this.$message({
  1253. message: '请选择一条有未付金额的条目!',
  1254. type: 'warning'
  1255. });
  1256. return
  1257. }
  1258. if (arr1[i].inType != '采购入库' && arr1[i].inType != '收购入库') {
  1259. this.$message({
  1260. message: '请选择货源是采购合同或收购合同的条目',
  1261. type: 'warning'
  1262. });
  1263. return
  1264. }
  1265. _this.dialogTitle = arr1[i].contractNo
  1266. getExpense({ contractNo: arr1[i].contractNo, compId: this.compId }).toPromise()
  1267. .then((response) => {
  1268. _this.form.contractId = response.id
  1269. _this.form.accumulatedPrepayment = response.accumulatedMargin
  1270. _this.form.recoveryPrepayments = response.withdrawalOfMargin
  1271. _this.form.distributionEd = response.allocatedMargin
  1272. _this.form.distributionCan = response.accumulatedMargin - response.withdrawalOfMargin - response.allocatedMargin
  1273. _this.form.distributionNot = arr1[i].amountNotPayable
  1274. this.currectdata = currectData
  1275. this.marginshow = true
  1276. }).catch(() => {
  1277. this.$message({
  1278. message: '无可分配金额',
  1279. type: 'warning'
  1280. });
  1281. return
  1282. })
  1283. }
  1284. },
  1285. interestrate() {
  1286. this.interestrateshow = true
  1287. },
  1288. async fieldrations() {
  1289. let _this = this
  1290. console.log(this.multipleSelection1)
  1291. var arr = []
  1292. var arr3 = []
  1293. var currectData = []
  1294. for (const key in this.multipleSelection1) {
  1295. var array = this.multipleSelection1[key]
  1296. for (let i = 0; i < array.length; i++) {
  1297. if(array[i].surplusWeight <=0){
  1298. continue
  1299. }
  1300. arr.push(array[i])
  1301. if (arr3.length == 0) {
  1302. arr3.push(array[i])
  1303. } else {
  1304. var arr2 = arr3.filter((item) => { return item.warehouseName == array[i].warehouseName })
  1305. if (arr2.length == 0) {
  1306. arr3.push(array[i])
  1307. }
  1308. }
  1309. }
  1310. }
  1311. currectData = arr
  1312. if (currectData.length == 0) {
  1313. this.$message({
  1314. message: '请选择一条数据!',
  1315. type: 'warning'
  1316. });
  1317. return
  1318. }
  1319. // console.log(arr1)
  1320. let map = new Map();
  1321. for (let item of currectData) {
  1322. map.set(item.goodsName, item);
  1323. }
  1324. var data = [...map.values()];
  1325. if (data.length > 1) {
  1326. this.$message({
  1327. message: '请选择同一个货名的数据进行折干!',
  1328. type: 'warning'
  1329. });
  1330. return
  1331. }
  1332. if (arr3.length > 1) {
  1333. this.$message({
  1334. message: '请选择同一个仓库的数据进行折干!',
  1335. type: 'warning'
  1336. });
  1337. return
  1338. }
  1339. // console.log(currectData)
  1340. var arr1 = currectData
  1341. for (let i = 0; i < arr1.length; i++) {
  1342. if (arr1[i].warehouseType != 1) {
  1343. this.$message({
  1344. message: '请选择常用库潮粮进行折干!',
  1345. type: 'warning'
  1346. });
  1347. return
  1348. }
  1349. if (arr1[i].goodsName.indexOf('潮粮') == -1) {
  1350. this.$message({
  1351. message: '只有潮粮可以折干!',
  1352. type: 'warning'
  1353. });
  1354. return
  1355. }
  1356. if (!arr1[i].weightedMoisture || arr1[i].weightedMoisture < 14) {
  1357. this.$message({
  1358. message: '加权水分不可小于干粮水分!',
  1359. type: 'warning'
  1360. });
  1361. return
  1362. }
  1363. // _this.dialogTitle=arr1[i].contractNo
  1364. }
  1365. var weight = 0
  1366. for (let i = 0; i < arr1.length; i++) {
  1367. console.log(arr1[i].surplusWeight)
  1368. weight += Number(arr1[i].surplusWeight)
  1369. }
  1370. // this.currectdata=item
  1371. this.currectdata = arr1
  1372. this.fieldrationsList.warehousingOrderList = this.currectdata
  1373. this.fieldrationsList.baseId = this.currectdata[0].baseId
  1374. this.fieldrationsList.beforeWeight = weight.toFixed(3)
  1375. var response=await getbyname({ warehouseId: this.currectdata[0].baseId, goodsName: this.currectdata[0].goodsName }).toPromise()
  1376. let count = 0
  1377. for(let i = 0;i<arr1.length;i++){
  1378. let array =[]
  1379. array.push(arr1[i])
  1380. var response1=await getdryweight({ warehousingOrderList: array }).toPromise()
  1381. if (response) {
  1382. let weight2 = 0
  1383. for (let i = 0; i < this.currectdata.length; i++) {
  1384. var weightedMoisture = (this.currectdata[i].weightedMoisture - 14)
  1385. var deductWeight = 100 - (weightedMoisture * response.deductWeight)
  1386. }
  1387. count =Number(count)+ Number(response1)
  1388. this.fieldrationsList.warehousingOrderList[i].afterWeight = response1
  1389. this.fieldrationsshow = true
  1390. }
  1391. }
  1392. this.fieldrationsList.afterWeight = count.toFixed(3)
  1393. // this.fieldrationsList.beforeCost=this.currectdata[0].avgCost
  1394. },
  1395. distribution() {
  1396. let _this = this
  1397. console.log(this.multipleSelection1)
  1398. var arr = []
  1399. var currectData = []
  1400. for (const key in this.multipleSelection1) {
  1401. var array = this.multipleSelection1[key]
  1402. for (let i = 0; i < array.length; i++) {
  1403. arr.push(array[i])
  1404. }
  1405. if (array.length > 0) {
  1406. currectData = array
  1407. }
  1408. }
  1409. if (arr.length > 1) {
  1410. this.$message({
  1411. message: '一次只能分配一条入库记录',
  1412. type: 'warning'
  1413. });
  1414. return
  1415. }
  1416. if (currectData.length == 0) {
  1417. this.$message({
  1418. message: '请选择一条数据!',
  1419. type: 'warning'
  1420. });
  1421. return
  1422. }
  1423. // console.log(currectData)
  1424. var arr1 = currectData
  1425. for (let i = 0; i < arr1.length; i++) {
  1426. if (arr1[i].amountNotPayable < 0) {
  1427. this.$message({
  1428. message: '请选择一条有未付金额的条目!',
  1429. type: 'warning'
  1430. });
  1431. return
  1432. }
  1433. if (arr1[i].inType != '采购入库' && arr1[i].inType != '收购入库') {
  1434. this.$message({
  1435. message: '请选择货源是采购合同或收购合同的条目',
  1436. type: 'warning'
  1437. });
  1438. return
  1439. }
  1440. _this.dialogTitle = arr1[i].contractNo
  1441. getExpense({ contractNo: arr1[i].contractNo, compId: this.compId }).toPromise()
  1442. .then((response) => {
  1443. _this.form.contractId = response.id
  1444. _this.form.accumulatedPrepayment = response.accumulatedPrepayment
  1445. _this.form.recoveryPrepayments = response.accumulatedRecovery
  1446. _this.form.distributionEd = response.prepaidAssigned
  1447. _this.form.distributionCan = response.accumulatedPrepayment - response.accumulatedRecovery - response.prepaidAssigned
  1448. _this.form.distributionNot = arr1[i].amountNotPayable
  1449. }).catch(() => {
  1450. this.$message({
  1451. message: '无可分配金额',
  1452. type: 'warning'
  1453. });
  1454. return
  1455. })
  1456. }
  1457. // this.currectdata=item
  1458. this.currectdata = arr1
  1459. this.distributionshow = true
  1460. },
  1461. getNowTime() {
  1462. const start = new Date(new Date().getTime() - 3600 * 1000 * 24)
  1463. .toISOString()
  1464. .replace('T', ' ')
  1465. .split('.')[0] //默认开始时间1天前
  1466. const end = new Date(new Date().getTime())
  1467. .toISOString()
  1468. .replace('T', ' ')
  1469. .split('.')[0]//默认结束时间今天
  1470. // console.log([start.split(' '), end])
  1471. return [start.split(' ')[0], end.split(' ')[0]]
  1472. },
  1473. cancel(item) {
  1474. item.payshow = true
  1475. for (let i = 0; i < this.multipleSelection1[item.id].length; i++) {
  1476. if (item.warehouseName == this.multipleSelection1[item.id][i].warehouseName) {
  1477. this.multipleSelection1[item.id][i].select = false
  1478. }
  1479. }
  1480. },
  1481. costclick(row) {
  1482. this.interest=row.interest
  1483. this.storageFee=row.storageFee
  1484. this.dryingFee = row.dryingFee
  1485. this.costlist = row.expenseAllocationInfoList
  1486. console.log(this.interest,this.storageFee)
  1487. this.dialogVisible1 = true
  1488. // getexenseinfo({id:row.id}).toPromise()
  1489. // .then((response) => {
  1490. // this.costlist=response
  1491. // }).catch(() => {
  1492. // })
  1493. },
  1494. selectInit(row, index) {
  1495. if (localStorage.getItem('ws-pf_roleName') == '销售内勤' || localStorage.getItem('ws-pf_roleName') == '采购内勤'||localStorage.getItem('ws-pf_roleName').indexOf('专员')> -1) {
  1496. return true
  1497. } else if (localStorage.getItem('ws-pf_staffName') == '杜大光') {
  1498. return true
  1499. } else if (localStorage.getItem('ws-pf_staffName') == '范占国') {
  1500. return true
  1501. } else if (localStorage.getItem('ws-pf_roleName') == '财务') {
  1502. return true
  1503. } else if (localStorage.getItem('ws-pf_roleName') == '出纳') {
  1504. return true
  1505. }else if (localStorage.getItem('ws-pf_deptName') == '单证中心') {
  1506. return true
  1507. } else {
  1508. return false
  1509. }
  1510. },
  1511. onChange() {
  1512. this.$refs.upload
  1513. .handleSaveBill()
  1514. .then(async response => {
  1515. this.paymentScreenshot = response
  1516. })
  1517. .catch(res => {
  1518. EventBus.$emit('error', (JSON.parse(res) || {}).message)
  1519. this.$refs.upload.clearFiles()
  1520. })
  1521. },
  1522. handleRemove(file) {
  1523. // console.log(file)
  1524. for (let i = 0; i < this.paymentScreenshot.length; i++) {
  1525. if (this.paymentScreenshot[i] == file.url) {
  1526. this.paymentScreenshot.splice(i, 1)
  1527. }
  1528. }
  1529. },
  1530. submit(item) {
  1531. var arr1 = this.multipleSelection1[item.id]
  1532. for (let i = 0; i < arr1.length; i++) {
  1533. if (!arr1[i].requestFunds) {
  1534. this.$message({
  1535. message: '请款金额不能为空!',
  1536. type: 'warning'
  1537. });
  1538. return
  1539. }
  1540. if (arr1[i].approveStatus && arr1[i].approveStatus!='发起人撤回') {
  1541. this.$message({
  1542. message: '至少选择一条待请款条目',
  1543. type: 'warning'
  1544. });
  1545. return
  1546. }
  1547. if (arr1[i].requestFunds > arr1[i].amountNotPayable) {
  1548. this.$message({
  1549. message: '请款金额不能大于未付金额!',
  1550. type: 'warning'
  1551. });
  1552. return
  1553. }
  1554. }
  1555. // for (let i = 0; i < arr1.length; i++) {
  1556. // if(arr[i].inType=='收购入库'){
  1557. // arr[i].inWarehouseWeight=arr[i].inWarehouseWeight*1000
  1558. // }
  1559. // }
  1560. this.$confirm('确认提交请款信息', {
  1561. confirmButtonText: '确定',
  1562. cancelButtonText: '取消',
  1563. type: 'warning',
  1564. })
  1565. .then(() => {
  1566. paymoney({ flag: 1, warehousingOrderList: arr1 }).toPromise()
  1567. .then((response) => {
  1568. this.$message({
  1569. message: '提交成功',
  1570. type: 'success'
  1571. });
  1572. this.getList()
  1573. }).catch(() => {
  1574. this.$message({
  1575. message: '提交失败',
  1576. type: 'warning'
  1577. });
  1578. })
  1579. }).catch(() => {
  1580. return false
  1581. })
  1582. },
  1583. paymentsubmit(item) {
  1584. var that = this
  1585. console.log(this.multipleSelection1, this.multipleSelection1[this.currectdata.id])
  1586. var arr2 = this.multipleSelection1[this.currectdata.id]
  1587. console.log(this.paymentScreenshot)
  1588. var len = this.paymentScreenshot ? this.paymentScreenshot.split(',') : []
  1589. if (len.length == 0) {
  1590. this.$message({
  1591. message: '请上传付款截图',
  1592. type: 'warning'
  1593. });
  1594. return
  1595. }
  1596. for (let i = 0; i < arr2.length; i++) {
  1597. if (arr2[i].addressUrlArray) {
  1598. arr2[i].addressUrlArray = arr2[i].addressUrlArray.concat(len)
  1599. }
  1600. else {
  1601. arr2[i].addressUrlArray = len
  1602. }
  1603. arr2[i].addressUrl = arr2[i].addressUrlArray.toString()
  1604. }
  1605. console.log(arr2)
  1606. paymoney({ flag: 0, warehousingOrderList: arr2 }).toPromise()
  1607. .then((response) => {
  1608. this.$message({
  1609. message: '付款成功',
  1610. type: 'success'
  1611. });
  1612. this.aduitshow = false
  1613. this.paymentScreenshot = ''
  1614. this.$refs.upload.clearFiles()
  1615. this.getList()
  1616. }).catch(() => {
  1617. this.$message({
  1618. message: '付款失败',
  1619. type: 'warning'
  1620. });
  1621. })
  1622. },
  1623. afterWeightchange(e) {
  1624. this.fieldrationsList.afterCost = (Number(this.fieldrationsList.beforeWeight) * Number(this.fieldrationsList.beforeCost)) / Number(e)
  1625. },
  1626. fieldrationssubmit() {
  1627. var arr2 = this.currectdata
  1628. if (!this.fieldrationsList.beforeWeight) {
  1629. this.$message({
  1630. message: '折干前重量不能为空',
  1631. type: 'warning'
  1632. });
  1633. return
  1634. }
  1635. if (this.fieldrationsList.beforeWeight <= 0) {
  1636. this.$message({
  1637. message: '折干前重量输入错误',
  1638. type: 'warning'
  1639. });
  1640. return
  1641. }
  1642. // if(!this.fieldrationsList.beforeBinNo){
  1643. // this.$message({
  1644. // message: '折干前仓位不能为空',
  1645. // type: 'warning'
  1646. // });
  1647. // return
  1648. // }
  1649. if (!this.fieldrationsList.afterWeight) {
  1650. this.$message({
  1651. message: '折干后重量不能为空',
  1652. type: 'warning'
  1653. });
  1654. return
  1655. }
  1656. if (this.fieldrationsList.afterWeight <= 0) {
  1657. this.$message({
  1658. message: '折干后重量输入错误',
  1659. type: 'warning'
  1660. });
  1661. return
  1662. }
  1663. if (Number(this.fieldrationsList.afterWeight) > Number(this.fieldrationsList.beforeWeight)) {
  1664. this.$message({
  1665. message: '折干后重量输入错误',
  1666. type: 'warning'
  1667. });
  1668. return
  1669. }
  1670. if (!this.fieldrationsList.afterBinNo) {
  1671. this.$message({
  1672. message: '折干后仓位不能为空',
  1673. type: 'warning'
  1674. });
  1675. return
  1676. }
  1677. this.$confirm('确定提交折干?', '提示', {
  1678. confirmButtonText: '确定',
  1679. cancelButtonText: '取消',
  1680. type: 'warning'
  1681. }).then(() => {
  1682. dryout(this.fieldrationsList).toPromise()
  1683. .then((response) => {
  1684. this.$message({
  1685. message: '折干成功',
  1686. type: 'success'
  1687. });
  1688. this.form.distributionIng = ''
  1689. this.$set(this.fieldrationsList,'beforeBinNo','')
  1690. this.$set(this.fieldrationsList,'afterBinNo','')
  1691. // this.fieldrationsList.beforeBinNo = ''
  1692. // this.fieldrationsList.afterBinNo = ''
  1693. this.fieldrationsshow = false
  1694. selectWarehouseSelf({
  1695. compId: localStorage.getItem('ws-pf_compId'),
  1696. })
  1697. .toPromise()
  1698. .then((response) => {
  1699. this.warehouseList = response
  1700. this.warehouseNameChange(this.warehouseName)
  1701. })
  1702. this.getList()
  1703. }).catch((response) => {
  1704. if (response.code == null) {
  1705. this.$message({
  1706. message: response.data.message,
  1707. type: 'warning'
  1708. });
  1709. } else {
  1710. this.$message({
  1711. message: '折干失败',
  1712. type: 'warning'
  1713. });
  1714. }
  1715. })
  1716. }).catch(() => {
  1717. // this.$message({
  1718. // type: 'info',
  1719. // message: '已取消删除'
  1720. // });
  1721. });
  1722. },
  1723. marginsubmit(item) {
  1724. var arr2 = this.currectdata
  1725. if (this.form.distributionIng > this.form.distributionCan) {
  1726. this.$message({
  1727. message: '超出可分配金额',
  1728. type: 'warning'
  1729. });
  1730. return
  1731. }
  1732. if (this.form.distributionIng > this.form.distributionNot) {
  1733. this.$message({
  1734. message: '超出未付金额',
  1735. type: 'warning'
  1736. });
  1737. return
  1738. }
  1739. this.$confirm('确定提交分配金额?', '提示', {
  1740. confirmButtonText: '确定',
  1741. cancelButtonText: '取消',
  1742. type: 'warning'
  1743. }).then(() => {
  1744. paymoney({ flag: 3, money: this.form.distributionIng, warehousingOrderList: arr2, contractId: this.form.contractId }).toPromise()
  1745. .then((response) => {
  1746. this.$message({
  1747. message: '分配成功',
  1748. type: 'success'
  1749. });
  1750. this.form.distributionIng = ''
  1751. this.marginshow = false
  1752. this.getList()
  1753. }).catch(() => {
  1754. this.$message({
  1755. message: '分配失败',
  1756. type: 'warning'
  1757. });
  1758. })
  1759. }).catch(() => {
  1760. // this.$message({
  1761. // type: 'info',
  1762. // message: '已取消删除'
  1763. // });
  1764. });
  1765. },
  1766. distributionsubmit() {
  1767. var arr2 = this.currectdata
  1768. if (this.form.distributionIng > this.form.distributionCan) {
  1769. this.$message({
  1770. message: '超出可分配金额',
  1771. type: 'warning'
  1772. });
  1773. return
  1774. }
  1775. if (this.form.distributionIng > this.form.distributionNot) {
  1776. this.$message({
  1777. message: '超出未付金额',
  1778. type: 'warning'
  1779. });
  1780. return
  1781. }
  1782. this.$confirm('确定提交分配金额?', '提示', {
  1783. confirmButtonText: '确定',
  1784. cancelButtonText: '取消',
  1785. type: 'warning'
  1786. }).then(() => {
  1787. paymoney({ flag: 2, money: this.form.distributionIng, warehousingOrderList: arr2, contractId: this.form.contractId }).toPromise()
  1788. .then((response) => {
  1789. this.$message({
  1790. message: '分配成功',
  1791. type: 'success'
  1792. });
  1793. this.form.distributionIng = ''
  1794. this.distributionshow = false
  1795. this.getList()
  1796. }).catch(() => {
  1797. this.$message({
  1798. message: '分配失败',
  1799. type: 'warning'
  1800. });
  1801. })
  1802. }).catch(() => {
  1803. // this.$message({
  1804. // type: 'info',
  1805. // message: '已取消删除'
  1806. // });
  1807. });
  1808. },
  1809. lookcustomer(row) {
  1810. this.customerInfo = row
  1811. this.customershow = true
  1812. },
  1813. payment(item) {
  1814. if (localStorage.getItem('ws-pf_roleName') == '出纳') {
  1815. this.money = 0
  1816. var moneyarr = this.multipleSelection1[item.id]
  1817. // console.log(moneyarr)
  1818. for (let i = 0; i < this.multipleSelection1[item.id].length; i++) {
  1819. if (this.multipleSelection1[item.id][i].warehouseName == item.warehouseName) {
  1820. if (this.multipleSelection1[item.id][i].addressUrl) {
  1821. this.multipleSelection1[item.id][i].addressUrlArray = this.multipleSelection1[item.id][i].addressUrl.split(',')
  1822. }
  1823. this.money = Number(this.money) + Number(this.multipleSelection1[item.id][i].requestFunds)
  1824. if (this.multipleSelection1[item.id][i].approveStatus !== null || this.multipleSelection1[item.id][i].requestFunds == 0) {
  1825. this.$message({
  1826. message: '请勾选一条待付款的条目',
  1827. type: 'warning'
  1828. })
  1829. return
  1830. }
  1831. }
  1832. }
  1833. this.form.name = this.money.toFixed(2)
  1834. this.currectdata = item
  1835. if (moneyarr && moneyarr.length > 0) {
  1836. // if(moneyarr[0].inType=='采购入库'){
  1837. // getpayeeinfo({compId: localStorage.getItem('ws-pf_compId'),contractNo:moneyarr[0].contractNo}).toPromise()
  1838. // .then((response) => {
  1839. // this.payeeinfo=response
  1840. // this.aduitshow=true
  1841. // })
  1842. // }else if(moneyarr[0].inType=='收购入库'){
  1843. // getbuypayeeinfo({compId: localStorage.getItem('ws-pf_compId'),customerName:moneyarr[0].customer}).toPromise()
  1844. // .then((response) => {
  1845. // this.payeeinfo=response
  1846. // })
  1847. // }
  1848. this.payeeinfo = moneyarr
  1849. this.aduitshow = true
  1850. } else {
  1851. this.$message({
  1852. message: '至少勾选一条待付款的条目',
  1853. type: 'warning'
  1854. })
  1855. }
  1856. } else {
  1857. this.$message({
  1858. message: '暂无此权限!',
  1859. type: 'warning'
  1860. })
  1861. }
  1862. },
  1863. aduit(row) {
  1864. var arr2 = this.multipleSelection1[row.id]
  1865. if(!this.multipleSelection1[row.id]){
  1866. this.$message({
  1867. message: '至少选择一条待审核的条目',
  1868. type: 'error'
  1869. });
  1870. }
  1871. // console.log(arr2)
  1872. if (arr2.length == 0) {
  1873. if (localStorage.getItem('ws-pf_staffName') == '杜大光') {
  1874. this.$message({
  1875. message: '至少选择一条待决策人审核的条目',
  1876. type: 'error'
  1877. });
  1878. return
  1879. } else if (localStorage.getItem('ws-pf_roleName') == '财务') {
  1880. this.$message({
  1881. message: '至少选择一条待财务审核的条目',
  1882. type: 'error'
  1883. });
  1884. return
  1885. }
  1886. }
  1887. for (let i = 0; i < arr2.length; i++) {
  1888. if (!arr2[i].approveStatus) {
  1889. this.$message({
  1890. message: '至少选择一条待审核的条目',
  1891. type: 'error'
  1892. });
  1893. return
  1894. }
  1895. if (!arr2[i].taskId) {
  1896. this.$message({
  1897. message: '至少选择一条待审核的条目',
  1898. type: 'error'
  1899. });
  1900. return
  1901. }
  1902. }
  1903. var arr3 = this.filtertask(arr2)
  1904. this.$confirm('审核请款信息', {
  1905. confirmButtonText: '通过',
  1906. cancelButtonText: '驳回',
  1907. distinguishCancelAndClose: true,
  1908. type: 'warning',
  1909. })
  1910. .then(() => {
  1911. this.title1='通过'
  1912. this.auditdata=arr3
  1913. this.rejectshow=true
  1914. // this.aduithandle(arr3, 0, true)
  1915. }).catch((action) => {
  1916. console.log(action)
  1917. if (action == 'cancel') {
  1918. this.title1='驳回'
  1919. this.auditdata=arr3
  1920. this.rejectshow=true
  1921. // this.aduithandle(arr3, 0, false)
  1922. }
  1923. })
  1924. },
  1925. rejectclick(){
  1926. if(this.title1=='通过'){
  1927. this.aduithandle(this.auditdata, 0, true)
  1928. }else{
  1929. this.aduithandle(this.auditdata, 0, false)
  1930. }
  1931. },
  1932. aduithandle(item, index, status) {
  1933. if (index < item.length) {
  1934. workflowhandle({
  1935. taskId: item[index].taskId,
  1936. approved: status,
  1937. auditMind: this.auditMind,
  1938. needReapply: true,
  1939. }).toPromise()
  1940. .then((response) => {
  1941. this.aduithandle(item, index + 1, status)
  1942. }).catch(() => {
  1943. if (status) {
  1944. this.$message({
  1945. message: '通过失败',
  1946. type: 'error'
  1947. });
  1948. } else {
  1949. this.$message({
  1950. message: '驳回失败',
  1951. type: 'error'
  1952. });
  1953. }
  1954. })
  1955. } else {
  1956. if (status) {
  1957. this.$message({
  1958. message: '通过成功',
  1959. type: 'success'
  1960. });
  1961. this.getList()
  1962. } else {
  1963. this.$message({
  1964. message: '驳回成功',
  1965. type: 'success'
  1966. });
  1967. this.rejectshow=false
  1968. this.getList()
  1969. }
  1970. this.rejectshow = false
  1971. }
  1972. },
  1973. //查找
  1974. lookUp() {
  1975. this.currentPage = 1
  1976. this.getList()
  1977. },
  1978. warehousingorder() {
  1979. this.dialogVisible = true
  1980. },
  1981. datechange(e) {
  1982. this.value2 = e
  1983. this.getList()
  1984. console.log(e)
  1985. },
  1986. getList() {
  1987. this.startDate = this.value2[0]
  1988. this.endDate = this.value2[1]
  1989. getenabledinfo({ functionType: 2 }).toPromise()
  1990. .then((response) => {
  1991. this.interestratevalue = response
  1992. })
  1993. getwarehousingorder({
  1994. compId: localStorage.getItem('ws-pf_compId'),
  1995. startDate: this.startDate,
  1996. endDate: this.endDate,
  1997. currentPage: this.currentPage,
  1998. pageSize: this.pageSize,
  1999. baseId: this.baseId,
  2000. searchType: this.searchType,
  2001. searchKeyWord: this.searchKeyWord,
  2002. goodsName:this.goodsName!='0'?this.goodsName:'',
  2003. weightGreater:this.weightGreater
  2004. })
  2005. .toPromise()
  2006. .then((response) => {
  2007. for (let i = 0; i < response.records.length; i++) {
  2008. response.records[i].payshow = true
  2009. var data = response.records[i].warehousingOrderList
  2010. for (let q = 0; q < data.length; q++) {
  2011. if (data[q].inType == '收购入库') {
  2012. data[q].inWarehouseWeight1 = Number((data[q].inWarehouseWeight).toFixed(3))
  2013. data[q].surplusWeight = ((data[q].inWarehouseWeight) - data[q].outWarehouseWeight + data[q].profitAndLoss).toFixed(3)
  2014. } else {
  2015. data[q].inWarehouseWeight1 = data[q].inWarehouseWeight.toFixed(3)
  2016. data[q].surplusWeight =(data[q].inWarehouseWeight - data[q].outWarehouseWeight + data[q].profitAndLoss).toFixed(3)
  2017. }
  2018. data[q].avgCost = Number(data[q].avgCost).toFixed(2)
  2019. data[q].amountMoney = Number(data[q].amountMoney).toFixed(4)
  2020. console.log(response.records[i].warehouseType)
  2021. data[q].select = false
  2022. data[q].weightedit = false
  2023. data[q].edit = false
  2024. data[q].warehouseType = response.records[i].warehouseType
  2025. }
  2026. }
  2027. this.gainList = response.records
  2028. // this.currentPage = response.current
  2029. // this.pageSize = response.size
  2030. console.log(this.gainList, 96)
  2031. this.deptBudgetTotal = response.total
  2032. })
  2033. },
  2034. multiFilter(array, filters) {
  2035. const filterKeys = Object.keys(filters)
  2036. // filters all elements passing the criteria
  2037. return array.filter((item) => {
  2038. // dynamically validate all filter criteria
  2039. return filterKeys.every(key => {
  2040. //ignore when the filter is empty Anne
  2041. if (!filters[key].length) return true
  2042. return !!~filters[key].indexOf(item[key])
  2043. })
  2044. })
  2045. },
  2046. copare(arr) {
  2047. // 缓存用于记录
  2048. const newArr = [];
  2049. for (const t of arr) {
  2050. // 检查缓存中是否已经存在
  2051. if (
  2052. newArr.find(
  2053. (c) =>
  2054. c.issuingTime === t.issuingTime
  2055. )
  2056. ) {
  2057. // 已经存在说明以前记录过,现在这个就是多余的,直接忽略
  2058. continue;
  2059. }
  2060. console.log(t)
  2061. // 不存在就说明以前没遇到过,把它记录下来
  2062. newArr.push(t);
  2063. }
  2064. // var results=this.makeGroupData(newArr,function (item) { return [item.issuingTime]; }); console.log(results)
  2065. // 记录结果就是过滤后的结果
  2066. return newArr;
  2067. },
  2068. filtertask(arr) {
  2069. const newArr = [];
  2070. for (const t of arr) {
  2071. if (
  2072. newArr.find(
  2073. (c) =>
  2074. c.taskId === t.taskId
  2075. )
  2076. ) {
  2077. continue;
  2078. }
  2079. newArr.push(t);
  2080. }
  2081. return newArr;
  2082. },
  2083. getSpanArr(data) {
  2084. let that = this
  2085. //页面展示的数据,不一定是全部的数据,所以每次都清空之前存储的 保证遍历的数据是最新的数据。以免造成数据渲染混乱
  2086. that.spanArr = []
  2087. that.pos = 0
  2088. //遍历数据
  2089. data.forEach((item, index) => {
  2090. //判断是否是第一项
  2091. // if (index === 0) {
  2092. // this.spanArr.push(1)
  2093. // this.pos = 0
  2094. // } else {
  2095. //不是第一项时,就根据标识去存储
  2096. if (data[index].warehouseNumViewList.length > 1) {
  2097. // 查找到符合条件的数据时每次要把之前存储的数据+1
  2098. this.spanArr[this.pos] = data[index].warehouseNumViewList.length
  2099. this.spanArr.push(0)
  2100. } else {
  2101. // 没有符合的数据时,要记住当前的index
  2102. this.spanArr.push(1)
  2103. this.pos = index
  2104. }
  2105. // }
  2106. })
  2107. },
  2108. //查看//传参
  2109. nocomplete(row) {
  2110. this.$router.push({
  2111. path: 'inOutWarehousetaskEdit',
  2112. query: {
  2113. relevanceId: row.relevanceId,
  2114. businessKey: row.id,
  2115. workflowId: row.workflowId,
  2116. },
  2117. })
  2118. },
  2119. dateFormat(fmt, date) {
  2120. let ret
  2121. const opt = {
  2122. 'Y+': date.getFullYear().toString(), // 年
  2123. 'm+': (date.getMonth() + 1).toString(), // 月
  2124. 'd+': date.getDate().toString(), // 日
  2125. 'H+': date.getHours().toString(), // 时
  2126. // "M+": date.getMinutes().toString(), // 分
  2127. // "S+": date.getSeconds().toString() // 秒
  2128. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  2129. }
  2130. for (let k in opt) {
  2131. ret = new RegExp('(' + k + ')').exec(fmt)
  2132. if (ret) {
  2133. fmt = fmt.replace(
  2134. ret[1],
  2135. ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
  2136. )
  2137. }
  2138. }
  2139. return fmt
  2140. },
  2141. handleClose() {
  2142. this.aduitshow = false
  2143. },
  2144. handleClose6() {
  2145. this.rejectshow = false
  2146. },
  2147. handleClose3() {
  2148. this.customershow = false
  2149. },
  2150. handleClose1() {
  2151. this.form.distributionIng = ''
  2152. this.distributionshow = false
  2153. },
  2154. handleClose2() {
  2155. this.form.distributionIng = ''
  2156. this.marginshow = false
  2157. },
  2158. handleClose4() {
  2159. this.fieldrationsList.afterWeight = 0
  2160. this.fieldrationsshow = false
  2161. },
  2162. handleSizeChange(val) {
  2163. console.log(`每页 ${val} 条`)
  2164. this.pageSize = val
  2165. this.getList()
  2166. },
  2167. handleCurrentChange(val) {
  2168. this.currentPage = val
  2169. console.log(`当前页: ${val}`)
  2170. this.getList()
  2171. },
  2172. editClick(row) {
  2173. var status = ''
  2174. if (row.taskStatus == '待审核' || row.taskStatus == '已完成') {
  2175. status = '执行中'
  2176. } else if (row.taskStatus == '执行中') {
  2177. status = '已完成'
  2178. }
  2179. //cancelButtonClass: "btn-custom-cancel"
  2180. this.$confirm(`是否将状态改为${status}`, {
  2181. confirmButtonText: '确定',
  2182. cancelButtonText: '取消',
  2183. type: 'warning',
  2184. })
  2185. .then(() => {
  2186. movestates({
  2187. id: row.id
  2188. })
  2189. .toPromise()
  2190. .then((response) => {
  2191. this.$notify.success({
  2192. title: '成功',
  2193. message: '状态修改成功',
  2194. })
  2195. this.getList()
  2196. })
  2197. .catch((response) => {
  2198. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  2199. })
  2200. })
  2201. .catch(() => {
  2202. return false
  2203. })
  2204. },
  2205. selecttaskType(e) {
  2206. for (var i = 0; i < this.taskTypeList.length; i++) {
  2207. if (this.taskTypeList[i].value == e) {
  2208. this.searchType = this.taskTypeList[i].type
  2209. }
  2210. }
  2211. this.currentPage = 1,
  2212. this.getList()
  2213. },
  2214. handleExamine(row) {
  2215. this.$router.push({
  2216. name: 'salesContractExamine',
  2217. query: {
  2218. id: row.id
  2219. },
  2220. })
  2221. },
  2222. // 关闭 dialog时 处理文件url 初始化upload组件
  2223. handleCloe() {
  2224. this.dialogViewSpareMoney = false
  2225. },
  2226. history(row) {
  2227. billoperatehis({
  2228. id: row.id
  2229. })
  2230. .toPromise()
  2231. .then((response) => {
  2232. this.historyList = response
  2233. })
  2234. },
  2235. find() {
  2236. this.currentPage = 1
  2237. this.getList()
  2238. },
  2239. },
  2240. }
  2241. </script>
  2242. <style lang="scss" scoped>
  2243. /deep/.el-form-item {
  2244. margin: 0;
  2245. }
  2246. /deep/.el-table .cell .el-input {
  2247. width: 92%;
  2248. }
  2249. .el-select {
  2250. width: 100%;
  2251. margin-right: 10px;
  2252. }
  2253. .col1 {
  2254. width: 50%;
  2255. }
  2256. .audit {
  2257. margin-bottom: 20px;
  2258. border-bottom: 1px solid #AFB3BF;
  2259. height: 70px;
  2260. .audit_item {
  2261. width: 100%;
  2262. display: flex;
  2263. height: 30px;
  2264. .audit_name {
  2265. margin-right: 30px;
  2266. font-size: 16px;
  2267. font-weight: 600;
  2268. }
  2269. .audit_left {
  2270. width: 60%;
  2271. }
  2272. .audit_date {
  2273. width: 40%;
  2274. justify-content: flex-end;
  2275. display: flex;
  2276. color: #AFB3BF;
  2277. }
  2278. }
  2279. .audit_opinion {}
  2280. }
  2281. /deep/.el-form {
  2282. width: 90%;
  2283. }
  2284. /deep/.el-upload--picture-card {
  2285. width: 100px;
  2286. height: 100px;
  2287. line-height: 100px;
  2288. }
  2289. /deep/.el-table .cell .el-input {
  2290. padding: 10px;
  2291. }
  2292. //打印弹窗
  2293. .mask {
  2294. background: black;
  2295. width: 100vw;
  2296. height: 100vh;
  2297. position: fixed;
  2298. top: 0;
  2299. z-index: 99;
  2300. opacity: 0.3;
  2301. }
  2302. .count {
  2303. text-align: center;
  2304. margin-bottom: 10px;
  2305. }
  2306. .print-type {
  2307. position: absolute;
  2308. top: 0;
  2309. bottom: 0;
  2310. left: 0;
  2311. right: 0;
  2312. margin: auto;
  2313. width: 400px;
  2314. height: 250px;
  2315. background: white;
  2316. border-radius: 10px;
  2317. z-index: 999;
  2318. .bottom-btn {
  2319. margin-top: 10px;
  2320. text-align: center;
  2321. }
  2322. }
  2323. .print-type-title {
  2324. text-align: center;
  2325. font-size: 18px;
  2326. // margin: 20px;
  2327. margin: 20px 20px 10px;
  2328. }
  2329. .print-type-checkbox {
  2330. padding-left: 20px;
  2331. .el-date-editor.el-input {
  2332. width: 85% !important;
  2333. }
  2334. .proportion_css {
  2335. width: 85%;
  2336. }
  2337. }
  2338. /deep/.el-table td,/deep/.el-table th{
  2339. text-align: center;
  2340. }
  2341. </style>