123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477 |
- <template>
- <div class="app-container">
- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
- <el-form-item label="入库单号" prop="asnNo">
- <el-input
- v-model="queryParams.asnNo"
- placeholder="请输入入库单号"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="入库类型" prop="asnType">
- <el-select v-model="queryParams.asnType" placeholder="请选择入库类型" clearable size="small">
- <el-option
- v-for="dict in dict.type.asn_type"
- :key="dict.value"
- :label="dict.label"
- :value="dict.value"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="单据状态" prop="asnStatus">
- <el-select v-model="queryParams.asnStatus" placeholder="请选择单据状态" clearable size="small">
- <el-option
- v-for="dict in dict.type.asn_status"
- :key="dict.value"
- :label="dict.label"
- :value="dict.value"
- />
- </el-select>
- </el-form-item>
- <!-- <el-form-item label="采购单号" prop="asnReference1">-->
- <!-- <el-input-->
- <!-- v-model="queryParams.asnReference1"-->
- <!-- placeholder="请输入采购单号"-->
- <!-- clearable-->
- <!-- size="small"-->
- <!-- @keyup.enter.native="handleQuery"-->
- <!-- />-->
- <!-- </el-form-item>-->
- <!-- <el-form-item label="预期到货时间" prop="expectedArriveTime">-->
- <!-- <el-date-picker clearable size="small"-->
- <!-- v-model="queryParams.expectedArriveTime"-->
- <!-- type="date"-->
- <!-- value-format="yyyy-MM-dd"-->
- <!-- placeholder="选择预期到货时间">-->
- <!-- </el-date-picker>-->
- <!-- </el-form-item>-->
- <el-form-item label="创建时间">
- <el-date-picker
- v-model="dateRange"
- size="small"
- style="width: 240px"
- value-format="yyyy-MM-dd"
- type="daterange"
- range-separator="-"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- ></el-date-picker>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
- </el-form-item>
- </el-form>
- <el-row :gutter="10" class="mb8">
- <el-col :span="1.5">
- <el-button
- type="primary"
- plain
- icon="el-icon-plus"
- size="mini"
- @click="handleAdd"
- v-hasPermi="['docAsn:docAsn:add']"
- >新增</el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="danger"
- plain
- icon="el-icon-delete"
- size="mini"
- :disabled="multiple"
- @click="handleDelete"
- v-hasPermi="['docAsn:docAsn:remove']"
- >删除</el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="warning"
- plain
- icon="el-icon-download"
- size="mini"
- @click="handleExport"
- v-hasPermi="['docAsn:docAsn:export']"
- >导出</el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="danger"
- plain
- icon="el-icon-message"
- size="mini"
- :disabled="multiple"
- @click="handlePush"
- v-hasPermi="['docAsn:docAsn:push']"
- >发送</el-button>
- </el-col>
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
- </el-row>
- <el-table v-loading="loading" :data="docAsnList" @selection-change="handleSelectionChange">
- <el-table-column type="selection" width="55" align="center" />
- <el-table-column label="入库单号" align="center" prop="asnNo" />
- <el-table-column label="入库类型" align="center" prop="asnType">
- <template slot-scope="scope">
- <dict-tag :options="dict.type.asn_type" :value="scope.row.asnType"/>
- </template>
- </el-table-column>
- <el-table-column label="单据状态" align="center" prop="asnStatus">
- <template slot-scope="scope">
- <dict-tag :options="dict.type.asn_status" :value="scope.row.asnStatus"/>
- </template>
- </el-table-column>
- <!--<el-table-column label="客户" align="center" prop="customerId" />-->
- <!-- <el-table-column label="客户单号" align="center" prop="customerNo" />-->
- <!-- <el-table-column label="采购单号" align="center" prop="asnReference1" />-->
- <!--<el-table-column label="asn参考信息" align="center" prop="asnReference2" />-->
- <!-- <el-table-column label="预期到货时间" align="center" prop="expectedArriveTime" width="180">-->
- <!-- <template slot-scope="scope">-->
- <!-- <span>{{ parseTime(scope.row.expectedArriveTime, '{y}-{m}-{d}') }}</span>-->
- <!-- </template>-->
- <!-- </el-table-column>-->
- <el-table-column label="创建时间" align="center" prop="createTime" width="180">
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
- <template slot-scope="scope">
- <el-button
- size="mini"
- type="text"
- icon="el-icon-view"
- @click="handleView(scope.row)"
- >查看</el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-edit"
- @click="handleUpdate(scope.row)"
- v-hasPermi="['docAsn:docAsn:edit']"
- v-if="scope.row.asnStatus != '98' && scope.row.asnStatus != '99' && scope.row.asnStatus != '97'"
- >修改</el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-delete"
- @click="handleDelete(scope.row)"
- v-if="scope.row.asnStatus == '00' && scope.row.asnStatus == '97'"
- v-hasPermi="['docAsn:docAsn:remove']"
- >删除</el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-edit"
- @click="handleClose(scope.row)"
- v-hasPermi="['docAsn:docAsn:close']"
- v-if="scope.row.asnStatus != '98' && scope.row.asnStatus != '99' && scope.row.asnStatus != '97'"
- >关闭</el-button>
- </template>
- </el-table-column>
- </el-table>
- <pagination
- v-show="total>0"
- :total="total"
- :page.sync="queryParams.pageNum"
- :limit.sync="queryParams.pageSize"
- @pagination="getList"
- />
- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="this.getList"></add-or-update>
- </div>
- </template>
- <script>
- import { listDocAsn, getDocAsn, delDocAsn, addDocAsn, updateDocAsn, closeDocAsn,pushDocAsn} from "@/api/docAsn/docAsn";
- import AddOrUpdate from './docAsnHeader-add-or-update'
- export default {
- name: "DocAsn",
- dicts: ['asn_status', 'asn_type'],
- data() {
- return {
- // 遮罩层
- loading: true,
- // 选中数组
- ids: [],
- // 子表选中数据
- checkedWmsDocAsnDetails: [],
- // 非单个禁用
- single: true,
- // 非多个禁用
- multiple: true,
- // 显示搜索条件
- showSearch: true,
- // 总条数
- total: 0,
- // 入库单表格数据
- docAsnList: [],
- // 入库单体表格数据
- wmsDocAsnDetailsList: [],
- // 弹出层标题
- title: "",
- // 是否显示弹出层
- open: false,
- //明细编辑
- addOrUpdateVisible: false,
- dateRange: [],
- // 查询参数
- queryParams: {
- pageNum: 1,
- pageSize: 10,
- asnNo: null,
- asnType: null,
- asnStatus: null,
- asnReference1: null,
- asnReference2: null,
- releaseStatus: null,
- expectedArriveTime: null,
- notes: null,
- supplierId: null
- },
- // 表单参数
- form: {},
- // 表单校验
- rules: {
- }
- };
- },
- components: {
- AddOrUpdate
- },
- created() {
- this.getList();
- },
- methods: {
- /** 查询入库单列表 */
- getList() {
- this.loading = true;
- listDocAsn(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
- this.docAsnList = response.rows;
- this.total = response.total;
- this.loading = false;
- });
- },
- // 取消按钮
- cancel() {
- this.open = false;
- this.reset();
- },
- // 表单重置
- reset() {
- this.form = {
- asnNo: null,
- asnType: null,
- asnStatus: "0",
- customerId: null,
- customerNo: null,
- asnReference1: null,
- asnReference2: null,
- releaseStatus: "0",
- expectedArriveTime: null,
- paNo: null,
- qcNo: null,
- notes: null,
- supplierId: null,
- userdefine1: null,
- userdefine2: null,
- userdefine3: null,
- userdefine4: null,
- userdefine5: null,
- createUserId: null,
- createDate: null,
- editUserId: null,
- editDate: null,
- activeFlag: null,
- hEdi01: null,
- hEdi02: null,
- hEdi03: null,
- hEdi04: null,
- hEdi05: null,
- hEdi06: null,
- hEdi07: null,
- hEdi08: null,
- hEdi09: null,
- hEdi10: null,
- hEdi11: null,
- hEdi12: null,
- hEdi13: null,
- hEdi14: null,
- hEdi15: null,
- desc2:null
- };
- this.wmsDocAsnDetailsList = [];
- this.resetForm("form");
- },
- /** 搜索按钮操作 */
- handleQuery() {
- this.queryParams.pageNum = 1;
- this.getList();
- },
- /** 重置按钮操作 */
- resetQuery() {
- this.resetForm("queryForm");
- this.handleQuery();
- },
- // 多选框选中数据
- handleSelectionChange(selection) {
- this.ids = selection.map(item => item.asnNo)
- this.single = selection.length!==1
- this.multiple = !selection.length
- },
- /** 新增按钮操作 */
- handleAdd() {
- this.reset();
- this.addOrUpdateVisible = true
- this.$nextTick(() => {
- this.$refs.addOrUpdate.init('undefine')
- })
- },
- /** 修改按钮操作 */
- handleUpdate(row) {
- this.reset();
- this.addOrUpdateVisible = true
- this.$nextTick(() => {
- this.$refs.addOrUpdate.init(row.asnNo)
- })
- },
- /** 提交按钮 */
- submitForm() {
- this.$refs["form"].validate(valid => {
- if (valid) {
- this.form.wmsDocAsnDetailsList = this.wmsDocAsnDetailsList;
- if (this.form.asnNo != null) {
- updateDocAsn(this.form).then(response => {
- this.$modal.msgSuccess("修改成功");
- this.open = false;
- this.getList();
- });
- } else {
- addDocAsn(this.form).then(response => {
- this.$modal.msgSuccess("新增成功");
- this.open = false;
- this.getList();
- });
- }
- }
- });
- },
- /** 删除按钮操作 */
- handleDelete(row) {
- const asnNos = row.asnNo || this.ids;
- this.$modal.confirm('是否确认删除入库单编号为"' + asnNos + '"的数据项?').then(function() {
- return delDocAsn(asnNos);
- }).then(() => {
- this.getList();
- this.$modal.msgSuccess("删除成功");
- }).catch(() => {});
- },
- /** 发送按钮操作 */
- handlePush(row) {
- const asnNos = row.asnNo || this.ids;
- this.$modal.confirm('是否确认发送入库单编号为"' + asnNos + '"的数据项?').then(function() {
- return pushDocAsn(asnNos);
- }).then(() => {
- this.getList();
- this.$modal.msgSuccess("发送成功");
- }).catch(() => {});
- },
- /** 入库单体序号 */
- rowWmsDocAsnDetailsIndex({ row, rowIndex }) {
- row.index = rowIndex + 1;
- },
- /** 入库单体添加按钮操作 */
- handleAddWmsDocAsnDetails() {
- let obj = {};
- obj.sku = "";
- obj.expectedQty = "";
- obj.expectedQtyEach = "";
- obj.receivedQty = "";
- obj.receivedQtyEach = "";
- obj.lineStatus = "";
- obj.holdRejectreason = "";
- obj.notes = "";
- obj.packId = "";
- obj.locationZone = "";
- obj.lotatt01 = "";
- obj.lotatt02 = "";
- obj.lotatt03 = "";
- obj.lotatt04 = "";
- obj.lotatt05 = "";
- obj.lotatt06 = "";
- obj.lotatt07 = "";
- obj.lotatt08 = "";
- obj.lotatt09 = "";
- obj.lotatt10 = "";
- obj.lotatt11 = "";
- obj.lotatt12 = "";
- obj.lotatt13 = "";
- obj.lotatt14 = "";
- obj.lotatt15 = "";
- obj.lotatt16 = "";
- obj.lotatt17 = "";
- obj.lotatt18 = "";
- obj.createUserId = "";
- obj.createDate = "";
- obj.editUserId = "";
- obj.editDate = "";
- obj.locationId = "";
- obj.documentId = "";
- obj.dEdi01 = "";
- obj.dEdi02 = "";
- obj.dEdi03 = "";
- obj.dEdi04 = "";
- obj.dEdi05 = "";
- obj.dEdi06 = "";
- obj.dEdi07 = "";
- obj.dEdi08 = "";
- obj.dEdi09 = "";
- obj.dEdi10 = "";
- obj.dEdi11 = "";
- obj.dEdi12 = "";
- obj.dEdi13 = "";
- obj.dEdi14 = "";
- obj.dEdi15 = "";
- this.wmsDocAsnDetailsList.push(obj);
- },
- /** 入库单体删除按钮操作 */
- handleDeleteWmsDocAsnDetails() {
- if (this.checkedWmsDocAsnDetails.length == 0) {
- this.$modal.msgError("请先选择要删除的入库单体数据");
- } else {
- const wmsDocAsnDetailsList = this.wmsDocAsnDetailsList;
- const checkedWmsDocAsnDetails = this.checkedWmsDocAsnDetails;
- this.wmsDocAsnDetailsList = wmsDocAsnDetailsList.filter(function(item) {
- return checkedWmsDocAsnDetails.indexOf(item.index) == -1
- });
- }
- },
- /** 复选框选中数据 */
- handleWmsDocAsnDetailsSelectionChange(selection) {
- this.checkedWmsDocAsnDetails = selection.map(item => item.index)
- },
- /** 导出按钮操作 */
- handleExport() {
- this.download('docAsn/docAsn/export', {
- ...this.queryParams
- }, `docAsn_${new Date().getTime()}.xlsx`)
- },
- handleClose(row) {
- this.$modal.confirm('是否确认关闭入库单编号为"' + row.asnNo + '"的数据项?').then(function() {
- return closeDocAsn(row.asnNo);
- }).then(() => {
- this.getList();
- this.$modal.msgSuccess("删除成功");
- }).catch(() => {});
- },
- handleView(row) {
- this.addOrUpdateVisible = true
- this.$refs.addOrUpdate.init(row.asnNo, true)
- }
- }
- };
- </script>
|