山东众工仓库管理系统前台vue代码
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

storechange.vue 37KB

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