{"remainingRequest":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\jd_cgpt_fvue\\src\\views\\Normal\\salesOrder\\shipmentsSales\\component\\shipmentsAddDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\src\\views\\Normal\\salesOrder\\shipmentsSales\\component\\shipmentsAddDialog.vue","mtime":1713259781147},{"path":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\r\nimport Breadcrumb from '@/components/Breadcrumb/index.vue'\r\nimport salesOrder from '@/api/BasicDataManagement/salesOrder.js'\r\nimport RejectInfoDialogVue from '../../../../../components/dialog/RejectInfoDialog.vue'\r\nexport default {\r\n name: 'shipmentsAddDialog',\r\n components: {Breadcrumb},\r\n props: {\r\n editData: Object,\r\n },\r\n data() {\r\n return {\r\n centralizedData: [\r\n {name: '是', id: 1},\r\n {name: '否', id: 0},\r\n ],\r\n breadcrumbOpt: [{breadcrumbName: '采购发货'}, {breadcrumbName: '新增'}],\r\n cardTypeData: [\r\n {\r\n name: '营业执照',\r\n value: 0,\r\n },\r\n {\r\n name: '身份证',\r\n value: 1,\r\n },\r\n {\r\n name: '驾驶证',\r\n value: 2,\r\n },\r\n {\r\n name: '军官证',\r\n value: 3,\r\n },\r\n {\r\n name: '护照',\r\n value: 4,\r\n },\r\n ],\r\n rules: {\r\n inManifestCompanyName: [\r\n {\r\n required: true,\r\n message: '请输入收货公司',\r\n trigger: 'blur',\r\n },\r\n ],\r\n contractName: [\r\n {\r\n required: true,\r\n message: '请输入合同名称',\r\n trigger: 'blur',\r\n },\r\n ],\r\n outManifestCompanyName: [\r\n {\r\n required: true,\r\n message: '请输入发货公司',\r\n trigger: 'blur',\r\n },\r\n ],\r\n outManifestUserName: [\r\n {\r\n required: true,\r\n message: '请输入发货人',\r\n trigger: 'blur',\r\n },\r\n ],\r\n outManifestUserPhone: [\r\n {\r\n required: true,\r\n message: '请输入联系电话',\r\n trigger: 'blur',\r\n },\r\n {\r\n pattern: /^1[3456789]\\d{9}$/,\r\n message: '手机号码格式不正确',\r\n trigger: 'blur',\r\n },\r\n ],\r\n outManifestDate: [\r\n {\r\n required: true,\r\n message: '请选择发货时间',\r\n trigger: 'blur',\r\n },\r\n ],\r\n purchaseOrderId: [\r\n {\r\n required: true,\r\n message: '请选择选择订单编号',\r\n trigger: 'blur',\r\n },\r\n ],\r\n },\r\n parameter: {\r\n bizReceipt: {},\r\n detailList: [],\r\n },\r\n dialogVisibleDetial: false,\r\n dialogVisible: false,\r\n dialogTableDataDetial: [],\r\n dialogTableData: [],\r\n params: {\r\n pageBean: {\r\n page: 1,\r\n pageSize: 20,\r\n total: 0,\r\n },\r\n },\r\n queryParams: [\r\n {\r\n group: 'main',\r\n operation: 'LIKE',\r\n parentGroup: '',\r\n property: 'orderCode',\r\n relation: 'AND',\r\n value: '',\r\n },\r\n ],\r\n queryParamsDetial: [\r\n {\r\n group: 'main',\r\n operation: 'LIKE',\r\n parentGroup: '',\r\n property: 'matName',\r\n relation: 'AND',\r\n value: '',\r\n },\r\n ],\r\n selectObj: {},\r\n oldDetailslist: [],\r\n }\r\n },\r\n created() {\r\n this.addModifyBtn()\r\n if (this.$route.query.editRows) {\r\n this.breadcrumbOpt[1].breadcrumbName = '编辑'\r\n // this.parameter = this.$route.query.editRows\r\n\r\n let row = JSON.parse(JSON.stringify(this.$route.query.editRows))\r\n\r\n this.selectOne(row)\r\n } else {\r\n if (sessionStorage.getItem('currentUserDetail')) {\r\n let userDetail = JSON.parse(sessionStorage.getItem('currentUserDetail'))\r\n let {username, userId, mobile} = userDetail.user\r\n let obj = {}\r\n obj.outManifestUserName = username\r\n obj.outManifestUserId = userId\r\n obj.outManifestUserPhone = mobile\r\n this.$set(this.parameter, 'bizReceipt', obj)\r\n }\r\n }\r\n\r\n // this.getDate()\r\n this.getTableData()\r\n },\r\n mounted() {},\r\n methods: {\r\n changeContract(res) {\r\n console.log(res, 'res')\r\n this.dialogTableData.forEach((item) => {\r\n if (item.id === res) {\r\n this.parameter.bizReceipt.contractName = item.contractName\r\n this.parameter.bizReceipt.purchaseOrderCode = item.orderCode\r\n this.parameter.bizReceipt.purchaseOrderId = item.id\r\n this.parameter.bizReceipt.inManifestCompanyId = item.matCompanyId\r\n this.parameter.bizReceipt.inManifestCompanyName = item.matCompanyName\r\n this.parameter.bizReceipt.outManifestCompanyId = item.vendorId\r\n this.parameter.bizReceipt.outManifestCompanyName = item.vendorName\r\n this.parameter.detailList = []\r\n }\r\n })\r\n },\r\n selectOne(row) {\r\n salesOrder.selectOne(row.id).then((res) => {\r\n console.log(res)\r\n this.parameter = res.data.value\r\n if (!this.parameter.detailList) {\r\n this.parameter.detailList = []\r\n } else {\r\n this.oldDetailslist = JSON.parse(\r\n JSON.stringify(this.parameter.detailList)\r\n )\r\n this.parameter.detailList.forEach((item) => {\r\n item.TaxPrice = item.transactionPrice / item.num\r\n })\r\n }\r\n })\r\n },\r\n handleSelectionChange(val) {\r\n if (val.length > 1) {\r\n this.$refs.dialogTable.clearSelection()\r\n this.$refs.dialogTable.toggleRowSelection(val[val.length - 1])\r\n }\r\n this.selectObj = val[val.length - 1]\r\n if (!this.selectObj) {\r\n this.selectObj = {}\r\n }\r\n },\r\n getTableData() {\r\n this.params.querys = [\r\n {\r\n group: 'main',\r\n operation: 'EQUAL',\r\n parentGroup: '',\r\n property: 'status',\r\n relation: 'AND',\r\n value: 3,\r\n },\r\n ]\r\n this.params.sorter = []\r\n if (this.queryParams[0].value) {\r\n this.params.querys.push(this.queryParams[0])\r\n }\r\n\r\n // if (this.sorter[0].direction) {\r\n // this.params.sorter.push(this.sorter[0])\r\n // }\r\n\r\n salesOrder.querycCntractDetails(this.params).then((res) => {\r\n this.dialogTableData = res.data.value.rows\r\n })\r\n },\r\n getTableDataDetial() {\r\n salesOrder\r\n .querycCntractDetailsOne(this.parameter.bizReceipt.purchaseOrderId)\r\n .then((res) => {\r\n this.dialogTableDataDetial = res.data.value.detailsList\r\n console.log(this.dialogTableDataDetial)\r\n })\r\n },\r\n handleSearch() {\r\n this.getTableData()\r\n },\r\n handleSearchDetial() {\r\n this.getTableDataDetial()\r\n },\r\n clearSearchFormDetial() {\r\n this.queryParamsDetial[0].value = ''\r\n this.getTableDataDetial()\r\n },\r\n clearSearchForm() {\r\n this.queryParams[0].value = ''\r\n this.getTableData()\r\n },\r\n handleDialogTableSubmit() {\r\n let selection = this.selectObj\r\n\r\n this.getTableDataDetial(selection)\r\n this.dialogVisible = false\r\n this.dialogVisibleDetial = true\r\n },\r\n handleDialogTableSubmitDetial() {\r\n let selection = this.$refs.dialogTableDetial.selection\r\n\r\n if (this.selectObj.id !== this.parameter.bizReceipt.orderId) {\r\n this.parameter.detailList = []\r\n }\r\n\r\n if (selection) {\r\n selection.forEach((item) => {\r\n delete item['id']\r\n })\r\n }\r\n\r\n this.parameter.detailList.push(...selection)\r\n this.parameter.detailList.forEach((item) => {\r\n item.purchaseOrderDetailId = item.purchasingApplicationDetailId\r\n item.purchaseOrderId = item.orderId\r\n item.num = item.matNum ? item.matNum : 0\r\n item.taxRate = item.taxRate ? item.taxRate : 0\r\n item.TaxPrice = item.taxInprice ? item.taxInprice : 0\r\n item.transactionPrice = item.taxInvalue ? item.taxInvalue : 0\r\n })\r\n\r\n this.dialogVisibleDetial = false\r\n },\r\n handleDialogClose(done) {\r\n done()\r\n },\r\n handleDialogCloseDetial(done) {\r\n done()\r\n },\r\n changeNum(data) {\r\n console.log(data)\r\n let taxsum = 0\r\n this.parameter.detailList.forEach((item) => {\r\n if (item.num != null && item.TaxPrice != null) {\r\n item.transactionPrice = item.num * item.TaxPrice\r\n }\r\n })\r\n this.parameter.detailList.forEach((item) => {\r\n if (item.transactionPrice != null) {\r\n taxsum = taxsum + item.transactionPrice\r\n }\r\n })\r\n this.$set(this.parameter.bizReceipt, 'amount', taxsum)\r\n console.log(this.parameter)\r\n },\r\n //列表删除行\r\n addTable() {\r\n this.getTableDataDetial()\r\n this.dialogVisibleDetial = true\r\n },\r\n //列表删除行\r\n delTable(index, row) {\r\n this.parameter.detailList.splice(index, 1)\r\n if (row.id) {\r\n this.parameter.deleteDetailsId.push(row.id)\r\n }\r\n },\r\n //编辑\r\n addModifyBtn() {\r\n if (this.$route.query.editRows) {\r\n console.log()\r\n this.breadcrumbOpt[1].breadcrumbName = '编辑'\r\n this.modifychoData(this.$route.query.editRows)\r\n } else {\r\n this.breadcrumbOpt[1].breadcrumbName = '新增'\r\n }\r\n },\r\n //获取修改回显数据\r\n modifychoData(val) {\r\n console.log(val)\r\n },\r\n // 关闭//面包屑点击\r\n handleClose() {\r\n if (this.breadcrumbOpt[1].breadcrumbName === '编辑') {\r\n this.$router.push({\r\n name: 'shipmentsSales',\r\n params: {\r\n pageBean: this.$route.query.pageBean,\r\n },\r\n })\r\n } else {\r\n this.$router.push({\r\n name: 'shipmentsSales',\r\n })\r\n }\r\n\r\n // this.$emit('closeComponent')\r\n this.parameter = {}\r\n // this.$refs.formInfo.clearValidate()\r\n },\r\n DeleteDetail(toDelete) {\r\n salesOrder.batchDeleteDetails(toDelete).then((res) => {\r\n if (res.data.state) {\r\n console.log(res)\r\n }\r\n })\r\n },\r\n // 保存\r\n handleSave() {\r\n this.$refs.formInfo.validate((valid) => {\r\n if (valid) {\r\n let toDelete = []\r\n this.oldDetailslist.forEach((a) => {\r\n let found = false\r\n this.parameter.detailList.forEach((item) => {\r\n if (item.id && item.id == a.id) {\r\n found = true\r\n }\r\n })\r\n if (!found) {\r\n toDelete.push(a.id)\r\n }\r\n })\r\n\r\n toDelete = toDelete.join(',')\r\n\r\n salesOrder.batchSubmit(this.parameter).then((res) => {\r\n if (res.data.state) {\r\n this.$message.success('保存成功!')\r\n // this.DeleteDetail(toDelete)\r\n this.$router.go(-1)\r\n } else {\r\n this.$message.success('保存失败!')\r\n }\r\n })\r\n }\r\n })\r\n },\r\n handleCurrentChange(page) {\r\n this.params.pageBean = {...this.params.pageBean, page}\r\n this.getTableDataDetial()\r\n },\r\n handleSizeChange(pageSize) {\r\n this.params.pageBean = {...this.params.pageBean, pageSize}\r\n this.getTableDataDetial()\r\n },\r\n },\r\n}\r\n",null]}