| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290 |
- <template>
- <div class="borderless" v-loading="pageLoading">
- <div class="customer-head">
- <div class="customer-back">
- <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
- @click="backToList">返回列表
- </el-button>
- </div>
- <div class="add-customer-btn">
- <el-button type="primary" size="small" v-if="detailData.status == 1" class="el-button--small-yh "
- @click.stop="openEdit">编辑
- </el-button>
- <el-button type="primary" :disabled="disabled" @click="editCustomer" :loading="subLoading"
- v-if="detailData.status != 1" size="small">保存数据
- </el-button>
- </div>
- </div>
- <div class="customer-main">
- <trade-card title="基础信息">
- <avue-form ref="form" class="trading-form" v-model="form" :option="option">
- </avue-form>
- </trade-card>
- <trade-card title="出库明细">
- <avue-crud ref="crud" :data="data" :option="tableOption" @row-del="rowDel" @saveColumn="saveColumn"
- @resetColumn="resetColumn" :cell-style="cellStyle">
- </avue-crud>
- </trade-card>
- </div>
- </div>
- </template>
- <script>
- import tableOption from "./config/customerContact.json";
- export default {
- name: "detailsPageEdit",
- data() {
- return {
- show: true,
- oldExchange: null,
- treeStyle: "height:" + (window.innerHeight - 315) + "px",
- switchDialog: false,
- form: {},
- disabled: false,
- tableOption: {},
- option: {
- menuBtn: false,
- labelWidth: 100,
- column: [
- {
- label: "客户名称",
- prop: "corpid",
- span: 6
- },
- {
- label: "提单号",
- prop: "mblno",
- span: 6
- },
- {
- label: "单据编号",
- prop: "billno",
- span: 6
- },
- {
- label: "业务日期",
- prop: "bsdate",
- span: 6
- },
- {
- label: "车辆类型",
- prop: "cartype",
- span: 6
- },
- {
- label: "出口单号",
- prop: "emblno",
- span: 6
- },
- {
- label: "仓库",
- prop: "warehouseid",
- span: 6
- },
- {
- label: "仓管员",
- prop: "storekeeper",
- span: 6
- },
- {
- label: "计费单位",
- prop: "feetUnit",
- span: 6
- },
- {
- label: "作业类型",
- prop: "businessType",
- span: 6
- },
- {
- label: "计划件数",
- prop: "planqty",
- span: 6
- },
- {
- label: "计划毛重(kg)",
- prop: "plangrossweight",
- span: 6
- },
- {
- label: "计划净重(kg)",
- prop: "plannetweight",
- span: 6
- },
- {
- label: "劳务公司",
- prop: "labour",
- span: 6
- },
- {
- label: "车队",
- prop: "fleet",
- span: 6
- },
- {
- label: "车号",
- prop: "truckno",
- span: 6
- },
- {
- label: "司机姓名",
- prop: "driverName",
- span: 6
- },
- {
- label: "司机身份证",
- prop: "driverIdCar",
- span: 6
- },
- {
- label: "司机电话",
- prop: "driverTel",
- span: 6
- },
- {
- label: "打印抬头",
- prop: "company",
- span: 6
- },
- {
- label: "备注",
- prop: "remark",
- type: "textarea",
- minRows: 2,
- span: 12
- },
- {
- label: "收费指示",
- prop: "remarksFees",
- type: "textarea",
- minRows: 2,
- span: 12
- }
- ]
- },
- data: [],
- loading: false,
- subLoading: false,
- pageLoading: false,
- };
- },
- props: {
- detailData: {
- type: Object
- }
- },
- async created() {
- if (this.detailData.id) {
- this.getDetail(this.detailData.id);
- }
- this.tableOption = await this.getColumnData(
- this.getColumnName(162),
- tableOption
- );
- },
- methods: {
- cellStyle() {
- return "padding:0;height:40px;";
- },
- addRow() {
- this.data.push({ $cellEdit: true });
- },
- rowCell(row, index) {
- if (row.$cellEdit == true) {
- this.$set(row, "$cellEdit", false);
- } else {
- this.$set(row, "$cellEdit", true);
- }
- },
- rowSave(row) {
- this.$set(row, "$cellEdit", false);
- },
- rowDel(row) {
- this.$confirm("确定删除数据?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- this.$message({
- type: "success",
- message: "删除成功!"
- });
- this.data.splice(row.$index, 1);
- });
- },
- getDetail(id) {
- this.loading = true;
- this.pageLoading = true;
- },
- //修改提交触发
- editCustomer(status) {
- this.$refs["form"].validate((valid, done) => {
- done();
- if (valid) {
- this.subLoading = true;
- } else {
- return false;
- }
- });
- },
- //返回列表
- backToList() {
- this.$emit("goBack");
- },
- openEdit() {
- this.detailData.status = 2;
- this.option = this.$options.data().option;
- this.$refs.crud.refreshTable();
- },
- async saveColumn() {
- const inSave = await this.saveColumnData(
- this.getColumnName(162),
- this.tableOption
- );
- if (inSave) {
- this.$nextTick(() => {
- this.$refs.crud.doLayout();
- });
- this.$message.success("保存成功");
- //关闭窗口
- this.$refs.crud.$refs.dialogColumn.columnBox = false;
- }
- },
- async resetColumn() {
- this.tableOption = tableOption;
- const inSave = await this.delColumnData(
- this.getColumnName(162),
- tableOption
- );
- if (inSave) {
- this.$nextTick(() => {
- this.$refs.crud.doLayout();
- });
- this.$message.success("重置成功");
- //关闭窗口
- setTimeout(() => {
- this.$refs.crud.$refs.dialogColumn.columnBox = false;
- }, 1000);
- }
- }
- },
- watch: {
- }
- };
- </script>
- <style lang="scss" scoped>
- .trading-form ::v-deep .el-form-item {
- margin-bottom: 8px !important;
- }
- ::v-deep .el-form-item__error {
- display: none !important;
- }
- ::v-deep .select-component {
- display: flex !important;
- }
- </style>
|