weightCheckRecord.vue 59 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587
  1. // 检斤记录
  2. <template>
  3. <div class="container">
  4. <el-row class="toptitle">
  5. <el-col :span="12">
  6. <h2 class="bg-left title">检斤记录</h2>
  7. </el-col>
  8. <el-col :span="12" class="bg-right">
  9. <el-button type="primary" size="small" @click="returnsales()">
  10. <img width="6" height="10" style="vertical-align: bottom; margin-right: 3px"
  11. src="../../../public/img/lujing.png" alt="" />返回
  12. </el-button>
  13. </el-col>
  14. </el-row>
  15. <div class="center">
  16. <el-row>
  17. <el-col :span="6">
  18. <el-button :type="warehousingType == 1?'primary':''" size="small" @click="changeType(1)"
  19. class="btn_css btn_topcss">贸易入库</el-button>
  20. <el-button :type="warehousingType == 3?'primary':''" size="small" @click="changeType(3)"
  21. class="btn_css btn_topcss">收购入库</el-button>
  22. </el-col>
  23. <el-col :span="18" class="bg-right">
  24. <div style="display:flex">
  25. <el-select style='margin-right:5px;width:40%' v-model="warehouseName" placeholder="请选择仓库名" @change="warehouseNameChange">
  26. <el-option v-for="item in warehouseList" :key="item.id" :label="item.warehouseName"
  27. :value="item.warehouseName"></el-option>
  28. </el-select>
  29. <el-date-picker v-model="value2" type="daterange" align="right" unlink-panels range-separator="至"
  30. start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions">
  31. </el-date-picker>
  32. <el-input :placeholder="warehousingType == 1 ? '可按业务编号、合同编号/移库编号、车牌号查找':'可按业务编号、车牌号、客户名查找'" clearable
  33. v-model="searchKeyWord" class="search_css"></el-input>
  34. <!-- <el-input placeholder="可按业务编号、车牌号、客户名查找" clearable v-model="searchKeyWord"></el-input> -->
  35. <el-button type="primary" size="small" @click="lookup">查找</el-button>
  36. </div>
  37. </el-col>
  38. </el-row>
  39. <el-button :type="choice == ''?'primary':''" size="small" @click="screen()" class="btn_css">全部</el-button>
  40. <el-button :type="choice == 2?'primary':''" size="small" @click="screen(2)" class="btn_css">已称毛重</el-button>
  41. <el-button :type="choice == 3?'primary':''" size="small" @click="screen(3)" class="btn_css">已称皮重</el-button>
  42. <el-button size="small" @click="print('',1)">批量打印</el-button>
  43. <el-upload style="margin-top: -35px; margin-left:430px" class="upload-demo inline-block margin-right-10" action=""
  44. :on-change="importClick" :show-file-list="false"
  45. accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
  46. :auto-upload="false">
  47. <ws-button type="primary">导入(移库)</ws-button>
  48. </el-upload>
  49. <el-table class="forData" :data="weighingRecordList" style="width: 100%; margin-top: 20px" height="780"
  50. @selection-change="handleSelectionChange">
  51. <el-table-column key="0" type="selection" width="55"></el-table-column>
  52. <el-table-column key="1" type="index" label="序号" width="80">
  53. <template scope="scope">
  54. <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
  55. <span v-else>{{ scope.$index + 1 }}</span>
  56. </template>
  57. </el-table-column>
  58. <el-table-column key="inOutTaskNo" prop="inOutTaskNo" label="任务编号" width="170"></el-table-column>
  59. <el-table-column key="2" prop="number" label="业务编号" width="170"></el-table-column>
  60. <el-table-column key="3" prop="contractNo" label="合同编号/移库编号" v-if="warehousingType == 1" width="130">
  61. <template scope="scope">
  62. <span v-if="scope.row.contractNo">{{scope.row.contractNo}}</span>
  63. <span v-else>{{scope.row.moveTaskNo}}</span>
  64. </template>
  65. </el-table-column>
  66. <!--//moveTaskNo -->
  67. <el-table-column key="4" prop="customer" label="客户" v-if="warehousingType == 3"></el-table-column>
  68. <el-table-column key="5" prop="carNumber" label="车牌号"></el-table-column>
  69. <el-table-column key="6" prop="goodsName" label="货名"></el-table-column>
  70. <el-table-column key="7" prop="grossWeight" label="毛重(公斤)" width="100"></el-table-column>
  71. <el-table-column key="8" prop="tare" label="皮重(公斤)" width="100"></el-table-column>
  72. <el-table-column key="9" prop="buckleMiscellaneous" label="扣重(公斤)" width="100"></el-table-column>
  73. <el-table-column key="10" prop="netWeight" label="净重(公斤)" width="100"></el-table-column>
  74. <el-table-column key="11" prop="secretaryWeigher" label="司称员"></el-table-column>
  75. <el-table-column key="12" prop="grossDate" label="检斤时间"></el-table-column>
  76. <el-table-column key="13" prop="status" label="状态"></el-table-column>
  77. <el-table-column key="14" label="操作" min-width="400">
  78. <template scope="scope">
  79. <!-- <el-button size="small" @click="print(scope.row)">打印</el-button> -->
  80. <el-button @click="print(scope.row,2)" v-if="scope.row.status == '已称皮重' || scope.row.status == '已称毛重'" v-hasPermission="`acquisitionManagement.acquisitionWeight.print`">打印</el-button>
  81. <el-button @click="backInfo(scope.row)" v-if="scope.row.status == '已称皮重'">退回</el-button>
  82. <el-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.huan`" class="putstorage" @click="exchange(scope.row)" v-if="scope.row.status == '已称毛重'|| scope.row.status == '已质检'">换仓</el-button>
  83. <el-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.huan`" class="putstorage" @click="exchangeNo(scope.row)" v-if="scope.row.status == '已称毛重'|| scope.row.status == '已质检'">换任务号</el-button>
  84. <el-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.huan`" class="putstorage" @click="exchangeName(scope.row)" v-if="(scope.row.status == '已称毛重'|| scope.row.status == '已质检') && warehousingType == 3">换客户</el-button>
  85. <el-button @click="deleteInfo(scope.row)" v-if="scope.row.status == '已称毛重'|| scope.row.status == '已质检'">删除</el-button>
  86. </template>
  87. </el-table-column>
  88. </el-table>
  89. </div>
  90. <div style="text-align: center; padding: 10px">
  91. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
  92. :page-size="deptCircularPage.pageSize" layout="total, sizes, prev, pager, next, jumper"
  93. :total="deptBudgetTotal">
  94. </el-pagination>
  95. </div>
  96. <div class="mask" v-show="isShowPrintType"></div>
  97. <div class="print-type" v-show="isShowPrintType">
  98. <div class="print-type-content">
  99. <div class="print-type-title">请选择打印纸张类型</div>
  100. <div class="print-type-checkbox">
  101. <!-- <el-radio-group v-model="radio">
  102. <el-radio label="A4" class="label-width" @change="selectType">A4</el-radio>
  103. <el-radio label="A5" class="label-width" @change="selectType">A5</el-radio>
  104. </el-radio-group> -->
  105. </div>
  106. <div class="shdw-style" v-if="checked||(!ddchecked&&!checked)">
  107. <div>收货单位:</div>
  108. <!-- <div>{{companyName}}</div> -->
  109. <el-select v-model="companyName" placeholder="请选择" style="width: 75%;">
  110. <el-option v-for="item in companyNameOptions" :key="item.value" :label="item.label" :value="item.value">
  111. </el-option>
  112. </el-select>
  113. </div>
  114. <div class="shdw-style" v-if="checked && serviceManagementType==3 || (!ddchecked && !checked && serviceManagementType==3)">
  115. <div>发货单位:</div>
  116. <!-- <div>{{companyName}}</div> -->
  117. <el-select v-model="customer" placeholder="请选择" style="width: 75%;">
  118. <el-option v-for="item in customerOptions" :key="item.value" :label="item.label" :value="item.value">
  119. </el-option>
  120. </el-select>
  121. </div>
  122. <div v-if="warehouseName=='鲅鱼圈金信库'&&printType==2||
  123. warehouseName=='白城内陆港'&&printType==2||
  124. warehouseName=='杜尔伯特家禾库'&&printType==2||
  125. warehouseName=='洮南兴旺库2023.10-2024.9'&&printType==2||
  126. warehouseName=='洮南新友谊兴旺库'&&printType==2||
  127. warehouseName=='甘南宏旗库'&&printType==2||
  128. warehouseName=='洮南向阳乡金昊'&&printType==2||
  129. warehouseName=='山东园丰库'&&printType==2">
  130. <div class="print-type-ew">
  131. <el-checkbox v-model="checked" @change="changeEw">打印额外票据</el-checkbox>
  132. <el-checkbox v-model="ddchecked" @change="changeEwDD">单独打印额外票据</el-checkbox>
  133. </div>
  134. <div class="ew-print" v-if="printSeparately">
  135. <div class="row">
  136. <div>额外客户姓名:</div>
  137. <!-- <div>{{companyName}}</div> -->
  138. <el-select v-model="ewCustomer" placeholder="请选择" style="width: 75%;">
  139. <el-option v-for="item in ewCustomerOptions" :key="item.value" :label="item.label" :value="item.value">
  140. </el-option>
  141. </el-select>
  142. </div>
  143. <div class="row">
  144. <div>额外收货单位:</div>
  145. <!-- <div>{{companyNameEW}}</div> -->
  146. <el-select v-model="companyNameEW" placeholder="请选择" style="width: 75%;">
  147. <el-option v-for="item in companyNameEWOptions" :key="item.value" :label="item.label"
  148. :value="item.value">
  149. </el-option>
  150. </el-select>
  151. </div>
  152. </div>
  153. </div>
  154. <div v-if="warehouseName=='鲅鱼圈金信库'&&printType==2">
  155. <div class="print-type-ew">
  156. <el-checkbox v-model="outchecked" @change="changeOut">是否打印出库</el-checkbox>
  157. </div>
  158. <div class="ew-print" v-if="printout">
  159. <div class="row">
  160. <div>出库发货单位:</div>
  161. <!-- <div>{{companyName}}</div> -->
  162. <el-select v-model="inshipments" placeholder="请选择" style="width: 75%;">
  163. <el-option v-for="item in ewCustomerOptions" :key="item.value" :label="item.label" :value="item.value">
  164. </el-option>
  165. </el-select>
  166. </div>
  167. <div class="row">
  168. <div>出库收货单位:</div>
  169. <!-- <div>{{companyNameEW}}</div> -->
  170. <el-select v-model="outshipments" placeholder="请选择" style="width: 75%;">
  171. <el-option v-for="item in companyNameEWOptions" :key="item.value" :label="item.label"
  172. :value="item.value">
  173. </el-option>
  174. </el-select>
  175. </div>
  176. <div class="row">
  177. <div>出库仓位号:</div>
  178. <!-- <div>{{companyNameEW}}</div> -->
  179. <el-select v-model="outbinNumber" placeholder="请选择仓位号" style="width: 75%;">
  180. <el-option v-for="item in binNumberList1" :key="item.id" :label="item.binNumber"
  181. :value="item.binNumber">
  182. </el-option>
  183. </el-select>
  184. </div>
  185. </div>
  186. </div>
  187. </div>
  188. <div class="bottom-btn">
  189. <el-button @click="typePrintClick">确定</el-button>
  190. <el-button @click="typePrintCannelClick">取消</el-button>
  191. </div>
  192. </div>
  193. <el-dialog width="70%" class="table-content" center :visible.sync="isShowPrint" title="粮食检斤单">
  194. <weightCheckPrint :tableData="dialogData"></weightCheckPrint>
  195. <div style="text-align:center">
  196. <el-button type="primary" @click="isShowPrint = false">关闭</el-button>
  197. <el-button type="primary" @click="printSmall">打印小票</el-button>
  198. <el-button type="primary" @click="printBig">打印单据</el-button>
  199. </div>
  200. </el-dialog>
  201. <el-dialog
  202. title="提示"
  203. :visible.sync="dialogVisible"
  204. width="30%"
  205. :before-close="handleClose">
  206. <div style="text-align:center">
  207. <el-select filterable clearable v-model="binNumber" placeholder="请选择仓位" class="typeselect"
  208. @change="binNumberChange">
  209. <el-option v-for="item in binnumberList" :key="item.binNumber" :label="item.binNumber"
  210. :value="item.binNumber" />
  211. </el-select>
  212. </div>
  213. <span slot="footer" class="dialog-footer">
  214. <el-button @click="dialogVisible = false">取 消</el-button>
  215. <el-button type="primary" @click="dialogVisibleconfirm">确 定</el-button>
  216. </span>
  217. </el-dialog>
  218. <el-dialog
  219. title="提示"
  220. :visible.sync="dialogVisible1"
  221. width="30%"
  222. :before-close="handleClose1">
  223. <div style="text-align:center">
  224. <el-form ref="form" label-width="110px">
  225. <el-form-item label="任务编号">
  226. <el-select filterable clearable v-model="inOutTaskNo" placeholder="请选择任务号" class="typeselect"
  227. @change="taskNoChange">
  228. <el-option v-for="item in taskNolist" :key="item.inOutTaskNo" :label="item.inOutTaskNo"
  229. :value="item.inOutTaskNo" />
  230. </el-select>
  231. </el-form-item>
  232. <el-form-item label="合同编号">
  233. <el-input v-model="contractNo" placeholder="合同编号" :disabled="disabled" maxlength="15">
  234. </el-input>
  235. </el-form-item>
  236. </el-form>
  237. </div>
  238. <span slot="footer" class="dialog-footer">
  239. <el-button @click="dialogVisible1 = false">取 消</el-button>
  240. <el-button type="primary" @click="dialogVisibleconfirm1">确 定</el-button>
  241. </span>
  242. </el-dialog>
  243. <el-dialog
  244. title="提示"
  245. :visible.sync="dialogVisible2"
  246. width="30%"
  247. :before-close="handleClose2">
  248. <div style="text-align:center">
  249. <el-form ref="form" label-width="110px">
  250. <el-form-item label="客户名">
  251. <el-select filterable clearable v-model="customerNumberCard" placeholder="请选择客户" class="typeselect"
  252. @change="customerChange">
  253. <el-option v-for="item in customerlist" :key="item.customerNumberCard" :label="item.customerName"
  254. :value="item.customerNumberCard" />
  255. </el-select>
  256. </el-form-item>
  257. <el-form-item label="手机号">
  258. <el-input v-model="customerPhone" placeholder="手机号" :disabled="disabled" maxlength="15">
  259. </el-input>
  260. </el-form-item>
  261. <el-form-item label="身份证号码">
  262. <el-input v-model="customerNumberCard" placeholder="身份证号码" :disabled="disabled" maxlength="20">
  263. </el-input>
  264. </el-form-item>
  265. </el-form>
  266. </div>
  267. <span slot="footer" class="dialog-footer">
  268. <el-button @click="dialogVisible2 = false">取 消</el-button>
  269. <el-button type="primary" @click="dialogVisibleconfirm2">确 定</el-button>
  270. </span>
  271. </el-dialog>
  272. </div>
  273. </template>
  274. <script>
  275. import {
  276. selectWarehouseSelf,
  277. getweighingList,
  278. getPrint,
  279. returnInfo,
  280. changeNo,
  281. changeTaskNo,
  282. changeCustomer,
  283. getcustomer,
  284. importWordYk,
  285. getweighingDelete,
  286. getbinNumber
  287. } from '@/model/houseSelfCollect/index'
  288. import {
  289. getReceiptTaskNo,
  290. } from '@/model/warehouse/index'
  291. import {
  292. getcomp
  293. } from '@/model/indexRx'
  294. import weightCheckPrint from './component/weightCheckPrint.vue'
  295. export default {
  296. components: {
  297. weightCheckPrint
  298. },
  299. data() {
  300. return {
  301. weighingRecordList: [],
  302. warehouseId: '',
  303. warehouseName: '',
  304. // goodsNameList: [],
  305. // goodsNameAllList: [],
  306. // binNoList: [],
  307. // binNumberId: '', //仓位Id
  308. // warehouseType: '',
  309. compId: '',
  310. outbinNumber:'',
  311. printType:0,
  312. binNumberList1:[],
  313. UserInfo:JSON.parse(localStorage.getItem('ws_login_getTenantInfoByUser')),
  314. pickerOptions: {
  315. shortcuts: [{
  316. text: '本周',
  317. onClick(picker) {
  318. const end = new Date()
  319. const start = new Date()
  320. var thisDay = start.getDay()
  321. var thisDate = start.getDate()
  322. if (thisDay != 0) {
  323. start.setDate(thisDate - thisDay)
  324. }
  325. picker.$emit('pick', [start, end])
  326. },
  327. },
  328. {
  329. text: '本月',
  330. onClick(picker) {
  331. const end = new Date()
  332. const start = new Date()
  333. start.setDate(1)
  334. picker.$emit('pick', [start, end])
  335. },
  336. },
  337. {
  338. text: '本季度',
  339. onClick(picker) {
  340. var oDate = new Date()
  341. var thisYear = oDate.getFullYear()
  342. var thisMonth = oDate.getMonth() + 1
  343. var n = Math.ceil(thisMonth / 3) // 季度
  344. var Month = n * 3 - 1
  345. var start = new Date(thisYear, Month - 2, 1)
  346. var end = new Date()
  347. picker.$emit('pick', [start, end])
  348. },
  349. },
  350. ],
  351. },
  352. //分页
  353. currentPage: 1,
  354. pageSize: 10,
  355. value2:[],
  356. deptCircularPage: {},
  357. deptBudgetTotal: 0,
  358. warehouseList: [], //仓库
  359. searchKeyWord: '',
  360. choice: '',
  361. warehousingType: 1,
  362. isShowPrint: false,
  363. dialogData: {},
  364. title: '',
  365. disabled: true,
  366. taskflag:2,
  367. modification: [],
  368. ewCustomerOptions: [{
  369. value: '天津建源供应链管理有限公司',
  370. label: '天津建源供应链管理有限公司'
  371. },{
  372. value: '黑龙江中天昊元贸易有限公司',
  373. label: '黑龙江中天昊元贸易有限公司'
  374. }, {
  375. value: '黑龙江利润元粮食贸易有限公司',
  376. label: '黑龙江利润元粮食贸易有限公司'
  377. }, {
  378. value: '黑龙江众利合粮食贸易有限公司',
  379. label: '黑龙江众利合粮食贸易有限公司'
  380. }, {
  381. value: '黑龙江鑫满仓粮食贸易有限公司',
  382. label: '黑龙江鑫满仓粮食贸易有限公司'
  383. },{
  384. value: '厦门建发物产有限公司',
  385. label: '厦门建发物产有限公司'
  386. },{
  387. value: '黑龙江谷香粮食贸易有限公司',
  388. label: '黑龙江谷香粮食贸易有限公司'
  389. },{
  390. value: '黑龙江秋收有限公司',
  391. label: '黑龙江秋收有限公司'
  392. }, {
  393. value: '黑龙江欣洋粮食贸易有限公司',
  394. label: '黑龙江欣洋粮食贸易有限公司'
  395. }, {
  396. value: '黑龙江益储益运粮食贸易有限公司',
  397. label: '黑龙江益储益运粮食贸易有限公司'
  398. }, {
  399. value: '黑龙江启兴粮食贸易有限公司',
  400. label: '黑龙江启兴粮食贸易有限公司'
  401. }, {
  402. value: '吉林中翰兴粮食贸易有限公司',
  403. label: '吉林中翰兴粮食贸易有限公司'
  404. }, {
  405. value: '黑龙江中天绿粮供应链服务有限公司',
  406. label: '黑龙江中天绿粮供应链服务有限公司'
  407. }],
  408. companyNameOptions: [{
  409. value: '黑龙江中天昊元贸易有限公司',
  410. label: '黑龙江中天昊元贸易有限公司'
  411. }, {
  412. value: '黑龙江利润元粮食贸易有限公司',
  413. label: '黑龙江利润元粮食贸易有限公司'
  414. }, {
  415. value: '黑龙江众利合粮食贸易有限公司',
  416. label: '黑龙江众利合粮食贸易有限公司'
  417. }, {
  418. value: '黑龙江鑫满仓粮食贸易有限公司',
  419. label: '黑龙江鑫满仓粮食贸易有限公司'
  420. },{
  421. value: '黑龙江谷香粮食贸易有限公司',
  422. label: '黑龙江谷香粮食贸易有限公司'
  423. },{
  424. value: '黑龙江秋收有限公司',
  425. label: '黑龙江秋收有限公司'
  426. }, {
  427. value: '黑龙江欣洋粮食贸易有限公司',
  428. label: '黑龙江欣洋粮食贸易有限公司'
  429. }, {
  430. value: '黑龙江益储益运粮食贸易有限公司',
  431. label: '黑龙江益储益运粮食贸易有限公司'
  432. }, {
  433. value: '黑龙江启兴粮食贸易有限公司',
  434. label: '黑龙江启兴粮食贸易有限公司'
  435. }, {
  436. value: '吉林中翰兴粮食贸易有限公司',
  437. label: '吉林中翰兴粮食贸易有限公司'
  438. }, {
  439. value: '黑龙江中天绿粮供应链服务有限公司',
  440. label: '黑龙江中天绿粮供应链服务有限公司'
  441. }],
  442. companyNameEWOptions: [{
  443. value: '天津建源供应链管理有限公司',
  444. label: '天津建源供应链管理有限公司'
  445. },{
  446. value: '厦门建发物产有限公司',
  447. label: '厦门建发物产有限公司'
  448. }],
  449. companyName: '黑龙江中天昊元贸易有限公司',
  450. companyNameEW: '厦门建发物产有限公司',
  451. ewCustomer: '黑龙江利润元粮食贸易有限公司',
  452. inshipments:'黑龙江中天昊元贸易有限公司',
  453. outshipments:'黑龙江中天昊元贸易有限公司',
  454. ewradio: '',
  455. ddchecked: false,
  456. checked: false,
  457. outchecked:false,
  458. customerOptions:[],
  459. customer:'',
  460. isShowPrintType: false,
  461. dialogDataList: [],
  462. jjSelectPrintList: [],
  463. outPrintList: [],
  464. printSeparately: false,
  465. printout:false,
  466. onePrint: false,
  467. startDate:'',
  468. endDate:'',
  469. dialogVisible:false,
  470. dialogVisible1:false,
  471. dialogVisible2:false,
  472. binNumber:'',
  473. binnumberList:[],
  474. taskNolist:[],
  475. customerlist:[],
  476. cangweiNum:'',
  477. contractNum:'',
  478. inOutTaskNo:'',
  479. customerName:'',
  480. contractNo:'',
  481. customerPhone:'',
  482. customerNumberCard:'',
  483. positionId:'',
  484. warehouseInOutDetail:{},
  485. serviceManagementType:1,
  486. }
  487. },
  488. activated() {
  489. //仓库
  490. console.log(localStorage.getItem('compNameoptions'))
  491. getcomp({userMobilePhone:JSON.parse(localStorage.getItem('ws_login_getTenantInfoByUser')).loginInfo.userMobilePhone}).toPromise().then((res)=>{
  492. this.compNameoptions=res
  493. if (this.compNameoptions.length>0) {
  494. var company=this.compNameoptions
  495. var extra=company.filter((item)=>{
  496. return item!='黑龙江中天昊元贸易有限公司'
  497. &&item!='黑龙江利润元粮食贸易有限公司'
  498. &&item!= '黑龙江众利合粮食贸易有限公司'
  499. &&item!='黑龙江鑫满仓粮食贸易有限公司'
  500. &&item!='黑龙江谷香粮食贸易有限公司'
  501. &&item!='黑龙江秋收有限公司'
  502. &&item!= '黑龙江欣洋粮食贸易有限公司'
  503. &&item!='黑龙江益储益运粮食贸易有限公司'
  504. &&item!='黑龙江启兴粮食贸易有限公司'
  505. })
  506. if(extra.length>0){
  507. this.companyNameOptions=[
  508. {
  509. value: '黑龙江中天昊元贸易有限公司',
  510. label: '黑龙江中天昊元贸易有限公司'
  511. }, {
  512. value: '黑龙江利润元粮食贸易有限公司',
  513. label: '黑龙江利润元粮食贸易有限公司'
  514. }, {
  515. value: '黑龙江众利合粮食贸易有限公司',
  516. label: '黑龙江众利合粮食贸易有限公司'
  517. }, {
  518. value: '黑龙江鑫满仓粮食贸易有限公司',
  519. label: '黑龙江鑫满仓粮食贸易有限公司'
  520. },{
  521. value: '黑龙江欣洋粮食贸易有限公司',
  522. label: '黑龙江欣洋粮食贸易有限公司'
  523. },{
  524. value: '黑龙江谷香粮食贸易有限公司',
  525. label: '黑龙江谷香粮食贸易有限公司'
  526. },{
  527. value: '黑龙江秋收有限公司',
  528. label: '黑龙江秋收有限公司'
  529. }, {
  530. value: '黑龙江益储益运粮食贸易有限公司',
  531. label: '黑龙江益储益运粮食贸易有限公司'
  532. }, {
  533. value: '黑龙江启兴粮食贸易有限公司',
  534. label: '黑龙江启兴粮食贸易有限公司'
  535. }, {
  536. value: '吉林中翰兴粮食贸易有限公司',
  537. label: '吉林中翰兴粮食贸易有限公司'
  538. }, {
  539. value: '黑龙江中天绿粮供应链服务有限公司',
  540. label: '黑龙江中天绿粮供应链服务有限公司'
  541. }]
  542. this.ewCustomerOptions= [
  543. {
  544. value: '天津建源供应链管理有限公司',
  545. label: '天津建源供应链管理有限公司'
  546. },{
  547. value: '黑龙江中天昊元贸易有限公司',
  548. label: '黑龙江中天昊元贸易有限公司'
  549. }, {
  550. value: '黑龙江利润元粮食贸易有限公司',
  551. label: '黑龙江利润元粮食贸易有限公司'
  552. }, {
  553. value: '黑龙江众利合粮食贸易有限公司',
  554. label: '黑龙江众利合粮食贸易有限公司'
  555. }, {
  556. value: '黑龙江鑫满仓粮食贸易有限公司',
  557. label: '黑龙江鑫满仓粮食贸易有限公司'
  558. },{
  559. value: '黑龙江欣洋粮食贸易有限公司',
  560. label: '黑龙江欣洋粮食贸易有限公司'
  561. },{
  562. value: '黑龙江谷香粮食贸易有限公司',
  563. label: '黑龙江谷香粮食贸易有限公司'
  564. },{
  565. value: '黑龙江秋收有限公司',
  566. label: '黑龙江秋收有限公司'
  567. }, {
  568. value: '黑龙江益储益运粮食贸易有限公司',
  569. label: '黑龙江益储益运粮食贸易有限公司'
  570. }, {
  571. value: '黑龙江启兴粮食贸易有限公司',
  572. label: '黑龙江启兴粮食贸易有限公司'
  573. }, {
  574. value: '吉林中翰兴粮食贸易有限公司',
  575. label: '吉林中翰兴粮食贸易有限公司'
  576. }, {
  577. value: '黑龙江中天绿粮供应链服务有限公司',
  578. label: '黑龙江中天绿粮供应链服务有限公司'
  579. }]
  580. this.companyNameEWOptions=[
  581. {
  582. value: '天津建源供应链管理有限公司',
  583. label: '天津建源供应链管理有限公司'
  584. },{
  585. value: '黑龙江中天昊元贸易有限公司',
  586. label: '黑龙江中天昊元贸易有限公司'
  587. }, {
  588. value: '黑龙江利润元粮食贸易有限公司',
  589. label: '黑龙江利润元粮食贸易有限公司'
  590. }, {
  591. value: '黑龙江众利合粮食贸易有限公司',
  592. label: '黑龙江众利合粮食贸易有限公司'
  593. }, {
  594. value: '黑龙江鑫满仓粮食贸易有限公司',
  595. label: '黑龙江鑫满仓粮食贸易有限公司'
  596. },{
  597. value: '黑龙江欣洋粮食贸易有限公司',
  598. label: '黑龙江欣洋粮食贸易有限公司'
  599. },{
  600. value: '黑龙江谷香粮食贸易有限公司',
  601. label: '黑龙江谷香粮食贸易有限公司'
  602. },{
  603. value: '黑龙江秋收有限公司',
  604. label: '黑龙江秋收有限公司'
  605. }, {
  606. value: '黑龙江益储益运粮食贸易有限公司',
  607. label: '黑龙江益储益运粮食贸易有限公司'
  608. }, {
  609. value: '黑龙江启兴粮食贸易有限公司',
  610. label: '黑龙江启兴粮食贸易有限公司'
  611. }, {
  612. value: '黑龙江中天绿粮供应链服务有限公司',
  613. label: '黑龙江中天绿粮供应链服务有限公司'
  614. }]
  615. if(localStorage.getItem('print_company_name')){
  616. this.companyName=localStorage.getItem('print_company_name')
  617. }else{
  618. this.companyName=extra[0]
  619. }
  620. if(localStorage.getItem('print_company_name_ew')){
  621. this.companyNameEW=localStorage.getItem('print_company_name_ew')
  622. }else{
  623. this.companyNameEW=extra[0]
  624. }
  625. if(localStorage.getItem('print_customer_name_ew')){
  626. this.ewCustomer=localStorage.getItem('print_customer_name_ew')
  627. }else{
  628. this.ewCustomer=extra[0]
  629. }
  630. for (let i = 0; i < extra.length; i++) {
  631. this.ewCustomerOptions.push({value: extra[i],label:extra[i]})
  632. this.companyNameOptions.push({value: extra[i],label:extra[i]})
  633. this.companyNameEWOptions.push({value: extra[i],label:extra[i]})
  634. }
  635. }
  636. }
  637. })
  638. selectWarehouseSelf({
  639. compId: localStorage.getItem('ws-pf_compId'),
  640. })
  641. .toPromise()
  642. .then((response) => {
  643. this.warehouseList = response
  644. })
  645. this.compId = localStorage.getItem('ws-pf_compId')
  646. this.warehousingType = this.$route.query.inWarehouseType
  647. this.warehouseName = this.$route.query.warehouseName //仓库名
  648. this.warehouseId = this.$route.query.warehouseId
  649. this.getList()
  650. },
  651. methods: {
  652. importClick(file, fileList) {
  653. this.fileTemp = file.raw
  654. let fileName = file.raw.name
  655. let fileType = fileName.substring(fileName.lastIndexOf('.') + 1)
  656. // 判断上传文件格式
  657. if (this.fileTemp) {
  658. if (fileType == 'xlsx' || fileType == 'xls') {
  659. this.importf(this.fileTemp)
  660. } else {
  661. this.$message({
  662. type: 'warning',
  663. message: '附件格式错误,请删除后重新上传!',
  664. })
  665. }
  666. } else {
  667. this.$message({
  668. type: 'warning',
  669. message: '请上传附件!',
  670. })
  671. }
  672. },
  673. importf(obj) {
  674. this.excelFreightspace = []
  675. // this.dialogVisible = true;
  676. let _this = this;
  677. let inputDOM = this.$refs.inputer; // 通过DOM取文件数据
  678. this.file = event.currentTarget.files[0];
  679. var rABS = false; //是否将文件读取为二进制字符串
  680. var f = this.file;
  681. var reader = new FileReader();
  682. //if (!FileReader.prototype.readAsBinaryString) {
  683. FileReader.prototype.readAsBinaryString = function(f) {
  684. var binary = '';
  685. var rABS = false; //是否将文件读取为二进制字符串
  686. var pt = this;
  687. var wb; //读取完成的数据
  688. var outdata;
  689. var reader = new FileReader();
  690. reader.onload = function(e) {
  691. var bytes = new Uint8Array(reader.result);
  692. var length = bytes.byteLength;
  693. for (var i = 0; i < length; i++) {
  694. binary += String.fromCharCode(bytes[i]);
  695. }
  696. var XLSX = require('xlsx');
  697. if (rABS) {
  698. wb = XLSX.read(btoa(fixdata(binary)), { //手动转化
  699. type: 'base64',
  700. cellDates: true
  701. });
  702. } else {
  703. wb = XLSX.read(binary, {
  704. type: 'binary'
  705. });
  706. }
  707. // outdata就是你想要的东西 excel导入的数据
  708. outdata = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]);
  709. // excel 数据再处理
  710. let arr = []
  711. outdata.map(v => {
  712. // let jsonString = JSON.stringify(v).replace(/\*/g, '').replace(/\s/ig,'');
  713. let jsonString = JSON.stringify(v).replace(/\//g, '').replace(/\s/ig, '');
  714. v = JSON.parse(jsonString);
  715. let obj = {}
  716. //xxx代表列名
  717. obj.number = v.业务编号
  718. obj.inOutTaskNo = v.移库任务编号
  719. obj.outType = v.运输方式
  720. obj.carNumber = v.车牌号
  721. obj.grossWeight = v.毛重
  722. obj.tare = v.皮重
  723. obj.netWeight = v.净重
  724. obj.grossDate = _this.formatDate(v.入库日期, '-')
  725. _this.excelFreightspace.push(obj)
  726. })
  727. if (_this.excelFreightspace) {
  728. importWordYk({
  729. warehouseName: _this.warehouseName,
  730. weighingManagementList: _this.excelFreightspace
  731. }).toPromise()
  732. .then((response) => {
  733. if (response == 'ok') {
  734. this.$notify({
  735. title: '成功',
  736. message: '导入成功',
  737. type: 'success'
  738. });
  739. _this.getList()
  740. }
  741. })
  742. }
  743. }
  744. reader.readAsArrayBuffer(f);
  745. }
  746. if (rABS) {
  747. reader.readAsArrayBuffer(f);
  748. } else {
  749. reader.readAsBinaryString(f);
  750. }
  751. },
  752. formatDate(numb, format) {
  753. const old = numb - 1;
  754. const t = Math.round((old - Math.floor(old)) * 24 * 60 * 60);
  755. const time = new Date(1900, 0, old, 0, 0, t)
  756. const year = time.getFullYear();
  757. const month = time.getMonth() + 1;
  758. const date = time.getDate();
  759. return year + format + (month < 10 ? '0' + month : month) + format + (date < 10 ? '0' + date : date) +
  760. ' 00:00:00'
  761. },
  762. binNumberChange(e){
  763. this.binNumber = e
  764. for(let i = 0 ; i < this.binnumberList.length ; i++){
  765. if(this.binNumber == this.binnumberList[i].binNumber){
  766. this.positionId = this.binnumberList[i].id
  767. }
  768. }
  769. },
  770. taskNoChange(e){
  771. this.inOutTaskNo = e
  772. for(let i = 0 ; i < this.taskNolist.length ; i++){
  773. if(this.inOutTaskNo == this.taskNolist[i].inOutTaskNo){
  774. if(this.taskNolist[i].contractNo){
  775. this.contractNo = this.taskNolist[i].contractNo
  776. }
  777. else{
  778. this.contractNo = this.taskNolist[i].moveTaskNo
  779. }
  780. }
  781. }
  782. },
  783. customerChange(e){
  784. for(let i = 0 ; i < this.customerlist.length ; i++){
  785. if(this.customerNumberCard == this.customerlist[i].customerNumberCard){
  786. this.customerPhone = this.customerlist[i].customerPhone
  787. this.customerName = this.customerlist[i].customerName
  788. }
  789. }
  790. },
  791. handleClose(){
  792. this.dialogVisible = false
  793. },
  794. handleClose1(){
  795. this.inOutTaskNo=''
  796. this.dialogVisible1 = false
  797. },
  798. handleClose2(){
  799. this.customerName=''
  800. this.customerPhone=''
  801. this.customerNumberCard=''
  802. this.dialogVisible2 = false
  803. },
  804. dialogVisibleconfirm(){
  805. if(this.binNumber == this.cangweiNum){
  806. this.$message.error('已是该仓位无需修改')
  807. return
  808. }
  809. this.$confirm(`确定修改仓位?`, {
  810. cancelButtonText: '取消',
  811. confirmButtonText: '确定',
  812. type: 'warning',
  813. })
  814. .then(() => {
  815. // let _obj = JSON.parse(this.warehouseInOutDetail)
  816. // _obj.binNumber = this.binNumber
  817. changeNo({id:this.id,changePositionId:this.positionId,changeBinNumer:this.binNumber}).toPromise()
  818. .then((response) => {
  819. this.$notify.success({
  820. title: '成功',
  821. message: '修改仓位成功',
  822. })
  823. this.getList()
  824. this.dialogVisible=false
  825. })
  826. })
  827. .catch(() => {
  828. return false
  829. })
  830. },
  831. dialogVisibleconfirm1(){
  832. // if(this.contractNo == this.contractNum){
  833. // this.$message.error('已是该任务号无需修改')
  834. // return
  835. // }
  836. this.$confirm(`确定修改任务号?`, {
  837. cancelButtonText: '取消',
  838. confirmButtonText: '确定',
  839. type: 'warning',
  840. })
  841. .then(() => {
  842. changeTaskNo({id:this.id,inOutTaskNo:this.inOutTaskNo,contractNo:this.contractNo}).toPromise()
  843. .then((response) => {
  844. this.$notify.success({
  845. title: '成功',
  846. message: '修改任务号成功',
  847. })
  848. this.getList()
  849. this.inOutTaskNo=''
  850. this.dialogVisible1=false
  851. })
  852. })
  853. .catch(() => {
  854. return false
  855. })
  856. },
  857. dialogVisibleconfirm2(){
  858. this.$confirm(`确定修改客户?`, {
  859. cancelButtonText: '取消',
  860. confirmButtonText: '确定',
  861. type: 'warning',
  862. })
  863. .then(() => {
  864. changeCustomer({id:this.id,customer:this.customerName,customerPhone:this.customerPhone,customerNumberCard:this.customerNumberCard}).toPromise()
  865. .then((response) => {
  866. this.$notify.success({
  867. title: '成功',
  868. message: '修改客户成功',
  869. })
  870. this.getList()
  871. this.customerName=''
  872. this.customerPhone=''
  873. this.customerNumberCard=''
  874. this.dialogVisible2=false
  875. })
  876. })
  877. .catch(() => {
  878. return false
  879. })
  880. },
  881. exchange(row){
  882. for(let i = 0 ; i < this.warehouseList.length; i++ ){
  883. if(this.warehouseName == this.warehouseList[i].warehouseName){
  884. this.binnumberList = this.warehouseList[i].positionInfos
  885. }
  886. }
  887. this.id = row.id
  888. this.binNumber = row.binNumber
  889. this.cangweiNum = row.binNumber
  890. this.dialogVisible = true
  891. },
  892. exchangeNo(row){
  893. if (row.serviceManagementType == 1) {
  894. this.taskflag=2
  895. } else {
  896. this.taskflag=3
  897. }
  898. getReceiptTaskNo({
  899. flag: this.taskflag,
  900. warehouseName: this.warehouseName,
  901. })
  902. .toPromise()
  903. .then((response) => {
  904. this.taskNolist = response
  905. })
  906. this.id = row.id
  907. this.contractNo = row.contractNo
  908. this.contractNum = row.contractNo
  909. this.dialogVisible1 = true
  910. },
  911. exchangeName(row){
  912. getcustomer({
  913. warehouseId: this.warehouseId,
  914. goodsName: row.goodsName
  915. })
  916. .toPromise()
  917. .then((response) => {
  918. this.customerlist = response
  919. })
  920. this.id = row.id
  921. this.dialogVisible2 = true
  922. },
  923. backInfo(row){
  924. this.$confirm('确定要退回该信息?', '提示', {
  925. confirmButtonText: '确定',
  926. cancelButtonText: '取消',
  927. type: 'warning',
  928. })
  929. .then(() => {
  930. returnInfo(row)
  931. .toPromise()
  932. .then((response) => {
  933. this.$notify.success({
  934. title: '成功',
  935. message: '退回成功!',
  936. })
  937. this.getList()
  938. })
  939. .catch((response) => {
  940. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  941. })
  942. })
  943. },
  944. deleteInfo(row){
  945. //删除
  946. this.$confirm('确定删除检斤信息?', '提示', {
  947. confirmButtonText: '确定',
  948. cancelButtonText: '取消',
  949. type: 'warning',
  950. })
  951. .then(() => {
  952. getweighingDelete({
  953. id: row.id,
  954. })
  955. .toPromise()
  956. .then((response) => {
  957. this.$notify.success({
  958. title: '成功',
  959. message: '删除成功',
  960. })
  961. this.getList()
  962. })
  963. .catch((response) => {
  964. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  965. })
  966. })
  967. .catch(() => {
  968. return false
  969. })
  970. },
  971. typePrintCannelClick() {
  972. this.onePrint = false //单个打印标识
  973. this.dialogDataList = [] //打个打印取消时数组至空
  974. this.isShowPrintType = false
  975. },
  976. handleSelectionChange(val) {
  977. this.modification = val;
  978. },
  979. // batchPrint(){
  980. // if(this.modification.length == 0){
  981. // this.$message.error("请选择批量打印的条目!")
  982. // return
  983. // }
  984. // // this.isShowPrintType = true
  985. // },
  986. changeEw(e) {
  987. this.ddchecked = false
  988. if (e) {
  989. this.printSeparately = true
  990. } else {
  991. this.printSeparately = false
  992. }
  993. },
  994. changeEwDD(e) {
  995. this.checked = false
  996. if (e) {
  997. this.printSeparately = true
  998. } else {
  999. this.printSeparately = false
  1000. }
  1001. },
  1002. changeOut(e) {
  1003. if (e) {
  1004. this.printout = true
  1005. } else {
  1006. this.printout = false
  1007. }
  1008. },
  1009. dateFormat(fmt, date) {
  1010. let ret
  1011. const opt = {
  1012. 'Y+': date.getFullYear().toString(), // 年
  1013. 'm+': (date.getMonth() + 1).toString(), // 月
  1014. 'd+': date.getDate().toString(), // 日
  1015. 'H+': date.getHours().toString(), // 时
  1016. // "M+": date.getMinutes().toString(), // 分
  1017. // "S+": date.getSeconds().toString() // 秒
  1018. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  1019. }
  1020. for (let k in opt) {
  1021. ret = new RegExp('(' + k + ')').exec(fmt)
  1022. if (ret) {
  1023. fmt = fmt.replace(
  1024. ret[1],
  1025. ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
  1026. )
  1027. }
  1028. }
  1029. return fmt
  1030. },
  1031. lookup() {
  1032. if (this.value2&&this.value2.length>0) {
  1033. this.startDate = this.dateFormat('YYYY-mm-dd', this.value2[0])
  1034. this.endDate = this.dateFormat('YYYY-mm-dd', this.value2[1])
  1035. } else {
  1036. this.startDate = ''
  1037. this.endDate = ''
  1038. }
  1039. this.currentPage = 1
  1040. this.getList()
  1041. },
  1042. changeType(val) {
  1043. this.warehousingType = val
  1044. this.getList()
  1045. },
  1046. screen(num) {
  1047. this.choice = num
  1048. this.getList()
  1049. },
  1050. returnsales() {
  1051. this.$router.go(-1)
  1052. },
  1053. async typePrintClick(type) {
  1054. localStorage.setItem('print_company_name',this.companyName)
  1055. localStorage.setItem('print_company_name_ew',this.companyNameEW)
  1056. localStorage.setItem('print_customer_name_ew',this.ewCustomer)
  1057. localStorage.setItem('print_out',this.outchecked)
  1058. if (this.onePrint) { //判断是否是单个打印
  1059. getPrint({
  1060. id: this.idPrint
  1061. })
  1062. .toPromise()
  1063. .then((response) => {
  1064. // 判断是否打印出库
  1065. this.dialogDataList = [] //点击确认时先清空要打印的数组
  1066. this.dialogData = response
  1067. if (response.compName == '黑龙江秋收有限公司') {
  1068. this.dialogData.compName = '黑龙江中天昊元贸易有限公司'
  1069. }else{
  1070. this.dialogData.compName = this.companyName
  1071. }
  1072. this.dialogData.customer=this.customer
  1073. if (this.checked) {
  1074. if(this.dialogData&&!this.dialogData.customer&&this.dialogData.contractManagement){
  1075. this.dialogData.customer = this.dialogData.contractManagement.seller
  1076. }
  1077. this.dialogDataList.push(this.dialogData)
  1078. var _datas = JSON.stringify(this.dialogData)
  1079. _datas = JSON.parse(_datas)
  1080. _datas.compName = this.companyNameEW;
  1081. _datas.customer = this.ewCustomer
  1082. this.dialogDataList.push(_datas)
  1083. } else if (this.ddchecked) {
  1084. _datas = this.dialogData
  1085. _datas.compName = this.companyNameEW;
  1086. _datas.customer = this.ewCustomer
  1087. this.dialogDataList.push(_datas)
  1088. }else {
  1089. this.dialogData.compName = this.companyName
  1090. if(this.dialogData&&this.dialogData.contractManagement&& this.warehousingType != 3&&this.dialogData.inOutType=='退库'){
  1091. this.dialogData.customer = this.dialogData.contractManagement.buyer
  1092. }
  1093. else if(this.dialogData&&this.dialogData.contractManagement&& this.warehousingType != 3&&this.dialogData.inOutType!='退库'){
  1094. this.dialogData.customer = this.dialogData.contractManagement.seller
  1095. }
  1096. this.dialogDataList.push(this.dialogData)
  1097. }
  1098. if(this.outchecked){
  1099. if(!this.checked&&!this.ddchecked){
  1100. this.dialogDataList=[]
  1101. var _data = JSON.parse(JSON.stringify(this.dialogData))
  1102. this.$set(_data,'printtype','out')
  1103. _data.compName = this.outshipments;
  1104. _data.customer = this.inshipments
  1105. _data.binNumber = this.outbinNumber
  1106. this.dialogDataList.push(_data)
  1107. }else{
  1108. var _data = JSON.parse(JSON.stringify(this.dialogData))
  1109. this.$set(_data,'printtype','out')
  1110. _data.compName = this.outshipments;
  1111. _data.customer = this.inshipments
  1112. _data.binNumber = this.outbinNumber
  1113. this.dialogDataList.push(_data)
  1114. }
  1115. }
  1116. this.printBig('', this.radio)
  1117. })
  1118. .catch((response) => {
  1119. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  1120. })
  1121. } else {
  1122. // if (this.isExcelPrint) {
  1123. // this.printBig(2, this.radio)
  1124. // this.isExcelPrint = false
  1125. // } else {
  1126. this.jjSelectPrintList = []
  1127. let index1 = 0;
  1128. for (let i = 0; i < this.modification.length; i++) {
  1129. await getPrint({
  1130. id: this.modification[i].id
  1131. })
  1132. .toPromise()
  1133. .then((response) => {
  1134. index1++;
  1135. response.compName = this.companyName
  1136. if (response.compName == '黑龙江秋收有限公司') {
  1137. response.compName = '黑龙江中天昊元贸易有限公司'
  1138. }
  1139. response.customer=this.customer
  1140. this.jjSelectPrintList.push(response)
  1141. if (index1 == this.modification.length) {
  1142. this.printBig(1, this.radio)
  1143. }
  1144. })
  1145. .catch((response) => {})
  1146. }
  1147. // }
  1148. }
  1149. },
  1150. makeEWjjSelectPrintList() {
  1151. let _selectPrint_EWjjSelectPrintList = JSON.parse(JSON.stringify(this.jjSelectPrintList));
  1152. for (let i = 0; i < _selectPrint_EWjjSelectPrintList.length; i++) {
  1153. let _data = _selectPrint_EWjjSelectPrintList[i];
  1154. _data.compName = this.companyNameEW;
  1155. _data.customer = this.ewCustomer
  1156. }
  1157. localStorage.setItem('selectPrint_EWjjSelectPrintList', JSON.stringify(_selectPrint_EWjjSelectPrintList))
  1158. },
  1159. check(name, type) {
  1160. if (type == 1) {
  1161. for (var _tmp = 0; _tmp < this.ewCustomerOptions.length; _tmp++) {
  1162. if (this.ewCustomerOptions[_tmp].label == name) {
  1163. return false
  1164. }
  1165. }
  1166. return true
  1167. } else if (type == 2) {
  1168. for (var _tmp = 0; _tmp < this.companyNameEWOptions.length; _tmp++) {
  1169. if (this.companyNameEWOptions[_tmp].label == name) {
  1170. return false
  1171. }
  1172. }
  1173. return true
  1174. } else if (type == 3) {
  1175. for (var _tmp = 0; _tmp < this.companyNameOptions.length; _tmp++) {
  1176. console.log(name)
  1177. if (this.companyNameOptions[_tmp].label == name) {
  1178. return false
  1179. }
  1180. }
  1181. return true
  1182. }
  1183. },
  1184. async print(row, type, pageType) {
  1185. this.printType=type
  1186. //打印
  1187. if (type == 1) { //
  1188. if (this.modification.length == 0) {
  1189. this.$message.error('请选择批量打印的条目!')
  1190. return
  1191. }
  1192. for (let _num = 0; _num < this.modification.length; _num++) {
  1193. this.serviceManagementType=this.modification[_num].serviceManagementType
  1194. if(this.modification[_num].serviceManagementType == 3){
  1195. this.customerOptions=[{label:this.modification[_num].customer,value:this.modification[_num].customer}]
  1196. this.customerOptions.push({label:this.modification[_num].seller,value:this.modification[_num].seller})
  1197. this.customer=this.modification[_num].customer
  1198. }
  1199. if (this.modification[_num].serviceManagementType == 1&&(this.warehouseName == '鲅鱼圈金信库'|| this.warehouseName == '杜尔伯特家禾库'|| this.warehouseName == '洮南兴旺库2023.10-2024.9'||this.warehouseName=='洮南新友谊兴旺库'||this.warehouseName=='甘南宏旗库' || this.warehouseName == '白城内陆港' || this.warehouseName == '洮南向阳乡金昊'||this.warehouseName=='山东园丰库'||this.warehouseName=='佳屹农仓储库')){
  1200. if (this.modification[_num].seller && this.modification[_num].buyer) {
  1201. let cang = {}
  1202. cang.value = this.modification[_num].seller
  1203. cang.label = this.modification[_num].seller
  1204. let cang1 = {}
  1205. cang1.value = this.modification[_num].buyer
  1206. cang1.label = this.modification[_num].buyer
  1207. // if (this.check(this.modification[_num].seller, 1)) {
  1208. // this.ewCustomerOptions.push(cang)
  1209. // }
  1210. if(this.warehouseName=='佳屹农仓储库'){
  1211. if (this.check(this.modification[_num].buyer, 3)) {
  1212. this.companyNameOptions.push(cang1)
  1213. this.companyName=this.modification[_num].buyer
  1214. }
  1215. }else{
  1216. if (this.check(this.modification[_num].buyer, 2)) {
  1217. this.ewCustomerOptions.push(cang1)
  1218. }
  1219. }
  1220. if (this.check(this.modification[_num].seller, 1)) {
  1221. this.companyNameEWOptions.push(cang)
  1222. }
  1223. }
  1224. }
  1225. }
  1226. this.isShowPrintType = true
  1227. } else {
  1228. this.serviceManagementType=row.serviceManagementType
  1229. if(row.serviceManagementType == 3){
  1230. this.customerOptions=[{label:row.customer,value:row.customer}]
  1231. this.customerOptions.push({label:row.seller,value:row.seller})
  1232. this.customer=row.customer
  1233. console.log(this.customerOptions,this.customer,222222)
  1234. }
  1235. if (row.serviceManagementType == 1&&(this.warehouseName == '鲅鱼圈金信库' || this.warehouseName == '杜尔伯特家禾库' || this.warehouseName == '洮南兴旺库2023.10-2024.9'||this.warehouseName=='洮南新友谊兴旺库'||this.warehouseName=='甘南宏旗库' || this.warehouseName == '白城内陆港' || this.warehouseName == '洮南向阳乡金昊'||this.warehouseName=='山东园丰库'||this.warehouseName=='佳屹农仓储库')) {
  1236. if (row.seller && row.buyer) {
  1237. let cang = {}
  1238. cang.value = row.seller
  1239. cang.label = row.seller
  1240. // if (this.check(row.seller, 1)) {
  1241. // this.ewCustomerOptions.push(cang)
  1242. // }
  1243. let cang1 = {}
  1244. cang1.value = row.buyer
  1245. cang1.label = row.buyer
  1246. if(this.warehouseName=='佳屹农仓储库'){
  1247. if (this.check(row.buyer, 3)) {
  1248. this.companyNameOptions.push(cang1)
  1249. this.companyName=row.buyer
  1250. }
  1251. }else{
  1252. if (this.check(row.buyer, 2)) {
  1253. this.companyNameEWOptions.push(cang1)
  1254. }
  1255. }
  1256. if (this.check(row.seller, 1)) {
  1257. this.ewCustomerOptions.push(cang)
  1258. }
  1259. }
  1260. }
  1261. this.idPrint = row.id
  1262. if(type==2&&this.warehouseName=='鲅鱼圈金信库'){
  1263. var data=await getbinNumber({id:row.warehouseId}).toPromise()
  1264. this.binNumberList1=data.warehousePositionInfoList
  1265. }
  1266. this.isShowPrintType = true
  1267. this.onePrint = true //单个打印标识
  1268. }
  1269. },
  1270. printSmall() {
  1271. window.open('../../../../static/weightCheck.html?type=1&tableData=' + JSON.stringify(this.dialogData).replace(/%/g, 'baifenhao'))
  1272. },
  1273. printBig(type, radioType) {
  1274. localStorage.removeItem('print_in_data')
  1275. // 打印额外
  1276. if (this.checked || this.ddchecked) {
  1277. this.makeEWjjSelectPrintList()
  1278. // this.selectEW = true;
  1279. }
  1280. // if(this.outchecked){
  1281. // var _data = JSON.parse(JSON.stringify(this.dialogData))
  1282. // this.$set(_data,'printtype','out')
  1283. // localStorage.setItem('selectPrint_jjSelectPrintList', JSON.stringify(this.jjSelectPrintList))
  1284. // }
  1285. if (type == 1) {
  1286. localStorage.setItem('selectPrint_jjSelectPrintList', JSON.stringify(this.jjSelectPrintList))
  1287. window.open('../../../../static/weightCheck.html?type=2&radioType=' + radioType + '&selectEW=' + this
  1288. .checked + '&selectEWDD=' + this.ddchecked)
  1289. } else if (type == 2) {
  1290. localStorage.setItem('selectPrint_jjSelectPrintList', JSON.stringify(this.excelPrintData))
  1291. window.open('../../../../static/weightCheck.html?type=2&radioType=' + radioType)
  1292. } else {
  1293. console.log(this.dialogDataList)
  1294. localStorage.setItem('print_in_data',JSON.stringify(this.dialogDataList).replace(/%/g, 'baifenhao'))
  1295. // window.open('../../../../static/weightCheck.html?type=2&tableData=' + JSON.stringify(this.dialogDataList).replace(/%/g, 'baifenhao'))
  1296. window.open('../../../../static/weightCheck.html?type=2&tableData=' )
  1297. }
  1298. },
  1299. warehouseNameChange() {
  1300. for(let i = 0 ; i < this.warehouseList.length; i++ ){
  1301. if(this.warehouseName == this.warehouseList[i].warehouseName){
  1302. this.warehouseId = this.warehouseList[i].id
  1303. }
  1304. }
  1305. this.getList()
  1306. },
  1307. handleSizeChange(val) {
  1308. console.log(`每页 ${val} 条`)
  1309. this.pageSize = val
  1310. this.getList()
  1311. },
  1312. handleCurrentChange(val) {
  1313. this.currentPage = val
  1314. console.log(`当前页: ${val}`)
  1315. this.getList()
  1316. },
  1317. getList() {
  1318. // 列表
  1319. getweighingList({
  1320. compId: localStorage.getItem('ws-pf_compId'),
  1321. currentPage: this.currentPage,
  1322. pageSize: this.pageSize,
  1323. searchKeyWord: this.searchKeyWord,
  1324. warehouseName: this.warehouseName,
  1325. managementType: 1,
  1326. serviceManagementType: this.warehousingType,
  1327. statusType: this.choice,
  1328. startDate: this.startDate,
  1329. endDate: this.endDate,
  1330. })
  1331. .toPromise()
  1332. .then((response) => {
  1333. this.weighingRecordList = response.records
  1334. this.deptBudgetTotal = response.total
  1335. })
  1336. .catch((response) => {
  1337. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  1338. })
  1339. },
  1340. },
  1341. }
  1342. </script>
  1343. <style lang="scss" scoped>
  1344. .toptitle {
  1345. background: #f6f7fc;
  1346. }
  1347. .bg-left {
  1348. padding-left: 30px;
  1349. }
  1350. .bg-right {
  1351. text-align: right;
  1352. padding: 16px 20px;
  1353. }
  1354. .top-title {
  1355. width: 50%;
  1356. display: flex;
  1357. }
  1358. .title {
  1359. position: relative;
  1360. }
  1361. .title::before {
  1362. content: '';
  1363. display: inline-block;
  1364. width: 5px;
  1365. height: 30px;
  1366. background: #5473e8;
  1367. position: absolute;
  1368. left: 0;
  1369. }
  1370. .container {
  1371. overflow: scroll;
  1372. height: 93vh;
  1373. }
  1374. .center {
  1375. margin: auto;
  1376. }
  1377. .centertitle {
  1378. display: flex;
  1379. margin: 10px 0;
  1380. }
  1381. .temporary {
  1382. line-height: 80px;
  1383. font-size: 20px;
  1384. color: #abaaaa;
  1385. }
  1386. /deep/.forData .cell {
  1387. text-align: center;
  1388. }
  1389. //弹出框
  1390. .eject-warehouse {
  1391. font-size: 20px;
  1392. margin-left: 15px;
  1393. font-weight: 600;
  1394. }
  1395. .table_css {
  1396. margin: 20px auto;
  1397. tr {
  1398. height: 50px;
  1399. }
  1400. .table_item {
  1401. min-width: 70px;
  1402. }
  1403. td {
  1404. text-align: center;
  1405. font-size: 18px;
  1406. font-weight: 600;
  1407. }
  1408. .el-select {
  1409. width: 90%;
  1410. }
  1411. }
  1412. .btn_topcss {
  1413. margin-top: 15px;
  1414. }
  1415. .btn_css {
  1416. width: 90px;
  1417. margin-left: 10px;
  1418. }
  1419. .search_css {
  1420. margin: 0 20px;
  1421. }
  1422. .mask {
  1423. background: black;
  1424. width: 100vw;
  1425. height: 100vh;
  1426. position: fixed;
  1427. top: 0;
  1428. z-index: 99;
  1429. opacity: 0.3;
  1430. }
  1431. .print-type-title {
  1432. text-align: center;
  1433. font-size: 18px;
  1434. margin: 20px;
  1435. }
  1436. .bottom-btn {
  1437. display: flex;
  1438. margin-top: 20px;
  1439. justify-content: space-around;
  1440. }
  1441. .print-type-checkbox {
  1442. // padding-left: 20px;
  1443. }
  1444. .print-type {
  1445. position: absolute;
  1446. top: 0;
  1447. bottom: 0;
  1448. left: 0;
  1449. right: 0;
  1450. margin: auto;
  1451. width: 440px;
  1452. height: 446px;
  1453. background: white;
  1454. border-radius: 10px;
  1455. z-index: 999;
  1456. }
  1457. /deep/.el-radio-group {
  1458. width: 100%;
  1459. display: flex;
  1460. }
  1461. /deep/.el-radio__label {
  1462. font-size: 20px;
  1463. }
  1464. /deep/.el-radio__inner {
  1465. // background: red;
  1466. height: 20px;
  1467. width: 20px;
  1468. }
  1469. .label-width {
  1470. width: 100%;
  1471. text-align: center;
  1472. font-size: 20px;
  1473. }
  1474. .show-excel {
  1475. opacity: 0;
  1476. }
  1477. /deep/.base_header_layout .find.el-button--primary {
  1478. width: 30px;
  1479. border-top-left-radius: 0px;
  1480. border-bottom-left-radius: 0px;
  1481. }
  1482. /deep/.base_header_layout .findinput input {
  1483. border-top-right-radius: 0px;
  1484. border-bottom-right-radius: 0px;
  1485. }
  1486. .ew-print {
  1487. padding: 0 20px;
  1488. margin-top: 10px;
  1489. // display: flex;
  1490. // justify-content: space-between;
  1491. // align-content: center;
  1492. .row {
  1493. display: flex;
  1494. margin-top: 10px;
  1495. align-items: center;
  1496. }
  1497. }
  1498. .sh-address {
  1499. display: flex;
  1500. }
  1501. .print-type-ew {
  1502. display: flex;
  1503. justify-content: space-between;
  1504. padding: 0 20px;
  1505. /deep/.el-radio__label {
  1506. font-size: 14px;
  1507. }
  1508. margin-top: 10px;
  1509. }
  1510. /deep/.el-table .cell {
  1511. text-align: center;
  1512. }
  1513. .shdw-style {
  1514. display: flex;
  1515. justify-content: space-between;
  1516. align-items: center;
  1517. padding: 0 20px;
  1518. margin-top: 20px;
  1519. }
  1520. </style>