| | |
| | | openData: false, //数据弹窗 |
| | | dialogTitle: "", |
| | | zuzhiId: 0, |
| | | organizationList: [], //组织列表 |
| | | organizationList: JSON.parse(sessionStorage.getItem('organizationList')), //组织列表 |
| | | subDisabled: false, //编辑页面保存按钮是否禁用(true禁用,false可用) |
| | | CheckBillDisabled: true, |
| | | // OperationType: this.$route.query.OperationType,//保存类型(新增1修改3) |
| | | HInterID: null, |
| | | baseURL: process.env.VUE_APP_BASE_API || "http://47.96.97.237/API/", |
| | | user: "admin", |
| | | currentRow: [], |
| | | lastSelectedRowIndex: null, // 用于记录上次点击的行索引 |
| | | lastSelectedRow: null, // 上一次选中的行 |
| | |
| | | }, |
| | | created() { |
| | | this.reset(); |
| | | this.fetchData(); |
| | | this.getdata(); |
| | | }, |
| | | activated() { |
| | | this.reset(); |
| | | this.fetchData(); |
| | | this.getdata(); |
| | | }, |
| | | methods: { |
| | | fetchData() { |
| | | //登录用户信息 |
| | | axios |
| | | .get( |
| | | "http://47.96.97.237/API/Web/GetUser?UserName=001&PassWord=123456&HOrgName=100038" |
| | | ) |
| | | .then((response) => { |
| | | let data = response.data.data[0]; |
| | | this.zuzhiId = data.HUSEORGID; //根据登录用户获取默认的组织ID |
| | | this.user = data.Czymc; |
| | | axios |
| | | .get(this.baseURL + "/Web/GetOrganizations", {}) |
| | | .then((response) => { |
| | | if (response.data.count == 1) { |
| | | this.organizationList = response.data.data; //组织列表 |
| | | this.getdata(); |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | this.$modal.msgError("接口请求失败!"); |
| | | }); |
| | | }) |
| | | .catch((error) => { |
| | | this.$modal.msgError("接口请求失败!"); |
| | | }); |
| | | }, |
| | | getdata() { |
| | | this.reset(); |
| | | console.log(this.OperationType); |
| | | console.log(this.OperationType,this.copyType); |
| | | if (this.OperationType != 1) { |
| | | this.zzSelDis = true; |
| | | axios |
| | | .get(this.baseURL + "/Gy_Department/cx", { |
| | | params: { |
| | | HInterID: this.linterid, |
| | | }, |
| | | }) |
| | | .then((response) => { |
| | | console.log(response); |
| | | let result = response.data; |
| | | if (result.code == 1) { |
| | | // 说明验证成功了, |
| | | var data = result.data[0]; |
| | | Object.assign(this.form, { |
| | | HNumber: data.部门代码, |
| | | HItemID: data.HItemID, |
| | | HName: data.部门名称, |
| | | HHelpCode: data.HHelpCode, |
| | | HEmpID: data.HEmpID, |
| | | HEmpName: data.HEmpName, |
| | | HBarCode: data.条形码, |
| | | HStopflag: data.禁用标记, |
| | | HRemark: data.HRemark, |
| | | HUSEORGID: data.HUSEORGID, |
| | | HRemark: data.备注, |
| | | HMakeEmp: data["创建人"], |
| | | HMakeDate: |
| | | data["创建日期"] == null |
| | | ? "" |
| | | : dayjs(new Date(data["创建日期"])).format("yyyy-MM-dd"), |
| | | HCheckEmp: data["审核人"], |
| | | HCheckDate: |
| | | data["审核日期"] == null |
| | | ? "" |
| | | : dayjs(new Date(data["审核日期"])).format("yyyy-MM-dd"), |
| | | HStopEmp: data["禁用人"], |
| | | HStopDate: |
| | | data["禁用日期"] == null |
| | | ? "" |
| | | : dayjs(new Date(data["禁用日期"])).format("yyyy-MM-dd"), |
| | | }); |
| | | if (!data.HCheckEmp) { |
| | | this.CheckBillDisabled = false; |
| | | } |
| | | } |
| | | this.$nextTick(() => { |
| | | this.formShow = true; |
| | | this.formLoading = false; |
| | | axios.get(this.$baseUrl + "/Gy_Department/cx", { |
| | | params: { |
| | | HInterID: this.linterid, |
| | | }, |
| | | }).then((response) => { |
| | | let result = response.data; |
| | | if (result.code == 1) { |
| | | // 说明验证成功了, |
| | | var data = result.data[0]; |
| | | Object.assign(this.form, { |
| | | HNumber: data.部门代码, |
| | | HItemID: data.HItemID, |
| | | HName: data.部门名称, |
| | | HHelpCode: data.HHelpCode, |
| | | HEmpID: data.HEmpID, |
| | | HEmpName: data.HEmpName, |
| | | HBarCode: data.条形码, |
| | | HStopflag: data.禁用标记, |
| | | HRemark: data.HRemark, |
| | | HUSEORGID: data.HUSEORGID, |
| | | HRemark: data.备注, |
| | | HMakeEmp: data["创建人"], |
| | | HMakeDate: data["创建日期"] == null ? "" : dayjs(new Date(data["创建日期"])).format("yyyy-MM-dd"), |
| | | HCheckEmp: data["审核人"], |
| | | HCheckDate: data["审核日期"] == null ? "" : dayjs(new Date(data["审核日期"])).format("yyyy-MM-dd"), |
| | | HStopEmp: data["禁用人"], |
| | | HStopDate: data["禁用日期"] == null ? "" : dayjs(new Date(data["禁用日期"])).format("yyyy-MM-dd"), |
| | | }); |
| | | }) |
| | | .catch((error) => { |
| | | this.$modal.msgError("接口请求失败!"); |
| | | if (!data.HCheckEmp) { |
| | | this.CheckBillDisabled = false; |
| | | } |
| | | if (this.copyType == 1) { |
| | | this.form.HItemID = 0 |
| | | this.form.HMakeEmp = sessionStorage["HUserName"] |
| | | this.form.HMakeDate = moment(new Date()).format("YYYY-MM-DDTHH:mm:ss") |
| | | this.form.HCheckEmp = '' |
| | | this.form.HCheckDate = '' |
| | | this.form.HStopEmp = '' |
| | | this.form.HStopDate = '' |
| | | } |
| | | } |
| | | this.$nextTick(() => { |
| | | this.formShow = true; |
| | | this.formLoading = false; |
| | | }); |
| | | }).catch((error) => { |
| | | this.$modal.msgError("接口请求失败!"); |
| | | }); |
| | | } else if (this.OperationType == 1) { |
| | | let date = new Date(); |
| | | this.form.HMakeDate = moment(date).format("YYYY-MM-DDTHH:mm:ss"); |
| | |
| | | reset() { |
| | | this.form = { |
| | | HNumber: '', |
| | | HItemID:0, |
| | | HItemID: 0, |
| | | HName: '', |
| | | HHelpCode: '', |
| | | HEmpID: 0, |
| | | HEmpName: '', |
| | | HBarCode: '', |
| | | HStopflag: false, |
| | | HRemark:'', |
| | | HUSEORGID:sessionStorage["OrganizationID"], |
| | | HRemark: '', |
| | | HMakeEmp:sessionStorage["HUserName"], |
| | | HUSEORGID: sessionStorage["OrganizationID"] - 0, |
| | | HRemark: '', |
| | | HMakeEmp: sessionStorage["HUserName"], |
| | | HMakeTime: null, |
| | | HStopEmp: null, |
| | | HStopTime: null, |
| | |
| | | var sMainStr = JSON.stringify(this.form); |
| | | axios({ |
| | | method: "post", |
| | | url: this.baseURL + "/Gy_Department/AddBill1", |
| | | url: this.$baseUrl + "/Gy_Department/AddBill1", |
| | | data: { |
| | | oMain: sMainStr + ';' + sessionStorage["HUserName"] + ';' + sessionStorage["OrganizationID"], |
| | | }, |
| | |
| | | .then(() => { |
| | | if (this.rowForm.状态 == "创建") { |
| | | axios |
| | | .get(this.baseURL + "/Kf_SellOutBill/DeltetSellOutBill", { |
| | | params: { HInterID: this.rowForm.hmainid.toString(), user: this.user }, |
| | | .get(this.$baseUrl + "/Kf_SellOutBill/DeltetSellOutBill", { |
| | | params: { HInterID: this.rowForm.hmainid.toString(), user: sessionStorage["HUserName"] }, |
| | | }) |
| | | .then((response) => { |
| | | if (response.data.count == 1) { |
| | |
| | | }, |
| | | // 反审核/审核数据 |
| | | set_CheckBill(num, form) { |
| | | var InterID = form.HItemID || form.HInterID; |
| | | var InterID = this.form.HItemID.toString(); |
| | | //逻辑审核方法 |
| | | axios |
| | | .get(this.baseURL + "/Gy_Department/StopGy_Department", { |
| | | params: { HInterID: InterID, IsAudit: num, CurUserName: this.user }, |
| | | .get(this.$baseUrl + "/Gy_Department/AuditGy_Department", { |
| | | params: { HInterID: InterID, IsAudit: num, CurUserName: sessionStorage["HUserName"] }, |
| | | }) |
| | | .then((response) => { |
| | | let result = response.data; |