Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

addPurchaseOrder.vue 24KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs="crumbs"></bread-crumb>
  5. </div>
  6. <div class="app-container" v-loading="loading">
  7. <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
  8. <div>
  9. <span style="color:red">*</span><span>供应商:</span>
  10. <el-select v-model="supplier_name" style="width:140px;margin-right:10px;" placeholder="请选择"
  11. @change="changeTypeName">
  12. <el-option
  13. v-for="item in supplyList"
  14. :key="item.id"
  15. :label="item.supplier_name"
  16. :value="item.id">
  17. </el-option>
  18. </el-select>
  19. <span>单据日期:</span>
  20. <el-date-picker
  21. size="small"
  22. v-model="start_time"
  23. prefix-icon="el-icon-date"
  24. :editable="false"
  25. style="width: 196px;"
  26. type="date"
  27. placeholder="选择日期时间"
  28. align="right"
  29. format="yyyy-MM-dd"
  30. value-format="yyyy-MM-dd"
  31. @change="startTimeChange"
  32. ></el-date-picker>
  33. <span>交货日期:</span>
  34. <el-date-picker
  35. size="small"
  36. v-model="end_time"
  37. prefix-icon="el-icon-date"
  38. :editable="false"
  39. style="width: 196px;"
  40. type="date"
  41. placeholder="选择日期时间"
  42. align="right"
  43. format="yyyy-MM-dd"
  44. value-format="yyyy-MM-dd"
  45. @change="endTimeChange"
  46. ></el-date-picker>
  47. <span>单据编码:{{number}}</span>
  48. </div>
  49. <div>
  50. <el-button size="small" type="primary" @click="savePurchaseOrder" v-show="showTwo">保存</el-button>
  51. <el-button size="small" type="primary" @click="toPrint()" v-show="showOne">打印</el-button>
  52. <el-button size="small" type="primary" @click="checkPurchaseOrder" v-show="showOne">审核</el-button>
  53. <el-button size="small" type="primary" @click="updatePurchaseOrder" v-show="showOne">修改</el-button>
  54. </div>
  55. </div>
  56. <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
  57. <el-table
  58. :row-style="{ color: '#303133' }"
  59. :header-cell-style="{
  60. backgroundColor: 'rgb(245, 247, 250)',
  61. color: '#606266'
  62. }"
  63. :data="recordInfo.tableList"
  64. :class="signAndWeighBoxPatients"
  65. border
  66. style="width: 100%"
  67. max-height="450"
  68. >
  69. <el-table-column align="center" width="200px">
  70. <template slot="header" slot-scope="scope">
  71. <span>商品<span style="color: red">*</span></span>
  72. </template>
  73. <template slot-scope="scope">
  74. <el-form-item :prop="'tableList.' + scope.$index + '.name'" :rules='tableRules.name'>
  75. <el-select v-model="scope.row.name" style="width:160px;" filterable placeholder="请选择" @change="changeName" @input="changeGoodName(scope.$index)" :disabled="disabled">
  76. <el-option
  77. v-for="(item,index) in tabList"
  78. :key="index"
  79. :label="item.supply_name"
  80. :value="item">
  81. </el-option>
  82. </el-select>
  83. </el-form-item>
  84. </template>
  85. </el-table-column>
  86. <el-table-column align="center" width="150px">
  87. <template slot="header" slot-scope="scope">
  88. <span>商品类别</span>
  89. </template>
  90. <template slot-scope="scope">
  91. <el-input v-model="scope.row.supply_type" style="width:120px" :disabled="true"></el-input>
  92. </template>
  93. </el-table-column>
  94. <el-table-column label="规格&单位" align="center" width="200px">
  95. <template slot-scope="scope">
  96. <el-input v-model="scope.row.supply_specification_name" style="width:150px" :disabled="true"></el-input>
  97. </template>
  98. </el-table-column>
  99. <el-table-column label="可用库存" align="center" width="130px">
  100. <template slot-scope="scope">
  101. <el-input v-model="scope.row.supply_total" style="width:100px" :disabled="true"></el-input>
  102. </template>
  103. </el-table-column>
  104. <el-table-column label="数量" align="center" width="120px">
  105. <template slot="header" slot-scope="scope">
  106. <span>数量<span style="color: red">*</span></span>
  107. </template>
  108. <template slot-scope="scope">
  109. <el-form-item :prop="'tableList.' + scope.$index + '.supply_count'" :rules='tableRules.supply_count'>
  110. <el-input v-model="scope.row.supply_count" style="width:80px" :disabled="disabled"></el-input>
  111. </el-form-item>
  112. </template>
  113. </el-table-column>
  114. <el-table-column label="单位" align="center" width="120px">
  115. <template slot="header" slot-scope="scope">
  116. <span>单位<span style="color: red">*</span></span>
  117. </template>
  118. <template slot-scope="scope">
  119. <el-select v-model="scope.row.supply_unit" style="width:160px;" filterable placeholder="请选择" :disabled="disabled">
  120. <el-option
  121. v-for="(item,index) in unitList"
  122. :key="index"
  123. :label="item.name"
  124. :value="item.name">
  125. </el-option>
  126. </el-select>
  127. </template>
  128. </el-table-column>
  129. <el-table-column label="购货单价" align="center" width="120px">
  130. <template slot-scope="scope">
  131. <el-input v-model="scope.row.supply_price" style="width:80px" :disabled="disabled"></el-input>
  132. </template>
  133. </el-table-column>
  134. <el-table-column label="购货金额" align="center" width="120px">
  135. <template slot-scope="scope">
  136. {{calculate(scope.row.supply_count * scope.row.supply_price)}}
  137. </template>
  138. </el-table-column>
  139. <el-table-column label="生产厂商" align="center" width="200px">
  140. <template slot-scope="scope">
  141. <el-input v-model="scope.row.supply_manufacturer" style="width:160px" :disabled="true"></el-input>
  142. </template>
  143. </el-table-column>
  144. <el-table-column label="批准文号" align="center" width="200px">
  145. <template slot-scope="scope">
  146. <el-input v-model="scope.row.supply_license_number" style="width:160px" :disabled="disabled"></el-input>
  147. </template>
  148. </el-table-column>
  149. <el-table-column label="备注" align="center" width="200px">
  150. <template slot-scope="scope">
  151. <el-input v-model="scope.row.supply_remake" style="width:160px" :disabled="disabled"></el-input>
  152. </template>
  153. </el-table-column>
  154. <el-table-column label="操作" align="center" width="150px" fixed="right" >
  155. <template slot-scope="scope">
  156. <el-tooltip class="item" effect="dark" content="新增" placement="top" >
  157. <el-button
  158. size="mini"
  159. type="primary"
  160. icon="el-icon-circle-plus-outline"
  161. @click="handleEdit(scope.$index, scope.row)">
  162. </el-button>
  163. </el-tooltip>
  164. <el-tooltip class="item" effect="dark" content="删除" placement="top">
  165. <el-button
  166. size="mini"
  167. type="danger"
  168. icon="el-icon-delete"
  169. @click="handleDelete(scope.$index, scope.row)">
  170. </el-button>
  171. </el-tooltip>
  172. </template>
  173. </el-table-column>
  174. </el-table>
  175. </el-form>
  176. <div style="margin-top:10px">
  177. 合计:{{getAllPrice()}} 元
  178. </div>
  179. <div style="margin-top:10px">
  180. <span>优惠率:<el-input style="width:100px" v-model="rate_of_concession"></el-input>%</span>
  181. <span>优惠金额:<el-input style="width:100px" v-model="discount_amount"></el-input></span>
  182. </div>
  183. </div>
  184. </div>
  185. </template>
  186. <script>
  187. import BreadCrumb from "@/xt_pages/components/bread-crumb";
  188. import {uParseTime } from '@/utils/tools'
  189. import {getInitOrder,savePurchaseOrder,updatePurchaseOrder,checkPurchaseOrder} from "@/api/supply"
  190. export default {
  191. name: "addPurchaseOrder",
  192. created() {
  193. this.org_id = this.$store.getters.xt_user.org_id
  194. var start_time = window.sessionStorage.getItem('start_time')
  195. var end_time = window.sessionStorage.getItem('end_time')
  196. if(start_time !=null){
  197. this.start_time = start_time
  198. }
  199. if(end_time!=null){
  200. this.end_time = end_time
  201. }
  202. window.sessionStorage.removeItem('start_time')
  203. window.sessionStorage.removeItem('end_time')
  204. },
  205. components: {
  206. BreadCrumb
  207. },
  208. data() {
  209. return {
  210. crumbs: [
  211. { path: false, name: "购货订单" },
  212. { path: "/spply/query", name: "新增购货订单" }
  213. ],
  214. showTwo:true,
  215. showOne:false,
  216. recordInfo: {
  217. tableList:[],
  218. },
  219. keywords: "",
  220. total: 0,
  221. multipleSelection: [],
  222. signAndWeighBoxPatients: "sign-and-weigh-box-patients",
  223. start_time: "",
  224. end_time: "",
  225. page: 1,
  226. limit: 10,
  227. goodType: [],
  228. goodInfo: [],
  229. org_id:0,
  230. types:[],
  231. tyep_name:"",
  232. form:{
  233. manufacturer_id:"",
  234. },
  235. tabList:[],
  236. manufactuerList:[],
  237. currentIndex: 0,
  238. goodTypeList:[],
  239. drugTypeList:[],
  240. supplier_name:"",
  241. supplyList:[],
  242. rate_of_concession:"",
  243. discount_amount:"",
  244. start_time:new Date(),
  245. end_time:new Date(),
  246. tableRules: {
  247. name: [{ required: true, message: '商品不能为空', trigger: 'blur' }],
  248. supply_count: [{ required: true, message: '数量不能为空', trigger: 'blur' }],
  249. },
  250. warehousing_id:0,
  251. number:"",
  252. loading:false,
  253. drugList:[],
  254. goodList:[],
  255. id:0,
  256. disabled:false,
  257. unitList:[
  258. {id:1,name:""},
  259. {id:2,name:""}
  260. ],
  261. };
  262. },
  263. methods:{
  264. getInitOrder(){
  265. getInitOrder().then(response=>{
  266. if(response.data.state == 1){
  267. var drugList = response.data.data.drugList
  268. this.manufactuerList = response.data.data.manufactuerList
  269. this.goodTypeList = response.data.data.goodTypeList
  270. this.drugTypeList = response.data.data.drugTypeList
  271. this.supplyList = response.data.data.supplyList
  272. for(let i=0;i<drugList.length;i++){
  273. for(let z=0;z<drugList[i].drug_warehouse_info.length;z++){
  274. drugList[i].drug_warehouse_info[z].stock_max_number = drugList[i].drug_warehouse_info[z].stock_max_number * drugList[i].min_number
  275. }
  276. for(let j=0;j<this.manufactuerList.length;j++){
  277. if(drugList[i].manufacturer == this.manufactuerList[j].id){
  278. drugList[i].manufacturer = this.manufactuerList[j].manufacturer_name
  279. }
  280. }
  281. for(let y=0;y<this.drugTypeList.length;y++){
  282. if(drugList[i].drug_type == this.drugTypeList[y].value){
  283. drugList[i].drug_type = this.drugTypeList[y].name
  284. }
  285. }
  286. drugList[i].supply_name = drugList[i].drug_name + " " + drugList[i].dose +drugList[i].dose_unit+"*"+drugList[i].min_number+ drugList[i].min_unit+"/"+drugList[i].max_unit + " " + drugList[i].manufacturer
  287. drugList[i].supply_type = drugList[i].drug_type
  288. drugList[i].supply_specification_name = drugList[i].dose +drugList[i].dose_unit+"*"+drugList[i].min_number+ drugList[i].min_unit+"/"+drugList[i].max_unit
  289. drugList[i].supply_total = this.getWarehoseInfo(drugList[i].drug_warehouse_info,drugList[i].max_unit,drugList[i].min_unit,drugList[i].min_number)
  290. drugList[i].supply_count = ""
  291. drugList[i].supply_total_price = ""
  292. drugList[i].supply_manufacturer= drugList[i].manufacturer
  293. drugList[i].supply_license_number= drugList[i].number
  294. drugList[i].supply_remake = ""
  295. drugList[i].type = 1
  296. drugList[i].supply_price = ""
  297. drugList[i].name = drugList[i].drug_name
  298. this.tabList.push(drugList[i])
  299. }
  300. this.drugList = drugList
  301. var goodList = response.data.data.goodList
  302. for(let i=0;i<goodList.length;i++){
  303. for(let j=0;j<this.manufactuerList.length;j++){
  304. if(goodList[i].manufacturer == this.manufactuerList[j].id){
  305. goodList[i].manufacturer = this.manufactuerList[j].manufacturer_name
  306. }
  307. }
  308. for(let y=0;y<this.goodTypeList.length;y++){
  309. if(goodList[i].good_type_id == this.goodTypeList[y].id){
  310. goodList[i].good_type_id = this.goodTypeList[y].type_name
  311. }
  312. }
  313. goodList[i].supply_name = goodList[i].good_name + " " + goodList[i].specification_name + " " +goodList[i].manufacturer
  314. goodList[i].supply_type = goodList[i].good_type_id
  315. goodList[i].supply_specification_name =goodList[i].specification_name
  316. goodList[i].supply_price = ""
  317. goodList[i].supply_total = this.getTotalStockCount(goodList[i].good_warehouse_info)
  318. goodList[i].supply_count = ""
  319. goodList[i].supply_total_price = ""
  320. goodList[i].supply_manufacturer = goodList[i].manufacturer
  321. goodList[i].supply_license_number = ""
  322. goodList[i].supply_remake = ""
  323. goodList[i].type = 2
  324. goodList[i].name = goodList[i].good_name
  325. this.tabList.push(goodList[i])
  326. }
  327. this.goodList = goodList
  328. }
  329. })
  330. },
  331. changeGoodName(val){
  332. this.currentIndex = val
  333. },
  334. changeName(val){
  335. console.log("val3233232322332",val)
  336. for(let i=0;i<this.recordInfo.tableList.length;i++){
  337. if(this.currentIndex == i){
  338. this.recordInfo.tableList[i].project_id = val.id
  339. this.recordInfo.tableList[i].type = val.type
  340. this.recordInfo.tableList[i].name = val.name
  341. this.recordInfo.tableList[i].supply_name = val.supply_name
  342. this.recordInfo.tableList[i].supply_type = val.supply_type
  343. this.recordInfo.tableList[i].supply_specification_name = val.supply_specification_name
  344. this.recordInfo.tableList[i].supply_total = val.supply_total
  345. this.recordInfo.tableList[i].supply_unit = val.max_unit
  346. if(val.supply_count == NaN){
  347. this.recordInfo.tableList[i].supply_count = ""
  348. }else{
  349. this.recordInfo.tableList[i].supply_count = val.supply_count?val.supply_count:""
  350. }
  351. this.recordInfo.tableList[i].supply_price = val.supply_price?val.supply_price:""
  352. this.recordInfo.tableList[i].supply_total_price = val.supply_total_price?val.supply_total_price:""
  353. this.recordInfo.tableList[i].supply_manufacturer = val.supply_manufacturer
  354. this.recordInfo.tableList[i].supply_license_number = val.supply_license_number
  355. this.recordInfo.tableList[i].supply_remake = val.supply_remake
  356. this.recordInfo.tableList[i].is_total = val.is_total
  357. this.recordInfo.tableList[i].supply_unit = val.supply_unit
  358. }
  359. }
  360. },
  361. handleEdit(){
  362. const tempObj = {}
  363. tempObj["id"] = 0
  364. tempObj["name"] = ""
  365. tempObj['supply_name'] = ""
  366. tempObj['supply_type'] = ""
  367. tempObj['supply_specification_name'] = ''
  368. tempObj['supply_total'] = ""
  369. tempObj['supply_count'] = ""
  370. tempObj['supply_price'] = ""
  371. tempObj['supply_total_price'] = ""
  372. tempObj['supply_manufacturer'] = ''
  373. tempObj['supply_license_number'] = ''
  374. tempObj['supply_remake'] = ''
  375. tempObj['type'] = 0
  376. tempObj['is_total'] = 1
  377. tempObj["project_id"] = 0
  378. tempObj["supply_unit"] = ""
  379. this.recordInfo.tableList.push(tempObj)
  380. },
  381. handleDelete: function(index, row) {
  382. if (this.recordInfo.tableList.length <= 1) {
  383. this.$message.error('只有一条记录的时候无法删除')
  384. return
  385. } else {
  386. this.recordInfo.tableList.splice(index, 1)
  387. }
  388. },
  389. savePurchaseOrder(){
  390. this.loading = true
  391. if(this.supplier_name == 0 || this.supplier_name == ""){
  392. this.$message.error("供应商不能为空!")
  393. return false
  394. }
  395. this.$refs["tableForm"].validate((valid)=>{
  396. if(valid){
  397. for(let i=0;i<this.recordInfo.tableList.length;i++){
  398. this.recordInfo.tableList[i].supply_count = parseInt(this.recordInfo.tableList[i].supply_count)
  399. this.recordInfo.tableList[i].supply_license_number = this.recordInfo.tableList[i].supply_license_number.toString()
  400. this.recordInfo.tableList[i].supply_total_price = (this.recordInfo.tableList[i].supply_count * this.recordInfo.tableList[i].supply_price).toString()
  401. this.recordInfo.tableList[i].supply_total = this.recordInfo.tableList[i].supply_total.toString()
  402. this.recordInfo.tableList[i].supply_price = this.recordInfo.tableList[i].supply_price.toString()
  403. for(let j=0;j<this.manufactuerList.length;j++){
  404. if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
  405. this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id
  406. }
  407. }
  408. }
  409. var start = this.getTimes(this.start_time)
  410. var end = this.getTimes(this.end_time)
  411. const params = {
  412. 'stockIn': this.recordInfo.tableList
  413. }
  414. savePurchaseOrder(params,this.supplier_name,start,end,this.rate_of_concession,this.discount_amount).then(response=>{
  415. if(response.data.state == 1){
  416. var order = response.data.data.order
  417. this.loading = false
  418. this.$message.success("保存成功!")
  419. var warehouseInfo = response.data.data.warehouseInfo
  420. this.number = warehouseInfo.number
  421. this.id = warehouseInfo.id
  422. this.recordInfo.tableList = []
  423. var orderInfo = response.data.data.orderInfo
  424. for(let i=0;i<orderInfo.length;i++){
  425. orderInfo[i].supply_count = orderInfo[i].count
  426. orderInfo[i].supply_price = orderInfo[i].price
  427. orderInfo[i].supply_remake = orderInfo[i].remark
  428. orderInfo[i].type = orderInfo[i].is_source
  429. orderInfo[i].project_id = orderInfo[i].project_id
  430. }
  431. console.log("orderINFO23323232",orderInfo)
  432. this.recordInfo.tableList = orderInfo
  433. // for(let i=0;i<orderInfo.length;i++){
  434. // orderInfo[i].name = ""
  435. // orderInfo[i].supply_name = ""
  436. // orderInfo[i].supply_specification_name = ""
  437. // if(orderInfo[i].is_source == 1){
  438. // for(let j=0;j<this.drugList.length;j++){
  439. // if(orderInfo[i].project_id == this.drugList[j].id){
  440. // orderInfo[i].name = this.drugList[j].drug_name
  441. // }
  442. // }
  443. // }
  444. // if(orderInfo[i].is_source == 2){
  445. // for(let y=0;y<this.goodList.length;y++){
  446. // if(orderInfo[i].project_id = this.goodList[y].id){
  447. // orderInfo[i].name = this.goodList[y].good_name
  448. // }
  449. // }
  450. // }
  451. // }
  452. this.showTwo = false
  453. this.showOne = true
  454. }
  455. })
  456. }
  457. })
  458. },
  459. changeTypeName(){
  460. },
  461. startTimeChange(){
  462. },
  463. endTimeChange(){
  464. },
  465. search(){
  466. },
  467. getWarehoseInfo(arr,max_unit,min_unit,min_number){
  468. var total = 0
  469. var max_str= ""
  470. var min_str = ""
  471. if (arr.length > 0) {
  472. for(let i=0;i<arr.length;i++){
  473. total += parseInt(arr[i].stock_max_number)
  474. }
  475. }
  476. if (total < min_number){
  477. min_str = total + min_unit
  478. }
  479. if (total == 0) {
  480. min_str = ""
  481. max_str = ""
  482. }
  483. if (total >=min_number) {
  484. if(parseInt(total/min_number)!=0){
  485. max_str = parseInt(total/min_number) + max_unit
  486. }
  487. if(total%min_number!=0){
  488. min_str = total%min_number + min_unit
  489. }
  490. }
  491. return max_str + min_str
  492. },
  493. getTotalStockCount(arr){
  494. var total_count = 0
  495. for(let i=0;i<arr.length;i++){
  496. total_count += arr[i].stock_count
  497. }
  498. return total_count
  499. },
  500. calculate: function(val) {
  501. if (isNaN(val)) {
  502. return "";
  503. }
  504. if (val == 0) {
  505. return "";
  506. }
  507. return Math.round(parseFloat(val) * 100) / 100;
  508. },
  509. getTimes(time) {
  510. if (time === '') {
  511. return ''
  512. }
  513. return uParseTime(time, '{y}-{m}-{d}')
  514. },
  515. updatePurchaseOrder(){
  516. this.loading = true
  517. this.$refs["tableForm"].validate((valid)=>{
  518. if(valid){
  519. for(let i=0;i<this.recordInfo.tableList.length;i++){
  520. this.recordInfo.tableList[i].supply_count = parseInt(this.recordInfo.tableList[i].supply_count)
  521. this.recordInfo.tableList[i].supply_license_number = this.recordInfo.tableList[i].supply_license_number.toString()
  522. this.recordInfo.tableList[i].supply_total_price = (this.recordInfo.tableList[i].supply_count * this.recordInfo.tableList[i].supply_price).toString()
  523. this.recordInfo.tableList[i].supply_total = this.recordInfo.tableList[i].supply_total.toString()
  524. this.recordInfo.tableList[i].supply_price = this.recordInfo.tableList[i].supply_price.toString()
  525. for(let j=0;j<this.manufactuerList.length;j++){
  526. if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
  527. this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id
  528. }
  529. }
  530. }
  531. var start = this.getTimes(this.start_time)
  532. var end = this.getTimes(this.end_time)
  533. const params = {
  534. 'stockIn': this.recordInfo.tableList
  535. }
  536. console.log("params23232233223",params)
  537. updatePurchaseOrder(params,this.supplier_name,start,end,this.rate_of_concession,this.discount_amount,this.id,this.number).then(response=>{
  538. if(response.data.state == 1){
  539. this.loading = false
  540. var warehousingInfo = response.data.data.warehousingInfo
  541. this.$message.success("修改成功!")
  542. }
  543. })
  544. }
  545. })
  546. },
  547. getAllPrice(){
  548. var total_price = 0
  549. for(let i=0;i<this.recordInfo.tableList.length;i++){
  550. total_price += (this.recordInfo.tableList[i].supply_price * this.recordInfo.tableList[i].supply_count)
  551. }
  552. return total_price.toFixed(2)
  553. },
  554. checkPurchaseOrder(id,index){
  555. this.$confirm('是否审核?', {
  556. confirmButtonText: '确 定',
  557. cancelButtonText: '取 消',
  558. type: 'warning'
  559. }).then(() => {
  560. console.log("id232233232323223",this.id)
  561. checkPurchaseOrder(this.id).then(response => {
  562. if (response.data.state == 1) {
  563. var info = response.data.data.info
  564. this.disabled = true
  565. this.$message.success("审核成功!")
  566. }
  567. })
  568. })
  569. .catch(() => {
  570. })
  571. },
  572. toPrint(){
  573. var id = this.id
  574. this.$router.push({path:"/purchase/order/print?&id="+id})
  575. }
  576. },
  577. created(){
  578. const tempObj = {}
  579. tempObj["id"] = 0
  580. tempObj["name"] = ""
  581. tempObj['supply_name'] = ""
  582. tempObj['supply_type'] = ""
  583. tempObj['supply_specification_name'] = ''
  584. tempObj['supply_total'] = ""
  585. tempObj['supply_count'] = ""
  586. tempObj['supply_price'] = ""
  587. tempObj['supply_total_price'] = ""
  588. tempObj['supply_manufacturer'] = ''
  589. tempObj['supply_license_number'] = ''
  590. tempObj['supply_remake'] = ''
  591. tempObj['type'] = 0
  592. tempObj['is_total'] = 1
  593. tempObj["project_id"] = 0
  594. tempObj["supply_unit"] = ""
  595. this.recordInfo.tableList.push(tempObj)
  596. this.getInitOrder()
  597. }
  598. };
  599. </script>
  600. <style rel="stylesheet/css" lang="scss" scoped>
  601. .information {
  602. border: 1px #dcdfe6 solid;
  603. padding: 30px 20px 30px 20px;
  604. .border {
  605. border-bottom: 1px #dcdfe6 solid;
  606. margin: 0px 0 20px 0;
  607. }
  608. }
  609. .title {
  610. background: #409eff;
  611. height: 44px;
  612. line-height: 44px;
  613. padding: 0 0 0 10px;
  614. color: #fff;
  615. margin: 0 0 10px 0;
  616. }
  617. .edit_separater {
  618. border-top: 1px solid rgb(233, 233, 233);
  619. margin-top: 15px;
  620. margin-bottom: 15px;
  621. }
  622. </style>
  623. <style>
  624. .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
  625. font-size: 12px;
  626. }
  627. .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
  628. background: #6fb5fa;
  629. }
  630. .count {
  631. color: #bd2c00;
  632. }
  633. .el-table td,
  634. .el-table th.is-leaf,
  635. .el-table--border,
  636. .el-table--group {
  637. border-color: #d0d3da;
  638. }
  639. .el-table--border::after,
  640. .el-table--group::after,
  641. .el-table::before {
  642. background-color: #d0d3da;
  643. }
  644. .el-table__fixed-right{
  645. width:150px;
  646. bottom: 20px;
  647. height: 100%;
  648. }
  649. </style>