plan.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409
  1. <template>
  2. <div>
  3. <!-- 页面主体内容 -->
  4. <div class="planAddContent" v-show="contentShow">
  5. <Card style="width:100%" :bordered="false" :dis-hover="true">
  6. <p slot="title">申购计划详情</p>
  7. <Row class="mainCont">
  8. <Col span="4" class-name="tables">计划单据号</Col>
  9. <Col span="4" class-name="tables">{{ form.jhdjh }}</Col>
  10. <Col span="4" class-name="tables">
  11. 所属区域
  12. <span class="mustSpan">*</span>
  13. </Col>
  14. <Col span="4" class-name="tables">{{ form.ssqy }}</Col>
  15. <Col span="4" class-name="tables">
  16. 所属项目
  17. <span class="mustSpan">*</span>
  18. </Col>
  19. <Col span="4" class-name="tables">{{ form.ssxm }}</Col>
  20. <Col span="4" class-name="tables">标题</Col>
  21. <Col span="4" class-name="tables">{{ form.bt }}</Col>
  22. <Col span="4" class-name="tables">参考总价(元)</Col>
  23. <Col span="4" class-name="tables">{{ form.totalPrice }}</Col>
  24. <Col span="4" class-name="tables">
  25. 计划类型
  26. <span class="mustSpan">*</span>
  27. </Col>
  28. <Col
  29. span="4"
  30. class-name="tables"
  31. >{{ form.jhlx == "" ? "" : jhlxList.filter(a => a.value == form.jhlx)[0].label }}</Col>
  32. <Col span="4" class-name="tables">
  33. 计划月份
  34. <span class="mustSpan">*</span>
  35. </Col>
  36. <Col span="4" class-name="tables">{{ form.date }}</Col>
  37. <Col span="4" class-name="tables">分管采购员</Col>
  38. <Col span="4" class-name="tables">{{ form.fgcgy }}</Col>
  39. <Col span="4" class-name="tables">申请人</Col>
  40. <Col span="4" class-name="tables">
  41. <span>{{ form.sqr }}</span>
  42. </Col>
  43. <Col span="4" class-name="tables">审批状态</Col>
  44. <Col span="4" class-name="tables">
  45. <span v-if="form.spzt == '0'">未发起</span>
  46. <span v-if="form.spzt == '1'">审批中</span>
  47. <span v-if="form.spzt == '2'">审批通过</span>
  48. <span v-if="form.spzt == '3'">审批不通过</span>
  49. <span v-if="form.spzt == '4'">审批驳回</span>
  50. </Col>
  51. <Col span="4" class-name="tables"></Col>
  52. <Col span="4" class-name="tables"></Col>
  53. <Col span="4" class-name="tables"></Col>
  54. <Col span="4" class-name="tables"></Col>
  55. </Row>
  56. <Row class="uplCont" type="flex" justify="center" style="align-items: stretch">
  57. <Col span="4" class-name="upl">附件</Col>
  58. <Col span="20" class="upl" style="padding: 5px">
  59. <div v-for="(item, index) in form.filesList" :key="index">
  60. <a :href="item.filePath" :download="item.fileName" target="_blank">{{ item.fileName }}</a>
  61. </div>
  62. <p v-if="uploading" style="text-align: center">上传中...</p>
  63. </Col>
  64. </Row>
  65. <Row class="mainCont">
  66. <Col span="4" class-name="tables">说明</Col>
  67. <Col span="20" class-name="tables">{{ form.sm }}</Col>
  68. </Row>
  69. <Spin size="large" fix v-if="spinShow"></Spin>
  70. </Card>
  71. <Card style="width:100%" :bordered="false" :dis-hover="true">
  72. <p slot="title">申购计划明细</p>
  73. <Table :columns="tableColumn" style="width: 100%" :data="tableData" :loading="tableLoading">
  74. <template slot-scope="{ row, index }" slot="amount">
  75. <div>{{ row.amount }}</div>
  76. </template>
  77. <template slot-scope="{ row, index }" slot="storehouseId">{{ row.storehouseName }}</template>
  78. <template slot-scope="{ row, index }" slot="linkedPersonName">
  79. <span>{{ row.linkedPersonName }}</span>
  80. </template>
  81. <template slot-scope="{ row, index }" slot="billType">{{ row.billTypeName }}</template>
  82. <template slot-scope="{ row, index }" slot="referenceTotalPrice">
  83. <span>{{ row.amount * row.referencePrice }}</span>
  84. </template>
  85. <template slot-scope="{ row, index }" slot="arriveTime">{{ row.arriveTime }}</template>
  86. <!-- @on-change="((val, date) => tableDateChange(val, date ,index))" -->
  87. <template slot-scope="{ row, index }" slot="remark">{{ row.remark }}</template>
  88. </Table>
  89. </Card>
  90. </div>
  91. </div>
  92. </template>
  93. <script>
  94. import {
  95. queryPurchaseApplyInfo4OA,
  96. getJobList,
  97. warehouseList,
  98. getLabelByCode4Purchase,
  99. queryPurchaseApplyInfo
  100. } from "@/service/getData";
  101. export default {
  102. data() {
  103. return {
  104. id: "",
  105. spinShow: false,
  106. contentShow: true,
  107. requestId: "",
  108. planType: "add",
  109. uploadHeaders: {
  110. token: localStorage.token,
  111. userId: localStorage.user_id
  112. },
  113. form: {
  114. status: "", //申购计划状态
  115. jhdjh: "", // 计划单据号
  116. bt: "", //标题
  117. spzt: 0, //审批状态
  118. date: "", //计划月份
  119. ssqy: "", //所属区域
  120. ssxm: "", //所属项目
  121. jhlx: "", //计划类型
  122. fgcgy: ",", //分管采购员
  123. totalPrice: 0, //总价
  124. sqr: localStorage.user_name, //申请人
  125. filesList: []
  126. },
  127. jhlxList: [
  128. { label: "计划性申购", value: 1 },
  129. { label: "临时申购", value: 2 }
  130. ],
  131. cgyList: [],
  132. djlxList: [],
  133. uploading: false,
  134. // 批量设置
  135. plszShow: false,
  136. plrkck: "",
  137. pldhsj: "",
  138. // table
  139. ckList: [],
  140. djList: [
  141. { label: "公区", value: 0 },
  142. { label: "内部", value: 1 }
  143. ],
  144. tableColumn: [
  145. {
  146. title: "物料编码",
  147. key: "code",
  148. tooltip: "true"
  149. // width: 100
  150. },
  151. {
  152. title: "物料分类",
  153. key: "firstClassName",
  154. tooltip: "true"
  155. // width: 100
  156. },
  157. {
  158. title: "物料名称",
  159. key: "materialName",
  160. tooltip: "true"
  161. // width: 100
  162. },
  163. {
  164. title: "规格型号",
  165. key: "specs",
  166. tooltip: "true"
  167. // width: 100
  168. },
  169. {
  170. title: "单位",
  171. key: "unit",
  172. tooltip: "true"
  173. // width: 100
  174. },
  175. {
  176. title: "库存量",
  177. key: "inventory",
  178. tooltip: "true"
  179. // width: 100
  180. },
  181. {
  182. title: "申购数量",
  183. slot: "amount",
  184. tooltip: "true"
  185. // width: 100
  186. },
  187. {
  188. title: "参考单价(元)",
  189. key: "referencePrice",
  190. tooltip: "true"
  191. // width: 120
  192. },
  193. {
  194. title: "参考总价(元)",
  195. slot: "referenceTotalPrice",
  196. tooltip: "true"
  197. // width: 120
  198. },
  199. {
  200. title: "入库仓库",
  201. slot: "storehouseId",
  202. tooltip: "true"
  203. // width: 100
  204. },
  205. {
  206. title: "对接人",
  207. slot: "linkedPersonName",
  208. tooltip: "true"
  209. // width: 100
  210. },
  211. {
  212. title: "单据类型",
  213. slot: "billType",
  214. tooltip: "true"
  215. // width: 100
  216. },
  217. {
  218. title: "计划到货时间",
  219. slot: "arriveTime",
  220. tooltip: "true"
  221. // width: 130
  222. },
  223. {
  224. title: "备注",
  225. slot: "remark",
  226. tooltip: "true"
  227. // width: 100
  228. }
  229. ],
  230. tableData: [],
  231. tableSelect: [],
  232. tableLoading: false
  233. };
  234. },
  235. created() {
  236. if (this.$route.query.param) {
  237. this.getSgjh();
  238. } else {
  239. this.getInfo();
  240. }
  241. },
  242. methods: {
  243. //表单上传
  244. getInfo() {
  245. queryPurchaseApplyInfo({
  246. id: this.$route.query.id
  247. }).then(res => {
  248. if (res.status == 200) {
  249. this.form.jhdjh = res.data.code;
  250. this.form.bt = res.data.title;
  251. this.form.ssqy = `${res.data.areaName}`;
  252. this.form.ssxm = `${res.data.projectName}`;
  253. this.form.jhlx = res.data.type;
  254. this.form.date = res.data.applyMonth;
  255. // this.form.fgcgy = res.data.purchaserName;
  256. this.form.sqr = res.data.applicantName;
  257. this.form.spzt = res.data.applyStatus;
  258. this.form.status = res.data.status;
  259. this.form.fgcgy = `${res.data.purchaserName}`;
  260. this.form.ylh = res.data.gpUnionpayNo;
  261. this.form.sf = res.data.gpProvince;
  262. this.form.yb = res.data.gpPostalCode;
  263. this.form.email = res.data.gpEmail;
  264. this.form.fax = res.data.gpFax;
  265. this.form.filesList = res.data.attachmentList;
  266. this.form.sm = res.data.remark;
  267. this.requestId = res.requestId;
  268. let getData = {
  269. areaId: res.data.areaId,
  270. projectId: res.data.projectId
  271. };
  272. let total = 0;
  273. for (let item in res.data.detailList) {
  274. total +=
  275. res.data.detailList[item].referencePrice *
  276. res.data.detailList[item].amount;
  277. }
  278. this.form.totalPrice = Number(total).toFixed(2);
  279. this.tableData = res.data.detailList;
  280. }
  281. });
  282. },
  283. beforeUpload() {},
  284. upFilesLoading() {
  285. this.uploading = true;
  286. },
  287. uploadFilesSuccess(response, file, fileList) {
  288. this.uploading = false;
  289. this.form.filesList.push({
  290. fileName: response.data.fileName,
  291. filePath: response.data.filePath,
  292. fileDetailType: ""
  293. });
  294. },
  295. plAdd(list) {
  296. for (let item in list) {
  297. if (
  298. this.tableData.filter(a => a.materialId == list[item].materialId)
  299. .length > 0
  300. ) {
  301. } else {
  302. this.tableData.push(list[item]);
  303. }
  304. }
  305. },
  306. //查询申购计划详情
  307. getSgjh(id) {
  308. this.spinShow = true;
  309. queryPurchaseApplyInfo4OA(this.$route.query.param).then(res => {
  310. this.spinShow = false;
  311. if (res.status == 200) {
  312. this.form.jhdjh = res.data.code;
  313. this.form.bt = res.data.title;
  314. this.form.ssqy = `${res.data.areaName}`;
  315. this.form.ssxm = `${res.data.projectName}`;
  316. this.form.jhlx = res.data.type;
  317. this.form.date = res.data.applyMonth;
  318. // this.form.fgcgy = res.data.purchaserName;
  319. this.form.sqr = res.data.applicantName;
  320. this.form.spzt = res.data.applyStatus;
  321. this.form.status = res.data.status;
  322. this.form.fgcgy = `${res.data.purchaserName}`;
  323. this.form.ylh = res.data.gpUnionpayNo;
  324. this.form.sf = res.data.gpProvince;
  325. this.form.yb = res.data.gpPostalCode;
  326. this.form.email = res.data.gpEmail;
  327. this.form.fax = res.data.gpFax;
  328. this.form.filesList = res.data.attachmentList;
  329. this.form.sm = res.data.remark;
  330. this.requestId = res.requestId;
  331. let getData = {
  332. areaId: res.data.areaId,
  333. projectId: res.data.projectId
  334. };
  335. let total = 0;
  336. for (let item in res.data.detailList) {
  337. total +=
  338. res.data.detailList[item].referencePrice *
  339. res.data.detailList[item].amount;
  340. }
  341. this.form.totalPrice = Number(total).toFixed(2);
  342. this.tableData = res.data.detailList;
  343. }
  344. });
  345. }
  346. }
  347. };
  348. </script>
  349. <style lang="scss" scoped>
  350. .mustSpan {
  351. color: red;
  352. margin-left: 2px;
  353. }
  354. button {
  355. min-width: 80px;
  356. }
  357. .uplCont {
  358. border-left: 1px solid #e4e4e4;
  359. .upl {
  360. flex: auto;
  361. min-height: 40px;
  362. border-right: 1px solid #e4e4e4;
  363. &:nth-child(1) {
  364. background: #f8f9fb;
  365. display: flex;
  366. align-items: center;
  367. justify-content: center;
  368. }
  369. }
  370. .uplf {
  371. display: flex;
  372. align-items: center;
  373. justify-content: center;
  374. min-height: 80px;
  375. }
  376. }
  377. .mainCont .tables {
  378. height: 50px;
  379. border-right: 1px solid #e4e4e4;
  380. border-bottom: 1px solid #e4e4e4;
  381. display: flex;
  382. align-items: center;
  383. justify-content: center;
  384. word-break: break-all;
  385. &:nth-child(2n + 1) {
  386. background: #f8f9fb;
  387. }
  388. }
  389. .mainCont {
  390. border-left: 1px solid #e4e4e4;
  391. border-top: 1px solid #e4e4e4;
  392. }
  393. ivu-card-head-inner,
  394. .ivu-card-head p {
  395. display: inline-block;
  396. width: 100%;
  397. height: 20px;
  398. line-height: 20px;
  399. font-size: 14px;
  400. color: #17233d;
  401. font-weight: 700;
  402. overflow: hidden;
  403. text-overflow: ellipsis;
  404. white-space: nowrap;
  405. font-weight: normal;
  406. }
  407. </style>