tranManagementTransport.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. // 运输管理
  2. <template>
  3. <div>
  4. <BaseHeaderLayout :leftSpan="20">
  5. <template slot="right">
  6. <ws-form-item label="起点" span="1" prop="agent">
  7. <ws-input
  8. v-model="deptBudgetList.agent"
  9. placeholder="请输入起点"
  10. maxlength="100"
  11. size="small"
  12. />
  13. </ws-form-item>
  14. <ws-form-item label="终点" span="1" prop="agent">
  15. <ws-input
  16. v-model="deptBudgetList.agent"
  17. placeholder="请输入终点"
  18. maxlength="100"
  19. size="small"
  20. />
  21. </ws-form-item>
  22. <ws-input
  23. v-model="warehouseName"
  24. placeholder="请输入仓库名"
  25. clearable
  26. maxlength="500"
  27. type="input"
  28. class="findValue"
  29. ></ws-input>
  30. <ws-button
  31. type="primary"
  32. @click="handleLook()"
  33. v-hasPermission="
  34. `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
  35. "
  36. >查找</ws-button
  37. >
  38. </template>
  39. <template slot="left">
  40. </template>
  41. </BaseHeaderLayout>
  42. <div class="connert">
  43. <el-table
  44. class="wenzi"
  45. :data="driverList.records"
  46. style="width: 100%; margin-top: 20px"
  47. fit
  48. height="780"
  49. >
  50. <el-table-column type="index" label="序号">
  51. <template scope="scope">
  52. <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
  53. <span v-else>{{ scope.$index + 1 }}</span>
  54. </template>
  55. </el-table-column>
  56. <el-table-column prop="driverName" label="姓名" width="100">
  57. </el-table-column>
  58. <el-table-column prop="numberCard" label="运输任务编号" width="200">
  59. </el-table-column>
  60. <el-table-column prop="driverPhone" label="合同编号" width="120">
  61. </el-table-column>
  62. <el-table-column prop="carNumber" label="货物(吨数)" width="80">
  63. </el-table-column>
  64. <el-table-column prop="binNumber" label="运输方式" width="120">
  65. </el-table-column>
  66. <el-table-column prop="carModel" label="起点" width="80">
  67. </el-table-column>
  68. <el-table-column prop="carLength" label="当前中转" width="80">
  69. </el-table-column>
  70. <el-table-column prop="carLength" label="终点" width="80">
  71. </el-table-column>
  72. <el-table-column prop="carLength" label="状态" width="80">
  73. </el-table-column>
  74. <el-table-column prop="address" label="操作" width="200">
  75. <ws-button
  76. type="primary"
  77. @click="look()"
  78. v-hasPermission="
  79. `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
  80. "
  81. >查看</ws-button
  82. >
  83. <ws-button
  84. type="primary"
  85. @click="edit()"
  86. v-hasPermission="
  87. `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
  88. "
  89. >编辑</ws-button
  90. >
  91. <ws-button
  92. type="primary"
  93. @click="deletes()"
  94. v-hasPermission="
  95. `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
  96. "
  97. >删除</ws-button
  98. >
  99. <!-- </template> -->
  100. </el-table-column>
  101. </el-table>
  102. <el-pagination
  103. @size-change="handleSizeChange"
  104. @current-change="handleCurrentChange"
  105. :current-page="currentPage"
  106. :page-size="deptCircularPage.pageSize"
  107. layout="total, sizes, prev, pager, next, jumper"
  108. :total="deptBudgetTotal"
  109. >
  110. </el-pagination>
  111. </div>
  112. </div>
  113. </template>
  114. <script>
  115. import { selectDriver, billoperatehis } from '@/model/transport/index'
  116. import Pagination from '@/components/Pagination'
  117. // provinceAndCityData省市二级
  118. import { provinceAndCityData, CodeToText } from 'element-china-area-data'
  119. import WsUpload from '@/components/WsUpload'
  120. import { dayjs, fmoney, EventBus } from 'base-core-lib'
  121. export default {
  122. name: 'viewSpareMoney',
  123. components: {
  124. WsUpload,
  125. Pagination,
  126. },
  127. watch: {
  128. vesselId(val) {
  129. this.getList()
  130. },
  131. isShow(val) {
  132. this.showType = val
  133. },
  134. },
  135. data() {
  136. return {
  137. //弹出框
  138. dialogViewSpareMoney: false,
  139. dialogApproveFormVisible: false,
  140. options_: provinceAndCityData,
  141. // 表格显示数据
  142. tableDate: [],
  143. // 是否显示
  144. showType: true,
  145. // 年
  146. year: '',
  147. deptBudgetTotal: 0,
  148. currentPage: 1,
  149. pageSize: 10,
  150. searchType: 1,
  151. searchKeyWord: '',
  152. contractType: 2,
  153. startDate: null,
  154. endDate: null,
  155. searchTypeText: '',
  156. // 提交类型
  157. submitType: true,
  158. size: 10,
  159. spanArr: [],
  160. compId: sessionStorage.getItem('ws-pf_compId'),
  161. deptCircularPage: {},
  162. date: {
  163. year: dayjs().format('YYYY'),
  164. month: dayjs().format('MM'),
  165. },
  166. driverList: [],
  167. deptBudgetList: {},
  168. historyList: [],
  169. pickerBeginDateBefore: {
  170. disabledDate: (time) => {
  171. return time.getTime() > Date.now()
  172. },
  173. },
  174. accessoryTFs: false,
  175. }
  176. },
  177. activated() {
  178. this.getList()
  179. this.showType = this.isShow
  180. },
  181. methods: {
  182. //查找
  183. handleLook() {
  184. this.currentPage = 1
  185. this.getList()
  186. },
  187. //添加
  188. handleAdd() {
  189. this.$router.push({ path: 'tranManagementDriverAdd' })
  190. },
  191. //编辑
  192. handleEdit() {
  193. this.$router.push({ path: 'warehouseManagementEdit' })
  194. },
  195. handleDelete() {
  196. this.$router.push({ path: 'warehouseManagementDelete' })
  197. },
  198. dateFormat(fmt, date) {
  199. let ret
  200. const opt = {
  201. 'Y+': date.getFullYear().toString(), // 年
  202. 'm+': (date.getMonth() + 1).toString(), // 月
  203. 'd+': date.getDate().toString(), // 日
  204. 'H+': date.getHours().toString(), // 时
  205. // "M+": date.getMinutes().toString(), // 分
  206. // "S+": date.getSeconds().toString() // 秒
  207. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  208. }
  209. for (let k in opt) {
  210. ret = new RegExp('(' + k + ')').exec(fmt)
  211. if (ret) {
  212. fmt = fmt.replace(
  213. ret[1],
  214. ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
  215. )
  216. }
  217. }
  218. return fmt
  219. },
  220. handleClose() {
  221. this.accessoryTFs = false
  222. },
  223. handleSizeChange(val) {
  224. console.log(`每页 ${val} 条`)
  225. this.pageSize = val
  226. this.getList()
  227. },
  228. handleCurrentChange(val) {
  229. this.currentPage = val
  230. console.log(`当前页: ${val}`)
  231. this.getList()
  232. },
  233. getList() {
  234. selectDriver({
  235. compId: sessionStorage.getItem('ws-pf_compId'),
  236. currentPage: this.currentPage,
  237. pageSize: this.pageSize,
  238. searchType: this.searchType,
  239. searchKeyWord: this.searchKeyWord,
  240. })
  241. .toPromise()
  242. .then((response) => {
  243. this.deptCircularPage.currentPage = response.current
  244. this.deptCircularPage.pageSize = response.size
  245. this.deptBudgetTotal = response.total
  246. this.driverList = response
  247. })
  248. },
  249. editClick(row) {
  250. var status = ''
  251. if (row.status == '待执行' || row.status == '已完成') {
  252. status = '执行中'
  253. } else if (row.status == '执行中') {
  254. status = '已完成'
  255. }
  256. //cancelButtonClass: "btn-custom-cancel"
  257. this.$confirm(`是否将状态改为${status}`, {
  258. confirmButtonText: '确定',
  259. cancelButtonText: '取消',
  260. type: 'warning',
  261. })
  262. .then(() => {
  263. editstatus({ id: row.id })
  264. .toPromise()
  265. .then((response) => {
  266. this.$notify.success({
  267. title: '成功',
  268. message: '状态修改成功',
  269. })
  270. this.getList()
  271. })
  272. .catch((response) => {
  273. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  274. })
  275. })
  276. .catch(() => {
  277. return false
  278. })
  279. },
  280. selecttaskType(e) {
  281. this.selectedOptions = e
  282. },
  283. fujian(row) {
  284. if (
  285. row.receiveAttachmentPath === null ||
  286. row.receiveAttachmentPath === ''
  287. ) {
  288. EventBus.$emit(
  289. 'warning',
  290. this.$t('system.noticeCircular.NoInformation')
  291. )
  292. } else {
  293. this.accessoryTFs = true
  294. }
  295. this.appendixIdss = row.receiveAttachmentPath
  296. },
  297. handleExamine(row) {
  298. this.$router.push({
  299. name: 'salesContractExamine',
  300. query: { id: row.id },
  301. })
  302. },
  303. // 关闭 dialog时 处理文件url 初始化upload组件
  304. handleCloe() {
  305. this.dialogViewSpareMoney = false
  306. },
  307. history(row) {
  308. console.log(row)
  309. billoperatehis({ id: row.id })
  310. .toPromise()
  311. .then((response) => {
  312. this.historyList = response
  313. })
  314. },
  315. find() {
  316. this.startDate = this.dateFormat('YYYY-mm-dd', this.value2[0])
  317. this.endDate = this.dateFormat('YYYY-mm-dd', this.value2[1])
  318. this.currentPage = 1
  319. this.getList()
  320. },
  321. },
  322. }
  323. </script>
  324. <style lang="scss" scoped>
  325. .connert {
  326. width: 90%;
  327. margin: 0 auto;
  328. }
  329. .vertical-text-left {
  330. width: 62px;
  331. text-align: right;
  332. }
  333. .findValue {
  334. margin: 0 10px;
  335. }
  336. </style>