保盛仓库管理前台
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

outrecord.vue 27KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795
  1. <template>
  2. <div style="height:100%;">
  3. <div class="searchForm-header">
  4. <el-row>
  5. <el-form :model="query" label-width="100px" inline="">
  6. <el-row>
  7. <el-form-item label="库房名称">
  8. <el-select size="small" v-model="query.wareName" clearable style="width: 140px;" @change="changeWare">
  9. <el-option v-for="item in optionsWare" :key="item.id" :label="item.name" :value="item.name">
  10. </el-option>
  11. </el-select>
  12. </el-form-item>
  13. <el-form-item label="垛位名称" style="margin-left: -35px">
  14. <el-input v-model="query.stackName" size="small" style="width:100px;margin-left: -8px"></el-input>
  15. </el-form-item>
  16. <el-form-item label="物料名称" style="margin-left: -35px">
  17. <el-input v-model="query.materialName" size="small" style="width:130px;margin-left: -8px">
  18. <el-button slot="append" icon="el-icon-search" @click="showMaterial"></el-button>
  19. </el-input>
  20. </el-form-item>
  21. <el-form-item label="钢种" style="margin-left: -35px">
  22. <el-input v-model="query.standard" size="small" style="width:130px;margin-left: -8px">
  23. <el-button slot="append" icon="el-icon-search" @click="showMaterial"></el-button>
  24. </el-input>
  25. </el-form-item>
  26. <el-form-item label="客户名称" style="margin-left: -35px">
  27. <el-input v-model="query.customerName" size="small" style="width:200px;margin-left: -8px">
  28. <el-button slot="append" icon="el-icon-search" @click="showCustomer"></el-button>
  29. </el-input>
  30. </el-form-item>
  31. <el-form-item label="付款单位" style="margin-left: -35px">
  32. <el-input v-model="query.fkComponyName" size="small" style="width:200px;margin-left: -8px">
  33. <el-button slot="append" icon="el-icon-search" @click="showFkCompony"></el-button>
  34. </el-input>
  35. </el-form-item>
  36. <el-form-item label="车号" style="margin-left: -35px">
  37. <el-input v-model="query.carNo" size="small" style="width:100px;margin-left: -8px"></el-input>
  38. </el-form-item>
  39. <el-form-item label="规格型号" style="margin-left: 0px;">
  40. <el-input v-model="query.model" size="small" style="width:120px;margin-left: -8px">
  41. </el-input>
  42. </el-form-item>
  43. <el-form-item label="钢板号" style="margin-left: -35px;">
  44. <el-input v-model="query.plateNo" size="small" style="width:120px;margin-left: -8px">
  45. </el-input>
  46. </el-form-item>
  47. <el-form-item label="出库时间" style="margin-left: -35px;margin-top: -15px">
  48. <el-date-picker v-model="query.RecordDate" style="width:330px;margin-left: -8px" size="small" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
  49. </el-date-picker>
  50. </el-form-item>
  51. <el-form-item label="理货人员" style="margin-top: -15px">
  52. <el-select v-model="query.tallyPeople" size="small" style="margin-left: 10px;margin-top: -15px" clearable placeholder="理货人员">
  53. <el-option v-for="item in tallyPeopleOption" :key="item.id" :label="item.dicName" :value="item.dicCode">
  54. </el-option>
  55. </el-select>
  56. </el-form-item>
  57. <el-form-item label="订单号" style="margin-left: -25px;margin-top: -15px">
  58. <el-input v-model="query.ordNo" size="small" style="width:120px;margin-left: -8px">
  59. </el-input>
  60. </el-form-item>
  61. <el-form-item label=" " style="margin-top: -15px;margin-left: -60px">
  62. <el-button @click="handleSearch" type="primary" size="small">查询</el-button>
  63. <el-button @click="handlePrintOut" type="primary" size="small" style="width:90px;text-align: left">打印出库单</el-button>
  64. <el-button @click="handleOutBack" type="danger" size="small" style="width:70px">取消出库</el-button>
  65. <el-button @click="handleVerifyAcc" type="primary" size="small" style="width:70px">对账</el-button>
  66. <el-button @click="handleModifyPrice" type="primary" size="small" >批量改价</el-button>
  67. </el-form-item>
  68. <el-form-item label="" style="margin-top: -15px">
  69. <el-upload class="upload-demo" action=""
  70. ref="upload" :limit="1" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
  71. :auto-upload="false" >
  72. <el-button plain slot="trigger" type="success" v-show="false" style= "margin-left: 5px" size="small">询单导入</el-button>
  73. <el-button type="success" @click="handleExport" style="margin-left: 2px" size="small">导出记录</el-button>
  74. </el-upload>
  75. </el-form-item>
  76. </el-row>
  77. </el-form>
  78. </el-row>
  79. <total-block style="margin-top: -15px" ref="totalBlock" v-bind:childParam="childParam" v-bind:childUrl = 'childUrl'></total-block>
  80. </div>
  81. <div class="tabledata-grid">
  82. <el-table v-loading="loading" :data="tableData" @selection-change="handleSelectionChange" @select="handleTableSelect" height="100%" stripe border style="width: 97%;font-size: 13px;margin-top: -50px;margin-left: 25px" :header-cell-style="{'text-align':'center'}">
  83. <el-table-column type="selection" width="40" header-align="center" align="center"></el-table-column>
  84. <el-table-column prop="id" label="编号" min-width="10%" v-if="false">
  85. </el-table-column>
  86. <el-table-column prop="distributionId" label="配车号" min-width="10%" v-if="false">
  87. </el-table-column>
  88. <el-table-column prop="wareName" label="仓库名称" width="150px" show-overflow-tooltip header-align="center">
  89. </el-table-column>
  90. <el-table-column prop="stackName" label="垛位" width="60px" show-overflow-tooltip header-align="center" align="center">
  91. </el-table-column>
  92. <el-table-column prop="layer" label="层号" show-overflow-tooltip width="60px" header-align="center" align="center">
  93. </el-table-column>
  94. <el-table-column prop="materialName" label="品名" show-overflow-tooltip width="100px" header-align="center" align="center">
  95. </el-table-column>
  96. <el-table-column prop="ordNo" label="订单号" width="180px" show-overflow-tooltip align="left">
  97. </el-table-column>
  98. <el-table-column prop="contractNo" label="合约号" width="180px" show-overflow-tooltip align="left">
  99. </el-table-column>
  100. <el-table-column prop="inUser" label="入库人" width="100px" show-overflow-tooltip align="left">
  101. </el-table-column>
  102. <el-table-column prop="inCarNo" label="入库车号" width="120px" show-overflow-tooltip align="left">
  103. </el-table-column>
  104. <el-table-column prop="inTime" label="入库时间" width="200px" show-overflow-tooltip align="left">
  105. </el-table-column>
  106. <el-table-column prop="model" label="规格" show-overflow-tooltip width="180px" align="center">
  107. </el-table-column>
  108. <el-table-column prop="standard" label="钢种" show-overflow-tooltip width="80px" align="center">
  109. </el-table-column>
  110. <el-table-column prop="count" label="出库数量" width="100px" show-overflow-tooltip align="right">
  111. </el-table-column>
  112. <el-table-column prop="weight" label="出库重量" width="100px" show-overflow-tooltip align="right">
  113. </el-table-column>
  114. <el-table-column prop="invoicePrice" label="基价" width="100px" show-overflow-tooltip align="right">
  115. </el-table-column>
  116. <el-table-column prop="unitPrice" label="结算价格" width="100px" show-overflow-tooltip align="right">
  117. </el-table-column>
  118. <el-table-column prop="plateNo" label="钢板号" width="200px" show-overflow-tooltip align="center">
  119. </el-table-column>
  120. <el-table-column prop="customerName" label="货权单位" width="200px" show-overflow-tooltip align="center">
  121. </el-table-column> <!-- 原客户名称 -->
  122. <el-table-column prop="fkComponyName" label="付款单位" width="200px" show-overflow-tooltip align="center">
  123. </el-table-column> <!-- 新增 -->
  124. <el-table-column prop="receiveAddress" label="收货地址" width="300" show-overflow-tooltip align="left">
  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="edgeTy" label="切边类型" width="100" show-overflow-tooltip header-align="center">
  129. </el-table-column>
  130. <el-table-column prop="productionPlace" label="产地" width="250" show-overflow-tooltip header-align="center">
  131. </el-table-column>
  132. <el-table-column prop="outCarNo" label="出库车号" width="100px" show-overflow-tooltip align="left">
  133. </el-table-column>
  134. <el-table-column prop="tallyPeople" label="出库理货人员" width="180px" show-overflow-tooltip align="left">
  135. </el-table-column>
  136. <el-table-column prop="addId" label="出库操作人" width="120px" show-overflow-tooltip align="left">
  137. </el-table-column>
  138. <el-table-column prop="addTime" label="出库时间" width="200px" show-overflow-tooltip align="left">
  139. </el-table-column>
  140. <el-table-column prop="remark" label="备注" width="100px" show-overflow-tooltip align="left">
  141. </el-table-column>
  142. <el-table-column prop="recordType" label="类型" width="100px" show-overflow-tooltip align="center" :formatter="typeFormatter">
  143. </el-table-column>
  144. <el-table-column prop="verifyAccountId" v-if="false" label="对账ID" width="100px" show-overflow-tooltip align="center" >
  145. </el-table-column>
  146. <el-table-column prop="backFlag" label="取消标记" show-overflow-tooltip width="100px" align="center">
  147. </el-table-column>
  148. </el-table>
  149. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
  150. :page-sizes="pageSizes" style="margin-left: 25px" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="totalRows">
  151. </el-pagination>
  152. </div>
  153. <el-dialog title="对账信息" :visible.sync="popupVerifyAcc" width="780px">
  154. <el-form label-width="150px" inline="">
  155. <el-row>
  156. <el-col :span="10">
  157. <el-form-item label="对账日期:" style="">
  158. <el-date-picker
  159. v-model="accData.accDate"
  160. type="date"
  161. placeholder="选择日期"
  162. style="width: 150px;margin-left: -8px">
  163. </el-date-picker>
  164. </el-form-item>
  165. </el-col>
  166. <el-col :span="12">
  167. <el-form-item label="总吨位:" style="">
  168. <el-input v-model="accData.accWgt" :disabled="true" size="small" style="width:150px;margin-left: -8px"></el-input>
  169. </el-form-item>
  170. </el-col>
  171. </el-row>
  172. <el-row>
  173. <el-col :span="10">
  174. <el-form-item label="总金额:" style="">
  175. <el-input v-model="accData.accAmt" :disabled="true" size="small" style="width:150px;margin-left: -8px"></el-input>
  176. </el-form-item>
  177. </el-col>
  178. <el-col :span="12">
  179. <el-form-item label="扣零:" style="">
  180. <el-input v-model="accData.accReminder" size="small" style="width:150px;margin-left: -8px"></el-input>
  181. </el-form-item>
  182. </el-col>
  183. </el-row>
  184. <el-row>
  185. <el-col :span="10">
  186. <el-form-item label="结算金额:" style="">
  187. <el-input v-model="accData.invoiceAmt" :disabled="true" size="small" style="width:150px;margin-left: -8px"></el-input>
  188. </el-form-item>
  189. </el-col>
  190. <el-col :span="12" :offset="2" >
  191. <el-button size="small" type="primary" style="margin-left: 30px;" @click="handleSaveVerifyAcc">提交</el-button>
  192. </el-col>
  193. </el-row>
  194. </el-form>
  195. </el-dialog>
  196. <el-dialog title="批量改价" :visible.sync="popupModPrice" width="780px">
  197. <el-form label-width="150px" inline="">
  198. <el-row>
  199. <el-col :span="12">
  200. <el-form-item label="总吨位:" style="">
  201. <el-input v-model="modifyWgt" :disabled="true" size="small" style="width:150px;margin-left: -8px"></el-input>
  202. </el-form-item>
  203. </el-col>
  204. <el-col :span="12">
  205. <el-form-item label="价格:" style="">
  206. <el-input v-model="modifyPrice" size="small" style="width:150px;margin-left: -8px"></el-input>
  207. </el-form-item>
  208. </el-col>
  209. </el-row>
  210. <el-row>
  211. <el-col :span="24" :offset="10" >
  212. <el-button size="small" type="primary" style="margin-left: 30px;" @click="handleSavePriceMod">提交</el-button>
  213. </el-col>
  214. </el-row>
  215. </el-form>
  216. </el-dialog>
  217. <popup-stack-with-select-ware :selectVareName="optionsWare" ref="PopupStackWithSelectWare" @receviceFromChild="receviceFromWareStack"></popup-stack-with-select-ware>
  218. <popup-material ref="PopupMaterial" @receviceFromChild="receviceFromMaterial"></popup-material>
  219. <popup-customer ref="PopupCustomer" @receviceFromChild="receviceFromCustomer"></popup-customer>
  220. <popup-customer ref="PopupFkCompony" @receviceFromChild="receviceFromFkCompony"></popup-customer>
  221. </div>
  222. </template>
  223. <script>
  224. import axios from '@/axios'
  225. //import PopupStack from '@/components/PopupStack.vue'
  226. import PopupMaterial from '@/components/PopupMaterial.vue'
  227. import PopupCustomer from '@/components/PopupCustomer.vue'
  228. import PopupStackWithSelectWare from '@/components/PopupStackWithSelectWare.vue'
  229. import TotalBlock from '@/components/TotalBlock.vue'
  230. import Export2Excel from '../../excel/Export2Excel.js'
  231. import {
  232. mapState
  233. } from 'vuex'
  234. export default {
  235. computed: {
  236. ...mapState({
  237. serverName: state => state.app.serverName
  238. })
  239. },
  240. components: {
  241. PopupStackWithSelectWare,
  242. PopupMaterial,
  243. PopupCustomer,
  244. TotalBlock
  245. },
  246. data() {
  247. return {
  248. query: {
  249. wareName: '',
  250. stackName: '',
  251. model: '',
  252. materialName: '',
  253. standard: '',
  254. customerName: '',
  255. plateNo: '',
  256. RecordDate:[],
  257. carNo:'',
  258. tallyPeople:'',
  259. ordNo:'',
  260. fkComponyName:'',
  261. },
  262. accData:{
  263. accDate:'',
  264. accWgt:0,
  265. accAmt:0,
  266. accReminder:0,
  267. invoiceAmt:0
  268. },
  269. tableData: [],
  270. currentPage: 1,
  271. totalRows: 0,
  272. pageSizes: [50, 100, 200,500],
  273. pageSize: 50,
  274. HideAndShow: 0,
  275. optionsWare: [],
  276. dialogVisible: false,
  277. selectRows: [],
  278. moveFromStack: null,
  279. childParam:{
  280. page: '',
  281. rows: '',
  282. wareName: '',
  283. stackName: '',
  284. model: '',
  285. materialName: '',
  286. standard: '',
  287. customerName: '',
  288. plateNo: ''
  289. },
  290. childUrl:'WareOutRecord/queryTotal.do',
  291. time:"",
  292. tallyPeopleOption:[],
  293. loading: false,
  294. popupVerifyAcc:false,
  295. popupModPrice:false,
  296. modifyWgt:0,
  297. modifyPrice:0
  298. };
  299. },
  300. //页面加载完成渲染
  301. mounted() {
  302. this.getWare()
  303. // this.getTableData()
  304. this.getSearchItem();
  305. this.setSearchTime();
  306. },
  307. methods: {
  308. setSearchTime(){
  309. var now = new Date();
  310. this.query.RecordDate = [new Date(now.getFullYear(), now.getMonth(), now.getDate()),new Date(now.getFullYear(), now.getMonth(), now.getDate()+1)];
  311. },
  312. typeFormatter: function(row, column) {
  313. switch (row.recordType) {
  314. case "0":
  315. return "出库取消";
  316. break;
  317. default:
  318. return "出库";
  319. break;
  320. }
  321. },
  322. handleSavePriceMod(){
  323. var url = 'WareOutRecord/savePriceMod.do'
  324. var param = {
  325. json: JSON.stringify(this.selectRows),
  326. modPrice:this.modifyPrice,
  327. }
  328. axios.post(url, param).then(response => {
  329. if (response.data.code == 0) {
  330. this.$message({
  331. type: 'success',
  332. message: '保存成功',
  333. });
  334. this.popupModPrice = false
  335. this.getTableData();
  336. } else {
  337. this.$message({
  338. type: 'error',
  339. message: '保存失败!' + response.data.msg,
  340. });
  341. }
  342. });
  343. },
  344. handleSaveVerifyAcc() {
  345. var url = 'WareOutRecord/saveVerifyAcc.do'
  346. var param = {
  347. json: JSON.stringify(this.selectRows),
  348. accWgt:this.accData.accWgt,
  349. accAmt:this.accData.accAmt,
  350. invoiceAmt:this.accData.invoiceAmt,
  351. accDate:this.accData.accDate.Format("yyyyMMdd"),
  352. accReminder:this.accData.accReminder,
  353. }
  354. axios.post(url, param).then(response => {
  355. if (response.data.code == 0) {
  356. this.$message({
  357. type: 'success',
  358. message: '保存成功',
  359. });
  360. this.popupVerifyAcc = false
  361. this.getTableData();
  362. } else {
  363. this.$message({
  364. type: 'error',
  365. message: '保存失败!' + response.data.msg,
  366. });
  367. }
  368. });
  369. },
  370. handleModifyPrice(){
  371. if (this.selectRows.length < 1) {
  372. this.$message({
  373. type: 'warning',
  374. message: '至少选择一条数据!',
  375. });
  376. return;
  377. }
  378. var wgt = 0;
  379. for(var i = 0;i < this.selectRows.length;i++){
  380. wgt += parseFloat(this.selectRows[i]["weight"]);
  381. }
  382. this.modifyWgt = wgt;
  383. this.popupModPrice = true;
  384. },
  385. handleVerifyAcc(){
  386. if (this.selectRows.length < 1) {
  387. this.$message({
  388. type: 'warning',
  389. message: '至少选择一条数据!',
  390. });
  391. return;
  392. }
  393. // accData:{
  394. // accDate:'',
  395. // accWgt:'',
  396. // accAmt:'',
  397. // accReminder:0,
  398. // invoiceAmt:''
  399. // },
  400. var wgt = 0;
  401. var amt = 0;
  402. var invAmt = 0;
  403. var fkcpy = this.selectRows[0]["fkComponyName"];
  404. var flag = true;
  405. for(var i = 0;i < this.selectRows.length;i++){
  406. if(this.selectRows[i]["fkComponyName"] != fkcpy){
  407. flag = false;
  408. }
  409. wgt += parseFloat(this.selectRows[i]["weight"]);
  410. amt = this.numSub(amt,this.numMulti(this.selectRows[i]["invoicePrice"] , this.selectRows[i]["weight"]));
  411. }
  412. if(!flag){
  413. this.$message({
  414. type: 'warning',
  415. message: '付款单位不同,无法对账',
  416. });
  417. return;
  418. }
  419. this.accData.accWgt = wgt;
  420. this.accData.accAmt = amt;
  421. this.accData.invoiceAmt = amt;
  422. var now = new Date();
  423. this.accData.accDate = new Date(now.getFullYear(), now.getMonth(), now.getDate());
  424. this.popupVerifyAcc = true;
  425. },
  426. numSub(num1, num2) {
  427. var baseNum, baseNum1, baseNum2;
  428. var precision;// 精度
  429. try {
  430. baseNum1 = num1.toString().split(".")[1].length;
  431. } catch (e) {
  432. baseNum1 = 0;
  433. }
  434. try {
  435. baseNum2 = num2.toString().split(".")[1].length;
  436. } catch (e) {
  437. baseNum2 = 0;
  438. }
  439. baseNum = Math.pow(10, Math.max(baseNum1, baseNum2));
  440. precision = (baseNum1 >= baseNum2) ? baseNum1 : baseNum2;
  441. return ((num1 * baseNum + num2 * baseNum) / baseNum).toFixed(precision);
  442. },
  443. numMulti(arg1,arg2){
  444. var m=0,s1=arg1.toString(),s2=arg2.toString();
  445. try{m+=s1.split(".")[1].length}catch(e){}
  446. try{m+=s2.split(".")[1].length}catch(e){}
  447. return Number(s1.replace(".",""))*Number(s2.replace(".",""))/Math.pow(10,m);
  448. },
  449. getSearchItem(){
  450. var url = 'Common/querySelector.do'
  451. var param = {
  452. type: 'TALLY_PEOPLE',
  453. }
  454. axios.get(url, param).then(response => {
  455. // alert(JSON.stringify(response))
  456. this.tallyPeopleOption = response.data.data;
  457. });
  458. },
  459. getWare() {
  460. var url = 'MaintWare/queryByUserId.do'
  461. var param = {}
  462. axios.get(url, param).then(response => {
  463. // console.log(response)
  464. this.optionsWare = response.data.data
  465. if (response.data.data.length == 1) {
  466. this.wareName = response.data.data[0].name
  467. // this.getStack()
  468. }
  469. });
  470. },
  471. handleTableSelectionChange(val) {
  472. this.selectRows = val
  473. },
  474. // 修改每页行数
  475. handleSizeChange(val) {
  476. this.pageSize = val
  477. this.getTableData()
  478. },
  479. // 修改当前页事件
  480. handleCurrentChange(val) {
  481. this.currentPage = val
  482. this.getTableData()
  483. },
  484. //点击查询
  485. handleSearch() {
  486. this.currentPage = 1
  487. this.getTableData()
  488. },
  489. showMaterial() {
  490. this.$refs.PopupMaterial.show()
  491. },
  492. receviceFromMaterial(material) {
  493. this.query.materialName = material.name
  494. this.query.standard = material.standard
  495. },
  496. showCustomer() {
  497. this.$refs.PopupCustomer.show()
  498. },
  499. showFkCompony(){
  500. this.$refs.PopupFkCompony.show()
  501. },
  502. receviceFromCustomer(customer) {
  503. this.query.customerName = customer.name
  504. },
  505. receviceFromFkCompony(customer) {
  506. this.query.fkComponyName = customer.name
  507. },
  508. getTableData() {
  509. var url = 'WareOutRecord/query.do'
  510. if(this.query.RecordDate == null){
  511. this.query.RecordDate = [false,false];
  512. }
  513. this.loading = true
  514. var param = {
  515. page: this.currentPage,
  516. rows: this.pageSize,
  517. wareName: this.query.wareName,
  518. stackName: this.query.stackName,
  519. model: this.query.model,
  520. materialName: this.query.materialName,
  521. standard: this.query.standard,
  522. customerName: this.query.customerName,
  523. plateNo: this.query.plateNo,
  524. pFromDate:(!this.query.RecordDate[0]) ? "1970-01-01 00:00:00" : this.query.RecordDate[0].Format("yyyy-MM-dd HH:mm:ss"), //date类型
  525. pToDate :(!this.query.RecordDate[1]) ? new Date().Format("yyyy-MM-dd HH:mm:ss") :this.query.RecordDate[1].Format("yyyy-MM-dd HH:mm:ss"),
  526. carNo:this.query.carNo,
  527. tallyPeople:this.query.tallyPeople,
  528. ordNo :this.query.ordNo,
  529. fkComponyName:this.query.fkComponyName
  530. }
  531. this.childParam = param;
  532. axios.get(url, param).then(response => {
  533. if (response.data.code == 0) {
  534. this.tableData = response.data.data.list
  535. // console.log(JSON.stringify(response))
  536. this.totalRows = response.data.data.total
  537. // console.log(JSON.stringify(this.tableData[0]))
  538. this.$refs.totalBlock.getTotalData();
  539. } else {
  540. this.$message({
  541. type: 'error',
  542. message: '操作失败;' + response.data.msg,
  543. });
  544. }
  545. this.loading = false;
  546. });
  547. },
  548. handleSelectionChange(val) {
  549. this.selectRows = val
  550. },
  551. handleOutBack() {
  552. if (this.selectRows.length != 1) {
  553. this.$message({
  554. type: 'error',
  555. message: '只能选择一条数据取消出库!',
  556. });
  557. return
  558. }
  559. if (this.selectRows[0].recordType == '0') {
  560. this.$message({
  561. type: 'error',
  562. message: '取消记录不能再次取消出库!',
  563. });
  564. return
  565. }
  566. if (this.selectRows[0].backFlag == '1') {
  567. this.$message({
  568. type: 'error',
  569. message: '该记录不能再次取消出库!',
  570. });
  571. return
  572. }
  573. // alert("1")
  574. this.$refs.PopupStackWithSelectWare.show()
  575. },
  576. receviceFromWareStack(stack) {
  577. var url = 'WareOut/back.do'
  578. var param = {
  579. json: JSON.stringify(this.selectRows),
  580. to: JSON.stringify(stack),
  581. }
  582. axios.post(url, param).then(response => {
  583. if (response.data.code == 0) {
  584. this.getTableData()
  585. } else {
  586. this.$message({
  587. type: 'error',
  588. message: '操作失败;' + response.data.msg,
  589. });
  590. }
  591. });
  592. },
  593. changeWare(){
  594. //this.getTableData()
  595. },
  596. handlePrintOut(){
  597. if(this.selectRows.length > 1){
  598. this.$message({
  599. type: 'warning',
  600. message: '操作失败,请选择一条数据进行操作' ,
  601. });
  602. return;
  603. }
  604. // console.log(JSON.stringify(this.selectRows[0]))
  605. var distId = this.selectRows[0].distributionId;
  606. if( typeof(distId) == "undefined"||!distId){
  607. this.$message({
  608. type: 'warning',
  609. message: '操作失败,请选择正确的出库记录' ,
  610. });
  611. return;
  612. }
  613. window.open(this.serverName + 'ureport/preview?_u=file:out.ureport.xml&id=' + distId +
  614. '&time=' + this.time)
  615. },
  616. getTime() {
  617. var date = new Date();
  618. var year = date.getFullYear();
  619. var month = date.getMonth();
  620. var day = date.getDate();
  621. var hour = date.getHours();
  622. var minute = date.getMinutes();
  623. var second = date.getSeconds();
  624. month = Number(month) < 10 ? '0' + month : month
  625. day = Number(day) < 10 ? '0' + day : day
  626. hour = Number(hour) < 10 ? '0' + hour : hour
  627. minute = Number(minute) < 10 ? '0' + minute : minute
  628. second = Number(second) < 10 ? '0' + second : second
  629. this.time = year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second
  630. },
  631. handleExport() {
  632. var imptData = [];
  633. var url = 'WareOutRecord/query.do'
  634. var param = {
  635. page: -1,
  636. rows: -1,
  637. wareName: this.query.wareName,
  638. stackName: this.query.stackName,
  639. model: this.query.model,
  640. materialName: this.query.materialName,
  641. standard: this.query.standard,
  642. customerName: this.query.customerName,
  643. plateNo: this.query.plateNo,
  644. pFromDate:(!this.query.RecordDate[0]) ? "1970-01-01 00:00:00" : this.query.RecordDate[0].Format("yyyy-MM-dd HH:mm:ss"), //date类型
  645. pToDate :(!this.query.RecordDate[1]) ? new Date().Format("yyyy-MM-dd HH:mm:ss") :this.query.RecordDate[1].Format("yyyy-MM-dd HH:mm:ss"),
  646. carNo:this.query.carNo,
  647. tallyPeople:this.query.tallyPeople,
  648. ordNo :this.query.ordNo,
  649. fkComponyName:this.query.fkComponyName
  650. }
  651. // alert(JSON.stringify(param))
  652. axios.get(url, param).then(response => {
  653. // alert(JSON.stringify(response))
  654. if (response.data.code == 0) {
  655. var imptData = response.data.data;
  656. if (imptData.length == 0) {
  657. this.$alert('无法导出,选择时间段无记录', '提示', {
  658. confirmButtonText: '确定',
  659. callback: action => {}
  660. });
  661. } else {
  662. this.exportExcel(imptData)
  663. }
  664. } else {
  665. this.$message({
  666. type: 'error',
  667. message: '操作失败;' + response.data.msg,
  668. });
  669. }
  670. });
  671. },
  672. exportExcel(imptData) {
  673. console.log(JSON.stringify(imptData))
  674. const header = ["仓库名称"
  675. ,"垛位"
  676. ,"层号"
  677. ,"品名"
  678. ,"订单号"
  679. ,"合约号"
  680. ,"入库人"
  681. ,"入库车号"
  682. ,"入库时间"
  683. ,"规格"
  684. ,"钢种"
  685. ,"出库数量"
  686. ,"出库重量"
  687. ,"基价"
  688. ,"结算价格"
  689. ,"钢板号"
  690. ,"货权单位"
  691. ,"付款单位"
  692. ,"收货地址"
  693. ,"计量方式"
  694. ,"切边类型"
  695. ,"产地"
  696. ,"出库车号"
  697. ,"出库理货人员"
  698. ,"出库操作人"
  699. ,"出库时间"
  700. ,"备注"
  701. ,"类型"
  702. ] // 导出的表头名
  703. const filterVal = [
  704. "wareName"
  705. ,"stackName"
  706. ,"layer"
  707. ,"materialName"
  708. ,"ordNo"
  709. ,"contractNo"
  710. ,"inUser"
  711. ,"inCarNo"
  712. ,"inTime"
  713. ,"model"
  714. ,"standard"
  715. ,"count"
  716. ,"weight"
  717. ,"invoicePrice"
  718. ,"unitPrice"
  719. ,"plateNo"
  720. ,"customerName"
  721. ,"fkComponyName"
  722. ,"receiveAddress"
  723. ,"wgtDcnMtcCd"
  724. ,"edgeTy"
  725. ,"productionPlace"
  726. ,"outCarNo"
  727. ,"tallyPeople"
  728. ,"addId"
  729. ,"addTime"
  730. ,"remark"
  731. ,"recordType"
  732. ]
  733. for(var i=0;i<imptData.length;i++){
  734. /*imptData[i]["addUserUserDesc"] = imptData[i].addUser.userDesc;
  735. imptData[i]["distributionTruckNo"] = imptData[i].distribution.truckNo;*/
  736. imptData[i]["recordType"] = imptData[i]["recordType"] == 0 ? "出库取消" : "出库";
  737. }
  738. const list = imptData
  739. const data = this.formatJson(filterVal, list)
  740. const filename = '出库单' + (new Date()).toLocaleDateString();
  741. Export2Excel.export_json_to_excel({
  742. header,
  743. data,
  744. filename
  745. })
  746. },
  747. formatJson(filterVal, jsonData) {
  748. return jsonData.map(v => filterVal.map(j => {
  749. return v[j]
  750. }))
  751. },
  752. },
  753. }
  754. </script>
  755. <style>
  756. .searchForm-header{
  757. /*background-color: red;*/
  758. height: auto;
  759. /*;*/
  760. margin-left: 10px;
  761. }
  762. .tabledata-grid{
  763. /*margin-left: 100px;*/
  764. font-size: 20px;
  765. height: calc(100% - 230px);
  766. /*background-color: #000;*/
  767. }
  768. </style>