materialAppNum.vue 12 KB

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