山东众工仓库管理系统前台vue代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

storechange.vue 39KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115
  1. <template>
  2. <div style="height:100%;">
  3. <div class="searchForm-header"> <!-- 查询、操作按钮框 -->
  4. <el-form :model="query" label-width="100px" inline="">
  5. <el-row>
  6. <el-form-item label="库房名称"> <!-- 库房查询条件 -->
  7. <el-select v-model="query.wareName" clearable size="small" style="width:150px">
  8. <el-option v-for="item in optionsWare" :key="item.id" :label="item.name" :value="item.name">
  9. </el-option>
  10. </el-select>
  11. </el-form-item>
  12. <el-form-item label="垛位名称"> <!-- 垛位查询条件 -->
  13. <el-input v-model="query.stackName" size="small" style="width:150px"></el-input>
  14. </el-form-item>
  15. <el-form-item label="品名"> <!-- 品名查询条件 -->
  16. <el-input v-model="query.materialName" size="small" style="width:150px">
  17. </el-input>
  18. </el-form-item>
  19. <el-form-item label="钢种"> <!-- 钢种查询条件 -->
  20. <el-input v-model="query.standard" size="small" style="width:150px">
  21. </el-input>
  22. </el-form-item>
  23. <el-form-item label="规格型号"> <!-- 规格型号查询条件 -->
  24. <el-input v-model="query.model" clearable size="small" style="width:120px">
  25. </el-input>
  26. </el-form-item>
  27. <el-form-item label="捆包号"> <!-- 捆包号查询条件 -->
  28. <el-input v-model="query.packNo" clearable size="small" style="width:120px" @input="getPackList">
  29. </el-input>
  30. </el-form-item>
  31. <el-form-item label="材料号"> <!-- 材料号查询条件 -->
  32. <el-input v-model="query.plateNo" clearable size="small" style="width:120px" @input="getPltList">
  33. </el-input>
  34. </el-form-item>
  35. <el-form-item label="订单号"> <!-- 订单号查询条件 -->
  36. <el-input v-model="query.ordNo" clearable size="small" style="width:120px" @input="getOrdList">
  37. </el-input>
  38. </el-form-item>
  39. <el-form-item label="合约号"> <!-- 合约号查询条件 -->
  40. <el-input v-model="query.contractNo" clearable size="small" style="width:120px" @input="getContractList">
  41. </el-input>
  42. </el-form-item>
  43. <el-form-item label="货权单位"> <!-- 货权单位查询条件 -->
  44. <el-select v-model="query.fkcustmerName" filterable placeholder="请选择货权单位" clearable size="small" style="width: 170px">
  45. <el-option v-for="item in optionsCust" :key="item.name" :label="item.name" :value="item.name" >
  46. </el-option>
  47. </el-select>
  48. </el-form-item>
  49. <el-form-item label="客户名称"> <!-- 客户名称查询条件 -->
  50. <el-select v-model="query.customerName" filterable placeholder="请选择订单客户" clearable size="small" style="width: 170px">
  51. <el-option v-for="item in optionsCust" :key="item.name" :label="item.name" :value="item.name" >
  52. </el-option>
  53. </el-select>
  54. </el-form-item>
  55. <el-form-item label="是否已出库"> <!-- 在库状态查询条件 -->
  56. <el-select v-model="query.outFlag" filterable placeholder="请选择在库状态" clearable size="small" style="width: 170px">
  57. <el-option v-for="item in optionsOutFlag" :key="item.value" :label="item.label" :value="item.value" >
  58. </el-option>
  59. </el-select>
  60. </el-form-item>
  61. <el-form-item label="入库时间"> <!-- 入库时间查询条件 -->
  62. <el-date-picker size="small" v-model="query.inRecordDate" style="width:330px" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
  63. </el-date-picker>
  64. </el-form-item>
  65. <el-form-item label=""> <!-- 常规使用的操作按钮 -->
  66. <el-button @click="handleSearch" size="small" type="primary">查询</el-button>
  67. <el-button @click="showChangeCustomer" size="small" type="primary">货权转移</el-button>
  68. <el-button @click="showDistribution" size="small" type="primary">配货</el-button>
  69. <el-button @click="showOut" size="small" type="primary">出库</el-button>
  70. <el-button @click="resetButton" size="small" type="primary">重置</el-button>
  71. <el-button @click="handleExport" size="small" type="success">导出记录</el-button>
  72. </el-form-item>
  73. <el-form-item label=""> <!-- 防止异常操作隐藏起来的的操作按钮1 -->
  74. <el-dropdown placement="bottom" trigger="click" @command="batchOperate">
  75. <el-button type="danger" size="small"> 其他操作<i class="el-icon-arrow-down el-icon--right"></i></el-button>
  76. <el-dropdown-menu slot="dropdown">
  77. <el-dropdown-item command="handleInBack" style="background-color: #f5f5f5;">取消入库</el-dropdown-item>
  78. <el-dropdown-item command="handleChangeCustomer" style="background-color: #f5f5f5;">批量修改</el-dropdown-item>
  79. <el-dropdown-item command="handleChangeStack" style="background-color: #f5f5f5;">批量倒垛</el-dropdown-item>
  80. </el-dropdown-menu>
  81. </el-dropdown>
  82. </el-form-item>
  83. <el-form-item label=""> <!-- 防止异常操作隐藏起来的的操作按钮2 -->
  84. <el-dropdown placement="bottom" trigger="click" @command="batchOperate">
  85. <el-button type="danger" size="small"> 封锁出仓<i class="el-icon-arrow-down el-icon--right"></i></el-button>
  86. <el-dropdown-menu slot="dropdown">
  87. <el-dropdown-item command="handleLock" style="background-color: #f5f5f5;">封锁</el-dropdown-item>
  88. <el-dropdown-item command="handleUnLock" style="background-color: #f5f5f5;">取消封锁</el-dropdown-item>
  89. <el-dropdown-item command="handleOutbound" style="background-color: #f5f5f5;">入仓</el-dropdown-item>
  90. </el-dropdown-menu>
  91. </el-dropdown>
  92. </el-form-item>
  93. </el-row>
  94. </el-form>
  95. <!-- 数据统计用的框 -->
  96. <total-block ref="totalBlock" style="margin-left: -25px;font-size: 13px;margin-left: 5px" v-bind:childParam="childParam" v-bind:childUrl = 'childUrl'></total-block>
  97. </div>
  98. <div class="tabledata-grid"> <!-- 数据展示框(包含翻页功能) -->
  99. <el-table :data="tableData" height="100%" border style="width: 97%;" v-loading="loading" ref="multipleTable" @select="handleTableSelect" @select-all = "selectAll"
  100. :row-class-name="tableRowClassName">
  101. <el-table-column type="selection" width="40" header-align="center" align="center" fixed></el-table-column>
  102. <el-table-column label="操作">
  103. <template slot-scope="scope">
  104. <el-button size="mini" @click="handleEdit(scope.row)">编辑</el-button>
  105. </template>
  106. </el-table-column>
  107. <el-table-column prop="stack.name" label="垛位" width="100" show-overflow-tooltip header-align="center" align="center">
  108. </el-table-column>
  109. <el-table-column prop="layer" label="层数" width="60" show-overflow-tooltip header-align="center" align="center">
  110. </el-table-column>
  111. <el-table-column prop="material.name" label="品名" width="120" show-overflow-tooltip header-align="center" align="center">
  112. </el-table-column>
  113. <el-table-column prop="material.standard" label="钢种" width="120" show-overflow-tooltip header-align="center" align="center">
  114. </el-table-column>
  115. <el-table-column prop="plateNo" label="产品编号" width="150" show-overflow-tooltip header-align="center">
  116. </el-table-column>
  117. <el-table-column prop="ordNo" label="订单号" width="120" show-overflow-tooltip header-align="center">
  118. </el-table-column>
  119. <el-table-column prop="model" label="规格型号" width="160" show-overflow-tooltip header-align="center" align="center">
  120. </el-table-column>
  121. <el-table-column prop="weight" label="重量" width="80" show-overflow-tooltip align="left" header-align="center">
  122. </el-table-column>
  123. <el-table-column prop="count" label="数量" width="60" show-overflow-tooltip align="left" header-align="center">
  124. </el-table-column>
  125. <el-table-column prop="contractNo" label="合约号" width="100" show-overflow-tooltip align="left" header-align="center">
  126. </el-table-column>
  127. <el-table-column prop="fkCustomerName" label="货权单位" width="240" show-overflow-tooltip header-align="center">
  128. </el-table-column>
  129. <el-table-column prop="customer.name" label="客户名称" width="240" show-overflow-tooltip header-align="center">
  130. </el-table-column>
  131. <el-table-column prop="receiveAddress" label="收货地址" width="300" show-overflow-tooltip header-align="center">
  132. </el-table-column>
  133. <el-table-column prop="ware.name" label="仓库名称" width="100" show-overflow-tooltip header-align="center" align="center">
  134. </el-table-column>
  135. <el-table-column prop="carNo" label="入库车号" width="120" show-overflow-tooltip align="left">
  136. </el-table-column>
  137. <el-table-column prop="addTime" label="入库时间" width="180" show-overflow-tooltip align="left">
  138. </el-table-column>
  139. <el-table-column prop="productionPlace" label="产地" width="160" show-overflow-tooltip header-align="center">
  140. </el-table-column>
  141. <el-table-column prop="packNo" label="捆包号" width="140" show-overflow-tooltip header-align="center">
  142. </el-table-column>
  143. <el-table-column prop="remark" label="备注" width="150" show-overflow-tooltip header-align="center">
  144. </el-table-column>
  145. <el-table-column prop="lockFlag" label="锁定状态" width="100" show-overflow-tooltip header-align="center" :formatter="lockFormatter">
  146. </el-table-column>
  147. <el-table-column prop="addUser.userDesc" label="入库操作人" width="120px" show-overflow-tooltip align="left">
  148. </el-table-column>
  149. <el-table-column prop="tallyPeople" label="吊装工" width="100" show-overflow-tooltip header-align="center">
  150. </el-table-column>
  151. <el-table-column prop="wgtDcnMtcCd" label="计量方式" width="100" show-overflow-tooltip header-align="center">
  152. </el-table-column>
  153. <el-table-column prop="payWay" label="月付方式" width="100" show-overflow-tooltip header-align="center">
  154. </el-table-column>
  155. <el-table-column prop="outBound" label="是否出仓" width="100" show-overflow-tooltip header-align="center">
  156. </el-table-column>
  157. <el-table-column prop="inwareDay" label="存储天数" width="100" show-overflow-tooltip header-align="center">
  158. </el-table-column>
  159. </el-table>
  160. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
  161. :page-sizes="pageSizes" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="totalRows">
  162. </el-pagination>
  163. </div>
  164. <el-dialog title="货权转移" :visible.sync="customerDialogVisible" width="500px">
  165. <el-form>
  166. <el-form-item label="新客户">
  167. <el-select v-model="newCustomer.name" filterable placeholder="请选择客户名称" clearable>
  168. <el-option v-for="item in optionsCust" :key="item.id" :label="item.name" :value="item.id" >
  169. </el-option>
  170. </el-select>
  171. </el-form-item>
  172. <el-form-item label="新货主">
  173. <el-select v-model="newfkCustomer.name" filterable placeholder="请选择货权单位" clearable>
  174. <el-option v-for="item in optionsCust" :key="item.id" :label="item.name" :value="item.id" >
  175. </el-option>
  176. </el-select>
  177. </el-form-item>
  178. <el-form-item label="修改地址">
  179. <el-input v-model="newAddress">
  180. </el-input>
  181. </el-form-item>
  182. <el-form-item label=" ">
  183. <el-button type="success" @click="handleCustomerSave">保存</el-button>
  184. <el-button type="danger" @click="handleCustomerCancelSave">取消</el-button>
  185. </el-form-item>
  186. </el-form>
  187. </el-dialog>
  188. <el-dialog title="批量垛位" :visible.sync="stackDialogVisible" width="500px">
  189. <el-form>
  190. <el-form-item label="库房名称" style="margin-left: -15px">
  191. <el-select v-model="newWare" clearable size="small" style="width:120px;margin-left: -8px">
  192. <el-option v-for="item in optionsWare" :key="item.id" :label="item.name" :value="item.name">
  193. </el-option>
  194. </el-select>
  195. </el-form-item>
  196. <el-form-item label="新垛位">
  197. <el-input v-model="newStack">
  198. </el-input>
  199. </el-form-item>
  200. <el-form-item label=" ">
  201. <el-button type="success" @click="handleStackSave">保存</el-button>
  202. <el-button type="danger" @click="handleStackCancelSave">取消</el-button>
  203. </el-form-item>
  204. </el-form>
  205. </el-dialog>
  206. <el-dialog title="批量修改信息明细" :visible.sync="changeCUSTDialogVisible" width="500px">
  207. <el-form>
  208. <el-form-item label="新客户名称" >
  209. <el-select v-model="newCustomername" filterable placeholder="请选择客户名称" clearable size="small" >
  210. <el-option v-for="item in optionsCust" :key="item.name" :label="item.name" :value="item.name" >
  211. </el-option>
  212. </el-select>
  213. </el-form-item>
  214. <el-form-item label="新货权单位" >
  215. <el-select v-model="newFKCustomername" filterable placeholder="请选择货权单位" clearable size="small" >
  216. <el-option v-for="item in optionsCust" :key="item.name" :label="item.name" :value="item.name" >
  217. </el-option>
  218. </el-select>
  219. </el-form-item>
  220. <el-form-item label="新订单号">
  221. <el-input v-model="newOrdno" style="width:200px;margin-left: 0px">
  222. </el-input>
  223. </el-form-item>
  224. <el-form-item label="新合约号">
  225. <el-input v-model="newContractno" style="width:200px;margin-left: 0px">
  226. </el-input>
  227. </el-form-item>
  228. <el-form-item label="新收货地址">
  229. <el-input v-model="newReceiveaddress" style="width:260px;margin-left: 0px">
  230. </el-input>
  231. </el-form-item>
  232. <el-form-item label="新产地">
  233. <el-input v-model="newProductionplace" style="width:260px;margin-left: 0px">
  234. </el-input>
  235. </el-form-item>
  236. <el-form-item label="新捆包号">
  237. <el-input v-model="newPackno" style="width:200px;margin-left: 0px">
  238. </el-input>
  239. </el-form-item>
  240. <el-form-item label=" ">
  241. <el-button type="success" @click="handleChangeCUSTSave">确定</el-button>
  242. <el-button type="danger" @click="handleChangeCUSTCancelSave">取消</el-button>
  243. </el-form-item>
  244. </el-form>
  245. </el-dialog>
  246. <el-dialog title="修改材料信息" :visible.sync="storedialogVisible" width="900px">
  247. <el-form :model="store" label-position="right" label-width="80px">
  248. <el-row>
  249. <el-col :span="9">
  250. <el-form-item label="材料编号">
  251. <el-input v-model.number="store.plateNo"></el-input>
  252. </el-form-item>
  253. </el-col>
  254. <el-col :span="9">
  255. <el-form-item label="规格型号">
  256. <el-input v-model.number="store.model"></el-input>
  257. </el-form-item>
  258. </el-col>
  259. </el-row>
  260. <el-row>
  261. <el-col :span="9">
  262. <el-form-item label="品名">
  263. <el-input v-model.number="store.material.name"></el-input>
  264. </el-form-item>
  265. </el-col>
  266. <el-col :span="9">
  267. <el-form-item label="钢种">
  268. <el-input v-model.number="store.material.standard"></el-input>
  269. </el-form-item>
  270. </el-col>
  271. </el-row>
  272. <el-row>
  273. <el-col :span="9">
  274. <el-form-item label="数量">
  275. <el-input v-model.number="store.count"></el-input>
  276. </el-form-item>
  277. </el-col>
  278. <el-col :span="9">
  279. <el-form-item label="重量">
  280. <el-input v-model.number="store.weight"></el-input>
  281. </el-form-item>
  282. </el-col>
  283. </el-row>
  284. <el-row>
  285. <el-col :span="9">
  286. <el-form-item label="订单号">
  287. <el-input v-model.number="store.ordNo"></el-input>
  288. </el-form-item>
  289. </el-col>
  290. <el-col :span="9">
  291. <el-form-item label="合约号">
  292. <el-input v-model.number="store.contractNo"></el-input>
  293. </el-form-item>
  294. </el-col>
  295. </el-row>
  296. <el-row>
  297. <el-col :span="9">
  298. <el-form-item label="捆包号">
  299. <el-input v-model.number="store.packNo"></el-input>
  300. </el-form-item>
  301. </el-col>
  302. <el-col :span="9">
  303. <el-form-item label="产地">
  304. <el-input v-model.number="store.productionPlace"></el-input>
  305. </el-form-item>
  306. </el-col>
  307. </el-row>
  308. <!-- 第六行 -->
  309. <el-row>
  310. <el-col :span="9">
  311. <el-form-item label="货权单位">
  312. <el-select v-model="store.fkCustomerName" filterable placeholder="请选择客户名称" clearable >
  313. <el-option v-for="item in optionsCust" :key="item.id" :label="item.name" :value="item.name" >
  314. </el-option>
  315. </el-select>
  316. </el-form-item>
  317. </el-col>
  318. <el-col :span="9">
  319. <el-form-item label="客户名称">
  320. <el-select v-model="store.customer.name" filterable placeholder="请选择客户名称" clearable >
  321. <el-option v-for="item in optionsCust" :key="item.id" :label="item.name" :value="item.name" >
  322. </el-option>
  323. </el-select>
  324. </el-form-item>
  325. </el-col>
  326. </el-row>
  327. <el-row>
  328. <el-col :span="18">
  329. <el-form-item label="收货地址">
  330. <el-input v-model="store.receiveAddress"></el-input>
  331. </el-form-item>
  332. </el-col>
  333. </el-row>
  334. <el-row>
  335. <el-col :span="18">
  336. <el-form-item label="备注">
  337. <el-input v-model="store.remark"></el-input>
  338. </el-form-item>
  339. </el-col>
  340. </el-row>
  341. <el-row>
  342. <el-button size="medium" type="success" @click="handleChangeStore(store)">确定</el-button>
  343. <el-button size="medium" type="danger" @click="handleChangeStoreCancelSave()">取消</el-button>
  344. </el-row>
  345. </el-form>
  346. </el-dialog>
  347. <!-- 调用外部界面的弹窗索引 -->
  348. <popup-distribution ref="PopupDistribution" @receviceFromChild="receviceFromDistreibution" :selectRows="selectRows"></popup-distribution>
  349. <popup-out ref="PopupOut" @receviceFromChild="receviceFromOut"></popup-out>
  350. </div>
  351. </template>
  352. <script>
  353. import axios from '@/axios'
  354. import PopupDistribution from '@/components/PopupDistribution.vue'
  355. import PopupOut from '@/components/PopupOut.vue'
  356. import Export2Excel from '../../excel/Export2Excel.js'
  357. import TotalBlock from '@/components/TotalBlock.vue'
  358. import {
  359. mapState
  360. } from 'vuex'
  361. export default {
  362. components : {
  363. PopupDistribution,
  364. PopupOut,
  365. TotalBlock
  366. },
  367. computed: {
  368. ...mapState({
  369. serverName: state => state.app.serverName,
  370. })
  371. },
  372. data() {
  373. return {
  374. query: { //查询条件
  375. wareName: '',
  376. stackName: '',
  377. model: '',
  378. materialName: '',
  379. standard: '',
  380. customerName: '',
  381. plateNo: [],
  382. wareId:'',
  383. ordNo:[],
  384. contractNo:[],
  385. packNo:[],
  386. fkcustmerName:'',
  387. outFlag:'0',
  388. inRecordDate:[]
  389. },
  390. optionsWare: [], //库房下拉框
  391. optionsCust: [], //客户名称下拉框
  392. optionsOutFlag: [{ //物料状态下拉框
  393. value: '0',
  394. label: '在库'
  395. },{
  396. value: '1',
  397. label: '已出库'
  398. }],
  399. tableData: [], //数据展示区域用到变量
  400. selectRows: [], //数据展示区域选选中行数数据暂存
  401. multipleSelection: [],
  402. currentPage: 1, //数据展示显示页数
  403. totalRows: 0, //数据合计
  404. pageSizes: [50, 100, 200,1000],//单页中数据展示的行数下拉框
  405. pageSize: 1000,//初始单页中数据展示的默认值
  406. loading: false,//数据展示区中是否正在加载flag
  407. childParam:{ //数据统计区域用到的查询变量
  408. wareName: '',
  409. stackName: '',
  410. model: '',
  411. materialName: '',
  412. standard: '',
  413. customerName: '',
  414. plateNo: [],
  415. wareId:'',
  416. ordNo:[],
  417. contractNo:[],
  418. packNo:[],
  419. fkcustmerName:'',
  420. remark1:'',
  421. outFlag:'0',
  422. inRecordDate:[]
  423. },
  424. childUrl:'WareStore/queryTotal.do',// 数据统计区域调用的后台
  425. customerDialogVisible: false, //“货权转移”的弹框Flag
  426. stackDialogVisible: false, //“批量垛位”的弹框Flag
  427. changeCUSTDialogVisible: false, //“批量修改信息”的弹框Flag
  428. storedialogVisible: false, //“单只材料修改”的弹框Flag
  429. newCustomer: {//“货权转移”的弹框中“新客户”
  430. id: '',
  431. name: ''
  432. },
  433. newfkCustomer: {//“货权转移”的弹框中“新货主”
  434. id: '',
  435. name: ''
  436. },
  437. newAddress: '',//“货权转移”的弹框中“新地址”
  438. newWare:'', //“批量修改垛位”弹窗中“新库房”
  439. newStack:'',//“批量修改垛位”弹窗中“新垛位”
  440. store:{ //“单只材料信息修改”弹窗中对应数据信息
  441. id: '',
  442. material: {
  443. id: '',
  444. name: '',
  445. standard: ''
  446. },
  447. model: '',
  448. customer: {
  449. id: '',
  450. name: ''
  451. },
  452. fkCompony: {
  453. id: '',
  454. name: ''
  455. },
  456. count: '',
  457. weight: '',
  458. remark: '',
  459. plateNo: '',
  460. receiveAddress: '',
  461. receiveAddressFir: '',
  462. receiveAddressLast: '',
  463. wgtDcnMtcCd:'',
  464. edgeTy:'',
  465. productionPlace:'',
  466. ordNo:'',
  467. carNo:'',
  468. tallyPeople:'',
  469. fkComponyId:'',
  470. customerSName:''
  471. },
  472. newCustomername:'', //“批量修改”弹窗中“新客户名称”
  473. newFKCustomername:'', //“批量修改”弹窗中“新付款单位”
  474. newContractno:'', //“批量修改”弹窗中“新合同号”
  475. newOrdno:'', //“批量修改”弹窗中“新订单号”
  476. newReceiveaddress:'', //“批量修改”弹窗中“新收货地址”
  477. newProductionplace:'', //“批量修改”弹窗中“新产地”
  478. newPackno:'', //“批量修改”弹窗中“新捆包号”
  479. }
  480. },
  481. mounted() {
  482. this.getWare() //初始化-库房下拉框-数据载入
  483. this.getAllCustomer() //初始化-客户下拉框-数据载入
  484. },
  485. methods: {
  486. //获取--库房下拉框--数据
  487. getWare() {
  488. var url = 'MaintWare/queryByUserId.do'
  489. var param = {}
  490. axios.get(url, param).then(response => {
  491. this.optionsWare = response.data.data
  492. if (response.data.data.length == 1) {
  493. this.wareName = response.data.data[0].name
  494. }
  495. });
  496. },
  497. //获取--客户下拉框--数据
  498. getAllCustomer() {
  499. var url = 'MaintCustomer/queryByUserId.do'
  500. var param = {}
  501. axios.get(url, param).then(response => {
  502. this.optionsCust = response.data.data
  503. });
  504. },
  505. // “捆包号”查询框进行批量查询时用到的函数
  506. getPackList(){
  507. const replaceResult = this.query.packNo.replace(/[;,,;\s\r\n]+/g, ",").split(",");
  508. this.query.packNo = replaceResult;
  509. },
  510. // “材料号”查询框进行批量查询时用到的函数
  511. getPltList(){
  512. const replaceResult = this.query.plateNo.replace(/[;,,;\s\r\n]+/g, ",").split(",");
  513. this.query.plateNo = replaceResult;
  514. },
  515. // “订单号”查询框进行批量查询时用到的函数
  516. getOrdList(){
  517. const replaceResult = this.query.ordNo.replace(/[;,,;\s\r\n]+/g, ",").split(",");
  518. this.query.ordNo = replaceResult;
  519. },
  520. // “合同号”查询框进行批量查询时用到的函数
  521. getContractList(){
  522. const replaceResult = this.query.contractNo.replace(/[;,,;\s\r\n]+/g, ",").split(",");
  523. this.query.contractNo = replaceResult;
  524. },
  525. //下拉按钮中对应按钮调用的独影的函数
  526. batchOperate(command) {
  527. switch (command) {
  528. case "handleInBack":
  529. this.handleInBack();
  530. break;
  531. case "handleChangeCustomer":
  532. this.handleChangeCustomer();
  533. break;
  534. case "handleChangeStack":
  535. this.handleChangeStack();
  536. break;
  537. case "handleLock":
  538. this.handleLock();
  539. break;
  540. case "handleUnLock":
  541. this.handleUnLock();
  542. break;
  543. case "handleOutbound":
  544. this.handleOutbound();
  545. break;
  546. }
  547. },
  548. // 数据展示框中调用的函数
  549. handleTableSelect(selection, row) {
  550. console.log(JSON.stringify(row))
  551. this.selectRows = selection
  552. },
  553. handleTableSelectionChange(val) {
  554. this.selectRows = val
  555. },
  556. selectAll(selection){
  557. this.selectRows = selection;
  558. },
  559. lockFormatter: function(row, column) {
  560. switch (row.lockFlag) {
  561. case "0":
  562. return "";
  563. break;
  564. default:
  565. return "已锁定";
  566. break;
  567. }
  568. },
  569. tableRowClassName({row}) { //行数据进行变色处理的函数
  570. if (row.lockFlag === '1') {
  571. return 'warning-row'
  572. }
  573. return ''
  574. },
  575. // 查询相关的函数
  576. handleSearch() { //查询按钮调用的函数
  577. this.currentPage = 1
  578. this.getTableData()
  579. },
  580. handleSizeChange(val) { //数据展示区域中翻页调用的函数
  581. this.pageSize = val
  582. this.getTableData()
  583. },
  584. handleCurrentChange(val) { //数据展示区域中单页显示条数变更调用的函数
  585. this.currentPage = val
  586. this.getTableData()
  587. },
  588. getTableData() { //调用后台的通用函数
  589. //增加判断条件,防止查询历史数据时间过长
  590. if(this.query.outFlag == '1' && (this.query.inRecordDate == null || this.query.inRecordDate == '')){
  591. this.$message({
  592. type: 'error',
  593. message: '查询历史数据请选择入库时间区间',
  594. });
  595. return
  596. }
  597. if(this.query.inRecordDate == null){
  598. this.query.inRecordDate = [false,false];
  599. }
  600. this.loading = true
  601. var url = 'WareStore/queryStore.do'
  602. var param = {
  603. page: this.currentPage,
  604. rows: this.pageSize,
  605. wareName: this.query.wareName,
  606. stackName: this.query.stackName,
  607. model: this.query.model,
  608. materialName: this.query.materialName,
  609. standard: this.query.standard,
  610. customerName: this.query.customerName,
  611. fkcustmerName: this.query.fkcustmerName,
  612. plateNo: this.query.plateNo.length == 0 ? '' : this.query.plateNo.join(','),
  613. ordNo: this.query.ordNo == 0 ? '' : this.query.ordNo.join(','),
  614. contractNo: this.query.contractNo == 0 ? '' : this.query.contractNo.join(','),
  615. packNo: this.query.packNo == 0 ? '' : this.query.packNo.join(','),
  616. remark1: this.query.remark1,
  617. outFlag: this.query.outFlag,
  618. fromDate:(!this.query.inRecordDate[0]) ? "1970-01-01 00:00:00" : this.query.inRecordDate[0].Format("yyyy-MM-dd HH:mm:ss"), //date类型
  619. toDate :(!this.query.inRecordDate[1]) ? new Date().Format("yyyy-MM-dd HH:mm:ss") :this.query.inRecordDate[1].Format("yyyy-MM-dd HH:mm:ss"),
  620. }
  621. this.childParam = param;
  622. axios.get(url, param).then(response => {
  623. if (response.data.code == 0) {
  624. this.tableData = response.data.data.list
  625. this.totalRows = response.data.data.total
  626. this.$refs.totalBlock.getTotalData();
  627. } else {
  628. this.$message({
  629. type: 'error',
  630. message: '操作失败;' + response.data.msg,
  631. });
  632. }
  633. this.loading = false
  634. });
  635. },
  636. //货权转移按钮对应的操作函数
  637. showChangeCustomer() { //判断数据条件并打开弹窗
  638. if (this.multipleSelection.length < 1) {
  639. this.$message({
  640. type: 'error',
  641. message: '至少选择一条记录!',
  642. });
  643. return
  644. }
  645. var customerAddress = this.multipleSelection[0].customer.address
  646. var boolean = true
  647. for (var i = 0; i < this.multipleSelection.length; i++) {
  648. if (this.multipleSelection[i].customer.address == customerAddress) {
  649. } else {
  650. boolean = boolean && false
  651. customerAddress = this.multipleSelection[i].customer.address
  652. }
  653. }
  654. if (boolean) {
  655. this.oldCustomer = this.multipleSelection[0].customer.name
  656. this.newCustomer.name = "",
  657. this.newCustomer.id = "",
  658. this.newfkCustomer.name="",
  659. this.newfkCustomer.id = "",
  660. this.customerDialogVisible = true
  661. } else {
  662. this.$message({
  663. type: 'error',
  664. message: '请选择同一客户!',
  665. });
  666. }
  667. },
  668. handleCustomerSave() { //“货权转移”界面“保存”按钮对应的调用后台的函数
  669. this.newCustomer.id = this.newCustomer.name;
  670. this.newfkCustomer.id = this.newfkCustomer.name;
  671. var url = 'WareChange/changeCustomer.do'
  672. var param = {
  673. json: JSON.stringify(this.multipleSelection),
  674. customer: JSON.stringify(this.newCustomer),
  675. fkcustomer: JSON.stringify(this.newfkCustomer),
  676. address: this.newAddress
  677. }
  678. axios.post(url, param).then(response => {
  679. if (response.data.code == 0) {
  680. this.getTableData()
  681. this.customerDialogVisible = false
  682. } else {
  683. this.$message({
  684. type: 'error',
  685. message: '操作失败;' + response.data.msg,
  686. });
  687. }
  688. });
  689. },
  690. handleCustomerCancelSave() { //“货权转移”界面“取消”按钮对应的调用后台的函数
  691. this.customerDialogVisible = false
  692. },
  693. //配货按钮对应的操作函数
  694. showDistribution() {
  695. if (this.selectRows.length < 1) {
  696. this.$message({
  697. type: 'warning',
  698. message: '至少选择一条数据!',
  699. });
  700. }
  701. this.$refs.PopupDistribution.show()
  702. },
  703. receviceFromDistreibution() { //弹窗返回的数据调用的函数
  704. this.handleSearch()
  705. },
  706. //出库按钮对应的操作函数
  707. showOut() {
  708. this.$refs.PopupOut.show()
  709. },
  710. receviceFromOut(customer) { //弹窗返回的数据调用的函数
  711. this.handleSearch()
  712. },
  713. //重置按钮对应的操作函数
  714. resetButton(){ //查询条件重置
  715. this.query.wareName = '',
  716. this.query.stackName = '',
  717. this.query.model = '',
  718. this.query.materialName = '',
  719. this.query.standard = '',
  720. this.query.customerName = '',
  721. this.query.plateNo = '',
  722. this.query.wareId = '',
  723. this.query.ordNo = '',
  724. this.query.fkcustmerName = ''
  725. },
  726. //导出记录按钮对应操作函数
  727. handleExport() { //根据查询条件获取到后台返回的数据内容
  728. var imptData = [];
  729. var url = 'WareStore/queryStore.do'
  730. var param = {
  731. page: -1,
  732. rows: -1,
  733. wareName: this.query.wareName,
  734. stackName: this.query.stackName,
  735. model: this.query.model,
  736. materialName: this.query.materialName,
  737. standard: this.query.standard,
  738. customerName: this.query.customerName,
  739. fkcustmerName: this.query.fkcustmerName,
  740. plateNo: this.query.plateNo.length == 0 ? '' : this.query.plateNo.join(','),
  741. ordNo: this.query.ordNo == 0 ? '' : this.query.ordNo.join(','),
  742. contractNo: this.query.contractNo == 0 ? '' : this.query.contractNo.join(','),
  743. packNo: this.query.packNo == 0 ? '' : this.query.packNo.join(','),
  744. remark1: this.query.remark1,
  745. outFlag: this.query.outFlag,
  746. fromDate:(!this.query.inRecordDate[0]) ? "1970-01-01 00:00:00" : this.query.inRecordDate[0].Format("yyyy-MM-dd HH:mm:ss"), //date类型
  747. toDate :(!this.query.inRecordDate[1]) ? new Date().Format("yyyy-MM-dd HH:mm:ss") :this.query.inRecordDate[1].Format("yyyy-MM-dd HH:mm:ss"),
  748. }
  749. axios.get(url, param).then(response => {
  750. if (response.data.code == 0) {
  751. console.log(response);
  752. var imptData = response.data.data;
  753. if (imptData.length == 0) {
  754. this.$alert('无法导出,没有库存', '提示', {
  755. confirmButtonText: '确定',
  756. callback: action => {}
  757. });
  758. } else {
  759. this.exportExcel(imptData)
  760. }
  761. } else {
  762. this.$message({
  763. type: 'error',
  764. message: '操作失败;' + response.data.msg,
  765. });
  766. }
  767. });
  768. },
  769. exportExcel(imptData) {//处理数据并生成excel文件的代码
  770. const header = ["仓库名称",
  771. "垛位",
  772. "层数",
  773. "品名",
  774. "钢种",
  775. "产品编号",
  776. "订单号",
  777. "规格型号",
  778. "重量",
  779. "数量",
  780. "合约号",
  781. "入库车号",
  782. "入库时间",
  783. "货权单位",
  784. "客户名称",
  785. "收货地址",
  786. "产地",
  787. "捆包号",
  788. "备注",
  789. "锁定状态",
  790. "入库操作人",
  791. "吊装工",
  792. "计量方式",
  793. "月付方式",
  794. "是否出仓",
  795. "存储天数"
  796. ] // 导出的表头名
  797. const filterVal = ["wareName",
  798. "stackName",
  799. "layer",
  800. "materialName",
  801. "materialStandard",
  802. "plateNo",
  803. "ordNo",
  804. "model",
  805. "weight",
  806. "count",
  807. "contractNo",
  808. "carNo",
  809. "addTime",
  810. "fkCustomerName",
  811. "customerName",
  812. "receiveAddress",
  813. "productionPlace",
  814. "packNo",
  815. "remark",
  816. "lockFlag",
  817. "addUserUserDesc",
  818. "tallyPeople",
  819. "wgtDcnMtcCd",
  820. "payWay",
  821. "outBound",
  822. "inwareDay"
  823. ]
  824. for(var i=0;i<imptData.length;i++){
  825. imptData[i]["wareName"] = imptData[i].ware.name;
  826. imptData[i]["stackName"] = imptData[i].stack.name;
  827. imptData[i]["materialName"] = imptData[i].material.name;
  828. imptData[i]["materialStandard"] = imptData[i].material.standard;
  829. imptData[i]["customerName"] = imptData[i].customer.name;
  830. imptData[i]["addUserUserDesc"] = imptData[i].addUser.userDesc;
  831. imptData[i]["lockFlag"] = imptData[i].lockFlag == 0 ? '': '已锁定';
  832. }
  833. const list = imptData
  834. const data = this.formatJson(filterVal, list)
  835. const filename = '库存信息' + (new Date()).toLocaleDateString();
  836. Export2Excel.export_json_to_excel({
  837. header,
  838. data,
  839. filename,
  840. rowStyle: (rowData, rowIndex) => {
  841. // 根据库存量设置颜色
  842. if (rowData.lockFlag === "已锁定") {
  843. return {
  844. fill: { fgColor: { rgb: "FF0000" } }, // 红色
  845. font: { color: { rgb: "FFFFFF" }, bold: true }
  846. };
  847. }
  848. return {};
  849. }
  850. })
  851. },
  852. formatJson(filterVal, jsonData) {
  853. return jsonData.map(v => filterVal.map(j => {
  854. return v[j]
  855. }))
  856. },
  857. //取消入库按钮对应的操作函数
  858. handleInBack() {
  859. this.$confirm("确认取消入库吗?", "提示", {
  860. confirmButtonText:'确认',
  861. cancelButtonText:'取消',
  862. type: "warning"
  863. }).then(() => {
  864. if (this.selectRows.length < 1) {
  865. this.$message({
  866. type: 'error',
  867. message: '至少选择一条数据!',
  868. });
  869. return
  870. } else {
  871. var url = 'WareIn/back.do'
  872. var param = {
  873. json: JSON.stringify(this.selectRows),
  874. }
  875. axios.post(url, param).then(response => {
  876. if (response.data.code == 0) {
  877. this.getStoreByStackId(response.data.data)
  878. } else {
  879. this.$message({
  880. type: 'error',
  881. message: '操作失败;' + response.data.msg,
  882. });
  883. }
  884. });
  885. }
  886. }).catch(() => {});
  887. },
  888. //”批量修改“操作对应的操作函数
  889. handleChangeCustomer(){ //打开“批量修改”的弹窗
  890. this.newCustomername = '',
  891. this.newFKCustomername='',
  892. this.newContractno='',
  893. this.newOrdno='',
  894. this.newReceiveaddress='',
  895. this.newProductionplace='',
  896. this.newPackno='',
  897. this.changeCUSTDialogVisible= true
  898. },
  899. handleChangeCUSTSave(){ //“批量修改”弹窗中“保存”按钮对应的函数
  900. var url = 'WareStore/changeAll.do'
  901. var param = {
  902. json: JSON.stringify(this.multipleSelection),
  903. newCustomername: this.newCustomername,
  904. newFKCustomername: this.newFKCustomername,
  905. newContractno: this.newContractno,
  906. newOrdno: this.newOrdno,
  907. newReceiveaddress: this.newReceiveaddress,
  908. newProductionplace: this.newProductionplace,
  909. newPackno: this.newPackno,
  910. }
  911. axios.post(url, param).then(response => {
  912. if (response.data.code == 0) {
  913. this.getTableData()
  914. this.changeCUSTDialogVisible = false
  915. } else {
  916. this.$message({
  917. type: 'error',
  918. message: '操作失败;' + response.data.msg,
  919. });
  920. }
  921. });
  922. },
  923. handleChangeCUSTCancelSave(){//“批量修改”弹窗中“取消”按钮对应的函数
  924. this.changeCUSTDialogVisible = false
  925. },
  926. //“批量修改垛位”操作对应的操作函数
  927. handleChangeStack(){ //打开“批量垛位修改”的弹窗
  928. this.stackDialogVisible = true;
  929. this.newStack='';
  930. },
  931. handleStackSave(){ //“批量垛位修改”弹窗中“保存”按钮对应的函数
  932. var url = 'WareStore/changeStack.do'
  933. var param = {
  934. json: JSON.stringify(this.multipleSelection),
  935. newWare: this.newWare,
  936. newStack: this.newStack,
  937. newRemark1: this.newRemark1,
  938. newRemark: this.newRemark
  939. }
  940. axios.post(url, param).then(response => {
  941. if (response.data.code == 0) {
  942. this.getTableData()
  943. this.stackDialogVisible = false
  944. } else {
  945. this.$message({
  946. type: 'error',
  947. message: '操作失败;' + response.data.msg,
  948. });
  949. }
  950. });
  951. },
  952. handleStackCancelSave(){ //“批量修改垛位”弹窗中“取消”按钮对应的函数
  953. this.stackDialogVisible = false
  954. },
  955. handleLock(){ //“封锁”按钮对应的函数
  956. this.$confirm("确认将选中的材料进行封锁吗?", "提示", {
  957. confirmButtonText:'确认',
  958. cancelButtonText:'取消',
  959. type: "warning"
  960. }).then(() => {
  961. if (this.selectRows.length < 1) {
  962. this.$message({
  963. type: 'error',
  964. message: '至少选择一条数据!',
  965. });
  966. return
  967. } else {
  968. var url = 'WareStore/lockAndUnlock.do'
  969. var param = {
  970. json: JSON.stringify(this.selectRows),
  971. lockFlag:'1'
  972. }
  973. axios.post(url, param).then(response => {
  974. if (response.data.code == 0) {
  975. this.getTableData()
  976. } else {
  977. this.$message({
  978. type: 'error',
  979. message: '操作失败;' + response.data.msg,
  980. });
  981. }
  982. });
  983. }
  984. }).catch(() => {});
  985. },
  986. handleUnLock(){//“取消封锁”的按钮对应的函数
  987. this.$confirm("确认将选中的材料取消封锁吗?", "提示", {
  988. confirmButtonText:'确认',
  989. cancelButtonText:'取消',
  990. type: "warning"
  991. }).then(() => {
  992. if (this.selectRows.length < 1) {
  993. this.$message({
  994. type: 'error',
  995. message: '至少选择一条数据!',
  996. });
  997. return
  998. } else {
  999. var url = 'WareStore/lockAndUnlock.do'
  1000. var param = {
  1001. json: JSON.stringify(this.selectRows),
  1002. lockFlag:'0'
  1003. }
  1004. axios.post(url, param).then(response => {
  1005. if (response.data.code == 0) {
  1006. this.getTableData()
  1007. } else {
  1008. this.$message({
  1009. type: 'error',
  1010. message: '操作失败;' + response.data.msg,
  1011. });
  1012. }
  1013. });
  1014. }
  1015. }).catch(() => {});
  1016. },
  1017. handleOutbound(){ //“入仓”按钮对应的函数
  1018. this.$confirm("确认将选中的材料标记为入仓吗?", "提示", {
  1019. confirmButtonText:'确认',
  1020. cancelButtonText:'取消',
  1021. type: "warning"
  1022. }).then(() => {
  1023. if (this.selectRows.length < 1) {
  1024. this.$message({
  1025. type: 'error',
  1026. message: '至少选择一条数据!',
  1027. });
  1028. return
  1029. } else {
  1030. var url = 'WareStore/Outbound.do'
  1031. var param = {
  1032. json: JSON.stringify(this.selectRows),
  1033. outbound: '已入仓'
  1034. }
  1035. axios.post(url, param).then(response => {
  1036. if (response.data.code == 0) {
  1037. this.getTableData()
  1038. } else {
  1039. this.$message({
  1040. type: 'error',
  1041. message: '操作失败;' + response.data.msg,
  1042. });
  1043. }
  1044. });
  1045. }
  1046. }).catch(() => {});
  1047. },
  1048. }
  1049. }
  1050. </script>
  1051. <style>
  1052. .option_btn { margin-left: 30px }
  1053. .searchForm-header {
  1054. height: auto;
  1055. margin-left: 10px;
  1056. }
  1057. .tabledata-grid {
  1058. font-size: 20px;
  1059. margin-left: 5px;
  1060. height: calc(100% - 100px);
  1061. }
  1062. .el-select-dropdown .el-scrollbar .el-scrollbar__wrap { overflow: scroll!important; }
  1063. .el-table .warning-row { background-color: #fde2e2; }
  1064. .el-table .success-row { background-color: #f0f9eb; }
  1065. </style>