weighingManagement.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. <!--检斤管理-->
  2. <template>
  3. <div>
  4. <BaseHeaderLayout :leftSpan="12">
  5. <template slot="left">
  6. <ws-button type="primary" @click="weighing(3)">添加</ws-button>
  7. </template>
  8. <!-- <template slot="left"> </template> -->
  9. <template slot="right">
  10. <ws-select v-model="warehouseName" placeholder="" @change="warehouseNameChange" :value="searchType">
  11. <ws-option v-for="item in warehouseList" :key="item.value" :label="item.value" :value="item.value"
  12. style="color: #8890b1" />
  13. </ws-select>
  14. <div></div>
  15. <ws-input v-model="searchKeyWord" placeholder="可按合同编号、车牌号查找" clearable maxlength="500" type="input">
  16. </ws-input>
  17. <ws-button class="find" type="primary" @click="find()"><img width="16" height="16" style="
  18. vertical-align: text-top;
  19. position: relative;
  20. top: 0px;
  21. left: -8px;
  22. " src="../../../public/img/sousuo.png" alt="" /></ws-button>
  23. </template>
  24. </BaseHeaderLayout>
  25. <el-table :data="weighingList" style="width: 100%; margin-top: 20px" ref="weighingList" border height="780">
  26. <el-table-column type="index" label="序号" width="50">
  27. <template scope="scope">
  28. <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
  29. <span v-else>{{ scope.$index + 1 }}</span>
  30. </template>
  31. </el-table-column>
  32. <el-table-column prop="contractNo" width="120" label="合同编号"></el-table-column>
  33. <el-table-column prop="goodsName" label="货名"></el-table-column>
  34. <el-table-column prop="carNumber" label="车牌号"></el-table-column>
  35. <el-table-column prop="grossWeight" label="毛重(公斤)"></el-table-column>
  36. <el-table-column prop="tare" label="皮重(公斤)"></el-table-column>
  37. <el-table-column prop="netWeight" label="净重(公斤)"></el-table-column>
  38. <el-table-column prop="binNumber" label="仓位号"></el-table-column>
  39. <el-table-column prop="storageNumber" label="囤位号"></el-table-column>
  40. <el-table-column prop="secretaryWeigher" label="司称员"></el-table-column>
  41. <el-table-column prop="grossDate" label="称重时间">
  42. <template slot-scope="scope">
  43. {{scope.row.grossDate}}
  44. <span v-if="scope.row.grossDate == null">
  45. {{scope.row.tareDate}}
  46. </span>
  47. </template>
  48. </el-table-column>
  49. <el-table-column prop="addressUrl" label="附件">
  50. <template slot-scope="scope">
  51. <img width="18" height="20" style="vertical-align: text-top; position: relative; top: -1px"
  52. src="../../../public/img/fujian.png" @click="fujian(scope.row)" alt="" />
  53. <span v-if="scope.row.addressUrlArray != null">
  54. {{scope.row.addressUrlArray.length == 0? '': scope.row.addressUrlArray.length}}
  55. </span>
  56. </template>
  57. </el-table-column>
  58. <el-table-column prop="status" label="状态"></el-table-column>
  59. <el-table-column width="300" prop="contractNo1" label="操作">
  60. <template slot-scope="scope">
  61. <el-button @click="weighing(scope.row, 1)" v-if="scope.row.status != '已质检'">毛重</el-button>
  62. <el-button @click="weighing(scope.row, 2)" v-if="scope.row.status == '已称皮重'">皮重</el-button>
  63. <el-button @click="del(scope.row)" v-if="scope.row.status == '已称皮重'">删除</el-button>
  64. </template>
  65. </el-table-column>
  66. </el-table>
  67. <div style="text-align: center">
  68. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
  69. :current-page="currentPage" :page-size="deptCircularPage.pageSize"
  70. layout="total, sizes, prev, pager, next, jumper" :total="deptBudgetTotal">
  71. </el-pagination>
  72. </div>
  73. <WinseaContentModal v-model="accessoryTFs" :title="$t('system.noticeCircular.information')"
  74. @on-cancel="handleClose">
  75. <p>查看附件</p>
  76. <div style="display: inline-block; margin: 5px" v-for="item in appendixIdss">
  77. <img width="100" height="100" :src="item" alt="" />
  78. </div>
  79. </WinseaContentModal>
  80. </div>
  81. </template>
  82. <script>
  83. import {
  84. getweighingList,
  85. selectWarehouseSelf,
  86. delelteWeighing,
  87. } from '@/model/outboundManagement/index'
  88. import {
  89. EventBus
  90. } from 'base-core-lib'
  91. import WsUpload from '@/components/WsUpload'
  92. export default {
  93. components: {
  94. WsUpload,
  95. },
  96. data() {
  97. return {
  98. //分页
  99. dialogViewSpareMoney: false,
  100. currentPage: 1,
  101. pageSize: 10,
  102. deptCircularPage: {},
  103. deptBudgetTotal: 0,
  104. paymentForm: false,
  105. paymentForm1: false,
  106. weighingList: [],
  107. searchKeyWord: '',
  108. searchType: [],
  109. warehouseName: '',
  110. value1: '', //选择时间
  111. warehouseList: [],
  112. warehouseId: '',
  113. accessoryTFs: false,
  114. appendixIdss: [],
  115. addressUrls: [],
  116. compId: sessionStorage.getItem('ws-pf_compId'),
  117. }
  118. },
  119. activated() {
  120. this.selectWarehouse()
  121. this.showType = this.isShow
  122. },
  123. methods: {
  124. warehouseNameChange(e) {
  125. // this.warehouseName = e
  126. console.log(this.warehouseList)
  127. for (let i = 0; i < this.warehouseList.length; i++) {
  128. if (this.warehouseList[i].value == e) {
  129. this.warehouseId = this.warehouseList[i].warehouseId
  130. }
  131. }
  132. },
  133. weighing(row, num) {
  134. console.log
  135. this.$router.push({
  136. path: 'weighing',
  137. query: {
  138. typeNo: num,
  139. id: row.id,
  140. number: row.number,
  141. binNumber: row.binNumber,
  142. customer: row.customer,
  143. storageNumber: row.storageNumber,
  144. carNumber: row.carNumber,
  145. goodsName: row.goodsName,
  146. grossWeight: row.grossWeight,
  147. tare: row.tare,
  148. netWeight: row.netWeight,
  149. relationId: row.relationId,
  150. warehouseId: this.warehouseId,
  151. warehouseName: this.warehouseName,
  152. },
  153. })
  154. },
  155. // Reacquire() {
  156. // //重新获取
  157. // },
  158. find() {
  159. this.getList()
  160. },
  161. handleSizeChange(val) {
  162. console.log(`每页 ${val} 条`)
  163. this.pageSize = val
  164. this.getList()
  165. },
  166. handleCurrentChange(val) {
  167. this.currentPage = val
  168. console.log(`当前页: ${val}`)
  169. this.getList()
  170. },
  171. del(row) {
  172. this.$confirm(`检斤信息删除后不可恢复,是否确定删除?`, {
  173. cancelButtonText: '取消',
  174. confirmButtonText: '确定',
  175. type: 'warning',
  176. })
  177. .then(() => {
  178. delelteWeighing({
  179. id: row.id
  180. })
  181. .toPromise()
  182. .then((response) => {
  183. this.$notify.success({
  184. title: '成功',
  185. message: '删除成功',
  186. })
  187. this.getList()
  188. })
  189. .catch((response) => {})
  190. })
  191. .catch(() => {
  192. return false
  193. })
  194. },
  195. selectWarehouse() {
  196. selectWarehouseSelf({
  197. compId: sessionStorage.getItem('ws-pf_compId'),
  198. personCharge: sessionStorage.getItem('ws-pf_staffName'),
  199. })
  200. .toPromise()
  201. .then((response) => {
  202. this.warehouseList = []
  203. for (let i = 0; i < response.length; i++) {
  204. this.warehouseList.push({
  205. value: response[i].warehouseName,
  206. warehouseId: response[i].id,
  207. })
  208. }
  209. this.warehouseName = this.warehouseList[0].value
  210. this.warehouseId = this.warehouseList[0].warehouseId
  211. this.purchasePriceList = this.warehouseList[0].warehouseList
  212. this.getList()
  213. })
  214. },
  215. getList() {
  216. getweighingList({
  217. compId: sessionStorage.getItem('ws-pf_compId'),
  218. currentPage: this.currentPage,
  219. pageSize: this.pageSize,
  220. searchKeyWord: this.searchKeyWord,
  221. warehouseName: this.warehouseName,
  222. managementType: 3,
  223. })
  224. .toPromise()
  225. .then((response) => {
  226. this.weighingList = response.records
  227. this.deptBudgetTotal = response.total
  228. for (var i = 0; i < response.records.length; i++) {
  229. if (response.records[i].addressUrl != null) {
  230. if (response.records[i].addressUrl) {
  231. response.records[i].addressUrlArray = response.records[i].addressUrl.split(',')
  232. }
  233. } else {
  234. response.records[i].addressUrlArray = []
  235. }
  236. }
  237. for (var i = 0; i < response.records.length; i++) {
  238. var arr = new Array()
  239. this.addressUrls[i] = new Array()
  240. if (this.weighingList.records[i].addressUrl !=
  241. null) {
  242. arr = this.weighingList.records[i].addressUrl.split(',')
  243. this.addressUrls[i] = arr
  244. }
  245. }
  246. })
  247. .catch((response) => {
  248. })
  249. },
  250. //附件
  251. fujian(row) {
  252. if (row.addressUrl === null || row.addressUrl === '') {
  253. EventBus.$emit(
  254. 'warning',
  255. this.$t('system.noticeCircular.NoInformation')
  256. )
  257. } else {
  258. this.accessoryTFs = true
  259. }
  260. this.appendixIdss = row.addressUrlArray
  261. },
  262. handleClose() {
  263. this.dialogViewSpareMoney = false
  264. },
  265. },
  266. }
  267. </script>
  268. <style lang="scss" scoped>
  269. .title {
  270. font-size: 20px;
  271. font-weight: 600;
  272. margin: 20px;
  273. }
  274. .ws-info-table {
  275. border: none;
  276. }
  277. .ws-info-table .el-form-item {
  278. width: 50%;
  279. border: none;
  280. }
  281. /deep/.ws-info-table .el-form-item .el-form-item__label {
  282. width: 30%;
  283. text-align: center;
  284. background: #ffffff;
  285. color: #8890b1;
  286. }
  287. /deep/.ws-info-table .el-form-item .el-form-item__content {
  288. border: none;
  289. }
  290. /deep/.el-table .el-table__header .cell,
  291. .el-table .el-table__body .cell {
  292. text-align: center;
  293. }
  294. /deep/.el-table--enable-row-transition .el-table__body td {
  295. text-align: center;
  296. }
  297. .formItem {
  298. width: 51% !important;
  299. }
  300. </style>