materialAppNum.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422
  1. <template>
  2. <fullscreen :fullscreen.sync="fullscreen" class="container">
  3. <div class="container-box">
  4. <toolList @iconCli="iconCli" :tooltit="tooltit"></toolList>
  5. <div class="search">
  6. <mySearch :searchList="searchList" @searchInfo="searchInfo"></mySearch>
  7. <el-button class="btn-check" size="medium" type="primary" @click="exportTempletelist">导出验收单
  8. </el-button>
  9. </div>
  10. <div class="tabbox">
  11. <el-table height="calc(100% - 40px)" class="com-table" ref="multipleTable" :data="tableData"
  12. tooltip-effect="dark" size="small" border style="width: 100%" @selection-change="selectionChange"
  13. v-loading="loading">
  14. <el-table-column type="selection" width="55">
  15. </el-table-column>
  16. <el-table-column prop="region" label="城市">
  17. </el-table-column>
  18. <el-table-column prop="district" label="区县">
  19. </el-table-column>
  20. <el-table-column prop="needName" label="业务名称">
  21. </el-table-column>
  22. <el-table-column prop="state" label="需求编号">
  23. </el-table-column>
  24. <el-table-column prop="materialNo" label="物料编码">
  25. </el-table-column>
  26. <el-table-column prop="material" label="物料名称">
  27. </el-table-column>
  28. <el-table-column prop="unit" label="物料单位">
  29. </el-table-column>
  30. <el-table-column prop="spec" label="规格尺寸">
  31. </el-table-column>
  32. <el-table-column prop="quantity" label="数量">
  33. </el-table-column>
  34. <el-table-column prop="districtScore" label="区县验收打分">
  35. </el-table-column>
  36. </el-table>
  37. <el-pagination class="pageBox" @current-change="currchange" layout="prev, pager, next" background
  38. :total="total">
  39. </el-pagination>
  40. </div>
  41. </div>
  42. </fullscreen>
  43. </template>
  44. <script>
  45. import { log } from "console";
  46. import mySearch from "../../../components/search.vue";
  47. import toolList from "../../../components/toolList";
  48. export default {
  49. components: {
  50. mySearch,
  51. toolList,
  52. },
  53. data() {
  54. return {
  55. exportList:[],
  56. searchList: [
  57. { type: "input", tit: "供应商", value: "", width: "31%" },
  58. { type: "input", tit: "城市名称", value: "", width: "31%" },
  59. { type: "input", tit: "区县名称", value: "", width: "31%" },
  60. { type: "input", tit: "物料编码", value: "", width: "31%" }
  61. ],
  62. tooltit: "宣传物料制作验收及打分",
  63. fullscreen: false,
  64. total: 0,
  65. pageSize: 1,
  66. tableData: [],
  67. dialogStatus: false,
  68. disableStatus: false,
  69. titname: "",
  70. infolist: {},
  71. userInfo: {},
  72. params: {},
  73. centerDialogVisible: false,
  74. messTit: "",
  75. delid: "",
  76. loading: false,
  77. loadinged: false,
  78. //使用场景
  79. sceneopt: [
  80. {
  81. dataCode: "1",
  82. dataName: "小区"
  83. },
  84. {
  85. dataCode: "2",
  86. dataName: "校园"
  87. },
  88. {
  89. dataCode: "3",
  90. dataName: "营业厅-VI改造-自有渠道"
  91. },
  92. {
  93. dataCode: "4",
  94. dataName: "营业厅-常规物料-自有渠道"
  95. },
  96. {
  97. dataCode: "5",
  98. dataName: '营业厅-VI改造-合作渠道'
  99. },
  100. {
  101. dataCode: "6",
  102. dataName: '营业厅-常规物料-合作渠道'
  103. },
  104. {
  105. dataCode: "7",
  106. dataName: "政企"
  107. }
  108. ],
  109. // 基础数据
  110. isAsicopt: [
  111. {
  112. id: "0",
  113. name: "是"
  114. },
  115. {
  116. id: "1",
  117. name: "否"
  118. }
  119. ],
  120. coefficientopt: [
  121. {
  122. id: "0",
  123. name: "按需录入"
  124. },
  125. {
  126. id: "1",
  127. name: "1"
  128. }
  129. ],
  130. //单位
  131. unitopt: [
  132. {
  133. id: "0",
  134. name: "平方米"
  135. },
  136. {
  137. id: "1",
  138. name: "个"
  139. },
  140. {
  141. id: "2",
  142. name: "延长米"
  143. },
  144. {
  145. id: "3",
  146. name: "套"
  147. },
  148. {
  149. id: "4",
  150. name: "组"
  151. }, {
  152. id: "5",
  153. name: "延米"
  154. }, {
  155. id: '6',
  156. name: '张'
  157. }
  158. ],
  159. //物料名称
  160. nameopt: [],
  161. //供应商
  162. suppOpt: [],
  163. usePlanceArr: [],
  164. metirialTypeopt: [],
  165. metirialCodeDisableStatus: false,
  166. // scene:[]
  167. };
  168. },
  169. methods: {
  170. selectionChange(val){
  171. this.exportList = val;
  172. },
  173. exportTempletelist() {
  174. if(this.exportList.length==0){
  175. this.$message.error('请选择导出文件')
  176. return
  177. }
  178. // return
  179. this.$http({
  180. url: "/market/xcwlProcess/excelExportDistrictScore",
  181. method: "post",
  182. headers: {
  183. "Content-Type": "application/json",
  184. },
  185. responseType: "blob",
  186. data: this.exportList,
  187. }).then((response) => {
  188. if (window.navigator && window.navigator.msSaveOrOpenBlob) {
  189. let blob = new Blob([response.data], {
  190. type: 'application/vnd.ms-excel'
  191. })
  192. window.navigator.msSaveOrOpenBlob(blob,
  193. new Date().getTime() + '.xlsx')
  194. } else {
  195. /* 火狐谷歌的文件下载方式 */
  196. var blob = new Blob([response.data])
  197. var downloadElement = document.createElement('a')
  198. var href = window.URL.createObjectURL(blob)
  199. downloadElement.href = href
  200. downloadElement.download = new Date().getTime() + '.xlsx'
  201. document.body.appendChild(downloadElement)
  202. downloadElement.click()
  203. document.body.removeChild(downloadElement)
  204. window.URL.revokeObjectURL(href)
  205. }
  206. });
  207. },
  208. usePlance(v) {
  209. this.usePlanceArr = v;
  210. },
  211. closedia() {
  212. this.infolist = {};
  213. this.dialogStatus = false;
  214. },
  215. //搜索数据
  216. searchInfo(v) {
  217. this.params = {};
  218. v[0] ? (this.params.selectedGys = v[0]) : "";
  219. v[1] ? (this.params.region = v[1]) : "";
  220. v[2] ? (this.params.district = v[2]) : "";
  221. v[3] ? (this.params.materialNo = v[3]) : "";
  222. this.getList(this.params, this.pageSize);
  223. },
  224. uploadBack(v) {
  225. let that = this;
  226. console.log(v);
  227. if (v.data.result == 0) {
  228. that.getList({}, 1);
  229. that.getUser();
  230. that.getMetirialType();
  231. that.getMetirialInfo();
  232. }
  233. },
  234. getMetirialInfo() {
  235. this.$http({
  236. url: "/market/cadvSecbuyMetirial/queryList",
  237. method: "post",
  238. headers: {
  239. "Content-Type": "application/json"
  240. },
  241. data: {
  242. dictCodePks: "metirialType"
  243. }
  244. }).then(res => {
  245. this.materialNameopt = res.data;
  246. });
  247. },
  248. getMetirialType() {
  249. this.$http({
  250. url: "/sysmgr/cfgDataDicts/queryMap",
  251. method: "post",
  252. headers: {
  253. "Content-Type": "application/json"
  254. },
  255. data: {
  256. dictCodePks: "metirialType"
  257. }
  258. }).then(res => {
  259. this.metirialTypeopt = res.data.body.metirialType;
  260. });
  261. },
  262. //获取列表
  263. getList(v, n) {
  264. this.pageSize = n;
  265. let _this = this;
  266. this.loading = true;
  267. this.tableData = [];
  268. this.$http({
  269. url: "/market/xcwlProcess/queryDonePage",
  270. method: "post",
  271. headers: {
  272. "Content-Type": "application/json",
  273. page: '{"pageNo":"' + n + '","pageSize":"10"}'
  274. },
  275. data: v
  276. }).then(res => {
  277. res.data.data.forEach(item => {
  278. for (let i = 0; i < this.sceneopt.length; i++) {
  279. if (this.sceneopt[i].dataCode == item.sceneName) {
  280. item.sceneName = this.sceneopt[i].dataName;
  281. }
  282. }
  283. });
  284. this.tableData = res.data.data;
  285. console.log(this.tableData);
  286. this.total = res.data.totalRecord;
  287. this.loading = false;
  288. });
  289. },
  290. // 分页
  291. currchange(v) {
  292. this.pageSize = v;
  293. this.getList(this.params, this.pageSize);
  294. },
  295. //功能栏
  296. iconCli(v) {
  297. if (v === 1) {
  298. this.getList(this.params, this.pageSize);
  299. }
  300. if (v === 2) {
  301. this.fullscreen = !this.fullscreen;
  302. }
  303. },
  304. getUser() {
  305. this.userInfo = JSON.parse(window.sessionStorage.userInfo);
  306. this.$http({
  307. url: "/market/cadvSupplier/queryValidSupplierList",
  308. method: "post",
  309. headers: {
  310. "Content-Type": "application/json"
  311. },
  312. // data: { buyTypeCode: "2" }
  313. data: {}
  314. }).then(res => {
  315. this.suppOpt = res.data;
  316. });
  317. },
  318. handleSelectionChange() {
  319. }
  320. },
  321. mounted() {
  322. this.getList({}, 1);
  323. this.getUser();
  324. this.$http({
  325. url: "/sysmgr/cfgDataDicts/queryMap",
  326. method: "post",
  327. headers: {
  328. "Content-Type": "application/json"
  329. },
  330. data: {
  331. dictCodePks: "metirialType"
  332. }
  333. }).then(res => {
  334. this.metirialTypeopt = res.data.body.metirialType;
  335. // this.stypeList = res.data.body.materType;
  336. });
  337. },
  338. created() { }
  339. };
  340. </script>
  341. <style scoped lang="scss">
  342. .onetab {
  343. margin-bottom: 20px;
  344. padding: 0 20px;
  345. }
  346. .titbox {
  347. div {
  348. float: right;
  349. i {
  350. font-size: 22px;
  351. margin-left: 20px;
  352. cursor: pointer;
  353. }
  354. }
  355. }
  356. .tabbox {
  357. margin-top: 15px;
  358. }
  359. .pageBox {
  360. text-align: right;
  361. margin-top: 10px;
  362. }
  363. .info-line {
  364. width: 100%;
  365. display: block;
  366. padding-left: 20px;
  367. div {
  368. width: 50%;
  369. display: inline-block;
  370. }
  371. span {
  372. width: 80px;
  373. display: inline-block;
  374. text-align: left;
  375. i {
  376. color: red;
  377. display: inline-block;
  378. padding-right: 5px;
  379. }
  380. }
  381. .el-select,
  382. .el-input {
  383. width: calc(100% - 100px);
  384. }
  385. }
  386. .online {
  387. width: 100%;
  388. .el-select {
  389. width: calc(100% - 100px);
  390. }
  391. span {
  392. vertical-align: top;
  393. }
  394. .el-textarea {
  395. width: calc(100% - 100px);
  396. }
  397. }
  398. </style>