You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

500 lines
15 KiB

11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
  1. <template>
  2. <div class="mod-config">
  3. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
  4. <el-form-item :label="'BU:'">
  5. <el-select v-model="searchData.buNo" placeholder="请选择" >
  6. <el-option label="全部" value=""></el-option>
  7. <el-option
  8. v-for = "i in buList"
  9. :key = "i.buNo"
  10. :label = "i.buDesc"
  11. :value = "i.buNo">
  12. </el-option>
  13. </el-select>
  14. </el-form-item>
  15. <el-form-item :label="'HS Code:'">
  16. <el-input v-model="searchData.hsCode" style="width: 120px"></el-input>
  17. </el-form-item>
  18. <el-form-item :label="' '" >
  19. <el-button @click="searchTable()" type="primary" style="margin-left: 2px;margin-top: 0px">{{'查询'}}</el-button>
  20. <el-button @click="addModelOpen()" type="primary" style="margin-left: 2px;margin-top: 0px">{{'新增'}}</el-button>
  21. </el-form-item>
  22. </el-form>
  23. <el-table
  24. @row-click="changeData"
  25. highlight-current-row
  26. :height="height"
  27. :data="dataList"
  28. ref="mainTable"
  29. border
  30. v-loading="dataListLoading"
  31. style="width: 100%;">
  32. <el-table-column
  33. header-align="center"
  34. align="center"
  35. width="100"
  36. fixed="left"
  37. label="操作">
  38. <template slot-scope="scope">
  39. <a type="text" size="small" @click="updateModelOpen(scope.row)">编辑</a>
  40. <a type="text" size="small" @click="deleteHsCode(scope.row)">删除</a>
  41. </template>
  42. </el-table-column>
  43. <el-table-column
  44. v-for="(item,index) in columnList1" :key="index"
  45. :sortable="item.columnSortable"
  46. :prop="item.columnProp"
  47. :header-align="item.headerAlign"
  48. :show-overflow-tooltip="item.showOverflowTooltip"
  49. :align="item.align"
  50. :fixed="item.fixed==''?false:item.fixed"
  51. :min-width="item.columnWidth"
  52. :label="item.columnLabel">
  53. <template slot-scope="scope">
  54. <span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
  55. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  56. style="width: 100px; height: 80px"/></span>
  57. </template>
  58. </el-table-column>
  59. </el-table>
  60. <el-pagination
  61. @size-change="sizeChangeHandle"
  62. @current-change="currentChangeHandle"
  63. :current-page="pageIndex"
  64. :page-sizes="[20, 50, 100, 1000]"
  65. :page-size="pageSize"
  66. :total="totalPage"
  67. layout="total, sizes, prev, pager, next, jumper">
  68. </el-pagination>
  69. <el-tabs style="font-size: 12px;min-height: 200px" class="customer-tab" v-model="activeName" type="border-card" @tab-click="tabClick" >
  70. <el-tab-pane label="基本信息" name="attribute">
  71. <order-attribute ref="dialogAttribute" :site="currentRow.site" :buNo="currentRow.buNo" :order-no="currentRow.hsCode" :code-no="currentRow.codeNo" :function-type="'ECSS'"></order-attribute>
  72. </el-tab-pane>
  73. </el-tabs>
  74. <el-dialog title="维护HSCode" :close-on-click-modal="false" v-drag :visible.sync="addModelFlag" width="500px">
  75. <el-form label-position="top" style="margin-left: 7px;margin-top: -5px;">
  76. <el-row :gutter="20">
  77. <el-col :span="8">
  78. <el-form-item :label="'BU:'">
  79. <el-select v-model="addModel.buNo" placeholder="请选择" :disabled="addModel.addFlag!==0" style="width: 100%">
  80. <el-option
  81. v-for = "i in buList"
  82. :key = "i.buNo"
  83. :label = "i.buDesc"
  84. :value = "i.buNo">
  85. </el-option>
  86. </el-select>
  87. </el-form-item>
  88. </el-col>
  89. <el-col :span="8">
  90. <el-form-item :label="'HS Code'" >
  91. <el-input v-model="addModel.hsCode" :disabled="addModel.addFlag!==0" ></el-input>
  92. </el-form-item>
  93. </el-col>
  94. <el-col :span="8">
  95. <el-form-item >
  96. <span slot="label" @click="getBaseList(33)"><a herf="#">属性模板</a></span>
  97. <el-input v-model="addModel.codeNo" ></el-input>
  98. </el-form-item>
  99. </el-col>
  100. </el-row>
  101. <el-row :gutter="20">
  102. <el-col :span="24">
  103. <el-form-item :label="'备注'" >
  104. <el-input v-model="addModel.remark" ></el-input>
  105. </el-form-item>
  106. </el-col>
  107. </el-row>
  108. </el-form>
  109. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  110. <el-button type="primary" @click="saveHSCode()">保存</el-button>
  111. <el-button type="primary" @click="addModelFlag=false">关闭</el-button>
  112. </el-footer>
  113. </el-dialog>
  114. <!--列表的组件-->
  115. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  116. </div>
  117. </template>
  118. <script>
  119. import Chooselist from '@/views/modules/common/Chooselist_eam'
  120. import orderAttribute from "./orderProperties"
  121. import {} from "@/api/sysLanguage.js"
  122. import {
  123. searchHsCodeData,
  124. saveHSCodeData,
  125. deleteHsCode,
  126. }from "@/api/ecss/ecss.js"
  127. import {getAllBuList}from '@/api/factory/site.js'
  128. export default {
  129. name: "null",
  130. components:{
  131. orderAttribute,
  132. Chooselist,
  133. },
  134. data() {
  135. return {
  136. pageIndex: 1,
  137. pageSize: 100,
  138. totalPage: 0,
  139. height: 200,
  140. buList:[],
  141. dataList:[],
  142. dataList2:[],
  143. dataListLoading: false,
  144. searchData: {
  145. page: 1,
  146. limit: 100,
  147. buNo:'',
  148. hsCode:'',
  149. codeNo:'',
  150. username:this.$store.state.user.name,
  151. },
  152. buttons:{
  153. search:'查询',
  154. },
  155. addModelFlag:false,
  156. addModel:{
  157. addFlag:0,
  158. site:'',
  159. buNo:'',
  160. hsCode:'',
  161. codeNo:'',
  162. remark:'',
  163. },
  164. addDisabledFlag:true,
  165. activeName:'attribute',
  166. columnList1: [
  167. {
  168. userId: this.$store.state.user.name,
  169. functionId: 801003,
  170. serialNumber: '801003Table1BuDesc',
  171. tableId: "801003Table1",
  172. tableName: "HsCode基础信息",
  173. columnProp: "buDesc",
  174. headerAlign: "center",
  175. align: "left",
  176. columnLabel: "BU",
  177. columnHidden: false,
  178. columnImage: false,
  179. columnSortable: false,
  180. sortLv: 0,
  181. status: true,
  182. fixed: '',
  183. columnWidth: 80
  184. },
  185. {
  186. userId: this.$store.state.user.name,
  187. functionId: 801003,
  188. serialNumber: '801003Table1HsCode',
  189. tableId: "801003Table1",
  190. tableName: "HsCode基础信息",
  191. columnProp: "hsCode",
  192. headerAlign: "center",
  193. align: "left",
  194. columnLabel: "HS Code",
  195. columnHidden: false,
  196. columnImage: false,
  197. columnSortable: false,
  198. sortLv: 0,
  199. status: true,
  200. fixed: '',
  201. columnWidth: 100
  202. },
  203. {
  204. userId: this.$store.state.user.name,
  205. functionId: 801003,
  206. serialNumber: '801003Table1CodeNo',
  207. tableId: "801003Table1",
  208. tableName: "HsCode基础信息",
  209. columnProp: "codeNo",
  210. headerAlign: "center",
  211. align: "center",
  212. columnLabel: "模板编码",
  213. columnHidden: false,
  214. columnImage: false,
  215. columnSortable: false,
  216. sortLv: 0,
  217. status: true,
  218. fixed: '',
  219. columnWidth: 100
  220. },
  221. {
  222. userId: this.$store.state.user.name,
  223. functionId: 801003,
  224. serialNumber: '801003Table1CreateBy',
  225. tableId: "801003Table1",
  226. tableName: "HsCode基础信息",
  227. columnProp: "createBy",
  228. headerAlign: "center",
  229. align: "center",
  230. columnLabel: "创建人",
  231. columnHidden: false,
  232. columnImage: false,
  233. columnSortable: false,
  234. sortLv: 0,
  235. status: true,
  236. fixed: '',
  237. columnWidth: 100
  238. },
  239. {
  240. userId: this.$store.state.user.name,
  241. functionId: 801003,
  242. serialNumber: '801003Table1CreateDate',
  243. tableId: "801003Table1",
  244. tableName: "HsCode基础信息",
  245. columnProp: "createDate",
  246. headerAlign: "center",
  247. align: "center",
  248. columnLabel: "创建日期",
  249. columnHidden: false,
  250. columnImage: false,
  251. columnSortable: false,
  252. sortLv: 0,
  253. status: true,
  254. fixed: '',
  255. columnWidth: 120
  256. },
  257. {
  258. userId: this.$store.state.user.name,
  259. functionId: 801003,
  260. serialNumber: '801003Table1UpdateBy',
  261. tableId: "801003Table1",
  262. tableName: "HsCode基础信息",
  263. columnProp: "updateBy",
  264. headerAlign: "center",
  265. align: "left",
  266. columnLabel: "修改人",
  267. columnHidden: false,
  268. columnImage: false,
  269. columnSortable: false,
  270. sortLv: 0,
  271. status: true,
  272. fixed: '',
  273. columnWidth: 100
  274. },
  275. {
  276. userId: this.$store.state.user.name,
  277. functionId: 801003,
  278. serialNumber: '801003Table1UpdateDate',
  279. tableId: "801003Table1",
  280. tableName: "HsCode基础信息",
  281. columnProp: "updateDate",
  282. headerAlign: "center",
  283. align: "center",
  284. columnLabel: "修改日期",
  285. columnHidden: false,
  286. columnImage: false,
  287. columnSortable: false,
  288. sortLv: 0,
  289. status: true,
  290. fixed: '',
  291. columnWidth: 100
  292. },
  293. {
  294. userId: this.$store.state.user.name,
  295. functionId: 801003,
  296. serialNumber: '801003Table1Remark',
  297. tableId: "801003Table1",
  298. tableName: "HsCode基础信息",
  299. columnProp: "remark",
  300. headerAlign: "center",
  301. align: "left",
  302. columnLabel: "备注",
  303. columnHidden: false,
  304. columnImage: false,
  305. columnSortable: false,
  306. sortLv: 0,
  307. status: true,
  308. fixed: '',
  309. columnWidth: 300
  310. },
  311. ],
  312. currentRow:{},
  313. }
  314. },
  315. mounted() {
  316. this.$nextTick(() => {
  317. this.height = (window.innerHeight - 240)/2;
  318. })
  319. },
  320. methods: {
  321. // 获取基础数据列表S
  322. getBaseList(val, type) {
  323. this.tagNo = val
  324. this.$nextTick(() => {
  325. let strVal = ''
  326. if (val === 33) {
  327. strVal = this.addModel.codeNo
  328. }
  329. this.$refs.baseList.init(val, strVal)
  330. })
  331. },
  332. /* 列表方法的回调 */
  333. getBaseData(val) {
  334. if (this.tagNo === 33) {
  335. this.addModel.codeNo = val.Code_No
  336. }
  337. },
  338. // 每页数
  339. sizeChangeHandle (val) {
  340. this.pageSize = val
  341. this.pageIndex = 1
  342. this.searchTable()
  343. },
  344. // 当前页
  345. currentChangeHandle (val) {
  346. this.pageIndex = val
  347. this.searchTable()
  348. },
  349. searchTable(){
  350. this.searchData.limit = this.pageSize
  351. this.searchData.page = this.pageIndex
  352. searchHsCodeData(this.searchData).then(({data}) => {
  353. //区分请求成功和失败的状况
  354. if (data && data.code == 0) {
  355. this.dataList = data.page.list
  356. this.pageIndex = data.page.currPage
  357. this.pageSize = data.page.pageSize
  358. this.totalPage = data.page.totalCount
  359. if(this.dataList.length>0){
  360. this.$refs.mainTable.setCurrentRow(this.dataList[0]);
  361. this.changeData(this.dataList[0])
  362. }else {
  363. this.changeData(null)
  364. }
  365. } else {
  366. this.dataList = [];
  367. }
  368. });
  369. },
  370. changeData(row){
  371. this.currentRow = JSON.parse(JSON.stringify(row));
  372. this.headerData=row;
  373. this.refreshCurrentTabTable ();
  374. },
  375. refreshCurrentTabTable(){
  376. if(this.currentRow===''||this.currentRow===null){
  377. this.currentRow={site:'',hsCode:'',buNo:'',recordType:'',codeNo:''}
  378. }
  379. if(this.activeName==='detail'){
  380. // searchEcssCoDelNotifyDetail(this.currentRow).then(({data}) => {
  381. // //区分请求成功和失败的状况
  382. // if (data && data.code == 0) {
  383. // this.dataList2 = data.rows
  384. //
  385. // } else {
  386. // this.dataList2 = [];
  387. // }
  388. // });
  389. }
  390. },
  391. tabClick (tab, event) {
  392. // 刷新列表数据
  393. this.refreshCurrentTabTable()
  394. },
  395. getBu () {
  396. let tempData = {
  397. username: this.$store.state.user.name,
  398. }
  399. getAllBuList(tempData).then(({data}) => {
  400. if (data.code === 0) {
  401. this.buList = data.rows
  402. }
  403. })
  404. },
  405. addModelOpen(){
  406. this.addDisabledFlag=true
  407. this.addModel={
  408. addFlag:0,
  409. site:'',
  410. buNo:'',
  411. hsCode:'',
  412. codeNo:'',
  413. remark:'',
  414. }
  415. this.addModelFlag=true
  416. },
  417. updateModelOpen(row){
  418. this.addDisabledFlag=false
  419. this.addModel={
  420. addFlag:1,
  421. site:row.site,
  422. buNo:row.buNo,
  423. hsCode:row.hsCode,
  424. codeNo:row.codeNo,
  425. remark:row.remark,
  426. }
  427. this.addModelFlag=true
  428. },
  429. deleteHsCode(row){
  430. this.$confirm('确认删除?', '提示').then(() => {
  431. deleteHsCode(row).then(({data}) => {
  432. if (data && data.code === 0) {
  433. this.searchTable()
  434. this.$message({
  435. message: '操作成功',
  436. type: 'success',
  437. duration: 1500,
  438. onClose: () => {}
  439. })
  440. } else {
  441. this.$alert(data.msg, '错误', {
  442. confirmButtonText: '确定'
  443. })
  444. }
  445. })
  446. })
  447. },
  448. saveHSCode(){
  449. if(this.addModel.buNo==null||this.addModel.buNo===''){
  450. this.$alert('请选择BU!', '错误', {
  451. confirmButtonText: '确定'
  452. })
  453. return false
  454. }
  455. if(this.addModel.hsCode==null||this.addModel.hsCode===''){
  456. this.$alert('请输入HSCode!', '错误', {
  457. confirmButtonText: '确定'
  458. })
  459. return false
  460. }
  461. if(this.addModel.codeNo==null||this.addModel.codeNo===''){
  462. this.$alert('请选择属性模板!', '错误', {
  463. confirmButtonText: '确定'
  464. })
  465. return false
  466. }
  467. saveHSCodeData(this.addModel).then(({data}) => {
  468. if (data && data.code === 0) {
  469. this.searchTable()
  470. this.addModelFlag = false
  471. this.$message({
  472. message: '操作成功',
  473. type: 'success',
  474. duration: 1500,
  475. onClose: () => {}
  476. })
  477. } else {
  478. this.$alert(data.msg, '错误', {
  479. confirmButtonText: '确定'
  480. })
  481. }
  482. })
  483. },
  484. },
  485. created() {
  486. this.getBu ()
  487. }
  488. }
  489. </script>
  490. <style scoped>
  491. </style>