|  | @@ -191,7 +191,7 @@ import {
 | 
	
		
			
				|  |  |    queryUserVal
 | 
	
		
			
				|  |  |  } from '@/api/purchaseRequest/index'
 | 
	
		
			
				|  |  |  import Cookies from 'js-cookie'
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +import Global from '@/layout/components/global'
 | 
	
		
			
				|  |  |  export default {
 | 
	
		
			
				|  |  |    name: 'index',
 | 
	
		
			
				|  |  |    data() {
 | 
	
	
		
			
				|  | @@ -342,7 +342,6 @@ export default {
 | 
	
		
			
				|  |  |            width: 100,
 | 
	
		
			
				|  |  |            onabort: '',
 | 
	
		
			
				|  |  |            disabled: false,
 | 
	
		
			
				|  |  | -          changeable: 1
 | 
	
		
			
				|  |  |          },{
 | 
	
		
			
				|  |  |            surface: '4',
 | 
	
		
			
				|  |  |            label: 'fUnitprice',
 | 
	
	
		
			
				|  | @@ -739,12 +738,15 @@ export default {
 | 
	
		
			
				|  |  |            labelSize: '80',
 | 
	
		
			
				|  |  |            rules: [{ required: false, message: ' ' }]
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -      ]
 | 
	
		
			
				|  |  | +      ],
 | 
	
		
			
				|  |  | +      pendingPage:null,
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    activated(){
 | 
	
		
			
				|  |  |      this.homePage()
 | 
	
		
			
				|  |  | -    // console.log(this.$route.query.open)
 | 
	
		
			
				|  |  | +    if(this.$route.query.list){
 | 
	
		
			
				|  |  | +      this.pendingPage = JSON.parse(this.$route.query.list)
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  |      if (this.$route.query.open === 'true'){
 | 
	
		
			
				|  |  |        this.contentList = []
 | 
	
		
			
				|  |  |        let data = {
 | 
	
	
		
			
				|  | @@ -887,18 +889,34 @@ export default {
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      //首页审批跳转关闭返回首页
 | 
	
		
			
				|  |  |      cancelTwo() {
 | 
	
		
			
				|  |  | -      let view = {
 | 
	
		
			
				|  |  | -        fullPath: '/purchaseRequest',
 | 
	
		
			
				|  |  | -        hash: '',
 | 
	
		
			
				|  |  | -        matched: Array(2),
 | 
	
		
			
				|  |  | -        meta: Object,
 | 
	
		
			
				|  |  | -        name: 'PurchaseRequest',
 | 
	
		
			
				|  |  | -        params: Object,
 | 
	
		
			
				|  |  | -        path: '/purchaseRequest',
 | 
	
		
			
				|  |  | -        query: Object,
 | 
	
		
			
				|  |  | -        title: '采购申请'
 | 
	
		
			
				|  |  | +      let view = {}
 | 
	
		
			
				|  |  | +      if(this.pendingPage.pendingPage){
 | 
	
		
			
				|  |  | +        view = {
 | 
	
		
			
				|  |  | +          fullPath: "/morePage/stock?open=true",
 | 
	
		
			
				|  |  | +          hash: "",
 | 
	
		
			
				|  |  | +          matched: Array(2),
 | 
	
		
			
				|  |  | +          meta: Object,
 | 
	
		
			
				|  |  | +          name: "MorePage/stock",
 | 
	
		
			
				|  |  | +          params: Object,
 | 
	
		
			
				|  |  | +          path: "/morePage/stock",
 | 
	
		
			
				|  |  | +          query: Object,
 | 
	
		
			
				|  |  | +          title: "待审数据"
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        this.$router.push({ path: '/morePage/stock' })
 | 
	
		
			
				|  |  | +      }else{
 | 
	
		
			
				|  |  | +        view = {
 | 
	
		
			
				|  |  | +          fullPath: '/purchaseRequest',
 | 
	
		
			
				|  |  | +          hash: '',
 | 
	
		
			
				|  |  | +          matched: Array(2),
 | 
	
		
			
				|  |  | +          meta: Object,
 | 
	
		
			
				|  |  | +          name: 'PurchaseRequest',
 | 
	
		
			
				|  |  | +          params: Object,
 | 
	
		
			
				|  |  | +          path: '/purchaseRequest',
 | 
	
		
			
				|  |  | +          query: Object,
 | 
	
		
			
				|  |  | +          title: '采购申请'
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        this.$router.push({ path: '/index' })
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  | -      this.$router.push({ path: '/index' })
 | 
	
		
			
				|  |  |        this.$store
 | 
	
		
			
				|  |  |          .dispatch('tagsView/delView', view)
 | 
	
		
			
				|  |  |          .then(({ visitedViews }) => {
 | 
	
	
		
			
				|  | @@ -957,7 +975,7 @@ export default {
 | 
	
		
			
				|  |  |        })
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      //查询列数据
 | 
	
		
			
				|  |  | -    getRow(data,list) {
 | 
	
		
			
				|  |  | +    getRow(data,list,add) {
 | 
	
		
			
				|  |  |        console.log(data,list)
 | 
	
		
			
				|  |  |        select(data).then((res) => {
 | 
	
		
			
				|  |  |          if (data.tableName === '采购申请详情') {
 | 
	
	
		
			
				|  | @@ -971,7 +989,11 @@ export default {
 | 
	
		
			
				|  |  |              this.$set(this.purchaseList,'columnList',this.$options.data().contentStyle)
 | 
	
		
			
				|  |  |              this.setRowList = this.$options.data().contentStyle
 | 
	
		
			
				|  |  |            }
 | 
	
		
			
				|  |  | -          this.purchaseList.columnList.forEach(item => item.disabled = true)
 | 
	
		
			
				|  |  | +          if(add){
 | 
	
		
			
				|  |  | +            this.purchaseList.columnList.forEach(item => item.disabled = false)
 | 
	
		
			
				|  |  | +          }else{
 | 
	
		
			
				|  |  | +            this.purchaseList.columnList.forEach(item => item.disabled = true)
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  |            this.pageDisplay = false
 | 
	
		
			
				|  |  |            this.isItHidden = false
 | 
	
		
			
				|  |  |            this.inDex = this.contentOption.length
 | 
	
	
		
			
				|  | @@ -1121,18 +1143,22 @@ export default {
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      //详情内容保存
 | 
	
		
			
				|  |  |      submitAndSave(item) {
 | 
	
		
			
				|  |  | -      let formData = new window.FormData()
 | 
	
		
			
				|  |  | -      this.$refs.avatar.form.fMoney = 0
 | 
	
		
			
				|  |  | -      this.contentList.forEach(item => this.$refs.avatar.form.fMoney += Number(item.fAmount))
 | 
	
		
			
				|  |  | -      formData.append('tWarehousebills', JSON.stringify(this.$refs.avatar.form))
 | 
	
		
			
				|  |  | -      formData.append('tWarehousebillsfees', JSON.stringify(this.contentList))
 | 
	
		
			
				|  |  | -      formData.append('fBilltype', 'SQ')
 | 
	
		
			
				|  |  | -      submit(formData).then(res => {
 | 
	
		
			
				|  |  | -        if (res.code == 200) {
 | 
	
		
			
				|  |  | -          this.$message.success('保存成功')
 | 
	
		
			
				|  |  | -          this.$refs.avatar.form = res.data.warehouseBills
 | 
	
		
			
				|  |  | -          this.contentList = res.data.tWarehousebillsCntrs
 | 
	
		
			
				|  |  | -          console.log(this.dataList, this.contentList)
 | 
	
		
			
				|  |  | +      console.log(this.$refs.avatar.form.fBillstatus)
 | 
	
		
			
				|  |  | +      if(this.$refs.avatar.form.fBillstatus < 4 || !this.$refs.avatar.form.fBillstatus) {
 | 
	
		
			
				|  |  | +        let formData = new window.FormData()
 | 
	
		
			
				|  |  | +        this.$refs.avatar.form.fMoney = 0
 | 
	
		
			
				|  |  | +        this.contentList.forEach(item => this.$refs.avatar.form.fMoney += Number(item.fAmount))
 | 
	
		
			
				|  |  | +        formData.append('tWarehousebills', JSON.stringify(this.$refs.avatar.form))
 | 
	
		
			
				|  |  | +        formData.append('tWarehousebillsfees', JSON.stringify(this.contentList))
 | 
	
		
			
				|  |  | +        formData.append('fBilltype', 'SQ')
 | 
	
		
			
				|  |  | +        submit(formData).then(res => {
 | 
	
		
			
				|  |  | +          if (res.code == 200) {
 | 
	
		
			
				|  |  | +            this.$message.success('保存成功')
 | 
	
		
			
				|  |  | +            this.$refs.avatar.form = res.data.warehouseBills
 | 
	
		
			
				|  |  | +            this.contentList = res.data.tWarehousebillsCntrs
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +        })
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  |            if (item == 1){
 | 
	
		
			
				|  |  |              this.dialogVisible = true
 | 
	
		
			
				|  |  |            }else if (item === 2){
 | 
	
	
		
			
				|  | @@ -1162,8 +1188,6 @@ export default {
 | 
	
		
			
				|  |  |                this.viewMethod(scope)
 | 
	
		
			
				|  |  |              })
 | 
	
		
			
				|  |  |            }
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -      })
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      //表单选中后触发
 | 
	
		
			
				|  |  |      selectTrigger(name, list, id) {
 | 
	
	
		
			
				|  | @@ -1193,7 +1217,7 @@ export default {
 | 
	
		
			
				|  |  |          this.query(this.formDataList)
 | 
	
		
			
				|  |  |        } else if(this.$route.query.data){
 | 
	
		
			
				|  |  |          this.cancelTwo();
 | 
	
		
			
				|  |  | -        this.$router.push({path:'/index'})
 | 
	
		
			
				|  |  | +        // this.$router.push({path:'/index'})
 | 
	
		
			
				|  |  |        }else {
 | 
	
		
			
				|  |  |          this.$confirm('当前数据未保存是否保存?', '提示', {
 | 
	
		
			
				|  |  |            confirmButtonText: '保存',
 | 
	
	
		
			
				|  | @@ -1217,15 +1241,13 @@ export default {
 | 
	
		
			
				|  |  |        let data
 | 
	
		
			
				|  |  |        switch (row.name) {
 | 
	
		
			
				|  |  |          case '新单':
 | 
	
		
			
				|  |  | -          if (row.nameTwo === '详情页'){
 | 
	
		
			
				|  |  |              this.contentList = []
 | 
	
		
			
				|  |  |              data = {
 | 
	
		
			
				|  |  |                tableName: this.purchaseList.tableName,
 | 
	
		
			
				|  |  |                userId: Cookies.get('userName')
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              this.$refs.avatar.form = {}
 | 
	
		
			
				|  |  | -            this.getRow(data)
 | 
	
		
			
				|  |  | -            this.$refs.avatar.clearVerification()
 | 
	
		
			
				|  |  | +            this.getRow(data,'',1)
 | 
	
		
			
				|  |  |              this.contentOption.forEach(item => {
 | 
	
		
			
				|  |  |                if (item.label == 'personNaem' || item.label == 'corpsName' || item.label == 'createBy' || item.label == 'fBillno') {
 | 
	
		
			
				|  |  |                  item.disabled = true
 | 
	
	
		
			
				|  | @@ -1235,26 +1257,8 @@ export default {
 | 
	
		
			
				|  |  |              })
 | 
	
		
			
				|  |  |              this.contentButton.forEach(item => item.disabled = false)
 | 
	
		
			
				|  |  |              this.contentStyle.forEach(item => item.disabled = false)
 | 
	
		
			
				|  |  | +             this.$refs.avatar.clearVerification()
 | 
	
		
			
				|  |  |              this.$refs.avatar.form.createBy = Cookies.get('userName')
 | 
	
		
			
				|  |  | -          }else {
 | 
	
		
			
				|  |  | -            this.contentList = []
 | 
	
		
			
				|  |  | -            data = {
 | 
	
		
			
				|  |  | -              tableName: this.purchaseList.tableName,
 | 
	
		
			
				|  |  | -              userId: Cookies.get('userName')
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -            this.$refs.avatar.form = {}
 | 
	
		
			
				|  |  | -            this.getRow(data)
 | 
	
		
			
				|  |  | -            this.contentOption.forEach(item => {
 | 
	
		
			
				|  |  | -              if (item.label == 'personNaem' || item.label == 'corpsName' || item.label == 'createBy' || item.label == 'fBillno') {
 | 
	
		
			
				|  |  | -                item.disabled = true
 | 
	
		
			
				|  |  | -              } else {
 | 
	
		
			
				|  |  | -                item.disabled = false
 | 
	
		
			
				|  |  | -              }
 | 
	
		
			
				|  |  | -            })
 | 
	
		
			
				|  |  | -            this.contentButton.forEach(item => item.disabled = false)
 | 
	
		
			
				|  |  | -            this.contentStyle.forEach(item => item.disabled = false)
 | 
	
		
			
				|  |  | -            this.$refs.avatar.form.createBy = Cookies.get('userName')
 | 
	
		
			
				|  |  | -          }
 | 
	
		
			
				|  |  |            break
 | 
	
		
			
				|  |  |          case '保存':
 | 
	
		
			
				|  |  |            this.$refs.avatar.submitForm('submit')
 |