| | |
| | | <el-col :span="6"> |
| | | <el-form-item label="销售员" prop="HEmpName"> |
| | | <el-input v-model="form.HEmpName" placeholder="请输入销售员" disabled> |
| | | <el-button slot="append" icon="el-icon-search"></el-button> |
| | | <el-button slot="append" icon="el-icon-search" @click="openDataDialog(4)"></el-button> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <Dept @deptEmitDb="dbEmitData" @deptEmit="emitData" v-if="deptShow" /> |
| | | <Warehouse @deptEmitDb="dbEmitData" @deptEmit="emitData" v-if="warehouseShow" /> |
| | | <Material @deptEmitDb="dbEmitData" @deptEmit="emitData" v-if="materialShow" /> |
| | | <GyEmployee @deptEmitDb="dbEmitData" @deptEmit="emitData" :openPage="HModName" v-if="gyEmployeeShow" /> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="deptClickSub">确 定</el-button> |
| | | <el-button @click="deptClose">取 消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <el-dialog title="隐藏列设置" :visible.sync="openRowHide" width="816px" append-to-body> |
| | | <RowSettings :colName="btResList" HModName="Kf_SellOutBillList" @rowEditClose="rowSetClose" v-if="rowHideShow" /> |
| | | <RowSettings :colName="btResList" :HModName="HModName" @rowEditClose="rowSetClose" v-if="rowHideShow" /> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | |
| | | import Warehouse from '@/views/component/warehouse' |
| | | import Material from '@/views/component/material' |
| | | import RowSettings from '@/views/component/rowSettings' |
| | | import GyEmployee from '@/views/basic/gyEmployee/gyEmployee.vue' |
| | | import moment from 'moment'; |
| | | |
| | | export default { |
| | | name: 'SellOutBill', |
| | | components: { Dept, Warehouse, Material, RowSettings }, |
| | | name: 'SellOutBillEdit', |
| | | components: { Dept, Warehouse, Material, RowSettings, GyEmployee }, |
| | | props: { |
| | | OperationType: { type: Number, }, |
| | | linterid: { type: Number, }, |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | HModName: "Kf_SellOutBill", |
| | | formShow: false, |
| | | temp: undefined, |
| | | formLoading: true, |
| | |
| | | deptShow: false,//部门数据组件 |
| | | warehouseShow: false,//仓库数据组件 |
| | | materialShow: false,//物料数据组件 |
| | | gyEmployeeShow: false,//销售员数据组件 |
| | | deptform: {},//弹窗选中数据 |
| | | openData: false,//数据弹窗 |
| | | dialogTitle: '', |
| | |
| | | this.fetchData() |
| | | this.getdata() |
| | | }, |
| | | beforeDestroy() { |
| | | this.$destroy() |
| | | }, |
| | | methods: { |
| | | fetchData() { |
| | | axios.get(this.baseURL + "/Web/GetOrganizations", { |
| | | axios.get(this.$baseUrl + "/Web/GetOrganizations", { |
| | | }).then(response => { |
| | | if (response.data.count == 1) { |
| | | this.organizationList = response.data.data;//组织列表 |
| | |
| | | }); |
| | | }, |
| | | getdata() { |
| | | console.log(this.copyType, this.OperationType) |
| | | this.formShow = false |
| | | this.formLoading = true |
| | | |
| | | if (this.OperationType == 4) { |
| | | this.zzSelDis = true |
| | | this.handleAdd() |
| | |
| | | var dataArray = []; |
| | | for (var i = 0; i < data.length; i++) { |
| | | // this.getPushSourceBillInit(data[i].hmainid, data[i].hsubid); |
| | | axios.get(this.baseURL + '/Xs_SeOrderBill/loadXs_SeOrderBill_Push', { |
| | | axios.get(this.$baseUrl + '/Xs_SeOrderBill/loadXs_SeOrderBill_Push', { |
| | | params: { |
| | | "HInterID": data[i].hmainid |
| | | , "HSubID": data[i].hsubid |
| | |
| | | }, |
| | | //根据主内码与子内码获取源单销售订单数据 |
| | | getPushSourceBillInit(HSourceInterID, HSourceEntryID) { |
| | | axios.get(this.baseURL + '/Xs_SeOrderBill/loadXs_SeOrderBill_Push', { |
| | | axios.get(this.$baseUrl + '/Xs_SeOrderBill/loadXs_SeOrderBill_Push', { |
| | | params: { |
| | | "HInterID": HSourceInterID |
| | | , "HSubID": HSourceEntryID |
| | |
| | | this.openRowHide = true |
| | | }, |
| | | rowSetClose(val) { |
| | | |
| | | this.rowHideShow = false |
| | | this.openRowHide = val |
| | | this.$destroy() |
| | | }, |
| | | |
| | | organizationChange(val) { |
| | |
| | | //部门弹窗赋值 |
| | | dbEmitData(deptRow, num) { |
| | | // num=1部门 num=2出库仓库 |
| | | if (num == 1) { |
| | | this.form.HDeptName = deptRow.部门名称 |
| | | this.form.HDeptID = deptRow.HItemID |
| | | this.form.HEmpID = deptRow.HEmpID |
| | | this.form.HManagerName = deptRow.负责人 |
| | | this.openData = false |
| | | } else if (num == 2) { |
| | | this.editData[this.zbIndex].HWHID = deptRow.HItemID; |
| | | this.editData[this.zbIndex].发货仓库 = deptRow.仓库名称; |
| | | this.openData = false |
| | | if (deptRow.HItemID) { |
| | | if (num == 1) { |
| | | this.form.HDeptName = deptRow.部门名称 |
| | | this.form.HDeptID = deptRow.HItemID |
| | | this.form.HManagerName = deptRow.负责人 |
| | | this.deptShow = false |
| | | this.openData = false |
| | | } else if (num == 2) { |
| | | this.editData[this.zbIndex].HWHID = deptRow.HItemID; |
| | | this.editData[this.zbIndex].发货仓库 = deptRow.仓库名称; |
| | | this.warehouseShow = false |
| | | this.openData = false |
| | | } else if (num == 3) { |
| | | this.editData[this.zbIndex].HMaterID = deptRow.HItemID; |
| | | this.editData[this.zbIndex].物料代码 = deptRow.物料代码; |
| | | this.editData[this.zbIndex].物料名称 = deptRow.物料名称; |
| | | this.editData[this.zbIndex].HUnitID = deptRow.HUnitID; |
| | | this.editData[this.zbIndex].规格型号 = deptRow.规格型号 |
| | | this.editData[this.zbIndex].计量单位 = deptRow.计量单位名称 |
| | | this.editData[this.zbIndex].HTaxPrice = deptRow.含税成本价 |
| | | this.editData[this.zbIndex].HTaxRate = deptRow.默认税率 |
| | | this.materialShow = false |
| | | this.openData = false |
| | | } else if (num == 4) { |
| | | this.form.HEmpName = deptRow.职员名称 |
| | | this.form.HEmpID = deptRow.HItemID |
| | | this.gyEmployeeShow = false |
| | | this.openData = false |
| | | } |
| | | } else { |
| | | this.$modal.msgError("请选择单条数据!"); |
| | | } |
| | | else if (num == 3) { |
| | | this.editData[this.zbIndex].HMaterID = deptRow.HItemID; |
| | | this.editData[this.zbIndex].物料代码 = deptRow.物料代码; |
| | | this.editData[this.zbIndex].物料名称 = deptRow.物料名称; |
| | | this.editData[this.zbIndex].HUnitID = deptRow.HUnitID; |
| | | this.editData[this.zbIndex].规格型号 = deptRow.规格型号 |
| | | this.editData[this.zbIndex].计量单位 = deptRow.计量单位名称 |
| | | this.editData[this.zbIndex].HTaxPrice = deptRow.含税成本价 |
| | | this.editData[this.zbIndex].HTaxRate = deptRow.默认税率 |
| | | this.openData = false |
| | | } |
| | | |
| | | }, |
| | | emitData(deptRow, num) { |
| | | this.dialogTypeNum = num |
| | |
| | | //退出 |
| | | close() { |
| | | this.reset() |
| | | |
| | | if (!this.OperationType && !this.copyType) { |
| | | // this.$router.back() |
| | | window.close() |
| | | const obj = { fullPath: this.$route.path, path: this.$route.path, name: this.$route.name, }; |
| | | this.$tab.closePage(obj).then(res => { |
| | | const latestView = res.visitedViews.slice(-1)[0] |
| | | if (latestView) { |
| | | this.$router.push(latestView.fullPath) |
| | | } else { |
| | | if (obj.name === 'Dashboard') { |
| | | this.$router.replace({ path: '/redirect' + obj.fullPath }) |
| | | } else { |
| | | this.$router.push('/') |
| | | } |
| | | } |
| | | }); |
| | | } else { |
| | | this.formShow = false |
| | | this.$emit('editClose', false) |
| | |
| | | }, |
| | | //根据用户获取对应职员、部门、销售主管 |
| | | getCzyglByUser() { |
| | | axios.get(this.baseURL + '/Xs_SeOrderBill/getCzyglByUser', { |
| | | axios.get(this.$baseUrl + '/Xs_SeOrderBill/getCzyglByUser', { |
| | | params: { "CurUserName": sessionStorage["HUserName"] } |
| | | }).then(response => { |
| | | let dataForm = response.data.data[0] |
| | |
| | | }) |
| | | }, |
| | | getHBillNo() { |
| | | axios.get(this.baseURL + "/WEBSController/GetMaxBillNoAndID_Json", { |
| | | axios.get(this.$baseUrl + "/WEBSController/GetMaxBillNoAndID_Json", { |
| | | params: { |
| | | HBillType: '1205' |
| | | } |
| | |
| | | }, |
| | | //获取销售出库单对应的条码明细 |
| | | getBarCodeNoteBySellOutBill(rowHmainid) { |
| | | axios.get(this.baseURL + '/Kf_SellOutBill/BarCodeNote', { |
| | | axios.get(this.$baseUrl + '/Kf_SellOutBill/BarCodeNote', { |
| | | params: { "HInterID": rowHmainid } |
| | | }).then(response => { |
| | | if (response.data.count == 1) { |
| | |
| | | }, |
| | | //#region 根据客户获取客户余额 |
| | | getCustomerBalance(HCusID) { |
| | | axios.get(this.baseURL + '/Xs_CusRatingChangeBill/getCustomerBalance', { |
| | | axios.get(this.$baseUrl + '/Xs_CusRatingChangeBill/getCustomerBalance', { |
| | | params: { "HCusID": HCusID, 'CurUserName': sessionStorage["HUserName"] } |
| | | }).then(response => { |
| | | if(response.data.count == 0) { |
| | | this.$modal.msgWarning(response.data.Message); |
| | | return |
| | | } |
| | | var data = response.data.data[0]; |
| | | this.form.HCusBalance = data.HCusBalance |
| | | this.form.HCreditRating_Now = data.HCreditRating_Now |
| | | this.form.HAvailableBalance = data.HAvailableBalance |
| | | }).catch(error => { |
| | | console.error(error) |
| | | this.$modal.msgError("接口请求失败!"); |
| | | }); |
| | | }, |
| | |
| | | handleUpdate() { |
| | | this.reset() |
| | | let rowHmainid = this.linterid |
| | | console.log(this.linterid) |
| | | axios.get(this.baseURL + "/Kf_SellOutBill/cx", { |
| | | axios.get(this.$baseUrl + "/Kf_SellOutBill/cx", { |
| | | params: { 'HInterID': rowHmainid } |
| | | }).then(response => { |
| | | if (response.data.count == 1) { |
| | |
| | | }, |
| | | //根据客户带出联系人、联系电话 |
| | | getCustomerByCusID(HCusID) { |
| | | axios.get(this.baseURL + "/Xs_SeOrderBill/getCustomerByCusID", { |
| | | axios.get(this.$baseUrl + "/Xs_SeOrderBill/getCustomerByCusID", { |
| | | params: { |
| | | HCusID: HCusID |
| | | } |
| | | }).then(response => { |
| | | if(response.data.count == 0) { |
| | | this.$modal.msgWarning(response.data.Message); |
| | | return |
| | | } |
| | | this.form.联系人 = response.data.data[0].HLinkMan |
| | | this.form.联系电话 = response.data.data[0].HLinkPhone |
| | | // this.form = response.data.data[0] |
| | |
| | | var sql = `exec h_p_Xt_GetMaxBillNo_SubType '1205','${this.form.HDate}',0,0,0,'${Type}','${this.form.HDeptID}'`; |
| | | axios({ |
| | | method: 'get', |
| | | url: this.baseURL + "/CommonModel/searchMethod", |
| | | url: this.$baseUrl + "/CommonModel/searchMethod", |
| | | params: { "sql": sql, "user": sessionStorage["HUserName"], "ModRightNameCheck": "" }, |
| | | }).then(response => { |
| | | if (response.data.count == 1) { |
| | |
| | | var sMainSub = sMainStr + ';' + sSubStr + ';' + sessionStorage["HUserName"] + ';' + this.OperationType; |
| | | axios({ |
| | | method: 'post', |
| | | url: this.baseURL + "/Kf_SellOutBill/SaveSellOutBillList", |
| | | url: this.$baseUrl + "/Kf_SellOutBill/SaveSellOutBillList", |
| | | data: { |
| | | 'msg': sMainSub |
| | | }, |
| | |
| | | set_CheckBill(num, form) { |
| | | var InterID = form.hmainid || form.HInterID |
| | | //逻辑审核方法 |
| | | axios.get(this.baseURL + "/Kf_SellOutBill/AuditKf_SellOutBill", { |
| | | axios.get(this.$baseUrl + "/Kf_SellOutBill/AuditKf_SellOutBill", { |
| | | params: { "HInterID": InterID, "IsAudit": num, "CurUserName": sessionStorage["HUserName"] } |
| | | }).then(response => { |
| | | let result = response.data |
| | |
| | | this.deptShow = false |
| | | this.warehouseShow = false |
| | | this.materialShow = false |
| | | this.gyEmployeeShow = false |
| | | }, |
| | | // 打开数据列表弹窗 |
| | | openDataDialog(num, row) { |
| | | //num1部门,2出库仓库,3物料,4销售员 |
| | | if (row) { |
| | | this.zbIndex = row.index - 1 |
| | | } |
| | |
| | | this.dialogTitle = '物料列表' |
| | | this.materialShow = true |
| | | this.openData = true |
| | | } else if (num == 4) { |
| | | this.dialogTitle = '销售员列表' |
| | | this.gyEmployeeShow = true |
| | | this.openData = true |
| | | } |
| | | }, |
| | | } |