山东众工仓库管理系统前台vue代码
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

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