浏览代码

加是否制造商

lining 6 年之前
父节点
当前提交
5ccf380e88

+ 1 - 0
src/dashoo.cn/backend/api/business/oilsupplier/tableheader/tableheader.go

@@ -10,6 +10,7 @@ type BaseTableheader struct {
 	Code           string    `xorm:"not null comment('名称号') VARCHAR(10)"`
 	Categorycode   string    `xorm:"not null comment('类别编码') VARCHAR(10)"`
 	Categoryname   string    `xorm:"not null comment('类别名称') VARCHAR(20)"`
+	IsManuf        string    `xorm:"not null comment('是否是制造商') VARCHAR(2)"`
 	Remark         string    `xorm:"comment('备注') VARCHAR(500)"`
 	Isdelete       int       `xorm:"default 0 comment('是否以删除(0正常,1已删除)') INT(10)"`
 	SortCode       int       `xorm:"default 0 comment('排序码') INT(10)"`

+ 4 - 1
src/dashoo.cn/backend/api/controllers/oilsupplier/tableheader.go

@@ -153,6 +153,7 @@ func (this *TableHeaderController) Getlocations() {
 type SBaseTableheader struct {
 	EditName string
 	SortCode int
+	IsManuf  string
 }
 
 // @Title 通过id更新
@@ -184,6 +185,7 @@ func (this *TableHeaderController) UpdateById() {
 
 	model.Name = model1.EditName
 	model.SortCode = model1.SortCode
+	model.IsManuf = model1.IsManuf
 
 	var Name = model.Name
 
@@ -192,6 +194,7 @@ func (this *TableHeaderController) UpdateById() {
 
 	where := "1=1 and name='" + Name + "'"
 	where += " and CategoryCode='"+ tmpModel.Categorycode +"'"
+	where += " and IsManuf='"+ model.IsManuf +"'"
 	where += " and Id != '"+ strconv.Itoa(tmpModel.Id) +"'"
 	total := svc.GetName(BaseTableHeader, where)
 	if total != 0 {
@@ -200,7 +203,7 @@ func (this *TableHeaderController) UpdateById() {
 		this.Data["json"] = &errinfo
 		this.ServeJSON()
 	} else {
-		cols = []string{"Name", "SortCode", "Modifiedon", "Modifieduserid", "Modifiedby"}
+		cols = []string{"Name", "SortCode", "IsManuf", "Modifiedon", "Modifieduserid", "Modifiedby"}
 
 		err := svc.UpdateEntityBytbl(BaseTableHeader, id, &model, cols)
 		if err == nil {

+ 1 - 1
src/dashoo.cn/frontend_web/nuxt.config.ignore.js

@@ -181,7 +181,7 @@ module.exports = {
     'pages/oilsupplier/tablefieldsetting/*.*',
     'pages/oilsupplier/technologyservice/*.*',
     'pages/system/*/*.*',
-    'pages/setting/*/*.*',
+    // 'pages/setting/*/*.*',
     // 'pages/select/*/*.*',
     'pages/report/*/*.*',
     'pages/oilbank/*/*.*',

+ 82 - 3
src/dashoo.cn/frontend_web/src/pages/setting/qcdSettings.vue

@@ -50,7 +50,16 @@
         <el-table-column label="名称"  width="360" prop="Name"></el-table-column>
         <el-table-column label="编码"  width="260" prop="Code"></el-table-column>
         <el-table-column label="类别名称"  width="260" prop="Categoryname"></el-table-column>
-
+        <el-table-column label="制造商"  width="100" prop="IsManuf">
+          <template slot-scope="scope">
+            {{isManufStr(scope.row.IsManuf)}}
+          </template>
+        </el-table-column>
+        <el-table-column label="排序码"  width="100" prop="SortCode">
+          <template slot-scope="scope">
+            <el-input size="small" v-model="scope.row.SortCode" style="width: 100%" @change="updateSortCode(scope.row)"></el-input>
+          </template>
+        </el-table-column>
          <!--内框表格操作栏显示-->
         <el-table-column label="操作" min-width="160" align="center" fixed="right">
           <template slot-scope="scope">
@@ -83,6 +92,20 @@
             </el-form-item>
           </el-col>
         </el-row>
+
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="是否是供应商" required prop="IsManuf">
+              <el-select  style="width: 100%" v-model="entityForm.IsManuf">
+                <el-option label="无" value="0"></el-option>
+                <el-option label="是" value="1"></el-option>
+                <el-option label="否" value="2"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+
         <!-- 第二行 -->
         <el-row>
           <el-col :span="24">
@@ -151,6 +174,18 @@
           </el-col>
         </el-row>
 
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="是否是供应商" required prop="IsManuf">
+              <el-select  style="width: 100%" v-model="editForm.IsManuf">
+                <el-option label="无" value="0"></el-option>
+                <el-option label="是" value="1"></el-option>
+                <el-option label="否" value="2"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+
         <!-- 第二行 -->
         <el-row>
             <el-col :span="24">
@@ -216,13 +251,15 @@ export default {
         Name: '',
         Categorycode: '',
         Code: '',
-        SortCode: 0
+        SortCode: 0,
+        IsManuf: '0'
       },
       editForm: {
         EditName: '',
         EditCategorycode: '',
         EditCode: '',
-        SortCode: 0
+        SortCode: 0,
+        IsManuf: '0'
       },
       searchForm:{
        SearchSupplierTypeName: ''
@@ -277,6 +314,13 @@ export default {
             message: "请输入排序码",
             trigger: "blur"
           }
+        ],
+        IsManuf: [
+          {
+            required: true,
+            message: '请选择输入',
+            trigger: 'blur'
+          }
         ]
       },
       options: [],
@@ -286,6 +330,32 @@ export default {
   },
 
   methods: {
+    updateSortCode (row) {
+      console.log(row, '==========')
+      this.editId = row.Id // 记录将更新的id
+      this.editForm.EditName = row.Name // 反显名称
+      this.editForm.EditCategorycode = row.Categorycode// 返现类别名称根据value值
+      this.editForm.EditCode = row.Code // 返现类别名称根据value值
+      this.editForm.SortCode = parseInt(row.SortCode)
+      this.editForm.IsManuf = row.IsManuf
+      console.log(this.editForm, 'this.editForm')
+      setapi.updatebyid(this.editId, this.editForm, this.$axios).then(res => {
+        if (res.data.code === 0) {
+          this.initDatas()
+          this.$message({
+            type: 'success',
+            message: res.data.message
+          })
+        } else {
+          this.$message({
+            type: 'warning',
+            message: res.data.message
+          })
+        }
+      }).catch(err => {
+        console.error(err)
+      })
+    },
     //初始化列表方法
     initDatas(event) {
       if(event!=null){
@@ -429,6 +499,15 @@ export default {
         this.currentPage = 1;
         this.initDatas()
       },
+    isManufStr (str) {
+      if (str === '1') {
+        return '是'
+      } else if (str === '2') {
+        return '否'
+      } else {
+        return '无'
+      }
+    }
   }
 };
 </script>